16 #ifndef GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERBASE_HPP_
17 #define GEOS_LINEARALGEBRA_SOLVERS_PRECONDITIONERBASE_HPP_
31 template<
typename LAI >
82 return m_mat->numGlobalRows();
91 return m_mat->numGlobalCols();
100 return m_mat->numLocalRows();
109 return m_mat->numLocalCols();
119 virtual MPI_Comm
comm()
const override
121 return m_mat->comm();
130 return m_mat !=
nullptr;
159 GEOS_ERROR(
"PreconditionerBase::preconditionerMatrix called. This is not supposed to happen."
160 "Check the value of hasPreconditionerMatrix() before accessing this function." );
#define GEOS_ERROR(msg)
Raise a hard error and terminate the program.
Abstract base class for linear operators.
VECTOR Vector
Alias for template parameter.
Common interface for preconditioning operators.
virtual void clear()
Clean up the preconditioner setup.
virtual Matrix const & preconditionerMatrix() const
Access the preconditioner in matrix form (whenever available). It must be overridden by the specific ...
virtual MPI_Comm comm() const override
Get the MPI communicator the matrix was created with.
virtual localIndex numLocalCols() const override
Get the number of local columns.
virtual bool hasPreconditionerMatrix() const
Check whether the preconditioner is available in matrix (explicit) form.
bool ready() const
Chech if preconditioner is ready to use.
virtual void setup(Matrix const &mat)
Compute the preconditioner from a matrix.
virtual globalIndex numGlobalCols() const override
Get the number of global columns.
virtual localIndex numLocalRows() const override
Get the number of local rows.
Matrix const & matrix() const
Access the matrix the preconditioner was computed from.
virtual globalIndex numGlobalRows() const override
Get the number of global rows.
typename Base::Vector Vector
Alias for vector type.
typename LAI::ParallelMatrix Matrix
Alias for matrix type.
#define GEOS_LAI_ASSERT_MSG(expr, msg)
#define GEOS_LAI_ASSERT(expr)
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
LAInterface::ParallelMatrix ParallelMatrix
Alias for ParallelMatrix.