![]() |
|
#include <linear_solver.h>
Public Member Functions | |
DenseLU () | |
Constructor, initialise storage. More... | |
DenseLU (const DenseLU &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const DenseLU &)=delete |
Broken assignment operator. More... | |
~DenseLU () | |
Destructor, clean up the stored LU factors. More... | |
void | solve (Problem *const &problem_pt, DoubleVector &result) |
void | solve (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
void | solve (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
double | jacobian_setup_time () const |
virtual double | linear_solver_solution_time () const |
![]() | |
LinearSolver () | |
Empty constructor, initialise the member data. More... | |
LinearSolver (const LinearSolver &dummy)=delete | |
Broken copy constructor. More... | |
void | operator= (const LinearSolver &)=delete |
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 () |
virtual void | disable_resolve () |
virtual void | solve_transpose (Problem *const &problem_pt, DoubleVector &result) |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &result) |
virtual void | solve_transpose (DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result) |
virtual void | resolve (const DoubleVector &rhs, DoubleVector &result) |
virtual void | resolve_transpose (const DoubleVector &rhs, DoubleVector &result) |
virtual void | enable_computation_of_gradient () |
void | disable_computation_of_gradient () |
void | reset_gradient () |
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)=delete | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
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) |
void | build_distribution (const LinearAlgebraDistribution &dist) |
Protected Member Functions | |
void | factorise (DoubleMatrixBase *const &matrix_pt) |
Perform the LU decomposition of the matrix. More... | |
void | backsub (const DoubleVector &rhs, DoubleVector &result) |
Do the backsubstitution step to solve the system LU result = rhs. More... | |
void | backsub (const Vector< double > &rhs, Vector< double > &result) |
perform back substitution using Vector<double> More... | |
void | clean_up_memory () |
Clean up the stored LU factors. More... | |
![]() | |
void | clear_distribution () |
Protected Attributes | |
double | Jacobian_setup_time |
Jacobian setup time. More... | |
double | Solution_time |
Solution time. More... | |
int | Sign_of_determinant_of_matrix |
![]() | |
bool | Enable_resolve |
bool | Doc_time |
Boolean flag that indicates whether the time taken. More... | |
bool | Compute_gradient |
bool | Gradient_has_been_computed |
flag that indicates whether the gradient was computed or not More... | |
DoubleVector | Gradient_for_glob_conv_newton_solve |
Private Attributes | |
long * | Index |
Pointer to storage for the index of permutations in the LU solve. More... | |
double * | LU_factors |
Pointer to storage for the LU decomposition. More... | |
Friends | |
class | DenseDoubleMatrix |
The DenseDoubleMatrix class is a friend. More... | |
Dense LU decomposition-based solve of full assembled linear system. VERY inefficient but useful to illustrate the principle. Only suitable for use with Serial matrices and vectors. This solver will only work with non-distributed matrices and vectors (note: DenseDoubleMatrix is not distributable)
|
inline |
Constructor, initialise storage.
References oomph::LinearSolver::Doc_time.
|
delete |
Broken copy constructor.
|
inline |
Destructor, clean up the stored LU factors.
References clean_up_memory().
|
protected |
Do the backsubstitution step to solve the system LU result = rhs.
Do the backsubstitution for the DenseLU solver. WARNING: this class does not perform any PARANOID checks on the vectors - these are all performed in the solve(...) method.
References i, Index, j, k, LU_factors, n, oomph::DistributableLinearAlgebraObject::nrow(), and oomph::DoubleVector::values_pt().
Referenced by solve().
perform back substitution using Vector<double>
Do the backsubstitution for the DenseLU solver. WARNING: this class does not perform any PARANOID checks on the vectors - these are all performed in the solve(...) method. So, if you call backsub directly, you have been warned...
|
protectedvirtual |
Clean up the stored LU factors.
Delete the storage that has been allocated for the LU factors, if the matrix data is not itself being overwritten.
Reimplemented from oomph::LinearSolver.
References oomph::DistributableLinearAlgebraObject::clear_distribution(), Index, and LU_factors.
Referenced by factorise(), solve(), and ~DenseLU().
|
protected |
Perform the LU decomposition of the matrix.
LU decompose the matrix. WARNING: this class does not perform any PARANOID checks on the vectors - these are all performed in the solve(...) method.
References clean_up_memory(), boost::multiprecision::fabs(), i, Index, j, k, LU_factors, n, oomph::DoubleMatrixBase::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, SYCL::sign(), Sign_of_determinant_of_matrix, and tmp.
Referenced by solve().
|
inlinevirtual |
returns the time taken to assemble the jacobian matrix and residual vector
Reimplemented from oomph::LinearSolver.
References Jacobian_setup_time.
|
inlinevirtual |
return the time taken to solve the linear system (needs to be overloaded for each linear solver)
Reimplemented from oomph::LinearSolver.
References Solution_time.
|
delete |
Broken assignment operator.
|
virtual |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system.
Reimplemented from oomph::LinearSolver.
Reimplemented in oomph::FD_LU.
References backsub(), oomph::DoubleVector::build(), oomph::DistributableLinearAlgebraObject::build_distribution(), clean_up_memory(), oomph::LinearAlgebraDistribution::communicator_pt(), oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearAlgebraDistribution::distributed(), oomph::DistributableLinearAlgebraObject::distribution_built(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::LinearSolver::Doc_time, oomph::LinearSolver::Enable_resolve, factorise(), oomph::DoubleMatrixBase::ncol(), oomph::OomphCommunicator::nproc(), oomph::DistributableLinearAlgebraObject::nrow(), oomph::DoubleMatrixBase::nrow(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, Solution_time, and oomph::TimingHelpers::timer().
|
virtual |
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the linear system.
Reimplemented from oomph::LinearSolver.
Reimplemented in oomph::FD_LU.
References backsub(), clean_up_memory(), oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearSolver::Doc_time, oomph::LinearSolver::Enable_resolve, factorise(), oomph::oomph_info, and Solution_time.
|
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.
Implements oomph::LinearSolver.
Reimplemented in oomph::FD_LU.
References oomph::TimingHelpers::convert_secs_to_formatted_string(), oomph::LinearSolver::Doc_time, oomph::Problem::get_jacobian(), Jacobian_setup_time, oomph::Problem::ndof(), oomph::oomph_info, Sign_of_determinant_of_matrix, oomph::Problem::sign_of_jacobian(), and oomph::TimingHelpers::timer().
Referenced by oomph::FD_LU::solve().
|
friend |
The DenseDoubleMatrix class is a friend.
|
private |
Pointer to storage for the index of permutations in the LU solve.
Referenced by backsub(), clean_up_memory(), and factorise().
|
protected |
Jacobian setup time.
Referenced by jacobian_setup_time(), solve(), and oomph::FD_LU::solve().
|
private |
Pointer to storage for the LU decomposition.
Referenced by backsub(), clean_up_memory(), and factorise().
|
protected |
Sign of the determinant of the matrix (obtained during the LU decomposition)
Referenced by factorise(), solve(), and oomph::FD_LU::solve().
|
protected |
Solution time.
Referenced by linear_solver_solution_time(), and solve().