21#include "../Utils_Fill.h"
41 double Udd(
double y )
112 class OS_evp_both_BC :
public Residual<D_complex>
127 class OS_bvp_left_BC :
public Residual<D_complex>
137 B[ 2 ] =
z[
psi ] - 1.0;
141 class OS_bvp_right_BC :
public Residual<D_complex>
180 catch (
const std::runtime_error &error )
182 std::cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
186 ode_global.
p_eigensystem() -> tag_eigenvalues_disc( + 1, 0.6 );
210 std::cout <<
"Adapted to " <<
ode_local -> solution().get_nnodes() <<
" nodes \n";
247 cout <<
"=== EVP: Temporal OSE via the equation interface ====\n";
248 cout <<
"=== followed by local refinement of the eigenvalue \n";
249 cout <<
"=== and arclength continuation of the neutral curve.\n";
253 unsigned initial_QZ_mesh = 121;
255 Example::alpha = 1.0;
263 newton.
theta() = 0.00001;
264 newton.
init_arc( Re, &Example::alpha, 0.001, 0.01 );
267 std::string dirname(
"./DATA");
268 mkdir( dirname.c_str(), S_IRWXU );
271 my_file.
push_ptr( &Re,
"Reynolds number" );
272 my_file.
push_ptr( &Example::alpha,
"Wavenumber" );
273 my_file.
push_ptr( &Example::wave_speed,
"Phase speed" );
276 double min_Re( Re[ 0 ] );
284 min_Re = std::min( Re[ 0 ], min_Re );
286 while ( Re[ 0 ] < 5820.0 );
288 std::cout <<
" Minimum Reynolds number (for this spatial resolution ) = " << min_Re <<
"\n";
291 if ( std::abs( min_Re - 5772. ) < 30.0 )
293 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
296 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
A shorter bundled include file for ODE_BVP and PDE_IBVP codes.
A shorter bundled include file for ODE_EVP and general eigenvalue problems.
void init_arc(DenseVector< _Type > x, _Type *p, const double &length, const double &max_length)
Initialise the class ready for arc-length continuation.
bool & rescale_theta()
Handle to the RESCALE_THETA flag.
double & theta()
Set the arclength theta parameter.
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 IBVP classes (and others).
An equation object base class used in the PDE_double_IBVP class.
ODE_BVP< D_complex > * ode_local
OS_bvp_right_BC * BC_right
Neutral_residual(const unsigned &initial_N)
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
A blank virtual residual function method.
Define the OSE for the local refinement procedure.
OS_bvp_equation()
The OS local problem is a nonlinear 5th order complex BVP.
void matrix0(const DenseVector< D_complex > &z, DenseMatrix< D_complex > &m) const
matrix to multiply the BVP coordinate
void residual_fn(const DenseVector< D_complex > &z, DenseVector< D_complex > &g) const
The OS equation.
void residual_fn(const DenseVector< D_complex > &z, DenseVector< D_complex > &B) const
A blank virtual residual function method.
void residual_fn(const DenseVector< D_complex > &z, DenseVector< D_complex > &B) const
A blank virtual residual function method.
void residual_fn(const DenseVector< D_complex > &z, DenseVector< D_complex > &B) const
A blank virtual residual function method.
Define the OS equation for the global QZ EVP.
void matrix1(const DenseVector< D_complex > &z, DenseMatrix< D_complex > &m) const
Define the unsteady terms by providing the mass matrix Here we define the eigenvalue contribution to ...
void residual_fn(const DenseVector< D_complex > &z, DenseVector< D_complex > &g) const
The OS equation.
void matrix0(const DenseVector< D_complex > &z, DenseMatrix< D_complex > &m) const
matrix to multiply the BVP coordinate
OS_evp_equation()
The OS equation is a 4th order complex ODE.
A vector NEWTON iteration class.
void set_monitor_det(bool flag)
If set then the system will monitor the sign of determinant of the Jacobian matrix and cause an Excep...
void arclength_solve(DenseVector< _Type > &x)
Arc-length solve the system.
A templated object for real/complex vector system of first-order ordinary differential equations.
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 add_tagged_to_mesh()
OneD_Node_Mesh< D_complex > get_mesh(const unsigned &i) const
void eigensolve()
Formulate and solve the global eigenvalue problem for a linear system.
_Xtype & coord(const unsigned &i)
General handle access to the coordinates.
A base class to be inherited by objects that define residuals.
void precision(unsigned prec)
void push_ptr(double *scalar, std::string desc="")
double Udd(double y)
Globally define the base flow curvature.
double Re
Globally define the Reynolds number and wavenumber.
double g(1.0)
gravitational acceleration
double wave_speed
The phase speed of the instability.
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.