Public Member Functions | Private Member Functions | Private Attributes | List of all members
oomph::HSL_MA42 Class Reference

#include <frontal_solver.h>

+ Inheritance diagram for oomph::HSL_MA42:

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...
 
- Public Member Functions inherited from oomph::LinearSolver
 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...
 
- Public Member Functions inherited from oomph::DistributableLinearAlgebraObject
 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...
 
LinearAlgebraDistributiondistribution_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

- Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject
void clear_distribution ()
 clear the distribution of this distributable linear algebra object More...
 
- Protected Attributes inherited from oomph::LinearSolver
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

oomph::HSL_MA42::HSL_MA42 ( )
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.

References Doc_stats, Front_factor, Lenbuf_factor0, Lenbuf_factor1, Lenbuf_factor2, Lenfle_factor, Reorder_flag, and Use_direct_access_files.

oomph::HSL_MA42::~HSL_MA42 ( )
inline

Destructor, clean up the allocated memory.

Definition at line 143 of file frontal_solver.h.

References clean_up_memory().

oomph::HSL_MA42::HSL_MA42 ( const HSL_MA42 )
inline

Broken copy constructor.

Definition at line 149 of file frontal_solver.h.

References oomph::BrokenCopy::broken_copy().

Member Function Documentation

void oomph::HSL_MA42::clean_up_memory ( )
inlinevirtual

Clean up memory.

Reimplemented from oomph::LinearSolver.

Definition at line 162 of file frontal_solver.h.

References IW, Liw, Lw, and W.

Referenced by disable_resolve(), and ~HSL_MA42().

void oomph::HSL_MA42::disable_direct_access_files ( )
inline

Disable use of direct access files.

Definition at line 223 of file frontal_solver.h.

References Use_direct_access_files.

void oomph::HSL_MA42::disable_doc_stats ( )
inline

Disable documentation of statistics.

Definition at line 211 of file frontal_solver.h.

References Doc_stats.

void oomph::HSL_MA42::disable_reordering ( )
inline

Disable reordering.

Definition at line 217 of file frontal_solver.h.

References Reorder_flag.

void oomph::HSL_MA42::disable_resolve ( )
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(), and oomph::LinearSolver::disable_resolve().

void oomph::HSL_MA42::enable_direct_access_files ( )
inline

Enable use of direct access files.

Definition at line 220 of file frontal_solver.h.

References Use_direct_access_files.

void oomph::HSL_MA42::enable_doc_stats ( )
inline

Enable documentation of statistics.

Definition at line 208 of file frontal_solver.h.

References Doc_stats.

void oomph::HSL_MA42::enable_reordering ( )
inline

Enable reordering using Sloan's algorithm.

Definition at line 214 of file frontal_solver.h.

References Reorder_flag.

double& oomph::HSL_MA42::front_factor ( )
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.

double& oomph::HSL_MA42::lenbuf_factor0 ( )
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.

double& oomph::HSL_MA42::lenbuf_factor1 ( )
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.

double& oomph::HSL_MA42::lenbuf_factor2 ( )
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.

double& oomph::HSL_MA42::lenfle_factor ( )
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.

void oomph::HSL_MA42::operator= ( const HSL_MA42 )
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().

void oomph::HSL_MA42::resolve ( const DoubleVector rhs,
DoubleVector result 
)
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.

void oomph::HSL_MA42::solve ( Problem *const &  problem_pt,
DoubleVector result 
)
virtual
void oomph::HSL_MA42::solve ( DoubleMatrixBase *const &  matrix_pt,
const DoubleVector rhs,
DoubleVector result 
)
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().

void oomph::HSL_MA42::solve ( DoubleMatrixBase *const &  matrix_pt,
const Vector< double > &  rhs,
Vector< double > &  result 
)
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 oomph::LinearSolver::solve().

void oomph::HSL_MA42::solve_for_one_dof ( Problem *const &  problem_pt,
DoubleVector result 
)
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().

Member Data Documentation

bool oomph::HSL_MA42::Doc_stats
private

Doc the solver stats or stay quiet?

Definition at line 72 of file frontal_solver.h.

Referenced by disable_doc_stats(), enable_doc_stats(), HSL_MA42(), reorder_elements(), and solve().

double oomph::HSL_MA42::Front_factor
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(), HSL_MA42(), and solve().

int oomph::HSL_MA42::Icntl[8]
private

Control flag for MA42; see MA42 documentation for details.

Definition at line 101 of file frontal_solver.h.

Referenced by resolve(), and solve().

int oomph::HSL_MA42::Info[23]
private

Control flag for MA42; see MA42 documentation for details.

Definition at line 107 of file frontal_solver.h.

Referenced by resolve(), and solve().

int oomph::HSL_MA42::Isave[45]
private

Control flag for MA42; see MA42 documentation for details.

Definition at line 104 of file frontal_solver.h.

Referenced by resolve(), and solve().

int* oomph::HSL_MA42::IW
private

Integer workspace storage for MA42.

Definition at line 116 of file frontal_solver.h.

Referenced by clean_up_memory(), resolve(), and solve().

double oomph::HSL_MA42::Lenbuf_factor0
private

Factor to increase storage for lenbuf[0]; see MA42 documentation for details.

Definition at line 82 of file frontal_solver.h.

Referenced by HSL_MA42(), lenbuf_factor0(), and solve().

double oomph::HSL_MA42::Lenbuf_factor1
private

Factor to increase storage for lenbuf[1]; see MA42 documentation for details.

Definition at line 86 of file frontal_solver.h.

Referenced by HSL_MA42(), lenbuf_factor1(), and solve().

double oomph::HSL_MA42::Lenbuf_factor2
private

Factor to increase storage for lenbuf[2]; see MA42 documentation for details.

Definition at line 90 of file frontal_solver.h.

Referenced by HSL_MA42(), lenbuf_factor2(), and solve().

double oomph::HSL_MA42::Lenfle_factor
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 HSL_MA42(), lenfle_factor(), and solve().

int oomph::HSL_MA42::Liw
private

Size of the integer workspace array.

Definition at line 119 of file frontal_solver.h.

Referenced by clean_up_memory(), resolve(), and solve().

int oomph::HSL_MA42::Lw
private

Size of the workspace array, W.

Definition at line 113 of file frontal_solver.h.

Referenced by clean_up_memory(), resolve(), and solve().

unsigned long oomph::HSL_MA42::N_dof
private

Size of the linear system.

Definition at line 122 of file frontal_solver.h.

Referenced by resolve(), solve(), and solve_for_one_dof().

bool oomph::HSL_MA42::Reorder_flag
private

Reorder elements with Sloan's algorithm?

Definition at line 75 of file frontal_solver.h.

Referenced by disable_reordering(), enable_reordering(), HSL_MA42(), and solve().

bool oomph::HSL_MA42::Use_direct_access_files
private

Use direct access files?

Definition at line 78 of file frontal_solver.h.

Referenced by disable_direct_access_files(), enable_direct_access_files(), HSL_MA42(), and solve().

double* oomph::HSL_MA42::W
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().


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