16#include "../Utils_Fill.h"
36 f[ 2 ] =
Re * ( -
z[ 3 ] -
z[ 1 ] *
z[ 1 ] +
z[ 0 ] *
z[ 2 ] );
83 u[ 2 ] = unknown[ 0 ];
84 u[ 3 ] = unknown[ 1 ];
86 u =
ode -> shoot4(
u );
88 BC[ 0 ] =
u[ 0 ] - 1.;
104 cout <<
"=== BVP_Shoot: vector Newton solution of Berman eqn =\n";
119 catch (
const std::runtime_error &error )
121 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
126 std::string dirname(
"./DATA");
127 mkdir( dirname.c_str(), S_IRWXU );
129 my_file.
push_ptr( &( problem.
ode -> get_mesh() ) );
133 if ( std::abs( guess[ 1 ] - 0.70457 ) > 1.e-5 )
135 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
136 cout.precision( 14 );
137 cout << guess[ 0 ] <<
" " << guess[ 1 ] <<
"\n";
142 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for initial-value problems.
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 BVP/IVP classes.
Define the Berman equation by inheriting Equation base class.
void mass(const DenseVector< double > &x, DenseMatrix< double > &m) const
Berman_equation()
Construct the Berman equation as a 4th order real system.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
We implement the equation as 4 first-order ODEs.
double Re
The Reynolds number.
Define a residual function using the boundary conditions for the Berman equation.
void residual_fn(const DenseVector< double > &unknown, DenseVector< double > &BC) const
implement a residual function.
A vector NEWTON iteration class.
void iterate(DenseVector< _Type > &x)
The Newton iteration method.
A templated object for real/complex vector system of first-order ordinary differential equations.
A base class to be inherited by objects that define residuals.
void push_ptr(double *scalar, std::string desc="")
double Re
Globally define the Reynolds number and wavenumber.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
void fill_identity(CppNoddy::Sequential_Matrix_base< _Type > &A)
Fill diagonal with unit values.