CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CppNoddy::Example::Diffusion_equations Class Reference
Inheritance diagram for CppNoddy::Example::Diffusion_equations:
CppNoddy::Equation_2matrix< double > CppNoddy::Equation_1matrix< _Type, _Xtype > CppNoddy::Residual_with_coords< _Type, _Xtype > CppNoddy::Residual< _Type >

Public Member Functions

 Diffusion_equations ()
 The problem is 2nd 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 domain-derivative terms by providing the mass 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_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...
 
- 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...
 

Additional Inherited Members

virtual void matrix1 (const DenseVector< double > &state, DenseMatrix< double > &m) const
 Define the matrix in terms of the current state vector. More...
 
- Protected Member Functions inherited from CppNoddy::Equation_1matrix< _Type, _Xtype >
virtual void matrix0 (const DenseVector< _Type > &x, DenseMatrix< _Type > &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...
 
- 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

Definition at line 24 of file IBVPDiffusionNonlinear.cpp.

Constructor & Destructor Documentation

◆ Diffusion_equations()

CppNoddy::Example::Diffusion_equations::Diffusion_equations ( )
inline

The problem is 2nd order and real.

Definition at line 29 of file IBVPDiffusionNonlinear.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::Diffusion_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 50 of file IBVPDiffusionNonlinear.cpp.

51 {
52 // blank definition leads to a zero result
53 }

◆ get_jacobian_of_matrix1_mult_vector()

void CppNoddy::Example::Diffusion_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 62 of file IBVPDiffusionNonlinear.cpp.

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

◆ matrix0()

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

Define the domain-derivative terms by providing the mass matrix.

Definition at line 42 of file IBVPDiffusionNonlinear.cpp.

43 {
44 // blank definition leads to a identity result
45 m( 0, 0 ) = 1.0;
46 m( 1, 1 ) = -z[ U ]/sigma;
47 }
@ U
Definition: BVPKarman.cpp:20
double sigma(100.0)

References m, CppNoddy::Example::sigma(), U, and CppNoddy::Example::z().

◆ matrix1()

void CppNoddy::Example::Diffusion_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 56 of file IBVPDiffusionNonlinear.cpp.

57 {
58 m( 1, 0 ) = 1.0;
59 }

References m.

◆ residual_fn()

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

Define the Karman equations.

Definition at line 32 of file IBVPDiffusionNonlinear.cpp.

33 {
34 double E( A*exp( -coord(1) ) );
35 double Y( coord(0) );
36 // we will add some source terms to give an exact solution
37 f[ 0 ] = z[ Ud ];
38 f[ 1 ] = -E*sin(M_PI*Y) + ((1+Y)+E*sin(M_PI*Y))*(M_PI*M_PI)*E*sin(M_PI*Y)/sigma;
39 }
@ f
Definition: BVPBerman.cpp:15
@ Ud
Definition: BVPKarman.cpp:20
_Xtype & coord(const unsigned &i)
General handle access to the coordinates.
double A(1.0)
initial hump amplitude

References CppNoddy::Example::A(), CppNoddy::Residual_with_coords< _Type, _Xtype >::coord(), E, f, CppNoddy::Example::sigma(), Ud, and CppNoddy::Example::z().


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

© 2012

R.E. Hewitt