17#include "../Utils_Fill.h"
37 f[ 2 ] = -
z[ 0 ] *
z[ 2 ];
76 u[ 2 ] = unknown[ 0 ];
78 u =
ode -> shoot45(
u, 1.e-7, 0.01 );
80 BC[ 0 ] =
u[ 1 ] - 1.;
95 cout <<
"=== BVP_Shoot: scalar Newton solution of Blasius ====\n";
108 catch (
const std::runtime_error &error )
110 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
115 std::string dirname(
"./DATA");
116 mkdir( dirname.c_str(), S_IRWXU );
118 my_file.
push_ptr( &( problem.
ode -> get_mesh() ) );
123 const double c = 1.65519036023e0;
124 const double answer = 1. / pow( c, 3. / 2. );
126 const double tol( 1.e-6 );
127 if ( abs( stress[0] - answer ) > tol )
129 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
130 cout.precision( 14 );
131 cout << abs( stress[0] - answer ) <<
" > " << tol <<
"\n";
136 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 Blasius equation by inheriting Equation base class.
Blasius_equation()
Construct a 3rd order real system.
void mass(const DenseVector< double > &x, DenseMatrix< double > &m) const
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
We implement the equation as 3 first-order ODEs.
Define a residual function using the boundary conditions for the Blasius profile.
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="")
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.