MFEM Geometric Multigrid#32831
Draft
lindsayad wants to merge 5 commits intoidaholab:nextfrom
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32771