47 f[ 4 ] = 2 *
z[ 0 ] *
z[ 3 ] +
z[ 2 ] *
z[ 4 ];
92 const double t =
coord( 0 );
96 b[ 2 ] =
z[
W ] - W_bc;
122 cout <<
"=== IBVP: The unsteady Karman equations ============\n";
139 unsigned max_steps = ( unsigned ) ( 30.0 / dt );
144 for (
unsigned i = 0; i < ny; ++i )
149 karman.
solution()( i,
W ) = Example::W_inf;
154 std::string dirname(
"./DATA");
155 mkdir( dirname.c_str(), S_IRWXU );
156 TrackerFile metric(
"./DATA/IBVP_Karman_metric.dat" );
160 TrackerFile profs(
"./DATA/IBVP_Karman_profs.dat" );
166 for (
unsigned i = 1; i < max_steps; ++i )
173 catch (
const std::runtime_error &error )
175 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
181 const double tol( 1.e-4 );
183 if ( abs( karman.
solution()( ny - 1,
V ) + 0.88447 ) > tol )
185 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
186 cout <<
" Difference = " << abs( karman.
solution()( ny - 1,
V ) + 0.88447 ) <<
"\n";
191 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for initial boundary 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 PDE_double_IBVP class.
Define the Karman equations.
void matrix0(const DenseVector< double > &z, DenseMatrix< double > &m) const
Define the BVP deriv by providing the matrix.
Karman_equations()
The problem is 5th order and real.
void matrix1(const DenseVector< double > &z, DenseMatrix< double > &m) const
Define the unsteady terms by providing the mass matrix.
void get_jacobian_of_matrix1_mult_vector(const DenseVector< double > &state, const DenseVector< double > &vec, DenseMatrix< double > &h) const
To speed things up we'll overload this to say the mass matrix is constant.
void get_jacobian_of_matrix0_mult_vector(const DenseVector< double > &state, const DenseVector< double > &vec, DenseMatrix< double > &h) const
To speed things up we'll overload this to say the mass matrix is constant.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
Define the Karman equations.
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 unsteady equations.
void step2(const double &dt)
A Crank-Nicolson 'time' stepper.
OneD_Node_Mesh< _Type > & solution()
double & coord()
Return a reference to the current value of the 'timelike/parabolic' coordinate.
A base class to be inherited by objects that define residuals.
double & coord(const unsigned &i)
General handle access to the coordinates.
void push_ptr(double *scalar, std::string desc="")
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...