15 #ifndef _ISTL_MATRIX_H
16 #define _ISTL_MATRIX_H
50 size_t dim()
const override {
return x.size(); }
53 void redim(
size_t n)
override;
99 size_t dim(
int = 1)
const override {
return 0; }
110 void init()
override;
136 std::unique_ptr<ISTL::Operator>
op;
137 std::unique_ptr<ISTL::InverseOperator>
solver;
138 std::unique_ptr<ISTL::Preconditioner>
pre;
Linear solver parameters for ISTL matrices.
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
Representation of the system matrix on an unstructured sparse format.
Class for representing the system matrix in ISTL format.
Definition: ISTLMatrix.h:86
const ProcessAdm & adm
Process administrator.
Definition: ISTLMatrix.h:141
int nLinSolves
Number of linear solves.
Definition: ISTLMatrix.h:143
std::unique_ptr< ISTL::Preconditioner > pre
Preconditioner to use.
Definition: ISTLMatrix.h:138
ISTL::Mat & getMatrix()
Returns the ISTL matrix (for assignment).
Definition: ISTLMatrix.h:128
bool endAssembly() override
Copies the assembled matrix into iA.
Definition: ISTLMatrix.C:150
SystemMatrix * copy() const override
Creates a copy of the system matrix and returns a pointer to it.
Definition: ISTLMatrix.h:102
const ISTL::Mat & getMatrix() const
Returns the ISTL matrix (for read access).
Definition: ISTLMatrix.h:130
LinAlg::MatrixType getType() const override
Returns the matrix type.
Definition: ISTLMatrix.h:96
size_t dim(int=1) const override
Returns the dimension of the system matrix.
Definition: ISTLMatrix.h:99
std::unique_ptr< ISTL::InverseOperator > solver
Solver to use.
Definition: ISTLMatrix.h:137
ISTLSolParams solParams
Linear solver parameters.
Definition: ISTLMatrix.h:142
void init() override
Initializes the matrix to zero assuming it is properly dimensioned.
Definition: ISTLMatrix.C:160
void initAssembly(const SAM &sam, char) override
Initializes the element assembly process. that are needed before the actual assembly can start are pe...
Definition: ISTLMatrix.C:120
Real Linfnorm() const override
Returns the L-infinity norm of the matrix.
Definition: ISTLMatrix.C:232
void handleSolverReset()
Handles solver resets.
Definition: ISTLMatrix.C:238
std::unique_ptr< ISTL::Operator > op
The matrix adapter.
Definition: ISTLMatrix.h:136
~ISTLMatrix() override
The destructor frees the dynamically allocated arrays.
Definition: ISTLMatrix.C:114
ISTL::Mat iA
The actual ISTL matrix.
Definition: ISTLMatrix.h:140
ISTLMatrix(const ProcessAdm &padm, const LinSolParams &spar)
Constructor.
Definition: ISTLMatrix.C:98
Class for ISTL solver parameters.
Definition: ISTLSolParams.h:225
Class for representing the system vector in ISTL format.
Definition: ISTLMatrix.h:30
const ISTL::Vec & getVector() const
Returns the ISTL vector (for read access).
Definition: ISTLMatrix.h:73
const ProcessAdm & getAdm() const
Return associated process administrator.
Definition: ISTLMatrix.h:68
Real Linfnorm() const override
Linfinity-norm of vector.
Definition: ISTLMatrix.C:92
void redim(size_t n) override
Sets the dimension of the system vector.
Definition: ISTLMatrix.C:64
bool endAssembly() override
Copies the assembled vector into x.
Definition: ISTLMatrix.C:71
size_t dim() const override
Returns the dimension of the system vector.
Definition: ISTLMatrix.h:50
~ISTLVector() override
Destructor.
Definition: ISTLMatrix.C:51
ISTL::Vec & getVector()
Returns the ISTL vector (for assignment).
Definition: ISTLMatrix.h:71
ISTLVector(const ProcessAdm &padm)
Constructor creating an empty vector.
Definition: ISTLMatrix.C:21
const ProcessAdm & adm
Process administrator.
Definition: ISTLMatrix.h:77
ISTL::Vec x
The actual ISTL vector.
Definition: ISTLMatrix.h:76
Real L1norm() const override
L1-norm of vector.
Definition: ISTLMatrix.C:80
LinAlg::MatrixType getType() const override
Returns the vector type.
Definition: ISTLMatrix.h:44
Real L2norm() const override
L2-norm of vector.
Definition: ISTLMatrix.C:86
void init(Real value=Real(0)) override
Initializes the vector to a given scalar value.
Definition: ISTLMatrix.C:57
Class for linear solver parameters.
Definition: LinSolParams.h:67
Class for administration of MPI processes in IFEM library.
Definition: ProcessAdm.h:33
This class contains data and functions for the assembly of FE matrices.
Definition: SAM.h:39
Class for representing a system matrix on an unstructured sparse form.
Definition: SparseMatrix.h:38
Vector A
Stores the nonzero matrix elements.
Definition: SparseMatrix.h:300
virtual bool solve(SystemVector &b, Real *rc=nullptr)=0
Solves the linear system of equations for a given right-hand-side.
Standard system vector stored as a single continuous array.
Definition: SystemMatrix.h:124
virtual const Vector & vec() const
Reference to underlying utl::vector.
Definition: SystemMatrix.h:171
Base class for representing a system matrix on different formats.
Definition: SystemMatrix.h:220
Base class for representing a system vector on different formats.
Definition: SystemMatrix.h:32
MatrixType
The available system matrix formats and associated solvers.
Definition: LinAlgenums.h:22
@ ISTL
Sparse matrices / Dune solver.
Definition: LinAlgenums.h:28