Skip to content

MFEM Geometric Multigrid#32831

Draft
lindsayad wants to merge 5 commits intoidaholab:nextfrom
lindsayad:mfem-geometric-multigrid-32771
Draft

MFEM Geometric Multigrid#32831
lindsayad wants to merge 5 commits intoidaholab:nextfrom
lindsayad:mfem-geometric-multigrid-32771

Conversation

@lindsayad
Copy link
Copy Markdown
Member

Closes #32771

lindsayad and others added 5 commits April 24, 2026 10:29
We create new Solvers syntax such that users may specify both
nonlinear and linear solvers within the same top-level syntax
block. This commit also includes capability for using PETSc
as the nonlinear solver backend
Move all MFEM framework classes into the Moose::MFEM namespace (e.g.
MFEMKernel -> Moose::MFEM::Kernel) across headers, sources, and unit
tests. Key changes:

- All class definitions in framework/include/mfem/ and framework/src/mfem/
  are now inside namespace Moose::MFEM with redundant Moose::MFEM::
  qualifications stripped within those blocks
- MFEMProblemData struct namespaced to Moose::MFEM::ProblemData
- MFEMProblemSolve: class Executioner; forward declaration moved outside
  the namespace block
- Moose.C task registration tokens updated to match registerBase values
  (Moose::MFEM::FESpace, Moose::MFEM::SubMesh, etc.)
- Factory name strings (e.g. "MFEMFoo") preserved throughout MFEMProblem.C;
  solverTypeString() returns the factory name via type()
- MFEM string parameter types (ScalarCoefficientName, VectorCoefficientName,
  MatrixCoefficientName, FESpaceName, SolverName) moved to Moose::MFEM
  namespace using new MooseDerivativeStringClassInNamespace macro;
  MooseDerivativeStringClass refactored to share body via
  MOOSE_DERIVATIVE_STRING_CLASS_IMPL helper to avoid duplication
- Unit test C++ type usages updated to Moose::MFEM::Foo; TEST_F test
  name identifiers left unchanged

Closes idaholab#32782

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ructure

- Add MFEMGeometricMultigridSolver: p-multigrid preconditioner backed by
  mfem::GeometricMultigrid. Rebuilds per-level bilinear forms from the
  equation system each solve via an MGProxy that prevents the
  mfem::MultigridBase::SetOperator abort.

- Add MFEMFESpaceHierarchy: builds a mfem::ParFiniteElementSpaceHierarchy
  from a base FESpace via a sequence of h- and p-refinements. Registers its
  finest-level FESpace in ProblemData::fespaces so variables can reference it
  directly with fespace_hierarchy = <name>.

- Add MFEMOperatorChebyshevSmoother: SPD smoother backed by
  mfem::OperatorChebyshevSmoother with automatic max-eigenvalue estimation
  via power method. Constructed lazily in updateSolver(); no placeholder needed.

- Add damping parameter to MFEMOperatorJacobiSmoother (default 1.0).

- Refactor LinearSolverBase::updateSolver(op, tdofs) to call
  _solver->SetOperator(op) in the base class, removing the need for each
  smoother to do it explicitly and fixing a null-oper crash in the coarse CG
  solver when used inside GeometricMultigridSolver.

- Remove Newton wrapper from ProblemOperatorBase linear solve path, eliminating
  the spurious "Newton: No convergence!" message on linear problems.

- Extend MFEMVariable to accept fespace_hierarchy as an alternative to fespace,
  storing the hierarchy's finest-level ParFiniteElementSpace directly. Add
  isScalar() to Variable and ComplexVariable; update MFEMProblem callers.

- Add name-collision guards between FESpace and FESpaceHierarchy namespaces in
  MFEMProblem::addFESpace and addFESpaceHierarchy.

- Fix task ordering in Moose.C: add_variable/add_aux_variable/
  add_elemental_field_variable now depend on add_mfem_fespace_hierarchies so
  hierarchy finest-level FESpaces are registered before variable construction.

- Add pmg_diffusion.i MMS test: Poisson on [0,1]^2 with u=sin(pi*x)sin(pi*y),
  verified via MFEML2Error against the exact solution.

- Add .claude/ to .gitignore alongside other IDE tool directories.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Apply Template Method pattern: EquationSystem::FormSystem() now calls
  BuildEquationSystem() internally, removing the two-step protocol from
  all ProblemOperator subclasses
- Add EquationSystem::prepareLinearSolver() to replace direct protected-
  member access in all ProblemOperator lambdas (Tell-Don-Ask)
- Rename updateSolver(ParBilinearForm) -> setupLOR throughout to
  distinguish LOR rebuild from operator-level propagation
- Fix five setupLOR() overrides (CGSolver, GMRESSolver, HypreGMRES,
  HyprePCG, HypreFGMRES) that were calling _preconditioner->updateSolver(blf)
  after the rename; ParBilinearForm silently bound to updateSolver(Operator&),
  passing a raw bilinear form to SetOperator and crashing in hypre setup
- Fix TimeDependentEquationSystemProblemOperator::ImplicitSolve lambda to
  use prepareLinearSolver, removing the same silent-binding bug
- Migrate all 36 MFEM test input files from [Preconditioner] to [Solvers]
- Fix orphaned root solver objects in lor/tests and kernels/tests spec files
  using inactive= parameters
- Add null guard in Problem::solverTypeString with mooseAssert that a null
  jacobian_solver implies solve=false
- Improve doxygen for ProblemOperatorBase, EquationSystem, and
  EquationSystemProblemOperator documenting the three-layer architecture

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide MOOSE interface to MFEM geometric multigrid

1 participant