12 #ifndef MFEM_BLOCKOPERATOR
13 #define MFEM_BLOCKOPERATOR
15 #include "../config/config.hpp"
16 #include "../general/array.hpp"
75 int IsZeroBlock(
int i,
int j)
const {
return (op(i,j)==NULL) ? 1 : 0; }
78 { MFEM_VERIFY(op(i,j),
"");
return *op(i,j); }
81 { MFEM_VERIFY(op(i,j),
"");
return coef(i,j); }
84 { MFEM_VERIFY(op(i,j),
""); coef(i,j) = c; }
154 { MFEM_VERIFY(op[iblock],
"");
return *op[iblock]; }
237 { MFEM_VERIFY(op(iblock,jblock),
"");
return *op(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.
Array< int > & Offsets()
Return the offsets for block starts.
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator.
int IsZeroBlock(int i, int j) const
Check if block (i,j) is a zero block.
virtual void SetOperator(const Operator &op)
This method is present since required by the abstract base class Solver.
Operator & GetBlock(int i, int j)
Return a reference to block i,j.
int NumBlocks() const
Return the number of blocks.
A class to handle Block lower triangular preconditioners in a matrix-free implementation.
Operator & GetDiagonalBlock(int iblock)
Return a reference to block i,i.
A class to handle Block diagonal preconditioners in a matrix-free implementation. ...
~BlockDiagonalPreconditioner()
void SetBlock(int iRow, int iCol, Operator *op)
Add a block op in the block-entry (iblock, jblock).
Operator & GetBlock(int iblock, int jblock)
Return a reference to block i,j.
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
BlockDiagonalPreconditioner(const Array< int > &offsets)
Constructor that specifies the block structure.
Dynamic 2D array using row-major layout.
BlockOperator(const Array< int > &offsets)
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
void SetDiagonalBlock(int iblock, Operator *op, double c=1.0)
Add block op in the block-entry (iblock, iblock).
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator.
void SetBlockCoef(int i, int j, double c)
Set the coefficient for block i,j.
virtual void SetOperator(const Operator &op)
This method is present since required by the abstract base class Solver.
~BlockLowerTriangularPreconditioner()
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator.
void SetDiagonalBlock(int iblock, Operator *op)
Add block op in the block-entry (iblock, iblock).
int NumBlocks() const
Return the number of blocks.
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
double GetBlockCoef(int i, int j) const
Return the coefficient for block i,j.
int NumRowBlocks() const
Return the number of row blocks.
BlockLowerTriangularPreconditioner(const Array< int > &offsets)
A class to handle Block systems in a matrix-free implementation.
int NumColBlocks() const
Return the number of column blocks.
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).
Array< int > & ColOffsets()
Return the columns offsets for block starts.