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