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

Allow for Mesh sub-generators #17184

Closed
ScottRichards-ANL opened this issue Mar 2, 2021 · 4 comments · Fixed by #17458
Closed

Allow for Mesh sub-generators #17184

ScottRichards-ANL opened this issue Mar 2, 2021 · 4 comments · Fixed by #17458
Assignees
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.

Comments

@ScottRichards-ANL
Copy link
Contributor

Reason

It would be useful in the creation of complicated geometries for a single MeshGenerator to be able to generate a mesh with many constituent sub-geometries matching those that existing MeshGenerators can create.

Design

Add the capability for a MeshGenerator to instantiate other MeshGenerators as sub-generators and have the meshes that they create to be directly passed to the higher level generator for manipulation and stitching with other meshes.

Impact

Depending on implementation, could impact internal APIs or add something new.

@ScottRichards-ANL ScottRichards-ANL added P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software. labels Mar 2, 2021
@roystgnr
Copy link
Contributor

Apologies for the late response here; @permcody thought that this would be a good excuse for me to get up to speed with the MeshGenerator and MooseApp APIs, and I'm embarrassed to say he seems to have have been overly optimistic about the amount of time that would take for me.

I took a first crack at seeing how hard this would be to do with existing APIs; you can see a draft of that in the StitchedSubgenerators constructor here:

next...roystgnr:mesh_subgenerators

So it's definitely possible to do now, with no API changes ... however, based on the time it took me to figure that out, I quite agree that we should add a new API, to make this easier to do and much easier to learn how to do. I'll be experimenting with some possible designs shortly, and I'm open to suggestions. My first crack is going to be a MeshGenerator::addSubGenerator variadic template function, to see if we can do common InputParameters augmentations in a one-liner.

@roystgnr roystgnr self-assigned this Mar 25, 2021
@roystgnr
Copy link
Contributor

to make this easier to do and much easier to learn how to do

And to make sure it's done safely and tested in CI and supported - now that I think about it, I'm not certain whether my current draft code is passing tests because I made sure the generate() dependencies were constructed correctly or whether the dependencies got sorted correctly out of luck, and either way that's something that should be guaranteed by the API, not something users should have to worry about slipping up on.

@roystgnr
Copy link
Contributor

I made sure the generate() dependencies were constructed correctly

Well, the API I was using did, anyway. I'll document that better, both there and in the new API.

roystgnr added a commit to roystgnr/moose that referenced this issue Mar 25, 2021
Hopefully this is something like what the ANL folks had in mind for
idaholab#17184
@roystgnr
Copy link
Contributor

to see if we can do common InputParameters augmentations in a one-liner.

It turns out we can! Take a look at ff6575f for an example. In hindsight I should have set up an example use case with more than one parameter, so that "file", MeshFileName(input_filename) would have been followed by "another_param_name", AnotherDataType(foo), "a_third", AThirdDataType(bar) to showcase the variadic capability, but this at least works as proof of concept. If everyone likes it then I'll add documentation and set up a PR.

roystgnr added a commit to roystgnr/moose that referenced this issue Mar 29, 2021
Hopefully this is something like what the ANL folks had in mind for
idaholab#17184
FY 21 NEAMS Multiphysics Technical Assistance Support automation moved this from To do to Done Mar 31, 2021
aeslaughter pushed a commit to aeslaughter/moose that referenced this issue Jun 2, 2021
Hopefully this is something like what the ANL folks had in mind for
idaholab#17184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants