-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Mesh Generator infrastructure changes to support --csg-only command line option #29102
base: next
Are you sure you want to change the base?
Conversation
dd72729
to
3ee8f97
Compare
Job Documentation, step Docs: sync website on 2a243e6 wanted to post the following: View the site here This comment will be updated on new commits. |
@kkiesling @eshemon FYI |
@GiudGiud @loganharbour this is a preliminary PR that defines the |
Job Coverage, step Generate coverage on 2a243e6 wanted to post the following: Framework coverage
Modules coverageCoverage did not change Full coverage reportsReports
This comment will be updated on new commits. |
I'm not sure that it makes sense to add this yet without the actual storage of the CSG representation? Has that component been discussed? |
Thought I’d push this up first to get your thoughts on whether this could be merged first before creating the data type for storage of CSG representation, since adding that data type will be quite a large number of changes as well. That portion has not been completed yet but if you’d like that part to be included in this PR as well we can treat this PR as a draft and you guys can review the code design so far. Let us know what makes most sense in terms of code review |
Just an update on this. I think I've figured out a way to generate a CSG mesh from any arbitrary Exodus file that is imported through FileMeshGenerator, the intermediate goal for this PR could then be to demonstrate |
Adding CSG output for a mesh generator would be great to demonstrate this CSG-only mode. what is your target output format? XML? |
right now targeting json output format so as not to favor one MC code over another. Then the downstream code (Cardinal / Shift etc) can have an in memory hook to convert this json data to whatever format they need |
Do you expect you'll output some explanation of the CSG through comments? This would make json a problem. |
Wasn't planning to. Right now I'm thinking of outputting the info about the root universe, the cells associated with this universe, and the surfaces used to define those cells. Can be expanded accordingly one we start to support nested universes, lattices etc. Let me know if you think outputting to JSON has any specific limitations w.r.t CSG representation |
I dont know enough. I just asked Paul on the crpg slack let's see what he thinks on formats. |
I’m honestly not too concerned with what the output data type is going to be here, as long as it contains the data that is needed to generate the CSG geometry. Ultimately I see this more of a debugging tool to make sure CSG-only is working as expected, and whatever format we choose we’re going to have to modify it to fit whatever the downstream MC code can read. We also might want to discuss whether we are creating a geometry specification file or a geometry input file (e.g. for OpenMC an XML file or a Python file?). Either can be possible |
Yes debugging and testing as well. I think that will be the main way of testing the CSG generation in MOOSE, which is why I'm happy to see this capability come in quite early.
This would be done in the OpenMC repo right? With a MOOSE-JSON-CSV reader/converter python script? |
Yup, or probably Cardinal since I don't think OpenMC directly interfaces with finite element meshes. Will have to coordinate with the external stakeholders for MC codes to figure this step out, but for now we can focus on the FEM-->CSG JSON step (or another output format if there is a strong reason to do so) |
The other thing to also note is that if we are coupling with a C++ code we can ignore the output data type altogether and generate the final CSG mesh from the internal representation we create in MOOSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick comments because I was curious. Looking forward to seeing how you make the CSGBase work
|
||
#include "Action.h" | ||
|
||
class CSGOnlyAction : public Action |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class CSGOnlyAction : public Action | |
/** | |
* Outputs the Constructive Solid Geometry to file then exits | |
*/ | |
class CSGOnlyAction : public Action |
@@ -195,6 +220,11 @@ class MeshGenerator : public MooseObject, public MeshMetaDataInterface | |||
*/ | |||
virtual void generateData(); | |||
|
|||
/** | |||
* Generate the CSG mesh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Generate the CSG mesh | |
* Generate the CSG representation of the mesh (or meshing operation) created by this mesh generator |
params.addCommandLineParam<std::string>( | ||
"csg_only", | ||
"--csg-only", | ||
"Setup and Output the input mesh in CSG format only (Default: \"<input_file_name>_in.e\")"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Setup and Output the input mesh in CSG format only (Default: \"<input_file_name>_in.e\")"); | |
"Setup and Output a constructive solid geometry (CSG) representation of the input mesh (Default: \"<input_file_name>_in.json\")"); |
void | ||
MeshGenerator::generateInternalCSG() | ||
{ | ||
mooseAssert(isDataOnly(), "Trying to use csg-only mode while not in data-driven mode"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@GiudGiud @loganharbour just pushed where I'm at with integrating --csg-only with
will need to update this to generate a JSON file instead. I'll let you know when the PR is ready to remove from being in draft stage |
Job Precheck, step Clang format on 64f0696 wanted to post the following: Your code requires style changes. A patch was auto generated and copied here
Alternatively, with your repository up to date and in the top level of your repository:
|
refs #29095