A custom linear solver class that is used to solve a block-factorised version of the Fold bifurcation detection problem. More...
#include <assembly_handler.h>
Public Member Functions | |
AugmentedBlockFoldLinearSolver (LinearSolver *const linear_solver_pt) | |
Constructor, inherits the original linear solver. | |
~AugmentedBlockFoldLinearSolver () | |
Destructor: clean up the allocated memory. | |
void | solve (Problem *const &problem_pt, DoubleVector &result) |
The solve function uses the block factorisation. | |
void | solve (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
The linear-algebra-type solver does not make sense. The interface is deliberately broken. | |
void | solve (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
The linear-algebra-type solver does not make sense. The interface is deliberately broken. | |
void | resolve (const DoubleVector &rhs, DoubleVector &result) |
The resolve function also uses the block factorisation. | |
LinearSolver * | linear_solver_pt () const |
Access function to the original linear solver. | |
![]() | |
LinearSolver () | |
Empty constructor, initialise the member data. | |
LinearSolver (const LinearSolver &dummy)=delete | |
Broken copy constructor. | |
void | operator= (const LinearSolver &)=delete |
Broken assignment operator. | |
virtual | ~LinearSolver () |
Empty virtual destructor. | |
void | enable_doc_time () |
Enable documentation of solve times. | |
void | disable_doc_time () |
Disable documentation of solve times. | |
bool | is_doc_time_enabled () const |
Is documentation of solve times enabled? | |
bool | is_resolve_enabled () const |
Boolean flag indicating if resolves are enabled. | |
virtual void | enable_resolve () |
Enable resolve (i.e. store matrix and/or LU decomposition, say) Virtual so it can be overloaded to perform additional tasks. | |
virtual void | disable_resolve () |
Disable resolve (i.e. store matrix and/or LU decomposition, say) This function simply resets an internal flag. It's virtual so it can be overloaded to perform additional tasks such as cleaning up memory that is only required for the resolve. | |
virtual void | solve_transpose (Problem *const &problem_pt, DoubleVector &result) |
Solver: Takes pointer to problem and returns the results vector which contains the solution of the linear system defined by the problem's fully assembled Jacobian and residual vector (broken virtual). | |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. | |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. | |
virtual void | resolve_transpose (const DoubleVector &rhs, DoubleVector &result) |
Solver: Resolve the system defined by the last assembled jacobian and the rhs vector. Solution is returned in the vector result. (broken virtual) | |
virtual void | clean_up_memory () |
Empty virtual function that can be overloaded in specific linear solvers to clean up any memory that may have been allocated (e.g. when preparing for a re-solve). | |
virtual double | jacobian_setup_time () const |
returns the time taken to assemble the Jacobian matrix and residual vector (needs to be overloaded for each solver) | |
virtual double | linear_solver_solution_time () const |
return the time taken to solve the linear system (needs to be overloaded for each linear solver) | |
virtual void | enable_computation_of_gradient () |
function to enable the computation of the gradient required for the globally convergent Newton method | |
void | disable_computation_of_gradient () |
function to disable the computation of the gradient required for the globally convergent Newton method | |
void | reset_gradient () |
function to reset the size of the gradient before each Newton solve | |
void | get_gradient (DoubleVector &gradient) |
function to access the gradient, provided it has been computed | |
![]() | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete | |
Broken copy constructor. | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
Broken assignment operator. | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution | |
unsigned | nrow () const |
access function to the number of global rows. | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. | |
unsigned | first_row () const |
access function for the first row on this processor | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor | |
bool | distributed () const |
distribution is serial or distributed | |
bool | distribution_built () const |
if the communicator_pt is null then the distribution is not setup then false is returned, otherwise return true | |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
setup the distribution of this distributable linear algebra object | |
void | build_distribution (const LinearAlgebraDistribution &dist) |
setup the distribution of this distributable linear algebra object | |
Private Attributes | |
LinearSolver * | Linear_solver_pt |
Pointer to the original linear solver. | |
Problem * | Problem_pt |
DoubleVector * | Alpha_pt |
Pointer to the storage for the vector alpha. | |
DoubleVector * | E_pt |
Pointer to the storage for the vector e. | |
Additional Inherited Members | |
![]() | |
void | clear_distribution () |
clear the distribution of this distributable linear algebra object | |
![]() | |
bool | Enable_resolve |
Boolean that indicates whether the matrix (or its factors, in the case of direct solver) should be stored so that the resolve function can be used. | |
bool | Doc_time |
Boolean flag that indicates whether the time taken. | |
bool | Compute_gradient |
flag that indicates whether the gradient required for the globally convergent Newton method should be computed or not | |
bool | Gradient_has_been_computed |
flag that indicates whether the gradient was computed or not | |
DoubleVector | Gradient_for_glob_conv_newton_solve |
DoubleVector storing the gradient for the globally convergent Newton method. | |
A custom linear solver class that is used to solve a block-factorised version of the Fold bifurcation detection problem.
Definition at line 396 of file assembly_handler.h.
|
inline |
Constructor, inherits the original linear solver.
Definition at line 412 of file assembly_handler.h.
oomph::AugmentedBlockFoldLinearSolver::~AugmentedBlockFoldLinearSolver | ( | ) |
Destructor: clean up the allocated memory.
Clean up the memory that may have been allocated by the solver.
Definition at line 389 of file assembly_handler.cc.
|
inline |
Access function to the original linear solver.
Definition at line 451 of file assembly_handler.h.
References Linear_solver_pt.
|
virtual |
The resolve function also uses the block factorisation.
Reimplemented from oomph::LinearSolver.
Definition at line 677 of file assembly_handler.cc.
References oomph::Problem::actions_after_change_in_bifurcation_parameter(), Alpha_pt, oomph::Problem::assembly_handler_pt(), oomph::LinearSolver::disable_resolve(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::dof(), e, oomph::Mesh::element_pt(), oomph::LinearSolver::enable_resolve(), oomph::GeneralisedElement::eqn_number(), oomph::GeneralisedElement::get_jacobian(), Linear_solver_pt, oomph::Problem::mesh_pt(), oomph::GeneralisedElement::ndof(), oomph::Problem::ndof(), oomph::Mesh::nelement(), Problem_pt, and oomph::LinearSolver::resolve().
|
inlinevirtual |
The linear-algebra-type solver does not make sense. The interface is deliberately broken.
Reimplemented from oomph::LinearSolver.
Definition at line 425 of file assembly_handler.h.
|
inlinevirtual |
The linear-algebra-type solver does not make sense. The interface is deliberately broken.
Reimplemented from oomph::LinearSolver.
Definition at line 437 of file assembly_handler.h.
|
virtual |
The solve function uses the block factorisation.
Use a block factorisation to solve the augmented system associated with a PitchFork bifurcation.
Implements oomph::LinearSolver.
Definition at line 405 of file assembly_handler.cc.
References oomph::Problem::actions_after_change_in_bifurcation_parameter(), Alpha_pt, oomph::Problem::assembly_handler_pt(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::Problem::communicator_pt(), oomph::LinearSolver::disable_resolve(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::Problem::dof(), e, E_pt, oomph::Mesh::element_pt(), oomph::LinearSolver::Enable_resolve, oomph::LinearSolver::enable_resolve(), oomph::GeneralisedElement::eqn_number(), oomph::GeneralisedElement::get_jacobian(), Linear_solver_pt, oomph::Problem::mesh_pt(), oomph::GeneralisedElement::ndof(), oomph::Problem::ndof(), oomph::Mesh::nelement(), Problem_pt, oomph::LinearSolver::resolve(), oomph::Problem::sign_of_jacobian(), and oomph::LinearSolver::solve().
|
private |
Pointer to the storage for the vector alpha.
Definition at line 405 of file assembly_handler.h.
Referenced by resolve(), solve(), and ~AugmentedBlockFoldLinearSolver().
|
private |
Pointer to the storage for the vector e.
Definition at line 408 of file assembly_handler.h.
Referenced by solve(), and ~AugmentedBlockFoldLinearSolver().
|
private |
Pointer to the original linear solver.
Definition at line 399 of file assembly_handler.h.
Referenced by linear_solver_pt(), resolve(), and solve().
|
private |
Definition at line 402 of file assembly_handler.h.