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

Define a residual function using the boundary conditions for the biharmonic_equation. More...

Inheritance diagram for CppNoddy::Example::Biharmonic_residual:
CppNoddy::Residual< D_complex >

Public Member Functions

 Biharmonic_residual ()
 
 ~Biharmonic_residual ()
 
void residual_fn (const DenseVector< D_complex > &unknown, DenseVector< D_complex > &BC) const
 implement a residual function. More...
 
- Public Member Functions inherited from CppNoddy::Residual< D_complex >
 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< D_complex > &state)
 Update the Residual object for the current set of state variables. More...
 
const DenseVector< D_complex > & residual () const
 Return a handle to the residuals corresponding to the last update state. More...
 
const DenseMatrix< D_complex > & jacobian () const
 Retrun a handle to the Jacobian of the residual corresponding to the last update state. More...
 
D_complexdelta ()
 
const D_complexdelta () 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< D_complex > &state, DenseVector< D_complex > &f) const
 A blank virtual residual function method. More...
 

Public Attributes

ODE_IVP< D_complex > * ode
 

Additional Inherited Members

- Protected Member Functions inherited from CppNoddy::Residual< D_complex >
virtual void jacobian (const DenseVector< D_complex > &state, DenseMatrix< D_complex > &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< D_complex >
DenseMatrix< D_complexJAC_AT_LAST_STATE
 Jacobian for the last state vector. More...
 
DenseVector< D_complexFN_AT_LAST_STATE
 Residual for the last state vector. More...
 
DenseVector< D_complexLAST_STATE
 The last state vector. More...
 
D_complex 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 a residual function using the boundary conditions for the biharmonic_equation.

Definition at line 44 of file EVPShootBiharmonic.cpp.

Constructor & Destructor Documentation

◆ Biharmonic_residual()

CppNoddy::Example::Biharmonic_residual::Biharmonic_residual ( )
inline

Definition at line 49 of file EVPShootBiharmonic.cpp.

50 {
51 // instantiate the 1D bi-harmonic eqn
52 eqn = new Biharmonic_equation;
53 // set up the ODE domain, step etc
54 ode = new ODE_IVP<D_complex>( eqn, 0.0, 1.0, 1000 );
55 }
A templated object for real/complex vector system of first-order ordinary differential equations.
Definition: ODE_IVP.h:20
A base class to be inherited by objects that define residuals.
Definition: Residual.h:15

References ode.

◆ ~Biharmonic_residual()

CppNoddy::Example::Biharmonic_residual::~Biharmonic_residual ( )
inline

Definition at line 57 of file EVPShootBiharmonic.cpp.

58 {
59 delete ode;
60 delete eqn;
61 }

References ode.

Member Function Documentation

◆ residual_fn()

void CppNoddy::Example::Biharmonic_residual::residual_fn ( const DenseVector< D_complex > &  unknown,
DenseVector< D_complex > &  BC 
) const
inlinevirtual

implement a residual function.

Reimplemented from CppNoddy::Residual< D_complex >.

Definition at line 64 of file EVPShootBiharmonic.cpp.

65 {
66 DenseVector<D_complex> u( 4, 0.0 ); // 4th order problem
67 u[ 0 ] = 0.0; // f = 0
68 u[ 1 ] = 0.0; // f' = 0
69 u[ 2 ] = 1.0; // f'' = 1
70 u[ 3 ] = unknown[ 0 ]; // f''' = unknown[0]
71 eqn -> lambda = unknown[ 1 ]; // parameter = unknown[1]
72 // shoot using R-K fixed step size algorithm
73 u = ode -> shoot4( u );
74 // return the BC residuals
75 BC[ 0 ] = u[ 0 ];
76 BC[ 1 ] = u[ 1 ]; // trying to make f = f' = 0 at other boundary
77 }
@ lambda
An DenseVector class – a dense vector object.
Definition: DenseVector.h:34

References lambda, ode, and u.

Member Data Documentation

◆ ode

ODE_IVP<D_complex>* CppNoddy::Example::Biharmonic_residual::ode

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

© 2012

R.E. Hewitt