Skip to content

Refactor MFEM objects away from MFEMGeneralUserObject#32701

Merged
nmnobre merged 28 commits intoidaholab:nextfrom
lindsayad:mfem-object-refactor-31434
Apr 17, 2026
Merged

Refactor MFEM objects away from MFEMGeneralUserObject#32701
nmnobre merged 28 commits intoidaholab:nextfrom
lindsayad:mfem-object-refactor-31434

Conversation

@lindsayad
Copy link
Copy Markdown
Member

Closes #31434

@lindsayad lindsayad force-pushed the mfem-object-refactor-31434 branch from a45642d to 2f4bd12 Compare April 2, 2026 22:55
@moosebuild
Copy link
Copy Markdown
Contributor

moosebuild commented Apr 3, 2026

Job Documentation, step Docs: sync website on 1c3e5c0 wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link
Copy Markdown
Contributor

Job Precheck, step Clang format on ff03cf6 wanted to post the following:

Your code requires style changes.

A patch was auto generated and copied here
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/docs/PRs/32701/clang_format/style.patch | git apply -v

Alternatively, with your repository up to date and in the top level of your repository:

git clang-format 23ccd6e15d138300b1cdb35925777634fd5c715f

@lindsayad lindsayad force-pushed the mfem-object-refactor-31434 branch 2 times, most recently from 2d2f48d to f641dc0 Compare April 7, 2026 04:28
@moosebuild
Copy link
Copy Markdown
Contributor

moosebuild commented Apr 7, 2026

Job Coverage, step Generate coverage on 1c3e5c0 wanted to post the following:

Framework coverage

217dea #32701 1c3e5c
Total Total +/- New
Rate 85.87% 85.87% +0.00% 100.00%
Hits 132046 132210 +164 400
Misses 21723 21748 +25 0

Diff coverage report

Full coverage report

Modules coverage

Coverage did not change

Full coverage reports

Reports

This comment will be updated on new commits.

@GiudGiud GiudGiud assigned lindsayad and unassigned lindsayad Apr 7, 2026
@lindsayad lindsayad force-pushed the mfem-object-refactor-31434 branch 4 times, most recently from 032a699 to 025f6b5 Compare April 8, 2026 22:24
@lindsayad lindsayad marked this pull request as ready for review April 9, 2026 15:18
Copy link
Copy Markdown
Collaborator

@alexanderianblair alexanderianblair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this a lot - major improvement to the user experience. Just one minor query:

Comment thread test/tests/mfem/kernels/tests Outdated
Copy link
Copy Markdown
Member

@nmnobre nmnobre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just skimmed (technically on holiday... I'm a disaster at holidaying): I'd like some docs. :P I can see we removed the docs for MFEMGeneralUserObject, but its replacements didn't get the same honours. Also, let's run Valgrind if we haven't.

Copy link
Copy Markdown
Member

@nmnobre nmnobre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to thanking you for the obvious improvement this is, I'd also like to honestly thank you for all the docstrings you added :)

Comment thread framework/src/mfem/postprocessors/MFEML2Error.C Outdated
Comment thread framework/src/mfem/postprocessors/MFEMVectorL2Error.C Outdated
Comment thread framework/doc/content/source/mfem/base/MFEMExecutedObject.md Outdated
Comment thread framework/doc/content/source/mfem/base/MFEMExecutedObject.md Outdated
Comment thread framework/include/mfem/base/MFEMExecutedObject.h Outdated
Comment thread framework/src/mfem/vectorpostprocessors/MFEMVectorPostprocessor.C Outdated
@lindsayad lindsayad force-pushed the mfem-object-refactor-31434 branch 2 times, most recently from 5735046 to 4ca7f48 Compare April 14, 2026 18:22
@lindsayad lindsayad requested a review from nmnobre April 15, 2026 14:59
@nmnobre
Copy link
Copy Markdown
Member

nmnobre commented Apr 15, 2026

At the risk of delaying this a few more hours, how do you like this: nmnobre@473f244 ?

lindsayad and others added 16 commits April 15, 2026 16:57
Update MFEM base header documentation and small API cleanup.

- add doxygen coverage for the non-override MFEMObject and MFEMExecutedObject APIs
- document the MFEM executed-object dependency metadata structures
- remove unnecessary interface using-declarations from MFEMObject

These changes are limited to framework/include/mfem/base/MFEMObject.h and framework/include/mfem/base/MFEMExecutedObject.h.

Co-authored-by: OpenAI Codex <codex@openai.com>
Tighten the MFEM executed-object cache and naming cleanup around the
ongoing warehouse-backed refactor.

This updates MFEMExecutedObject to lazily build requested/supplied
dependency sets, switches it over to getParam-based access, and adds
missing doxygen on MFEMProblem and FEProblemBase helper APIs touched by
this work.

On the MFEM problem side, remove immediate warehouse round-trips after
addObject() where the returned shared_ptr is already sufficient, and
simplify a few remaining shared_ptr casts.

Also replace misleading UserObjectName parameters used for MFEM-specific
systems with dedicated derivative string classes:
- MFEMFESpaceName for MFEM FESpace references
- MFEMSolverName for MFEM solver/preconditioner references

The new MFEM name types are registered with the parser/JSON machinery,
and the affected MFEM variables, solvers, indicators, problem helpers,
and unit tests are updated accordingly.

Co-authored-by: OpenAI Codex <codex@openai.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d::string>

No existing execute object produces more than one resource, and there is
no precedent in the libMesh-backed MOOSE objects for that either.  Replace
the three plural produced*Names() virtual methods returning std::set<std::string>
with singular produced*Name() methods returning std::optional<std::string>,
and update all six overriding subclasses and the documentation accordingly.

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

"supplied" is the term used by DependencyResolverInterface (getSuppliedItems).
Rename the three virtual helpers accordingly across all overriding subclasses
and documentation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Alex Lindsay <alexander.lindsay@inl.gov>
@lindsayad lindsayad force-pushed the mfem-object-refactor-31434 branch from b5ab1ff to 1c3e5c0 Compare April 16, 2026 21:55
Copy link
Copy Markdown
Member

@nmnobre nmnobre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for this @lindsayad, it's a clear usability improvement (and thanks for tweaking the name to haveParameter instead and squashing the commits! 😍).
I approve those changes which aren't mine.

The only thing still itching is {get,has}MFEMObject(), though not enough to hold this I don't think. Only one is templated but they both could be, and the template argument encloses sufficient information to determine the system unambiguously, right? Problem is I can't think of a way to do this, but to implement a map...

@lindsayad
Copy link
Copy Markdown
Member Author

Thanks for the review!

The only thing still itching is {get,has}MFEMObject(), though not enough to hold this I don't think. Only one is templated but they both could be, and the template argument encloses sufficient information to determine the system unambiguously, right? Problem is I can't think of a way to do this, but to implement a map...

Could be potential follow-on work

@moosebuild
Copy link
Copy Markdown
Contributor

Job Test, step Results summary on 1c3e5c0 wanted to post the following:

Framework test summary

Compared against 217deaa in job civet.inl.gov/job/3749200.

No change

Modules test summary

Compared against 217deaa in job civet.inl.gov/job/3749200.

No change

@nmnobre
Copy link
Copy Markdown
Member

nmnobre commented Apr 17, 2026

Failure in fetching RELAP-7 is surely unrelated.

@nmnobre nmnobre merged commit 52c5d71 into idaholab:next Apr 17, 2026
68 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support dependency resolution between MFEM classes derived from GeneralUserObject

4 participants