CppNoddy
0.92
|
An equation object base class used in the IBVP classes (and others). More...
#include <Equation_1matrix.h>
Public Member Functions | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
Protected Member Functions | |
virtual void | matrix0 (const DenseVector< _Type > &x, DenseMatrix< _Type > &m) const |
Define the matrix in terms of the current state vector. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
std::vector< _Xtype > | coords |
The coordinates stored for this residual. More... | |
![]() | |
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... | |
An equation object base class used in the IBVP classes (and others).
An equation object is essentially a ('square') residual object with an independent variable data member and access methods. By 'square' we mean that it defines N residuals and N state variables. The equation is defined using an NxN matrix that multiplies the derivative of unknowns and a residual RHS.
Definition at line 18 of file Equation_1matrix.h.
|
explicit |
Constructor for equation class.
order | The order of the system |
Definition at line 12 of file Equation_1matrix.cpp.
References CppNoddy::Residual< _Type >::ORDER_OF_SYSTEM.
|
virtual |
An empty destructor, virtual since we have virtual methods.
Definition at line 18 of file Equation_1matrix.cpp.
|
virtual |
Return the product of the Jacobian-of-the-matrix and a vector 'vec' when the equation has a given 'state'.
The user should overload this if concerned about performance of the solver. If not overloaded, the default is to finite difference the Jacobian-of-the-matrix.
state | The current state variables – used for clarity when overloaded by the user instead of expecting the user to access the member data. |
vec | The vector that will be multiplied by the Jacobian-of-the-matrix |
h | The resulting 2D matrix |
Definition at line 23 of file Equation_1matrix.cpp.
|
inline |
Return a handle to the matrix.
Definition at line 66 of file Equation_1matrix.h.
|
inlineprotectedvirtual |
Define the matrix in terms of the current state vector.
x | The current state vector. |
m | The matrix. |
Reimplemented in CppNoddy::Example::Harmonic_equation< _Type, _Xtype >, CppNoddy::Example::Troesch_equation< _Type, _Xtype >, CppNoddy::Example::Nonidentity_equation< _Type, _Xtype >, CppNoddy::Example::Harmonic_equation< _Type, _Xtype >, CppNoddy::Example::OS_bvp_equation, CppNoddy::Example::OS_bvp_equation, CppNoddy::Example::Berman_equation, CppNoddy::Example::Blasius_equation, CppNoddy::Example::Karman_equations, CppNoddy::Example::Karman_equations, CppNoddy::Example::Karman_equations, CppNoddy::Example::Karman_equations, and CppNoddy::Example::Karman_equations.
Definition at line 51 of file Equation_1matrix.h.
void CppNoddy::Equation_1matrix< _Type, _Xtype >::update | ( | const DenseVector< _Type > & | state | ) |
Update the Equation object for the current set of state variables.
state | The state vector at which to set the equation object |
Definition at line 50 of file Equation_1matrix.cpp.
References CppNoddy::Residual< _Type >::update().
Referenced by CppNoddy::Equation_2matrix< _Type, double >::Equation_2matrix().
© 2012
R.E. Hewitt