12 #ifndef MFEM_MULTIGRID
13 #define MFEM_MULTIGRID
18 #include "../linalg/operator.hpp"
19 #include "../linalg/handle.hpp"
99 int postSmoothingSteps_);
109 void SmoothingStep(
int level,
bool transpose)
const;
112 void Cycle(
int level)
const;
115 virtual const Operator* GetProlongationAtLevel(
int level)
const;
145 virtual const Operator* GetProlongationAtLevel(
int level)
const override;
Geometric multigrid associated with a hierarchy of finite element spaces.
virtual ~GeometricMultigrid()
Destructor.
Pointer to an Operator of a specified type.
Array< BilinearForm * > bfs
Array< Array< int > * > essentialTrueDofs
Array< Operator * > prolongations
const FiniteElementSpaceHierarchy & fespaces
Array< bool > ownedProlongations
virtual void SetOperator(const Operator &op) override
Not supported for multigrid.
virtual ~Multigrid()
Destructor.
Array< Solver * > smoothers
void AddLevel(Operator *opr, Solver *smoother, bool ownOperator, bool ownSmoother)
Adds a level to the multigrid operator hierarchy.
Solver * GetSmootherAtLevel(int level) const
Returns smoother at given level.
const Operator * GetOperatorAtFinestLevel() const
Returns operator at finest level.
virtual void Mult(const Vector &x, Vector &y) const override
Application of the multigrid as a preconditioner.
void RecoverFineFEMSolution(const Vector &X, const Vector &b, Vector &x)
Recover the solution of a linear system formed with FormFineLinearSystem()
int GetFinestLevelIndex() const
Returns the index of the finest level.
void FormFineLinearSystem(Vector &x, Vector &b, OperatorHandle &A, Vector &X, Vector &B)
int NumLevels() const
Returns the number of levels.
const Operator * GetOperatorAtLevel(int level) const
Returns operator at given level.
Array< Operator * > operators
Multigrid()
Constructs an empty multigrid hierarchy.
Array< bool > ownedSmoothers
GeometricMultigrid(const FiniteElementSpaceHierarchy &fespaces_)
Array< bool > ownedOperators
void SetCycleType(CycleType cycleType_, int preSmoothingSteps_, int postSmoothingSteps_)
Set cycle type and number of pre- and post-smoothing steps used by Mult.