15#include "../Utils_Fill.h"
75 cout <<
"=== EVP: The harmonic equation done the easy way ====\n";
92 const double tol = 1.e-3;
94 cout <<
" Solving the system using LAPACK:\n";
104 catch (
const std::runtime_error &error )
106 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
110 ode_lapack.
p_eigensystem() -> tag_eigenvalues_disc( + 1, 1. );
113 if ( abs( lapack_lambdas[ 0 ].real() - M_PI * M_PI ) < tol )
116 cout <<
" LAPACK solver works.\n";
121 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
125 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for ODE_EVP and general eigenvalue problems.
A spec for a collection of utility functions.
A matrix class that constructs a DENSE matrix as a row major std::vector of DenseVectors.
An DenseVector class – a dense vector object.
An equation object base class used in the PDE_double_IBVP class.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &B) const
A blank virtual residual function method.
Define the harmonic equation by inheriting the Equation base class.
void matrix0(const DenseVector< double > &z, DenseMatrix< double > &m) const
matrix to multiply the BVP coordinate
void residual_fn(const DenseVector< double > &z, DenseVector< double > &g) const
The harmonic equation.
void matrix1(const DenseVector< double > &z, DenseMatrix< double > &m) const
Define the eigenvalue terms by providing the mass matrix This defines the term lambda * z[ f ] ;.
harmonic_equation()
The harmonic equation is a 2nd order real ODE.
A templated object for real/complex vector system of first-order ordinary differential equations.
LinearEigenSystem_base * p_eigensystem()
Allow access to the underlying dense linear eigensystem through a pointer to the private member data.
void eigensolve()
Formulate and solve the global eigenvalue problem for a linear system.
A base class to be inherited by objects that define residuals.
double g(1.0)
gravitational acceleration
DenseVector< double > uniform_node_vector(const double &lower, const double &upper, const std::size_t &N)
Return a DENSE vector with the nodal points of a uniform mesh distributed between the upper/lower bou...
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
std::complex< double > D_complex
A complex double precision number using std::complex.
void fill_identity(CppNoddy::Sequential_Matrix_base< _Type > &A)
Fill diagonal with unit values.