12 #ifndef MFEM_MULTIGRID 13 #define MFEM_MULTIGRID 18 #include "../linalg/operator.hpp" 19 #include "../linalg/handle.hpp" 106 int postSmoothingSteps_);
116 MFEM_ABORT(
"SetOperator is not supported in Multigrid!");
121 void Cycle(
int level)
const;
124 void SmoothingStep(
int level,
bool zero,
bool transpose)
const;
127 void InitVectors()
const;
128 void EraseVectors()
const;
131 virtual const Operator* GetProlongationAtLevel(
int level)
const = 0;
158 virtual const Operator* GetProlongationAtLevel(
int level)
const override 190 virtual const Operator* GetProlongationAtLevel(
int level)
const override
const Operator * GetOperatorAtFinestLevel() const
Returns operator at finest level.
Operator * GetProlongationAtLevel(int level) const
Returns the prolongation operator from the finite element space at level to the finite element space ...
Array< bool > ownedOperators
Geometric multigrid associated with a hierarchy of finite element spaces.
virtual ~GeometricMultigrid()
Destructor.
Pointer to an Operator of a specified type.
Solver * GetSmootherAtLevel(int level)
Array< BilinearForm * > bfs
Array< Array< int > * > essentialTrueDofs
Array< Operator * > prolongations
Array< Operator * > operators
Operator * GetOperatorAtLevel(int level)
Array< Solver * > smoothers
Array< bool > ownedSmoothers
const Solver * GetSmootherAtLevel(int level) const
Returns smoother at given level.
int GetFinestLevelIndex() const
Returns the index of the finest level.
const Operator * GetOperatorAtLevel(int level) const
Returns operator at given level.
virtual void Mult(const Vector &x, Vector &y) const override
Application of the multigrid as a preconditioner.
virtual void SetOperator(const Operator &op) override
Not supported for multigrid.
virtual void ArrayMult(const Array< const Vector *> &X_, Array< Vector *> &Y_) const override
Operator application on a matrix: Y=A(X).
void SetCycleType(CycleType cycleType_, int preSmoothingSteps_, int postSmoothingSteps_)
Set cycle type and number of pre- and post-smoothing steps used by Mult.
Dynamic 2D array using row-major layout.
const FiniteElementSpaceHierarchy & fespaces
virtual ~MultigridBase()
Destructor.
Array< bool > ownedProlongations
virtual ~Multigrid()
Destructor.
MultigridBase()
Constructs an empty multigrid hierarchy.
void RecoverFineFEMSolution(const Vector &X, const Vector &b, Vector &x)
Recover the solution of a linear system formed with FormFineLinearSystem()
int NumLevels() const
Returns the number of levels.
void FormFineLinearSystem(Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B)
void AddLevel(Operator *op, Solver *smoother, bool ownOperator, bool ownSmoother)
Adds a level to the multigrid operator hierarchy.
Multigrid()
Constructs an empty multigrid hierarchy.
GeometricMultigrid(const FiniteElementSpaceHierarchy &fespaces_)
Operator * GetOperatorAtFinestLevel()
Abstract base class for Multigrid solvers.