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

Define the Karman equations. More...

Inheritance diagram for CppNoddy::Example::Karman_equations:
CppNoddy::Equation_1matrix< double > CppNoddy::Equation_1matrix< double > CppNoddy::Equation_1matrix< double > CppNoddy::Equation_1matrix< double > CppNoddy::Equation_2matrix< double > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Equation_1matrix< _Type, _Xtype > CppNoddy::Residual< _Type > CppNoddy::Residual< _Type > CppNoddy::Residual< _Type > CppNoddy::Residual< _Type > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual< _Type >

Public Member Functions

 Karman_equations ()
 The Karman system is a 5th order real system of ODEs. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 Define the Karman system. More...
 
void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
 Karman_equations ()
 The Karman system is a 5th order real system of ODEs. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 Define the Karman system. More...
 
void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
 Karman_equations ()
 The Karman system is a 5th order real system of ODEs. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 Define the Karman system. More...
 
void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
 Karman_equations ()
 The Karman system is a 5th order real system of ODEs. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 Define the Karman system. More...
 
void jacobian (const DenseVector< double > &z, DenseMatrix< double > &jac) const
 Provide the exact Jacobian of above RHS rather than using finite-differences. More...
 
void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
 Karman_equations ()
 The problem is 5th order and real. More...
 
void residual_fn (const DenseVector< double > &z, DenseVector< double > &f) const
 Define the Karman equations. More...
 
void matrix0 (const DenseVector< double > &z, DenseMatrix< double > &m) const
 Define the BVP deriv by providing the matrix. More...
 
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. More...
 
void matrix1 (const DenseVector< double > &z, DenseMatrix< double > &m) const
 Define the unsteady terms by providing the mass matrix. More...
 
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. 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 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_2matrix< double >
 Equation_2matrix (const unsigned &order)
 Constructor for equation class. More...
 
virtual ~Equation_2matrix ()
 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 > & matrix1 () const
 Return a handle to the matrix member data. More...
 
virtual void get_jacobian_of_matrix1_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 Member Functions inherited from CppNoddy::Equation_1matrix< _Type, _Xtype >
 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< _Type > &state)
 Update the Equation object for the current set of state variables. More...
 
const DenseMatrix< _Type > & matrix0 () const
 Return a handle to the matrix. More...
 
virtual void get_jacobian_of_matrix0_mult_vector (const DenseVector< _Type > &state, const DenseVector< _Type > &vec, DenseMatrix< _Type > &h) const
 Return the product of the Jacobian-of-the-matrix and a vector 'vec' when the equation has a given 'state'. More...
 

Additional Inherited Members

virtual void matrix0 (const DenseVector< double > &x, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
- 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 matrix1 (const DenseVector< double > &state, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
virtual void matrix0 (const DenseVector< _Type > &x, DenseMatrix< _Type > &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 Karman equations.

Definition at line 27 of file BVPKarman.cpp.

Constructor & Destructor Documentation

◆ Karman_equations() [1/5]

CppNoddy::Example::Karman_equations::Karman_equations ( )
inline

The Karman system is a 5th order real system of ODEs.

Definition at line 32 of file BVPKarman.cpp.

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

◆ Karman_equations() [2/5]

CppNoddy::Example::Karman_equations::Karman_equations ( )
inline

The Karman system is a 5th order real system of ODEs.

Definition at line 31 of file BVPKarmanAdaptive.cpp.

◆ Karman_equations() [3/5]

CppNoddy::Example::Karman_equations::Karman_equations ( )
inline

The Karman system is a 5th order real system of ODEs.

Definition at line 38 of file BVPKarmanArclength.cpp.

◆ Karman_equations() [4/5]

CppNoddy::Example::Karman_equations::Karman_equations ( )
inline

The Karman system is a 5th order real system of ODEs.

Definition at line 30 of file BVPKarmanJacobian.cpp.

◆ Karman_equations() [5/5]

CppNoddy::Example::Karman_equations::Karman_equations ( )
inline

The problem is 5th order and real.

Definition at line 37 of file IBVPKarman.cpp.

An equation object base class used in the PDE_double_IBVP class.

Member Function Documentation

◆ get_jacobian_of_matrix0_mult_vector()

void CppNoddy::Example::Karman_equations::get_jacobian_of_matrix0_mult_vector ( const DenseVector< double > &  state,
const DenseVector< double > &  vec,
DenseMatrix< double > &  h 
) const
inline

To speed things up we'll overload this to say the mass matrix is constant.

Definition at line 62 of file IBVPKarman.cpp.

63 {
64 // blank definition leads to a zero result
65 }

◆ get_jacobian_of_matrix1_mult_vector()

void CppNoddy::Example::Karman_equations::get_jacobian_of_matrix1_mult_vector ( const DenseVector< double > &  state,
const DenseVector< double > &  vec,
DenseMatrix< double > &  h 
) const
inlinevirtual

To speed things up we'll overload this to say the mass matrix is constant.

Reimplemented from CppNoddy::Equation_2matrix< double >.

Definition at line 75 of file IBVPKarman.cpp.

76 {
77 // blank definition leads to a zero result
78 }

◆ jacobian()

void CppNoddy::Example::Karman_equations::jacobian ( const DenseVector< double > &  z,
DenseMatrix< double > &  jac 
) const
inline

Provide the exact Jacobian of above RHS rather than using finite-differences.

Definition at line 44 of file BVPKarmanJacobian.cpp.

45 {
46 jac( 0, Ud ) = 1.0;
47 jac( 1, U ) = 2 * z[ U ];
48 jac( 1, Ud ) = z[ V ];
49 jac( 1, V ) = z[ Ud ];
50 jac( 1, W ) = -2 * z[ W ];
51 jac( 2, U ) = -2.0;
52 jac( 3, Wd ) = 1.0;
53 jac( 4, U ) = 2 * z[ W ];
54 jac( 4, V ) = z[ Wd ];
55 jac( 4, W ) = 2 * z[ U ];
56 jac( 4, Wd ) = z[ V ];
57 }
@ V
Definition: BVPKarman.cpp:20
@ Wd
Definition: BVPKarman.cpp:20
@ W
Definition: BVPKarman.cpp:20
@ U
Definition: BVPKarman.cpp:20
@ Ud
Definition: BVPKarman.cpp:20

References U, Ud, V, W, Wd, and CppNoddy::Example::z().

◆ matrix0() [1/5]

void CppNoddy::Example::Karman_equations::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 45 of file BVPKarman.cpp.

46 {
48 }
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() [2/5]

void CppNoddy::Example::Karman_equations::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 44 of file BVPKarmanAdaptive.cpp.

45 {
47 }

References Utils_Fill::fill_identity(), and m.

◆ matrix0() [3/5]

void CppNoddy::Example::Karman_equations::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 51 of file BVPKarmanArclength.cpp.

52 {
54 }

References Utils_Fill::fill_identity(), and m.

◆ matrix0() [4/5]

void CppNoddy::Example::Karman_equations::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 59 of file BVPKarmanJacobian.cpp.

60 {
62 }

References Utils_Fill::fill_identity(), and m.

◆ matrix0() [5/5]

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

Define the BVP deriv by providing the matrix.

Reimplemented from CppNoddy::Equation_1matrix< double >.

Definition at line 51 of file IBVPKarman.cpp.

52 {
53 // identity matrix
54 m( 0, 0 ) = 1.0;
55 m( 1, 1 ) = 1.0;
56 m( 2, 2 ) = 1.0;
57 m( 3, 3 ) = 1.0;
58 m( 4, 4 ) = 1.0;
59 }

References m.

◆ matrix1()

void CppNoddy::Example::Karman_equations::matrix1 ( const DenseVector< double > &  z,
DenseMatrix< double > &  m 
) const
inlinevirtual

Define the unsteady terms by providing the mass matrix.

Reimplemented from CppNoddy::Equation_2matrix< double >.

Definition at line 68 of file IBVPKarman.cpp.

69 {
70 m( 1, 0 ) = -1.0;
71 m( 4, 3 ) = -1.0;
72 }

References m.

◆ residual_fn() [1/5]

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

Define the Karman system.

Definition at line 35 of file BVPKarman.cpp.

36 {
37 // The 5th order system for ( U, U', V, W, W' )
38 f[ U ] = z[ Ud ];
39 f[ Ud ] = z[ U ] * z[ U ] + z[ V ] * z[ Ud ] - z[ W ] * z[ W ];
40 f[ V ] = -2 * z[ U ];
41 f[ W ] = z[ Wd ];
42 f[ Wd ] = 2 * z[ U ] * z[ W ] + z[ V ] * z[ Wd ];
43 }
@ f
Definition: BVPBerman.cpp:15

References f, U, Ud, V, W, Wd, and CppNoddy::Example::z().

◆ residual_fn() [2/5]

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

Define the Karman system.

Definition at line 34 of file BVPKarmanAdaptive.cpp.

35 {
36 // The 5th order system for ( U, U', V, W, W' )
37 f[ U ] = z[ Ud ];
38 f[ Ud ] = z[ U ] * z[ U ] + z[ V ] * z[ Ud ] - z[ W ] * z[ W ];
39 f[ V ] = -2 * z[ U ];
40 f[ W ] = z[ Wd ];
41 f[ Wd ] = 2 * z[ U ] * z[ W ] + z[ V ] * z[ Wd ];
42 }

References f, U, Ud, V, W, Wd, and CppNoddy::Example::z().

◆ residual_fn() [3/5]

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

Define the Karman system.

Definition at line 41 of file BVPKarmanArclength.cpp.

42 {
43 // The 5th order system for ( U, U', V, W, W' )
44 f[ U ] = z[ Ud ];
45 f[ Ud ] = z[ U ] * z[ U ] + z[ V ] * z[ Ud ] - z[ W ] * z[ W ] + s * s;
46 f[ V ] = -2 * z[ U ];
47 f[ W ] = z[ Wd ];
48 f[ Wd ] = 2 * z[ U ] * z[ W ] + z[ V ] * z[ Wd ];
49 }
double s
relative rotation rate

References f, CppNoddy::Example::s, U, Ud, V, W, Wd, and CppNoddy::Example::z().

◆ residual_fn() [4/5]

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

Define the Karman system.

Definition at line 33 of file BVPKarmanJacobian.cpp.

34 {
35 // The 5th order system for ( U, U', V, W, W' )
36 f[ U ] = z[ Ud ];
37 f[ Ud ] = z[ U ] * z[ U ] + z[ V ] * z[ Ud ] - z[ W ] * z[ W ];
38 f[ V ] = -2 * z[ U ];
39 f[ W ] = z[ Wd ];
40 f[ Wd ] = 2 * z[ U ] * z[ W ] + z[ V ] * z[ Wd ];
41 }

References f, U, Ud, V, W, Wd, and CppNoddy::Example::z().

◆ residual_fn() [5/5]

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

Define the Karman equations.

Definition at line 40 of file IBVPKarman.cpp.

41 {
42 // The 5th order system for ( U, U', V, W, W' )
43 f[ 0 ] = z[ 1 ];
44 f[ 1 ] = z[ 0 ] * z[ 0 ] + z[ 2 ] * z[ 1 ] - z[ 3 ] * z[ 3 ] + W_inf * W_inf;
45 f[ 2 ] = -2 * z[ 0 ];
46 f[ 3 ] = z[ 4 ];
47 f[ 4 ] = 2 * z[ 0 ] * z[ 3 ] + z[ 2 ] * z[ 4 ];
48 }
double W_inf(0.0)

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


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

© 2012

R.E. Hewitt