CppNoddy
0.92
|
A templated object for real/complex vector system of first-order ordinary differential equations. More...
#include <ODE_BVP.h>
Public Member Functions | |
ODE_BVP (Equation_1matrix< _Type, _Xtype > *ptr_to_equation, const DenseVector< _Xtype > &nodes, Residual< _Type > *ptr_to_left_residual, Residual< _Type > *ptr_to_right_residual) | |
The class is defined by a vector function for the system. More... | |
virtual | ~ODE_BVP () |
Destructor. More... | |
virtual void | actions_before_linear_solve (BandedMatrix< _Type > &a, DenseVector< _Type > &b) |
A virtual method that is called prior to the linear solve stage of the solve2() method. More... | |
void | solve2 () |
Formulate and solve the ODE using Newton iteration and a second-order finite difference scheme. More... | |
std::pair< unsigned, unsigned > | adapt (const double &adapt_tol) |
Adapt the computational mesh ONCE. More... | |
void | adapt_until (const double &adapt_tol) |
Adaptively solve the system until no refinements or unrefinements are applied. More... | |
void | set_monitor_det (bool flag) |
Set the flag that determines if the determinant will be monitored The default is to monitor. More... | |
void | init_arc (_Type *p, const double &length, const double &max_length) |
Initialise the class ready for arc length continuation. More... | |
double | arclength_solve (const double &step) |
Arc-length solve the system. More... | |
OneD_Node_Mesh< _Type, _Xtype > & | solution () |
double & | tolerance () |
Access method to the tolerance. More... | |
int & | max_itns () |
Access method to the maximum number of iterations. More... | |
std::pair< unsigned, unsigned > | adapt (const double &adapt_tol) |
std::pair< unsigned, unsigned > | adapt (const double &adapt_tol) |
void | adapt_until (const double &adapt_tol) |
void | adapt_until (const double &adapt_tol) |
![]() | |
ArcLength_base () | |
virtual | ~ArcLength_base () |
void | init_arc (DenseVector< _Type > x, _Type *p, const double &length, const double &max_length) |
Initialise the class ready for arc-length continuation. More... | |
virtual void | solve (DenseVector< _Type > &x)=0 |
Compute a solution for that state & parameter variables that are an arc-length 'ds' from the current state. More... | |
double & | ds () |
Return a handle to the arclength step. More... | |
double & | arcstep_multiplier () |
Used to set the multiplication constant used when increasing or decreasing the arclength step. More... | |
bool & | rescale_theta () |
Handle to the RESCALE_THETA flag. More... | |
double & | theta () |
Set the arclength theta parameter. More... | |
double & | desired_arc_proportion () |
Handle to the desired proportion of the parameter to be used in the arc length solver. More... | |
Additional Inherited Members | |
![]() | |
void | update (const DenseVector< _Type > &x) |
A method called by arclength_solve and init_arc which stores the current converged state and parameter and hence computes the derivatives w.r.t the arc-length. More... | |
double | arclength_residual (const DenseVector< _Type > &x) const |
The extra constraint that is to be used to replace the unknown arc length. More... | |
DenseVector< _Type > | Jac_arclength_residual (DenseVector< _Type > &x) const |
The derivative of the arclength_residual function with respect to each of the state variables. More... | |
void | update_theta (const DenseVector< _Type > &x) |
Automatically update the Keller THETA such that the proportion of the arclength obtained from the parameter is the desired value. More... | |
![]() | |
_Type * | p_PARAM |
pointer to the parameter in arclength solves More... | |
DenseVector< _Type > | LAST_X |
state variable at the last computed solution More... | |
DenseVector< _Type > | X_DERIV_S |
derivative of the state variable w.r.t. arc length More... | |
_Type | LAST_PARAM |
parameter value at the last computed solution More... | |
_Type | PARAM_DERIV_S |
derivative of the parameter w.r.t arc length More... | |
double | DS |
size of the arc length step More... | |
double | MAX_DS |
maximum arc length step to be taken More... | |
double | ARCSTEP_MULTIPLIER |
step change multiplier More... | |
bool | INITIALISED |
for the arc-length solver - to show it has been initialised More... | |
double | THETA |
the arclength theta More... | |
A templated object for real/complex vector system of first-order ordinary differential equations.
The class is double templated, with the first type associated with real/complex data, and second (real/complex) type associated with a problem on the real line or line in the complex plane.
CppNoddy::ODE_BVP< _Type, _Xtype >::ODE_BVP | ( | Equation_1matrix< _Type, _Xtype > * | ptr_to_equation, |
const DenseVector< _Xtype > & | nodes, | ||
Residual< _Type > * | ptr_to_left_residual, | ||
Residual< _Type > * | ptr_to_right_residual | ||
) |
The class is defined by a vector function for the system.
ptr_to_equation | A pointer to an Equation_1matrix object. |
nodes | A vector that defines the nodal positions. |
ptr_to_left_residual | A pointer to a residual object that defines the LHS boundary conditions. |
ptr_to_right_residual | A pointer to a residual object that defines the RHS boundary conditions. |
Definition at line 31 of file ODE_BVP.cpp.
|
virtual |
Destructor.
Definition at line 69 of file ODE_BVP.cpp.
|
inlinevirtual |
A virtual method that is called prior to the linear solve stage of the solve2() method.
This is called prior to any linear solve to allow the user to manually tune the matrix problem directly.
a | The Jacbian matrix to be passed to the linear solver |
b | The residual vector to be passed to the linear solver |
Definition at line 63 of file ODE_BVP.h.
std::pair< unsigned, unsigned > CppNoddy::ODE_BVP< _Type, _Xtype >::adapt | ( | const double & | adapt_tol | ) |
Adapt the computational mesh ONCE.
We step through each interior node and evaluate the residual at that node. If the residual is less than the convergence tolerance, the node is removed. If the residual is greater than the adapt_tol parameter, then the mesh is adapted with an addition node place either side of the evaluation node.
adapt_tol | The residual tolerance at a nodal point that will lead to the mesh adaptation. |
Definition at line 481 of file ODE_BVP.cpp.
References CppNoddy::DenseVector< _Type >::inf_norm(), and CppNoddy::DenseVector< _Type >::push_back().
Referenced by main().
std::pair< unsigned, unsigned > CppNoddy::ODE_BVP< std::complex< double >, std::complex< double > >::adapt | ( | const double & | adapt_tol | ) |
Definition at line 432 of file ODE_BVP.cpp.
std::pair< unsigned, unsigned > CppNoddy::ODE_BVP< double, std::complex< double > >::adapt | ( | const double & | adapt_tol | ) |
Definition at line 442 of file ODE_BVP.cpp.
void CppNoddy::ODE_BVP< _Type, _Xtype >::adapt_until | ( | const double & | adapt_tol | ) |
Adaptively solve the system until no refinements or unrefinements are applied.
adapt_tol | The residual tolerance at a nodal point that will lead to the mesh adaptation. |
Definition at line 471 of file ODE_BVP.cpp.
void CppNoddy::ODE_BVP< std::complex< double >, std::complex< double > >::adapt_until | ( | const double & | adapt_tol | ) |
Definition at line 452 of file ODE_BVP.cpp.
void CppNoddy::ODE_BVP< double, std::complex< double > >::adapt_until | ( | const double & | adapt_tol | ) |
Definition at line 462 of file ODE_BVP.cpp.
double CppNoddy::ODE_BVP< _Type, _Xtype >::arclength_solve | ( | const double & | step | ) |
Arc-length solve the system.
Before this can be called the arc_init method should have been called in order to ensure we know a solution and have derivatives w.r.t. the arc-length parameter.
Definition at line 164 of file ODE_BVP.cpp.
References CppNoddy::Utility::dot(), CppNoddy::BandedLinearSystem< _Type >::get_det_sign(), CppNoddy::DenseVector< _Type >::inf_norm(), CppNoddy::BandedLinearSystem< _Type >::set_monitor_det(), and CppNoddy::BandedLinearSystem< _Type >::solve().
Referenced by main().
void CppNoddy::ODE_BVP< _Type, _Xtype >::init_arc | ( | _Type * | p, |
const double & | length, | ||
const double & | max_length | ||
) |
Initialise the class ready for arc length continuation.
The base class requires a vector, so we wrap the base class method here so that the vector can be extracted from the mesh member data.
p | The pointer to the parameter |
length | The initial arc length step to be taken (all in the parameter. |
max_length | The maximum arc length step to be allowed. |
Definition at line 179 of file ODE_BVP.h.
References p.
Referenced by main().
|
inline |
void CppNoddy::ODE_BVP< _Type, _Xtype >::set_monitor_det | ( | bool | flag | ) |
|
inline |
void CppNoddy::ODE_BVP< _Type, _Xtype >::solve2 |
Formulate and solve the ODE using Newton iteration and a second-order finite difference scheme.
The solution is stored in the publicly accessible 'solution' member data.
Definition at line 83 of file ODE_BVP.cpp.
Referenced by main().
|
inline |
© 2012
R.E. Hewitt