20#include "../Utils_Fill.h"
59 class Karman_left_BC :
public Residual<double>
69 B[ 2 ] =
z[
W ] - 1.0;
73 class Karman_right_BC :
public Residual<double>
95 cout <<
"=== BVP: Arc-length continuation of the Karman eqns =\n";
105 double right = 150.0;
115 for (
unsigned i = 0; i < N; ++i )
121 std::string dirname(
"./DATA");
122 mkdir( dirname.c_str(), S_IRWXU );
123 TrackerFile my_file(
"./DATA/BVP_Karman_arc.dat", 8 );
124 my_file.
push_ptr( &Example::s,
"s" );
129 ode.
init_arc( &Example::s, ds, 0.01 );
134 double last_approx_lp( 0.0 );
136 for (
int i = 0; i < 101; ++i )
141 cout << Example::s <<
" " << ode.
solution()( N-1,
V ) <<
"\n";
145 cout <<
" Bifurcation detected near p = " << Example::s <<
"\n";
146 last_approx_lp = Example::s;
151 if ( std::abs( last_approx_lp + 0.1605 ) > 1.e-3 )
153 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
154 cout <<
" Difference = " << abs( last_approx_lp + 0.1605 ) <<
"\n";
159 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for ODE_BVP and PDE_IBVP codes.
bool & rescale_theta()
Handle to the RESCALE_THETA flag.
double & desired_arc_proportion()
Handle to the desired proportion of the parameter to be used in the arc length solver.
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).
Define the Karman equations.
Karman_equations()
The Karman system is a 5th order real system of ODEs.
void matrix0(const DenseVector< double > &x, DenseMatrix< double > &m) const
Define the matrix in terms of the current state vector.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
Define the Karman system.
Define the boundary conditions.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &B) const
A blank virtual residual function method.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &B) const
A blank virtual residual function method.
A templated object for real/complex vector system of first-order ordinary differential equations.
double arclength_solve(const double &step)
Arc-length solve the system.
OneD_Node_Mesh< _Type, _Xtype > & solution()
void init_arc(_Type *p, const double &length, const double &max_length)
Initialise the class ready for arc length continuation.
A base class to be inherited by objects that define residuals.
void push_ptr(double *scalar, std::string desc="")
double s
relative rotation rate
DenseVector< double > power_node_vector(const double &lower, const double &upper, const std::size_t &N, const double &power)
Return a DENSE vector with the nodal points of a non-uniform mesh distributed between the upper/lower...
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.