#include <frontal_solver.h>
Public Member Functions | |
HSL_MA42 () | |
Constructor: By default suppress verbose output (stats), don't reorder elements and don't use direct access files. More... | |
~HSL_MA42 () | |
Destructor, clean up the allocated memory. More... | |
HSL_MA42 (const HSL_MA42 &) | |
Broken copy constructor. More... | |
void | operator= (const HSL_MA42 &) |
Broken assignment operator. More... | |
void | clean_up_memory () |
Clean up memory. More... | |
void | disable_resolve () |
Overload disable resolve so that it cleans up memory too. More... | |
void | solve (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. More... | |
void | solve (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. Call the broken base-class version. If you want this, please implement it. More... | |
void | solve (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 Call the broken base-class version. If you want this, please implement it. More... | |
void | resolve (const DoubleVector &rhs, DoubleVector &result) |
Return the solution to the linear system Ax = result, where A is the most recently factorised jacobian matrix of the problem problem_pt. The solution is returned in the result vector. More... | |
void | reorder_elements (Problem *const &problem_pt) |
Function to reorder the elements based on Sloan's algorithm. More... | |
void | enable_doc_stats () |
Enable documentation of statistics. More... | |
void | disable_doc_stats () |
Disable documentation of statistics. More... | |
void | enable_reordering () |
Enable reordering using Sloan's algorithm. More... | |
void | disable_reordering () |
Disable reordering. More... | |
void | enable_direct_access_files () |
Enable use of direct access files. More... | |
void | disable_direct_access_files () |
Disable use of direct access files. More... | |
double & | lenbuf_factor0 () |
Factor to increase storage for lenbuf[0]; see MA42 documentation for details. More... | |
double & | lenbuf_factor1 () |
Factor to increase storage for lenbuf[1]; see MA42 documentation for details. More... | |
double & | lenbuf_factor2 () |
Factor to increase storage for lenbuf[2]; see MA42 documentation for details. More... | |
double & | front_factor () |
Factor to increase storage for front size; see MA42 documentation for details. More... | |
double & | lenfle_factor () |
Factor to increase the size of the direct access files; see MA42 documentation for details. More... | |
![]() | |
LinearSolver () | |
Empty constructor, initialise the member data. More... | |
LinearSolver (const LinearSolver &dummy) | |
Broken copy constructor. More... | |
void | operator= (const LinearSolver &) |
Broken assignment operator. More... | |
virtual | ~LinearSolver () |
Empty virtual destructor. More... | |
void | enable_doc_time () |
Enable documentation of solve times. More... | |
void | disable_doc_time () |
Disable documentation of solve times. More... | |
bool | is_doc_time_enabled () const |
Is documentation of solve times enabled? More... | |
bool | is_resolve_enabled () const |
Boolean flag indicating if resolves are enabled. More... | |
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. More... | |
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) More... | |
virtual double | linear_solver_solution_time () const |
return the time taken to solve the linear system (needs to be overloaded for each linear solver) More... | |
virtual void | enable_computation_of_gradient () |
function to enable the computation of the gradient required for the globally convergent Newton method More... | |
void | disable_computation_of_gradient () |
function to disable the computation of the gradient required for the globally convergent Newton method More... | |
void | reset_gradient () |
function to reset the size of the gradient before each Newton solve More... | |
void | get_gradient (DoubleVector &gradient) |
function to access the gradient, provided it has been computed More... | |
![]() | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. More... | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix) | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &) |
Broken assignment operator. More... | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. More... | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution More... | |
unsigned | nrow () const |
access function to the number of global rows. More... | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. More... | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. More... | |
unsigned | first_row () const |
access function for the first row on this processor More... | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor More... | |
bool | distributed () const |
distribution is serial or distributed More... | |
bool | distribution_built () const |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
setup the distribution of this distributable linear algebra object More... | |
void | build_distribution (const LinearAlgebraDistribution &dist) |
setup the distribution of this distributable linear algebra object More... | |
Private Member Functions | |
void | solve_for_one_dof (Problem *const &problem_pt, DoubleVector &result) |
Special solver for problems with 1 dof (MA42 can't handle this case so solve() forwards the "solve" to this function. More... | |
Private Attributes | |
bool | Doc_stats |
Doc the solver stats or stay quiet? More... | |
bool | Reorder_flag |
Reorder elements with Sloan's algorithm? More... | |
bool | Use_direct_access_files |
Use direct access files? More... | |
double | Lenbuf_factor0 |
Factor to increase storage for lenbuf[0]; see MA42 documentation for details. More... | |
double | Lenbuf_factor1 |
Factor to increase storage for lenbuf[1]; see MA42 documentation for details. More... | |
double | Lenbuf_factor2 |
Factor to increase storage for lenbuf[2]; see MA42 documentation for details. More... | |
double | Front_factor |
Factor to increase storage for front size; see MA42 documentation for details. More... | |
double | Lenfle_factor |
Factor to increase size of direct access files; see MA42 documentation for details. More... | |
int | Icntl [8] |
Control flag for MA42; see MA42 documentation for details. More... | |
int | Isave [45] |
Control flag for MA42; see MA42 documentation for details. More... | |
int | Info [23] |
Control flag for MA42; see MA42 documentation for details. More... | |
double * | W |
Workspace storage for MA42. More... | |
int | Lw |
Size of the workspace array, W. More... | |
int * | IW |
Integer workspace storage for MA42. More... | |
int | Liw |
Size of the integer workspace array. More... | |
unsigned long | N_dof |
Size of the linear system. More... | |
Additional Inherited Members | |
![]() | |
void | clear_distribution () |
clear the distribution of this distributable linear algebra object More... | |
![]() | |
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. More... | |
bool | Doc_time |
Boolean flag that indicates whether the time taken. More... | |
bool | Compute_gradient |
flag that indicates whether the gradient required for the globally convergent Newton method should be computed or not More... | |
bool | Gradient_has_been_computed |
flag that indicates whether the gradient was computed or not More... | |
DoubleVector | Gradient_for_glob_conv_newton_solve |
DoubleVector storing the gradient for the globally convergent Newton method. More... | |
Linear solver class that provides a wrapper to the frontal solver MA42 from the HSL library; see http://www.hsl.rl.ac.uk/.
Definition at line 61 of file frontal_solver.h.
|
inline |
Constructor: By default suppress verbose output (stats), don't reorder elements and don't use direct access files.
Definition at line 128 of file frontal_solver.h.
|
inline |
Destructor, clean up the allocated memory.
Definition at line 143 of file frontal_solver.h.
References clean_up_memory().
|
inline |
Broken copy constructor.
Definition at line 149 of file frontal_solver.h.
References oomph::BrokenCopy::broken_copy().
|
inlinevirtual |
Clean up memory.
Reimplemented from oomph::LinearSolver.
Definition at line 162 of file frontal_solver.h.
Referenced by disable_resolve(), and ~HSL_MA42().
|
inline |
Disable use of direct access files.
Definition at line 223 of file frontal_solver.h.
|
inline |
Disable documentation of statistics.
Definition at line 211 of file frontal_solver.h.
|
inline |
Disable reordering.
Definition at line 217 of file frontal_solver.h.
|
inlinevirtual |
Overload disable resolve so that it cleans up memory too.
Reimplemented from oomph::LinearSolver.
Definition at line 169 of file frontal_solver.h.
References clean_up_memory(), oomph::LinearSolver::disable_resolve(), and solve().
|
inline |
Enable use of direct access files.
Definition at line 220 of file frontal_solver.h.
|
inline |
Enable documentation of statistics.
Definition at line 208 of file frontal_solver.h.
|
inline |
Enable reordering using Sloan's algorithm.
Definition at line 214 of file frontal_solver.h.
|
inline |
Factor to increase storage for front size; see MA42 documentation for details.
Definition at line 239 of file frontal_solver.h.
References Front_factor.
|
inline |
Factor to increase storage for lenbuf[0]; see MA42 documentation for details.
Definition at line 227 of file frontal_solver.h.
References Lenbuf_factor0.
|
inline |
Factor to increase storage for lenbuf[1]; see MA42 documentation for details.
Definition at line 231 of file frontal_solver.h.
References Lenbuf_factor1.
|
inline |
Factor to increase storage for lenbuf[2]; see MA42 documentation for details.
Definition at line 235 of file frontal_solver.h.
References Lenbuf_factor2.
|
inline |
Factor to increase the size of the direct access files; see MA42 documentation for details.
Definition at line 243 of file frontal_solver.h.
References Lenfle_factor.
|
inline |
Broken assignment operator.
Definition at line 155 of file frontal_solver.h.
References oomph::BrokenCopy::broken_assign().
void oomph::HSL_MA42::reorder_elements | ( | Problem *const & | problem_pt | ) |
Function to reorder the elements based on Sloan's algorithm.
Function to reorder the elements according to Sloan's algorithm.
Definition at line 904 of file frontal_solver.cc.
References oomph::Problem::assembly_handler_pt(), Doc_stats, e, oomph::Mesh::element_pt(), oomph::AssemblyHandler::eqn_number(), i, oomph::Problem::mesh_pt(), oomph::AssemblyHandler::ndof(), oomph::Problem::ndof(), oomph::Mesh::nelement(), and oomph::oomph_info.
Referenced by solve().
|
virtual |
Return the solution to the linear system Ax = result, where A is the most recently factorised jacobian matrix of the problem problem_pt. The solution is returned in the result vector.
Wrapper for HSL MA42 frontal solver.
Reimplemented from oomph::LinearSolver.
Definition at line 837 of file frontal_solver.cc.
References oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::distribution_pt(), i, Icntl, Info, Isave, IW, Liw, Lw, N_dof, oomph::DistributableLinearAlgebraObject::nrow(), and W.
Referenced by solve().
|
virtual |
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.
Wrapper for HSL MA42 frontal solver.
Implements oomph::LinearSolver.
Definition at line 131 of file frontal_solver.cc.
References oomph::Problem::assembly_handler_pt(), oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::build_distribution(), oomph::Problem::communicator_pt(), Doc_stats, e, oomph::Mesh::element_pt(), oomph::LinearSolver::Enable_resolve, oomph::AssemblyHandler::eqn_number(), Front_factor, oomph::AssemblyHandler::get_jacobian(), i, Icntl, Info, Isave, IW, Lenbuf_factor0, Lenbuf_factor1, Lenbuf_factor2, Lenfle_factor, Liw, Lw, oomph::Problem::mesh_pt(), N_dof, oomph::AssemblyHandler::ndof(), oomph::Problem::ndof(), oomph::Mesh::nelement(), oomph::oomph_info, reorder_elements(), Reorder_flag, oomph::DenseMatrix< T >::resize(), oomph::Problem::sign_of_jacobian(), solve_for_one_dof(), Use_direct_access_files, and W.
Referenced by disable_resolve().
|
inlinevirtual |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system. Call the broken base-class version. If you want this, please implement it.
Reimplemented from oomph::LinearSolver.
Definition at line 183 of file frontal_solver.h.
References oomph::LinearSolver::solve().
|
inlinevirtual |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system Call the broken base-class version. If you want this, please implement it.
Reimplemented from oomph::LinearSolver.
Definition at line 193 of file frontal_solver.h.
References reorder_elements(), resolve(), and oomph::LinearSolver::solve().
|
private |
Special solver for problems with 1 dof (MA42 can't handle this case so solve() forwards the "solve" to this function.
Special solver for problems with one DOF – HSL_MA42 can't handle that!
Definition at line 54 of file frontal_solver.cc.
References oomph::Problem::assembly_handler_pt(), e, oomph::Mesh::element_pt(), oomph::LinearSolver::Enable_resolve, oomph::AssemblyHandler::get_jacobian(), oomph::Problem::mesh_pt(), N_dof, oomph::AssemblyHandler::ndof(), oomph::Problem::ndof(), oomph::Mesh::nelement(), oomph::Problem::sign_of_jacobian(), and W.
Referenced by solve().
|
private |
Doc the solver stats or stay quiet?
Definition at line 72 of file frontal_solver.h.
Referenced by reorder_elements(), and solve().
|
private |
Factor to increase storage for front size; see MA42 documentation for details.
Definition at line 94 of file frontal_solver.h.
Referenced by front_factor(), and solve().
|
private |
Control flag for MA42; see MA42 documentation for details.
Definition at line 101 of file frontal_solver.h.
|
private |
Control flag for MA42; see MA42 documentation for details.
Definition at line 107 of file frontal_solver.h.
|
private |
Control flag for MA42; see MA42 documentation for details.
Definition at line 104 of file frontal_solver.h.
|
private |
Integer workspace storage for MA42.
Definition at line 116 of file frontal_solver.h.
Referenced by clean_up_memory(), resolve(), and solve().
|
private |
Factor to increase storage for lenbuf[0]; see MA42 documentation for details.
Definition at line 82 of file frontal_solver.h.
Referenced by lenbuf_factor0(), and solve().
|
private |
Factor to increase storage for lenbuf[1]; see MA42 documentation for details.
Definition at line 86 of file frontal_solver.h.
Referenced by lenbuf_factor1(), and solve().
|
private |
Factor to increase storage for lenbuf[2]; see MA42 documentation for details.
Definition at line 90 of file frontal_solver.h.
Referenced by lenbuf_factor2(), and solve().
|
private |
Factor to increase size of direct access files; see MA42 documentation for details.
Definition at line 98 of file frontal_solver.h.
Referenced by lenfle_factor(), and solve().
|
private |
Size of the integer workspace array.
Definition at line 119 of file frontal_solver.h.
|
private |
Size of the workspace array, W.
Definition at line 113 of file frontal_solver.h.
|
private |
Size of the linear system.
Definition at line 122 of file frontal_solver.h.
Referenced by resolve(), solve(), and solve_for_one_dof().
|
private |
Reorder elements with Sloan's algorithm?
Definition at line 75 of file frontal_solver.h.
Referenced by solve().
|
private |
|
private |
Workspace storage for MA42.
Definition at line 110 of file frontal_solver.h.
Referenced by clean_up_memory(), resolve(), solve(), and solve_for_one_dof().