Public Member Functions | Protected Attributes | List of all members
oomph::DoubleMatrixBase Class Referenceabstract

Abstract base class for matrices of doubles – adds abstract interfaces for solving, LU decomposition and multiplication by vectors. More...

#include <matrices.h>

+ Inheritance diagram for oomph::DoubleMatrixBase:

Public Member Functions

 DoubleMatrixBase ()
 (Empty) constructor. More...
 
 DoubleMatrixBase (const DoubleMatrixBase &matrix)=delete
 Broken copy constructor. More...
 
void operator= (const DoubleMatrixBase &)=delete
 Broken assignment operator. More...
 
virtual unsigned long nrow () const =0
 Return the number of rows of the matrix. More...
 
virtual unsigned long ncol () const =0
 Return the number of columns of the matrix. More...
 
virtual ~DoubleMatrixBase ()
 virtual (empty) destructor More...
 
virtual double operator() (const unsigned long &i, const unsigned long &j) const =0
 Round brackets to give access as a(i,j) for read only (we're not providing a general interface for component-wise write access since not all matrix formats allow efficient direct access!) More...
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
void solve (DoubleVector &rhs)
 Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution). The default should not need to be over-written. More...
 
void solve (const DoubleVector &rhs, DoubleVector &soln)
 Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten. More...
 
void solve (Vector< double > &rhs)
 Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution). The default should not need to be over-written. More...
 
void solve (const Vector< double > &rhs, Vector< double > &soln)
 Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten. More...
 
virtual void residual (const DoubleVector &x, const DoubleVector &b, DoubleVector &residual_)
 Find the residual, i.e. r=b-Ax the residual. More...
 
virtual double max_residual (const DoubleVector &x, const DoubleVector &rhs)
 Find the maximum residual r=b-Ax – generic version, can be overloaded for specific derived classes where the max. can be determined "on the fly". More...
 
virtual void multiply (const DoubleVector &x, DoubleVector &soln) const =0
 Multiply the matrix by the vector x: soln=Ax. More...
 
virtual void multiply_transpose (const DoubleVector &x, DoubleVector &soln) const =0
 Multiply the transposed matrix by the vector x: soln=A^T x. More...
 

Protected Attributes

LinearSolverLinear_solver_pt
 
LinearSolverDefault_linear_solver_pt
 

Detailed Description

Abstract base class for matrices of doubles – adds abstract interfaces for solving, LU decomposition and multiplication by vectors.

Definition at line 260 of file matrices.h.

Constructor & Destructor Documentation

◆ DoubleMatrixBase() [1/2]

oomph::DoubleMatrixBase::DoubleMatrixBase ( )
inline

(Empty) constructor.

Definition at line 271 of file matrices.h.

◆ DoubleMatrixBase() [2/2]

oomph::DoubleMatrixBase::DoubleMatrixBase ( const DoubleMatrixBase matrix)
delete

Broken copy constructor.

◆ ~DoubleMatrixBase()

virtual oomph::DoubleMatrixBase::~DoubleMatrixBase ( )
inlinevirtual

virtual (empty) destructor

Definition at line 286 of file matrices.h.

Member Function Documentation

◆ linear_solver_pt() [1/2]

LinearSolver*& oomph::DoubleMatrixBase::linear_solver_pt ( )
inline

Return a pointer to the linear solver object.

Definition at line 296 of file matrices.h.

References Linear_solver_pt.

Referenced by oomph::HelmholtzMGPreconditioner< DIM >::disable_smoother_and_superlu_doc_time().

◆ linear_solver_pt() [2/2]

LinearSolver* const& oomph::DoubleMatrixBase::linear_solver_pt ( ) const
inline

Return a pointer to the linear solver object (const version)

Definition at line 302 of file matrices.h.

References Linear_solver_pt.

◆ max_residual()

virtual double oomph::DoubleMatrixBase::max_residual ( const DoubleVector x,
const DoubleVector rhs 
)
inlinevirtual

Find the maximum residual r=b-Ax – generic version, can be overloaded for specific derived classes where the max. can be determined "on the fly".

Definition at line 348 of file matrices.h.

References oomph::DoubleVector::max(), and residual().

◆ multiply()

virtual void oomph::DoubleMatrixBase::multiply ( const DoubleVector x,
DoubleVector soln 
) const
pure virtual

◆ multiply_transpose()

virtual void oomph::DoubleMatrixBase::multiply_transpose ( const DoubleVector x,
DoubleVector soln 
) const
pure virtual

Multiply the transposed matrix by the vector x: soln=A^T x.

Implemented in oomph::SumOfMatrices, oomph::CCDoubleMatrix, oomph::DenseDoubleMatrix, and oomph::CRDoubleMatrix.

◆ ncol()

virtual unsigned long oomph::DoubleMatrixBase::ncol ( ) const
pure virtual

◆ nrow()

virtual unsigned long oomph::DoubleMatrixBase::nrow ( ) const
pure virtual

◆ operator()()

virtual double oomph::DoubleMatrixBase::operator() ( const unsigned long &  i,
const unsigned long &  j 
) const
pure virtual

Round brackets to give access as a(i,j) for read only (we're not providing a general interface for component-wise write access since not all matrix formats allow efficient direct access!)

Implemented in oomph::SumOfMatrices, oomph::CCDoubleMatrix, oomph::DenseDoubleMatrix, and oomph::CRDoubleMatrix.

◆ operator=()

void oomph::DoubleMatrixBase::operator= ( const DoubleMatrixBase )
delete

Broken assignment operator.

◆ residual()

virtual void oomph::DoubleMatrixBase::residual ( const DoubleVector x,
const DoubleVector b,
DoubleVector residual_ 
)
inlinevirtual

◆ solve() [1/4]

void oomph::DoubleMatrixBase::solve ( const DoubleVector rhs,
DoubleVector soln 
)

Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten.

Complete LU solve (Nothing gets overwritten!). This generic version should never need to be overwritten.

Definition at line 74 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

◆ solve() [2/4]

void oomph::DoubleMatrixBase::solve ( const Vector< double > &  rhs,
Vector< double > &  soln 
)

Complete LU solve (Nothing gets overwritten!). The default should not need to be overwritten.

Complete LU solve (Nothing gets overwritten!). This generic version should never need to be overwritten.

Definition at line 116 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

◆ solve() [3/4]

void oomph::DoubleMatrixBase::solve ( DoubleVector rhs)

Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution). The default should not need to be over-written.

Complete LU solve (overwrites RHS with solution). This is the generic version which should not need to be over-written.

Definition at line 50 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

Referenced by oomph::Newmark< NSTEPS >::assign_initial_data_values(), oomph::Newmark< NSTEPS >::assign_initial_data_values_stage2(), oomph::BlackBoxFDNewtonSolver::black_box_fd_newton_solve(), oomph::RefineableTetMeshBase::compute_volume_target(), oomph::HelmholtzMGPreconditioner< DIM >::direct_solve(), oomph::BrethertonSpineMesh< ELEMENT, INTERFACE_ELEMENT >::find_distance_to_free_surface(), oomph::PVDEquationsBase< DIM >::get_principal_stress(), and oomph::FiniteElement::locate_zeta().

◆ solve() [4/4]

void oomph::DoubleMatrixBase::solve ( Vector< double > &  rhs)

Complete LU solve (replaces matrix by its LU decomposition and overwrites RHS with solution). The default should not need to be over-written.

Complete LU solve (overwrites RHS with solution). This is the generic version which should not need to be over-written.

Definition at line 92 of file matrices.cc.

References Linear_solver_pt, and oomph::LinearSolver::solve().

Member Data Documentation

◆ Default_linear_solver_pt

LinearSolver* oomph::DoubleMatrixBase::Default_linear_solver_pt
protected

◆ Linear_solver_pt

LinearSolver* oomph::DoubleMatrixBase::Linear_solver_pt
protected

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