CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CppNoddy::Example::Berman_equation Class Reference

Define the Berman equation by inheriting Equation base class. More...

Inheritance diagram for CppNoddy::Example::Berman_equation:
CppNoddy::Equation< double > CppNoddy::Equation_1matrix< double > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual< _Type > CppNoddy::Residual< _Type >

Public Member Functions

 Berman_equation ()
 Construct the Berman equation as a 4th order real system. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 We implement the equation as 4 first-order ODEs. More...
 
void mass (const DenseVector< double > &x, DenseMatrix< double > &m) const
 
 Berman_equation ()
 The Berman equation is a 4th order real ODE. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &g) const
 The Berman equation. More...
 
void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
- Public Member Functions inherited from CppNoddy::Equation< double >
 Equation (const unsigned &order)
 Constructor for equation class. More...
 
virtual ~Equation ()
 An empty destructor, virtual since we have virtual methods. More...
 
- Public Member Functions inherited from CppNoddy::Residual_with_coords< _Type, _Xtype >
 Residual_with_coords (const unsigned &order, const unsigned &ncoords)
 Constructor for a 'square' residual object that is, N residuals for N unknowns. More...
 
 Residual_with_coords (const unsigned &order, const unsigned &nvars, const unsigned &ncoords)
 Constructor for a 'non-square' residual object that is, there are less residual constraints than unknowns. More...
 
virtual ~Residual_with_coords ()
 An empty destructor. More...
 
_Xtype & coord (const unsigned &i)
 General handle access to the coordinates. More...
 
const _Xtype & coord (const unsigned &i) const
 General handle access to the coordinates. More...
 
- Public Member Functions inherited from CppNoddy::Residual< _Type >
 Residual (const unsigned &order)
 Constructor for a 'square' residual object that is, N residuals for N unknowns. More...
 
 Residual (const unsigned &order, const unsigned &nvars)
 Constructor for a 'non-square' residual object that is, there are less residual constraints than unknowns. More...
 
virtual ~Residual ()
 An empty destructor, virtual since we have virtual methods. More...
 
void update (const DenseVector< _Type > &state)
 Update the Residual object for the current set of state variables. More...
 
const DenseVector< _Type > & residual () const
 Return a handle to the residuals corresponding to the last update state. More...
 
const DenseMatrix< _Type > & jacobian () const
 Retrun a handle to the Jacobian of the residual corresponding to the last update state. More...
 
_Type & delta ()
 
const _Type & delta () const
 
unsigned get_order () const
 Get the order of the residual vector. More...
 
unsigned get_number_of_vars () const
 Get the number of variables that this residual condition is defined for. More...
 
virtual void residual_fn (const DenseVector< _Type > &state, DenseVector< _Type > &f) const
 A blank virtual residual function method. More...
 
- Public Member Functions inherited from CppNoddy::Equation_1matrix< double >
 Equation_1matrix (const unsigned &order)
 Constructor for equation class. More...
 
virtual ~Equation_1matrix ()
 An empty destructor, virtual since we have virtual methods. More...
 
void update (const DenseVector< double > &state)
 Update the Equation object for the current set of state variables. More...
 
const DenseMatrix< double > & matrix0 () const
 Return a handle to the matrix. More...
 
virtual void get_jacobian_of_matrix0_mult_vector (const DenseVector< double > &state, const DenseVector< double > &vec, DenseMatrix< double > &h) const
 Return the product of the Jacobian-of-the-matrix and a vector 'vec' when the equation has a given 'state'. More...
 

Public Attributes

double Re
 The Reynolds number. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CppNoddy::Residual< _Type >
virtual void jacobian (const DenseVector< _Type > &state, DenseMatrix< _Type > &jac) const
 Because the residual evaluation at the current state is assumed to have already been done by the 'update' method, this routine is protected. More...
 
virtual void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
- Protected Attributes inherited from CppNoddy::Residual_with_coords< _Type, _Xtype >
std::vector< _Xtype > coords
 The coordinates stored for this residual. More...
 
- Protected Attributes inherited from CppNoddy::Residual< _Type >
DenseMatrix< _Type > JAC_AT_LAST_STATE
 Jacobian for the last state vector. More...
 
DenseVector< _Type > FN_AT_LAST_STATE
 Residual for the last state vector. More...
 
DenseVector< _Type > LAST_STATE
 The last state vector. More...
 
_Type DELTA
 A default step for FD computation of the Jacobian. More...
 
unsigned ORDER_OF_SYSTEM
 The order of the system of equations. More...
 
unsigned NUMBER_OF_VARS
 The number of elements in the state vector. More...
 

Detailed Description

Define the Berman equation by inheriting Equation base class.

Define the Berman equation by inheriting the Equation base class.

Definition at line 24 of file BermanShooting.cpp.

Constructor & Destructor Documentation

◆ Berman_equation() [1/2]

CppNoddy::Example::Berman_equation::Berman_equation ( )
inline

Construct the Berman equation as a 4th order real system.

Definition at line 29 of file BermanShooting.cpp.

29: Equation<double> ( 4 ) {}
An equation object base class used in the BVP/IVP classes.
Definition: Equation.h:22

◆ Berman_equation() [2/2]

CppNoddy::Example::Berman_equation::Berman_equation ( )
inline

The Berman equation is a 4th order real ODE.

Definition at line 27 of file BVPBerman.cpp.

An equation object base class used in the IBVP classes (and others).

Member Function Documentation

◆ mass()

void CppNoddy::Example::Berman_equation::mass ( const DenseVector< double > &  x,
DenseMatrix< double > &  m 
) const
inline

Definition at line 40 of file BermanShooting.cpp.

41 {
43 }
void fill_identity(CppNoddy::Sequential_Matrix_base< _Type > &A)
Fill diagonal with unit values.
Definition: Utils_Fill.h:22

References Utils_Fill::fill_identity(), and m.

◆ matrix0()

void CppNoddy::Example::Berman_equation::matrix0 ( const DenseVector< double > &  x,
DenseMatrix< double > &  m 
) const
inlinevirtual

Define the matrix in terms of the current state vector.

Parameters
xThe current state vector.
mThe matrix.

Reimplemented from CppNoddy::Equation_1matrix< double >.

Definition at line 38 of file BVPBerman.cpp.

39 {
41 }

References Utils_Fill::fill_identity(), and m.

◆ residual_fn() [1/2]

void CppNoddy::Example::Berman_equation::residual_fn ( const DenseVector< double > &  z,
DenseVector< double > &  f 
) const
inline

We implement the equation as 4 first-order ODEs.

Definition at line 32 of file BermanShooting.cpp.

33 {
34 f[ 0 ] = z[ 1 ];
35 f[ 1 ] = z[ 2 ];
36 f[ 2 ] = Re * ( - z[ 3 ] - z[ 1 ] * z[ 1 ] + z[ 0 ] * z[ 2 ] );
37 f[ 3 ] = 0.0;
38 }
@ f
Definition: BVPBerman.cpp:15
double Re
The Reynolds number.

References f, Re, and CppNoddy::Example::z().

◆ residual_fn() [2/2]

void CppNoddy::Example::Berman_equation::residual_fn ( const DenseVector< double > &  z,
DenseVector< double > &  g 
) const
inline

The Berman equation.

Definition at line 30 of file BVPBerman.cpp.

31 {
32 g[ f ] = z[ fd ];
33 g[ fd ] = z[ fdd ];
34 g[ fdd ] = z[ fddd ];
35 g[ fddd ] = Re * ( z[ f ] * z[ fddd ] - z[ fd ] * z[ fdd ] );
36 }
@ fd
Definition: BVPBerman.cpp:15
@ fdd
Definition: BVPBerman.cpp:15
@ fddd
Definition: BVPBerman.cpp:15
double g(1.0)
gravitational acceleration

References f, fd, fdd, fddd, CppNoddy::Example::g(), Re, and CppNoddy::Example::z().

Member Data Documentation

◆ Re

double CppNoddy::Example::Berman_equation::Re

The Reynolds number.

Definition at line 46 of file BermanShooting.cpp.

Referenced by main(), and residual_fn().


The documentation for this class was generated from the following files:

© 2012

R.E. Hewitt