-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement generateCSG method for PinMeshGenerator #31782
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
base: next
Are you sure you want to change the base?
Conversation
7872670 to
d2f3a18
Compare
|
@eshemon @kkiesling FYI |
|
Job Documentation, step Docs: sync website on 60f35e4 wanted to post the following: View the site here This comment will be updated on new commits. |
d2f3a18 to
762d24e
Compare
|
Job Coverage, step Generate coverage on 60f35e4 wanted to post the following: Framework coverage
Modules coverageReactor
Full coverage reportsReports
This comment will be updated on new commits. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@GiudGiud this PR should be good to review 🙏🏾 |
GiudGiud
left a comment
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.
I think we should make some sort of "tester" for the CSG, to ensure it is valid
this could be checking volumes? Or simplifying them and making sure a region is not empty? (intersection of +plane and -plane for example) ? or make a converter to OpenMC so the reviewer can plot them there?
modules/reactor/doc/content/source/meshgenerators/PinMeshGenerator.md
Outdated
Show resolved
Hide resolved
modules/reactor/test/tests/meshgenerators/pin_mesh_generator/tests
Outdated
Show resolved
Hide resolved
modules/reactor/test/tests/meshgenerators/pin_mesh_generator/tests
Outdated
Show resolved
Hide resolved
modules/reactor/test/tests/meshgenerators/pin_mesh_generator/gold/pin_hex_3d_csg.json
Outdated
Show resolved
Hide resolved
@GiudGiud Unfortunately, this is not necessarily within scope of the funded work that @shikhar413 and I currently doing. Yes, having some sort of visualization would be helpful as a developer, but that will also naturally come as the connection to specific codes are developed and each code has its native visualization tool that can be used. Additionally, Ideally tests are written in small enough units that the output can be manually inspected by developers/reviewers for correctness (which it seems you were able to do here, noting the mistake), and then they cover enough cases to be able to trust the larger complex models are correct. Also, this CSG framework is not necessarily meant to check the validity of a CSG model, but instead makes sure it matches whatever input it was given. We are operating under the assumption that MOOSE has already validated the input as valid, and therefore if the CSG model is made to match that correctly, it is also valid. So in the example of an empty region, if that is what is created by the MOOSE input and valid there, then that is what would be created and considered valid for CSG as well. Let us know if you want to discuss this in more detail offline/in a meeting. |
762d24e to
a7c8afe
Compare
|
Job Precheck, step Clang format on a7c8afe 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:
|
a7c8afe to
7f225eb
Compare
modules/reactor/test/tests/meshgenerators/pin_mesh_generator/gold/pin_square_3d_csg.json
Show resolved
Hide resolved
7f225eb to
640ef1f
Compare
b45dbf8 to
c173e79
Compare
|
@GiudGiud this should be good for a re-review now |
c173e79 to
60f35e4
Compare
|
Job Test, step Results summary on 60f35e4 wanted to post the following: Framework test summaryCompared against ee0740d in job civet.inl.gov/job/3349339. Removed testsAdded tests
Run time changesModules test summaryCompared against ee0740d in job civet.inl.gov/job/3349339. Removed testsAdded tests
Run time changes |
| For example: | ||
| These functions should be called from the constructor of the MeshGenerator, so that the MeshGenerator system can properly define the dependency tree of all mesh generators in the input file. The returned CSGBase pointers can be stored in a member variable and updated in the `generateCSG()` method in order to make any changes to the CSGBase object. | ||
| For example, the following member variable stores the pointer to the CSGBase object that is generated by an input mesh geenerator: |
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.
| For example, the following member variable stores the pointer to the CSGBase object that is generated by an input mesh geenerator: | |
| For example, the following member variable stores the pointer to the CSGBase object that is generated by an input mesh generator: |
|
|
||
| /// Holds the output CSGBase object for each mesh generator | ||
| std::map<std::string, std::unique_ptr<CSG::CSGBase>> _csg_base_output; | ||
| /// Holds the output CSGBase object for each mesh generator - including duplicates needed for downstream |
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.
| /// Holds the output CSGBase object for each mesh generator - including duplicates needed for downstream | |
| /// Holds the output CSGBase object for each mesh generator - including duplicates when needed by multiple downstream generators (key is MG name, value list is duplicates) |
| * @brief Add a new universe to the universe list based on a universe reference. | ||
| * This method is called by the copy constructor of CSGBase | ||
| * | ||
| * @param cell reference to CSGCell that should be added to universe list |
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.
| * @param cell reference to CSGCell that should be added to universe list | |
| * @param univ reference to CSGUniverse that should be added to universe list |
| // calculate the equivalent coeffients (aX + bY + cZ = d) from 3 points on a plane | ||
| void coeffsFromPoints(const Point & p1, const Point & p2, const Point & p3); | ||
|
|
||
| // Normalize plane coefficients so that a^2 + b^2 + c^2 = 1 |
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.
| // Normalize plane coefficients so that a^2 + b^2 + c^2 = 1 | |
| /// Normalize plane coefficients so that a^2 + b^2 + c^2 = 1 |
// is for comments, /// is for docstring
| // Link all cells in other_base root universe to current root universe | ||
| for (auto & root_cell : other_base.getRootUniverse().getAllCells()) | ||
| { | ||
| const auto & list_cell = _cell_list.getCell(root_cell.get().getName()); |
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.
could be an efficiency issue to do everything by name but only time and profiling will tell (no action item now)
| { | ||
|
|
||
| CSGRegion | ||
| getInnerRegion(const std::vector<std::reference_wrapper<const CSGSurface>> & radial_surfaces, |
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.
| getInnerRegion(const std::vector<std::reference_wrapper<const CSGSurface>> & radial_surfaces, | |
| getInnerRegion(const std::vector<std::reference_wrapper<const CSGSurface>> & surfaces, |
Reason
Design
Impact
refs #31733