Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeshGenerator::addMeshSubgenerator() api #17458

Merged
merged 18 commits into from Mar 31, 2021

Conversation

roystgnr
Copy link
Contributor

This makes the adding of "subgenerators" from a user-defined MeshGenerator subclass into a much easier-to-learn and more self-documenting process.

Resolves #17184

These names can be any mesh generator in the input file, they're not
mesh filenames.
If we don't assume that the index names and the mesh ptr vectors are the
same size, then we can have subclasses that add additional mesh ptr
entries from other sources.  This is useful for a test subclass I'm
adding.
The modified test will instantiate "subgenerators" itself instead of
getting them from earlier in the input file.
Template parameter packs are neat.

More importantly, template parameter packs let us pass arbitrary
parameters to set in the internals of another helper function.
Hopefully this is something like what the ANL folks had in mind for
idaholab#17184
This turns several lines of slightly tricky code into 4 lines of
arguably self-documenting code, so I'm fairly happy with it.
roystgnr and others added 6 commits March 30, 2021 09:50
Make subgenerator name base unique

Co-authored-by: Logan Harbour <loganhharbour@gmail.com>
Thanks to @loganharbour for catching this
This overload is a little trickier to use but is more in line with some
other MOOSE APIs.
This lets users be a little less picky about how they construct their
InputParameters without us hitting a failure at generate() time.
This way, if we ever add any more subtle parameters like _moose_app that
ought to be set from within addMeshSubgenerator() itself, we'll catch
the error in this test rather than in any user codes making use of the
InputParameters-accepting overload.
@moosebuild
Copy link
Contributor

Job Precheck on 2208e32 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/17458/style.patch | git apply -v

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

git clang-format 579cc6274bfa1525b7962796270dfcdbb1bb27b0

Copy link
Member

@loganharbour loganharbour left a comment

Choose a reason for hiding this comment

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

All of the objects placed within the test directory and not the framework directory are objects that are meant for testing only. For this reason, they are all

test/src/meshgenerators/StitchedSubgenerators.C Outdated Show resolved Hide resolved
test/src/meshgenerators/StitchedSubgenerators.C Outdated Show resolved Hide resolved
test/tests/meshgenerators/stitched_subgenerators/tests Outdated Show resolved Hide resolved
roystgnr and others added 3 commits March 30, 2021 14:14
This is a test object only

Co-authored-by: Logan Harbour <loganhharbour@gmail.com>
Or a requirement that @loganharbour and I were both happy enough with,
at least.
Logan is insistant that test objects should be clearly labeled as such.

Which makes sense, so I nominate him to fix the *other* 291 classes in
test/src/*/ that don't have "Test" in the name.
@moosebuild
Copy link
Contributor

Job Documentation on c7213e2 wanted to post the following:

View the site here

This comment will be updated on new commits.

@roystgnr roystgnr merged commit c74772e into idaholab:next Mar 31, 2021
@roystgnr roystgnr deleted the mesh_subgenerator_api branch March 31, 2021 15:44
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.

Allow for Mesh sub-generators
3 participants