Public Member Functions | Private Types | Private Attributes | Friends | List of all members
oomph::FoldHandler Class Reference

A class that is used to assemble the augmented system that defines a fold (saddle-node) or limit point. The "standard" problem must be a function of a global paramter $\lambda$, and a solution is $R(u,\lambda) = 0 $ , where $ u $ are the unknowns in the problem. A limit point is formally specified by the augmented system of size $ 2N+1 $. More...

#include <assembly_handler.h>

+ Inheritance diagram for oomph::FoldHandler:

Public Member Functions

 FoldHandler (Problem *const &problem_pt, double *const &parameter_pt)
 Constructor: initialise the fold handler, by setting initial guesses for Y, Phi and calculating count. If the system changes, a new fold handler must be constructed. More...
 
 FoldHandler (Problem *const &problem_pt, double *const &parameter_pt, const DoubleVector &eigenvector)
 Constructor in which initial eigenvector can be passed. More...
 
 FoldHandler (Problem *const &problem_pt, double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation)
 Constructor in which initial eigenvector and normalisation can be passed. More...
 
 ~FoldHandler ()
 Destructor, return the problem to its original state before the augmented system was added. More...
 
unsigned ndof (GeneralisedElement *const &elem_pt)
 Get the number of elemental degrees of freedom. More...
 
unsigned long eqn_number (GeneralisedElement *const &elem_pt, const unsigned &ieqn_local)
 Get the global equation number of the local unknown. More...
 
void get_residuals (GeneralisedElement *const &elem_pt, Vector< double > &residuals)
 Get the residuals. More...
 
void get_jacobian (GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian)
 Calculate the elemental Jacobian matrix "d equation / d variable". More...
 
void get_dresiduals_dparameter (GeneralisedElement *const &elem_pt, double *const &parameter_pt, Vector< double > &dres_dparam)
 Overload the derivatives of the residuals with respect to a parameter to apply to the augmented system. More...
 
void get_djacobian_dparameter (GeneralisedElement *const &elem_pt, double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 Overload the derivative of the residuals and jacobian with respect to a parameter so that it breaks. More...
 
void get_hessian_vector_products (GeneralisedElement *const &elem_pt, Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 Overload the hessian vector product function so that it breaks. More...
 
int bifurcation_type () const
 Indicate that we are tracking a fold bifurcation by returning 1. More...
 
double * bifurcation_parameter_pt () const
 Return a pointer to the bifurcation parameter in bifurcation tracking problems. More...
 
void get_eigenfunction (Vector< DoubleVector > &eigenfunction)
 Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tracking problems. More...
 
void solve_augmented_block_system ()
 Set to solve the augmented block system. More...
 
void solve_block_system ()
 Set to solve the block system. More...
 
void solve_full_system ()
 Solve non-block system. More...
 
- Public Member Functions inherited from oomph::AssemblyHandler
 AssemblyHandler ()
 Empty constructor. More...
 
virtual void dof_vector (GeneralisedElement *const &elem_pt, const unsigned &t, Vector< double > &dof)
 Return vector of dofs at time level t in the element elem_pt. More...
 
virtual void dof_pt_vector (GeneralisedElement *const &elem_pt, Vector< double * > &dof_pt)
 Return vector of pointers to dofs in the element elem_pt. More...
 
virtual double & local_problem_dof (Problem *const &problem_pt, const unsigned &t, const unsigned &i)
 Return the t-th level of storage associated with the i-th (local) dof stored in the problem. More...
 
virtual void get_all_vectors_and_matrices (GeneralisedElement *const &elem_pt, Vector< Vector< double >> &vec, Vector< DenseMatrix< double >> &matrix)
 Calculate all desired vectors and matrices provided by the element elem_pt. More...
 
virtual void get_inner_products (GeneralisedElement *const &elem_pt, Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 Compute the inner products of the given vector of pairs of history values over the element. More...
 
virtual void get_inner_product_vectors (GeneralisedElement *const &elem_pt, Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 Compute the vectors that when taken as a dot product with other history values give the inner product over the element. More...
 
virtual void synchronise ()
 Function that is used to perform any synchronisation required during the solution. More...
 
virtual ~AssemblyHandler ()
 Empty virtual destructor. More...
 

Private Types

enum  { Full_augmented , Block_J , Block_augmented_J }
 A little private enum to determine whether we are solving the block system or not. More...
 

Private Attributes

unsigned Solve_which_system
 Integer flag to indicate which system should be assembled. There are three possibilities. The full augmented system (0), the non-augmented jacobian system (1), a system in which the jacobian is augmented by 1 row and column to ensure that it is non-singular (2). See the enum above. More...
 
ProblemProblem_pt
 Pointer to the problem. More...
 
unsigned Ndof
 Store the number of degrees of freedom in the non-augmented problem. More...
 
Vector< double > Phi
 A constant vector used to ensure that the null vector is not trivial. More...
 
Vector< double > Y
 Storage for the null vector. More...
 
Vector< int > Count
 A vector that is used to determine how many elements contribute to a particular equation. It is used to ensure that the global system is correctly formulated. More...
 
double * Parameter_pt
 Storage for the pointer to the parameter. More...
 

Friends

class AugmentedBlockFoldLinearSolver
 

Detailed Description

A class that is used to assemble the augmented system that defines a fold (saddle-node) or limit point. The "standard" problem must be a function of a global paramter $\lambda$, and a solution is $R(u,\lambda) = 0 $ , where $ u $ are the unknowns in the problem. A limit point is formally specified by the augmented system of size $ 2N+1 $.

\[ R(u,\lambda) = 0, \]

\[ Jy = 0, \]

\[\phi\cdot y = 1. \]

In the above $ J $ is the usual Jacobian matrix, $ dR/du $, and $ \phi $ is a constant vector that is chosen to ensure that the null vector, $ y $, is not trivial.

Definition at line 472 of file assembly_handler.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

A little private enum to determine whether we are solving the block system or not.

Enumerator
Full_augmented 
Block_J 
Block_augmented_J 

Definition at line 478 of file assembly_handler.h.

Constructor & Destructor Documentation

◆ FoldHandler() [1/3]

oomph::FoldHandler::FoldHandler ( Problem *const &  problem_pt,
double *const &  parameter_pt 
)

◆ FoldHandler() [2/3]

oomph::FoldHandler::FoldHandler ( Problem *const &  problem_pt,
double *const &  parameter_pt,
const DoubleVector eigenvector 
)

◆ FoldHandler() [3/3]

oomph::FoldHandler::FoldHandler ( Problem *const &  problem_pt,
double *const &  parameter_pt,
const DoubleVector eigenvector,
const DoubleVector normalisation 
)

◆ ~FoldHandler()

oomph::FoldHandler::~FoldHandler ( )

Destructor, return the problem to its original state before the augmented system was added.

Destructor return the problem to its original (non-augmented) state.

Definition at line 1573 of file assembly_handler.cc.

References oomph::LinearAlgebraDistribution::build(), oomph::Problem::communicator_pt(), oomph::Problem::Dof_distribution_pt, oomph::Problem::Dof_pt, oomph::Problem::linear_solver_pt(), oomph::AugmentedBlockFoldLinearSolver::linear_solver_pt(), Ndof, Problem_pt, and oomph::Problem::Sparse_assemble_with_arrays_previous_allocation.

Member Function Documentation

◆ bifurcation_parameter_pt()

double* oomph::FoldHandler::bifurcation_parameter_pt ( ) const
inlinevirtual

Return a pointer to the bifurcation parameter in bifurcation tracking problems.

Reimplemented from oomph::AssemblyHandler.

Definition at line 584 of file assembly_handler.h.

References Parameter_pt.

◆ bifurcation_type()

int oomph::FoldHandler::bifurcation_type ( ) const
inlinevirtual

Indicate that we are tracking a fold bifurcation by returning 1.

Reimplemented from oomph::AssemblyHandler.

Definition at line 577 of file assembly_handler.h.

◆ eqn_number()

unsigned long oomph::FoldHandler::eqn_number ( GeneralisedElement *const &  elem_pt,
const unsigned &  ieqn_local 
)
virtual

Get the global equation number of the local unknown.

Return the global equation number associated with local equation number ieqn_local. We choose to number the unknowns according to the augmented system.

Reimplemented from oomph::AssemblyHandler.

Definition at line 1138 of file assembly_handler.cc.

References oomph::GeneralisedElement::eqn_number(), Ndof, and oomph::GeneralisedElement::ndof().

Referenced by get_jacobian(), oomph::AugmentedBlockFoldLinearSolver::resolve(), and oomph::AugmentedBlockFoldLinearSolver::solve().

◆ get_djacobian_dparameter()

void oomph::FoldHandler::get_djacobian_dparameter ( GeneralisedElement *const &  elem_pt,
double *const &  parameter_pt,
Vector< double > &  dres_dparam,
DenseMatrix< double > &  djac_dparam 
)
virtual

Overload the derivative of the residuals and jacobian with respect to a parameter so that it breaks.

Overload the derivative of the residuals and jacobian with respect to a parameter so that it breaks because it should not be required.

Reimplemented from oomph::AssemblyHandler.

Definition at line 1512 of file assembly_handler.cc.

◆ get_dresiduals_dparameter()

void oomph::FoldHandler::get_dresiduals_dparameter ( GeneralisedElement *const &  elem_pt,
double *const &  parameter_pt,
Vector< double > &  dres_dparam 
)
virtual

Overload the derivatives of the residuals with respect to a parameter to apply to the augmented system.

Formulate the derivatives of the augmented system with respect to a parameter.

Reimplemented from oomph::AssemblyHandler.

Definition at line 1442 of file assembly_handler.cc.

References Block_augmented_J, Block_J, oomph::GeneralisedElement::eqn_number(), Full_augmented, oomph::GeneralisedElement::get_djacobian_dparameter(), oomph::GeneralisedElement::get_dresiduals_dparameter(), i, oomph::GeneralisedElement::ndof(), Solve_which_system, and Y.

◆ get_eigenfunction()

void oomph::FoldHandler::get_eigenfunction ( Vector< DoubleVector > &  eigenfunction)
virtual

Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tracking problems.

Reimplemented from oomph::AssemblyHandler.

Definition at line 1555 of file assembly_handler.cc.

References oomph::Problem::communicator_pt(), Ndof, Problem_pt, and Y.

◆ get_hessian_vector_products()

void oomph::FoldHandler::get_hessian_vector_products ( GeneralisedElement *const &  elem_pt,
Vector< double > const &  Y,
DenseMatrix< double > const &  C,
DenseMatrix< double > &  product 
)
virtual

Overload the hessian vector product function so that it breaks.

Overload the hessian vector product function so that it breaks because it should not be required.

Reimplemented from oomph::AssemblyHandler.

Definition at line 1533 of file assembly_handler.cc.

◆ get_jacobian()

void oomph::FoldHandler::get_jacobian ( GeneralisedElement *const &  elem_pt,
Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
virtual

◆ get_residuals()

void oomph::FoldHandler::get_residuals ( GeneralisedElement *const &  elem_pt,
Vector< double > &  residuals 
)
virtual

◆ ndof()

unsigned oomph::FoldHandler::ndof ( GeneralisedElement *const &  elem_pt)
virtual

Get the number of elemental degrees of freedom.

The number of unknowns is 2n+1.

Reimplemented from oomph::AssemblyHandler.

Definition at line 1105 of file assembly_handler.cc.

References Block_augmented_J, Block_J, Full_augmented, oomph::GeneralisedElement::ndof(), and Solve_which_system.

Referenced by get_jacobian(), oomph::AugmentedBlockFoldLinearSolver::resolve(), and oomph::AugmentedBlockFoldLinearSolver::solve().

◆ solve_augmented_block_system()

void oomph::FoldHandler::solve_augmented_block_system ( )

◆ solve_block_system()

void oomph::FoldHandler::solve_block_system ( )

Set to solve the block system.

Set to solve the block system. The boolean flag specifies whether the block decomposition should use exactly the same jacobian.

Definition at line 1629 of file assembly_handler.cc.

References Block_J, oomph::LinearAlgebraDistribution::build(), oomph::Problem::communicator_pt(), oomph::Problem::Dof_distribution_pt, oomph::Problem::Dof_pt, Ndof, Problem_pt, Solve_which_system, and oomph::Problem::Sparse_assemble_with_arrays_previous_allocation.

◆ solve_full_system()

void oomph::FoldHandler::solve_full_system ( )

Friends And Related Function Documentation

◆ AugmentedBlockFoldLinearSolver

friend class AugmentedBlockFoldLinearSolver
friend

Definition at line 474 of file assembly_handler.h.

Member Data Documentation

◆ Count

Vector<int> oomph::FoldHandler::Count
private

A vector that is used to determine how many elements contribute to a particular equation. It is used to ensure that the global system is correctly formulated.

Definition at line 509 of file assembly_handler.h.

Referenced by FoldHandler(), get_jacobian(), and get_residuals().

◆ Ndof

unsigned oomph::FoldHandler::Ndof
private

Store the number of degrees of freedom in the non-augmented problem.

Definition at line 497 of file assembly_handler.h.

Referenced by eqn_number(), FoldHandler(), get_eigenfunction(), get_jacobian(), solve_augmented_block_system(), solve_block_system(), solve_full_system(), and ~FoldHandler().

◆ Parameter_pt

double* oomph::FoldHandler::Parameter_pt
private

Storage for the pointer to the parameter.

Definition at line 512 of file assembly_handler.h.

Referenced by bifurcation_parameter_pt(), solve_augmented_block_system(), and solve_full_system().

◆ Phi

Vector<double> oomph::FoldHandler::Phi
private

A constant vector used to ensure that the null vector is not trivial.

Definition at line 501 of file assembly_handler.h.

Referenced by FoldHandler(), get_jacobian(), and get_residuals().

◆ Problem_pt

Problem* oomph::FoldHandler::Problem_pt
private

◆ Solve_which_system

unsigned oomph::FoldHandler::Solve_which_system
private

Integer flag to indicate which system should be assembled. There are three possibilities. The full augmented system (0), the non-augmented jacobian system (1), a system in which the jacobian is augmented by 1 row and column to ensure that it is non-singular (2). See the enum above.

Definition at line 490 of file assembly_handler.h.

Referenced by get_dresiduals_dparameter(), get_jacobian(), get_residuals(), ndof(), solve_augmented_block_system(), solve_block_system(), and solve_full_system().

◆ Y

Vector<double> oomph::FoldHandler::Y
private

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