#include <assembly_handler.h>
Public Member Functions | |
PitchForkHandler (Problem *const &problem_pt, AssemblyHandler *const &assembly_handler_pt, double *const ¶meter_pt, const DoubleVector &symmetry_vector) | |
Constructor, initialise the systems. More... | |
~PitchForkHandler () | |
Destructor return the problem to its original (non-augmented) state. 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 ¶meter_pt, Vector< double > &dres_dparam) |
Overload the derivatives of the residuals with respect to. More... | |
void | get_djacobian_dparameter (GeneralisedElement *const &elem_pt, double *const ¶meter_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 pitchfork bifurcation by returning 2. 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. More... | |
void | synchronise () |
Function that is used to perform any synchronisation required during the solution. 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... | |
![]() | |
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 | ~AssemblyHandler () |
Empty virtual destructor. More... | |
Private Types | |
enum | { Full_augmented, Block_J, Block_augmented_J } |
Private Member Functions | |
unsigned | global_eqn_number (const unsigned &i) |
Function that is used to return map the global equations using the simplistic numbering scheme into the actual distributed scheme. 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... | |
Problem * | Problem_pt |
Pointer to the problem. More... | |
AssemblyHandler * | Assembly_handler_pt |
Pointer to the underlying (original) assembly handler. More... | |
unsigned | Ndof |
Store the number of degrees of freedom in the non-augmented problem. More... | |
LinearAlgebraDistribution * | Dof_distribution_pt |
Store the original dof distribution. More... | |
LinearAlgebraDistribution * | Augmented_dof_distribution_pt |
The augmented distribution. More... | |
double | Sigma |
A slack variable used to specify the amount of antisymmetry in the solution. More... | |
DoubleVectorWithHaloEntries | Y |
Storage for the null vector. More... | |
DoubleVectorWithHaloEntries | Psi |
A constant vector that is specifies the symmetry being broken. More... | |
DoubleVectorWithHaloEntries | C |
A constant vector used to ensure that the null vector is not trivial. More... | |
DoubleVectorWithHaloEntries | 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. This should really be an integer, but its double so that the distribution can be used. More... | |
Vector< unsigned > | Global_eqn_number |
A vector that is used to map the global equations to their actual location in a distributed problem. More... | |
double * | Parameter_pt |
Storage for the pointer to the parameter. More... | |
unsigned | Nelement |
bool | Distributed |
Boolean to indicate whether the problem is distributed. More... | |
Friends | |
class | BlockPitchForkLinearSolver |
class | AugmentedBlockPitchForkLinearSolver |
A class that is used to assemble the augmented system that defines a pitchfork (symmetry-breaking) bifurcation. The "standard" problem must be a function of a global parameter and a solution is
, where
are the unknowns in the problem. A pitchfork bifurcation may be specified by the augmented system of size
.
In the abovem is the usual Jacobian matrix,
and
is a constant vector that is chosen to ensure that the null vector,
, is not trivial. Here
is a slack variable that is used to enforce the constraint
— the inner product of the solution with the chosen symmetry vector is zero. At the bifurcation
should be very close to zero. Note that this formulation means that any odd symmetry in the problem must be about zero. Moreover, we use the dot product of two vectors to calculate the inner product, rather than an integral over the domain and so the mesh must be symmetric in the appropriate directions.
Definition at line 748 of file assembly_handler.h.
|
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 755 of file assembly_handler.h.
oomph::PitchForkHandler::PitchForkHandler | ( | Problem *const & | problem_pt, |
AssemblyHandler *const & | assembly_handler_pt, | ||
double *const & | parameter_pt, | ||
const DoubleVector & | symmetry_vector | ||
) |
Constructor, initialise the systems.
Constructor: Initialise the PitchForkHandler by setting intial guesses for Sigma, Y, specifying C and Psi and calculating count.
Definition at line 2539 of file assembly_handler.cc.
References Assembly_handler_pt, Augmented_dof_distribution_pt, oomph::DoubleVector::build(), oomph::DoubleVectorWithHaloEntries::build_halo_scheme(), C, oomph::Problem::communicator_pt(), Count, oomph::Problem::distributed(), Distributed, oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::Dof_distribution_pt, Dof_distribution_pt, oomph::Problem::Dof_pt, e, oomph::Mesh::element_pt(), oomph::AssemblyHandler::eqn_number(), oomph::LinearAlgebraDistribution::first_row(), Global_eqn_number, oomph::DoubleVectorWithHaloEntries::global_value(), oomph::Problem::Halo_scheme_pt, oomph::GeneralisedElement::is_halo(), oomph::Problem::mesh_pt(), oomph::AssemblyHandler::ndof(), Ndof, oomph::Problem::ndof(), oomph::Mesh::nelement(), Nelement, oomph::DoubleVector::norm(), oomph::LinearAlgebraDistribution::nrow_local(), Problem_pt, Psi, oomph::Problem::setup_dof_halo_scheme(), Sigma, oomph::Problem::Sparse_assemble_with_arrays_previous_allocation, oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and Y.
oomph::PitchForkHandler::~PitchForkHandler | ( | ) |
Destructor return the problem to its original (non-augmented) state.
Destructor, return the problem to its original state, before the augmented system was added
Definition at line 2753 of file assembly_handler.cc.
References oomph::Problem::Dof_distribution_pt, Dof_distribution_pt, oomph::Problem::Dof_pt, oomph::BlockPitchForkLinearSolver::linear_solver_pt(), oomph::AugmentedBlockPitchForkLinearSolver::linear_solver_pt(), oomph::Problem::linear_solver_pt(), oomph::LinearAlgebraDistribution::nrow_local(), Problem_pt, and oomph::Problem::Sparse_assemble_with_arrays_previous_allocation.
|
inlinevirtual |
Return a pointer to the bifurcation parameter in bifurcation tracking problems.
Reimplemented from oomph::AssemblyHandler.
Definition at line 893 of file assembly_handler.h.
References oomph::AssemblyHandler::get_eigenfunction(), and oomph::AssemblyHandler::synchronise().
|
inlinevirtual |
Indicate that we are tracking a pitchfork bifurcation by returning 2.
Reimplemented from oomph::AssemblyHandler.
Definition at line 889 of file assembly_handler.h.
|
virtual |
Get the global equation number of the local unknown.
Reimplemented from oomph::AssemblyHandler.
Definition at line 2831 of file assembly_handler.cc.
References Block_augmented_J, Block_J, Distributed, oomph::GeneralisedElement::eqn_number(), Full_augmented, global_eqn_number(), Ndof, oomph::GeneralisedElement::ndof(), and Solve_which_system.
Referenced by oomph::AugmentedBlockPitchForkLinearSolver::resolve(), oomph::AugmentedBlockPitchForkLinearSolver::solve(), oomph::BlockHopfLinearSolver::solve(), and oomph::BlockHopfLinearSolver::solve_for_two_rhs().
|
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 3256 of file assembly_handler.cc.
|
virtual |
Overload the derivatives of the residuals with respect to.
Get the derivatives of the residuals with respect to a parameter.
a parameter to apply to the augmented system
Reimplemented from oomph::AssemblyHandler.
Definition at line 3178 of file assembly_handler.cc.
References oomph::Problem::actions_before_newton_convergence_check(), Block_augmented_J, Block_J, oomph::GeneralisedElement::eqn_number(), Full_augmented, oomph::GeneralisedElement::get_djacobian_dparameter(), oomph::GeneralisedElement::get_dresiduals_dparameter(), oomph::DoubleVectorWithHaloEntries::global_value(), i, oomph::GeneralisedElement::ndof(), Problem_pt, Solve_which_system, and Y.
|
virtual |
Return the eigenfunction(s) associated with the bifurcation that.
has been detected in bifurcation tracking problems
Return the eigenfunction(s) associated with the bifurcation that has been detected in bifurcation tracking problems
Reimplemented from oomph::AssemblyHandler.
Definition at line 3294 of file assembly_handler.cc.
References Dof_distribution_pt, and Y.
|
virtual |
Overload the hessian vector product function so that it breaks.
Overload the hessian vector product function so that it calls the underlying element's hessian function.
Reimplemented from oomph::AssemblyHandler.
Definition at line 3279 of file assembly_handler.cc.
References oomph::GeneralisedElement::get_hessian_vector_products().
|
virtual |
Calculate the elemental Jacobian matrix "d equation / d variable".
ALICE:
ALICE
Reimplemented from oomph::AssemblyHandler.
Definition at line 2995 of file assembly_handler.cc.
References oomph::Problem::actions_after_change_in_bifurcation_parameter(), oomph::Problem::actions_before_newton_convergence_check(), Assembly_handler_pt, Block_augmented_J, Block_J, C, Count, oomph::AssemblyHandler::eqn_number(), oomph::GeneralisedElement::eqn_number(), oomph::BlackBoxFDNewtonSolver::FD_step, Full_augmented, oomph::GeneralisedElement::get_jacobian(), get_residuals(), oomph::Problem::global_dof_pt(), oomph::DoubleVectorWithHaloEntries::global_value(), i, oomph::GeneralisedElement::ndof(), ndof(), Parameter_pt, Problem_pt, Psi, Sigma, and Solve_which_system.
Referenced by oomph::AugmentedBlockPitchForkLinearSolver::resolve(), and oomph::AugmentedBlockPitchForkLinearSolver::solve().
|
virtual |
Get the residuals.
Reimplemented from oomph::AssemblyHandler.
Definition at line 2891 of file assembly_handler.cc.
References Block_augmented_J, Block_J, C, Count, oomph::GeneralisedElement::eqn_number(), Full_augmented, oomph::GeneralisedElement::get_jacobian(), oomph::GeneralisedElement::get_residuals(), oomph::Problem::global_dof_pt(), oomph::DoubleVectorWithHaloEntries::global_value(), i, oomph::GeneralisedElement::ndof(), Nelement, Problem_pt, Psi, Sigma, Solve_which_system, and Y.
Referenced by get_jacobian().
|
inlineprivate |
Function that is used to return map the global equations using the simplistic numbering scheme into the actual distributed scheme.
Definition at line 819 of file assembly_handler.h.
References oomph::AssemblyHandler::eqn_number(), oomph::AssemblyHandler::get_djacobian_dparameter(), oomph::AssemblyHandler::get_dresiduals_dparameter(), oomph::AssemblyHandler::get_hessian_vector_products(), oomph::AssemblyHandler::get_jacobian(), oomph::AssemblyHandler::get_residuals(), i, and oomph::AssemblyHandler::ndof().
Referenced by eqn_number().
|
virtual |
Get the number of elemental degrees of freedom.
Reimplemented from oomph::AssemblyHandler.
Definition at line 2801 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::AugmentedBlockPitchForkLinearSolver::resolve(), and oomph::AugmentedBlockPitchForkLinearSolver::solve().
void oomph::PitchForkHandler::solve_augmented_block_system | ( | ) |
Set to solve the augmented block system.
Set to solve the augmented-by-one block system.
Definition at line 3338 of file assembly_handler.cc.
References Block_augmented_J, Block_J, oomph::Problem::communicator_pt(), oomph::Problem::Dof_distribution_pt, oomph::Problem::Dof_pt, Ndof, Parameter_pt, Problem_pt, Solve_which_system, and oomph::Problem::Sparse_assemble_with_arrays_previous_allocation.
Referenced by oomph::AugmentedBlockPitchForkLinearSolver::resolve(), and oomph::AugmentedBlockPitchForkLinearSolver::solve().
void oomph::PitchForkHandler::solve_block_system | ( | ) |
Set to solve the block system.
Set to solve the block system. The boolean flag is used to specify whether the block decomposition should use exactly the same jacobian as the original system.
Definition at line 3373 of file assembly_handler.cc.
References Block_J, oomph::Problem::Dof_distribution_pt, Dof_distribution_pt, oomph::Problem::Dof_pt, oomph::LinearAlgebraDistribution::nrow_local(), Problem_pt, Solve_which_system, and oomph::Problem::Sparse_assemble_with_arrays_previous_allocation.
Referenced by oomph::BlockPitchForkLinearSolver::resolve(), and oomph::BlockPitchForkLinearSolver::solve().
void oomph::PitchForkHandler::solve_full_system | ( | ) |
Solve non-block system.
Definition at line 3396 of file assembly_handler.cc.
References Augmented_dof_distribution_pt, Block_J, oomph::Problem::communicator_pt(), Distributed, oomph::Problem::Dof_distribution_pt, Dof_distribution_pt, oomph::Problem::Dof_pt, Full_augmented, oomph::LinearAlgebraDistribution::nrow_local(), Parameter_pt, Problem_pt, Sigma, Solve_which_system, oomph::Problem::Sparse_assemble_with_arrays_previous_allocation, and Y.
Referenced by oomph::BlockPitchForkLinearSolver::resolve(), oomph::AugmentedBlockPitchForkLinearSolver::resolve(), oomph::BlockPitchForkLinearSolver::solve(), and oomph::AugmentedBlockPitchForkLinearSolver::solve().
|
virtual |
Function that is used to perform any synchronisation required during the solution.
Reimplemented from oomph::AssemblyHandler.
Definition at line 3313 of file assembly_handler.cc.
References oomph::Problem::communicator_pt(), Distributed, Parameter_pt, Problem_pt, Sigma, oomph::DoubleVectorWithHaloEntries::synchronise(), and Y.
|
friend |
Definition at line 751 of file assembly_handler.h.
|
friend |
Definition at line 750 of file assembly_handler.h.
|
private |
Pointer to the underlying (original) assembly handler.
Definition at line 768 of file assembly_handler.h.
Referenced by get_jacobian(), and PitchForkHandler().
|
private |
The augmented distribution.
Definition at line 778 of file assembly_handler.h.
Referenced by PitchForkHandler(), oomph::BlockPitchForkLinearSolver::resolve(), oomph::BlockPitchForkLinearSolver::solve(), and solve_full_system().
|
private |
A constant vector used to ensure that the null vector is not trivial.
Definition at line 792 of file assembly_handler.h.
Referenced by get_jacobian(), get_residuals(), and PitchForkHandler().
|
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. This should really be an integer, but its double so that the distribution can be used.
Definition at line 799 of file assembly_handler.h.
Referenced by get_jacobian(), get_residuals(), and PitchForkHandler().
|
private |
Boolean to indicate whether the problem is distributed.
Definition at line 813 of file assembly_handler.h.
Referenced by eqn_number(), PitchForkHandler(), solve_full_system(), and synchronise().
|
private |
Store the original dof distribution.
Definition at line 775 of file assembly_handler.h.
Referenced by get_eigenfunction(), PitchForkHandler(), oomph::BlockPitchForkLinearSolver::resolve(), oomph::BlockPitchForkLinearSolver::solve(), solve_block_system(), solve_full_system(), and ~PitchForkHandler().
|
private |
A vector that is used to map the global equations to their actual location in a distributed problem.
Definition at line 803 of file assembly_handler.h.
Referenced by PitchForkHandler().
|
private |
Store the number of degrees of freedom in the non-augmented problem.
Definition at line 772 of file assembly_handler.h.
Referenced by eqn_number(), PitchForkHandler(), and solve_augmented_block_system().
|
private |
Definition at line 809 of file assembly_handler.h.
Referenced by get_residuals(), and PitchForkHandler().
|
private |
Storage for the pointer to the parameter.
Definition at line 806 of file assembly_handler.h.
Referenced by get_jacobian(), oomph::BlockPitchForkLinearSolver::solve(), solve_augmented_block_system(), solve_full_system(), and synchronise().
|
private |
Pointer to the problem.
Definition at line 765 of file assembly_handler.h.
Referenced by get_dresiduals_dparameter(), get_jacobian(), get_residuals(), PitchForkHandler(), oomph::BlockHopfLinearSolver::solve(), solve_augmented_block_system(), solve_block_system(), oomph::BlockHopfLinearSolver::solve_for_two_rhs(), solve_full_system(), synchronise(), and ~PitchForkHandler().
|
private |
A constant vector that is specifies the symmetry being broken.
Definition at line 788 of file assembly_handler.h.
Referenced by get_jacobian(), get_residuals(), PitchForkHandler(), oomph::BlockPitchForkLinearSolver::resolve(), oomph::BlockPitchForkLinearSolver::solve(), and oomph::AugmentedBlockPitchForkLinearSolver::solve().
|
private |
A slack variable used to specify the amount of antisymmetry in the solution.
Definition at line 782 of file assembly_handler.h.
Referenced by get_jacobian(), get_residuals(), PitchForkHandler(), solve_full_system(), and synchronise().
|
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 762 of file assembly_handler.h.
Referenced by eqn_number(), get_dresiduals_dparameter(), get_jacobian(), get_residuals(), ndof(), solve_augmented_block_system(), solve_block_system(), and solve_full_system().
|
private |
Storage for the null vector.
Definition at line 785 of file assembly_handler.h.
Referenced by get_dresiduals_dparameter(), get_eigenfunction(), get_residuals(), PitchForkHandler(), oomph::BlockPitchForkLinearSolver::resolve(), oomph::AugmentedBlockPitchForkLinearSolver::resolve(), oomph::BlockPitchForkLinearSolver::solve(), oomph::AugmentedBlockPitchForkLinearSolver::solve(), solve_full_system(), and synchronise().