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

Define the residual for arc-length continuation of a circle. More...

Inheritance diagram for CppNoddy::Example::Arc_problem:
CppNoddy::Residual< double > CppNoddy::Residual< double > CppNoddy::Residual< double >

Public Member Functions

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

Public Attributes

double p
 
double eps
 

Additional Inherited Members

- Protected Member Functions inherited from CppNoddy::Residual< double >
virtual void jacobian (const DenseVector< double > &state, DenseMatrix< double > &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< double >
DenseMatrix< double > JAC_AT_LAST_STATE
 Jacobian for the last state vector. More...
 
DenseVector< double > FN_AT_LAST_STATE
 Residual for the last state vector. More...
 
DenseVector< double > LAST_STATE
 The last state vector. More...
 
double 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 residual for arc-length continuation of a circle.

Define the residual for arc-length continuation.

Definition at line 19 of file ArcCircle.cpp.

Constructor & Destructor Documentation

◆ Arc_problem() [1/3]

CppNoddy::Example::Arc_problem::Arc_problem ( )
inline

Definition at line 24 of file ArcCircle.cpp.

24: Residual<double>( 1 ) {}
A base class to be inherited by objects that define residuals.
Definition: Residual.h:15

◆ Arc_problem() [2/3]

CppNoddy::Example::Arc_problem::Arc_problem ( )
inline

Definition at line 23 of file ArcCircleVector.cpp.

23: Residual<double>( 2 ) {}

◆ Arc_problem() [3/3]

CppNoddy::Example::Arc_problem::Arc_problem ( )
inline

Definition at line 27 of file ArcTranscritFold.cpp.

27: Residual<double>( 1 ) {}

Member Function Documentation

◆ residual_fn() [1/3]

void CppNoddy::Example::Arc_problem::residual_fn ( const DenseVector< double > &  state,
DenseVector< double > &  f 
) const
inlinevirtual

A blank virtual residual function method.

Parameters
stateThe unknown variable.
fThe residual function f(x).

Reimplemented from CppNoddy::Residual< double >.

Definition at line 26 of file ArcCircle.cpp.

27 {
28 f[ 0 ] = z[ 0 ] * z[ 0 ] + p * p - 2.0;
29 }
@ f
Definition: BVPBerman.cpp:15

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

◆ residual_fn() [2/3]

void CppNoddy::Example::Arc_problem::residual_fn ( const DenseVector< double > &  state,
DenseVector< double > &  f 
) const
inlinevirtual

A blank virtual residual function method.

Parameters
stateThe unknown variable.
fThe residual function f(x).

Reimplemented from CppNoddy::Residual< double >.

Definition at line 25 of file ArcCircleVector.cpp.

26 {
27 f[ 0 ] = 1.0 - std::pow( z[ 0 ], 2 ) - std::pow( p, 2 );
28 f[ 1 ] = z[ 1 ] - std::sin( z[ 0 ] );
29 }

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

◆ residual_fn() [3/3]

void CppNoddy::Example::Arc_problem::residual_fn ( const DenseVector< double > &  state,
DenseVector< double > &  f 
) const
inlinevirtual

A blank virtual residual function method.

Parameters
stateThe unknown variable.
fThe residual function f(x).

Reimplemented from CppNoddy::Residual< double >.

Definition at line 29 of file ArcTranscritFold.cpp.

30 {
31 f[0] = ( z[0] - 3 ) * ( ( z[0] - 2 ) * ( z[0] - 2 )
32 + ( p - 4 ) ) + eps;
33 }

References eps, f, p, and CppNoddy::Example::z().

Member Data Documentation

◆ eps

double CppNoddy::Example::Arc_problem::eps

Definition at line 25 of file ArcTranscritFold.cpp.

Referenced by main(), and residual_fn().

◆ p

double CppNoddy::Example::Arc_problem::p

Definition at line 22 of file ArcCircle.cpp.

Referenced by main(), and residual_fn().


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

© 2012

R.E. Hewitt