12 #ifndef MFEM_BLOCKOPERATOR 13 #define MFEM_BLOCKOPERATOR 15 #include "../config/config.hpp" 16 #include "../general/array.hpp" 17 #include "operator.hpp" 81 int IsZeroBlock(
int i,
int j)
const {
return (op(i,j)==NULL) ? 1 : 0; }
84 { MFEM_VERIFY(op(i,j),
"");
return *op(i,j); }
87 { MFEM_VERIFY(op(i,j),
"");
return *op(i,j); }
90 { MFEM_VERIFY(op(i,j),
"");
return coef(i,j); }
93 { MFEM_VERIFY(op(i,j),
""); coef(i,j) = c; }
169 { MFEM_VERIFY(ops[iblock],
"");
return *ops[iblock]; }
173 { MFEM_VERIFY(ops[iblock],
"");
return *ops[iblock]; }
259 { MFEM_VERIFY(ops(iblock,jblock),
"");
return *ops(iblock,jblock); }
Array< int > & Offsets()
Return the offsets for block starts.
A class to handle Vectors in a block fashion.
Array< int > & RowOffsets()
Return the row offsets for block starts.
double GetBlockCoef(int i, int j) const
Return the coefficient for block i,j.
int NumBlocks() const
Return the number of blocks.
Array< int > & Offsets()
Return the offsets for block starts.
ID for the base class BlockOperator.
int NumRowBlocks() const
Return the number of row blocks.
BlockOperator & operator=(const BlockOperator &)=delete
Copy assignment is not supported.
const Operator & GetBlock(int i, int j) const
Return a reference to block i,j (const version)
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
virtual void SetOperator(const Operator &op)
This method is present since required by the abstract base class Solver.
int NumColBlocks() const
Return the number of column blocks.
Operator & GetBlock(int i, int j)
Return a reference to block i,j.
A class to handle Block lower triangular preconditioners in a matrix-free implementation.
Operator & GetDiagonalBlock(int iblock)
Return a reference to block i,i.
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator.
A class to handle Block diagonal preconditioners in a matrix-free implementation. ...
int NumBlocks() const
Return the number of blocks.
const Array< int > & RowOffsets() const
Read only access to the row offsets for block starts.
~BlockDiagonalPreconditioner()
void SetBlock(int iRow, int iCol, Operator *op)
Add a block opt in the block-entry (iblock, jblock).
Operator & GetBlock(int iblock, int jblock)
Return a reference to block i,j.
BlockDiagonalPreconditioner(const Array< int > &offsets)
Constructor that specifies the block structure.
const Operator & GetDiagonalBlock(int iblock) const
Return a reference to block i,i (const version).
Dynamic 2D array using row-major layout.
BlockOperator(const Array< int > &offsets)
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator.
void SetDiagonalBlock(int iblock, Operator *op, double c=1.0)
Add block op in the block-entry (iblock, iblock).
void SetBlockCoef(int i, int j, double c)
Set the coefficient for block i,j.
Type
Enumeration defining IDs for some classes derived from Operator.
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
virtual Type GetType() const
virtual void SetOperator(const Operator &op)
This method is present since required by the abstract base class Solver.
int IsZeroBlock(int i, int j) const
Check if block (i,j) is a zero block.
~BlockLowerTriangularPreconditioner()
void SetDiagonalBlock(int iblock, Operator *op)
Add block op in the block-entry (iblock, iblock).
const Array< int > & ColOffsets() const
Read only access to the columns offsets for block starts.
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator.
BlockLowerTriangularPreconditioner(const Array< int > &offsets)
const Array< int > & Offsets() const
Read only access to the offsets for block starts.
A class to handle Block systems in a matrix-free implementation.
void SetBlock(int iRow, int iCol, Operator *op, double c=1.0)
Add a block op in the block-entry (iblock, jblock).
void SetDiagonalBlock(int iblock, Operator *op)
Add a square block op in the block-entry (iblock, iblock).
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
Array< int > & ColOffsets()
Return the columns offsets for block starts.