Skip to content

Conversation

@shikhar413
Copy link
Contributor

Reason

Design

Impact

refs #31733

@shikhar413
Copy link
Contributor Author

@eshemon @kkiesling FYI

@moosebuild
Copy link
Contributor

moosebuild commented Oct 24, 2025

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.

@moosebuild
Copy link
Contributor

moosebuild commented Oct 24, 2025

Job Coverage, step Generate coverage on 60f35e4 wanted to post the following:

Framework coverage

ee0740 #31782 60f35e
Total Total +/- New
Rate 85.98% 85.98% +0.00% 100.00%
Hits 124327 124408 +81 100
Misses 20269 20282 +13 0

Diff coverage report

Full coverage report

Modules coverage

Reactor

ee0740 #31782 60f35e
Total Total +/- New
Rate 93.93% 93.98% +0.05% 100.00%
Hits 8011 8099 +88 99
Misses 518 519 +1 0

Diff coverage report

Full coverage report

Full coverage reports

Reports

This comment will be updated on new commits.

@shikhar413
Copy link
Contributor Author

@GiudGiud this PR should be good to review 🙏🏾

Copy link
Contributor

@GiudGiud GiudGiud left a 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?

@GiudGiud GiudGiud self-assigned this Oct 27, 2025
@kkiesling
Copy link
Collaborator

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?

@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.

@moosebuild
Copy link
Contributor

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
You can directly apply the patch by running, in the top level of your repository:

curl -s https://mooseframework.inl.gov/docs/PRs/31782/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 2acb415a170285fef37748f90025af38c3977b3c

@shikhar413 shikhar413 force-pushed the pin_mg_to_csg branch 2 times, most recently from b45dbf8 to c173e79 Compare October 31, 2025 20:10
@shikhar413
Copy link
Contributor Author

@GiudGiud this should be good for a re-review now

@moosebuild
Copy link
Contributor

Job Test, step Results summary on 60f35e4 wanted to post the following:

Framework test summary

Compared against ee0740d in job civet.inl.gov/job/3349339.

Removed tests

Added tests

Test Time (s)
csg.geometry/csg_only_one_to_many_dependencies 0.82

Run time changes

Modules test summary

Compared against ee0740d in job civet.inl.gov/job/3349339.

Removed tests

Added tests

Test Time (s)
reactor/test:meshgenerators/pin_mesh_generator.csg/2d_square 0.84
reactor/test:meshgenerators/pin_mesh_generator.csg/3d_hex 0.81
reactor/test:meshgenerators/pin_mesh_generator.csg/2d_hex_single_assembly 0.80
reactor/test:meshgenerators/pin_mesh_generator.csg/2d_square_single_assembly 0.79
reactor/test:meshgenerators/pin_mesh_generator.csg/2d_hex_homogenized 0.79
reactor/test:meshgenerators/pin_mesh_generator.csg/3d_hex_single_assembly 0.78
reactor/test:meshgenerators/pin_mesh_generator.csg/3d_hex_homogenized 0.77
reactor/test:meshgenerators/pin_mesh_generator.csg/3d_square 0.77
reactor/test:meshgenerators/pin_mesh_generator.csg/2d_hex 0.76

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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());
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
getInnerRegion(const std::vector<std::reference_wrapper<const CSGSurface>> & radial_surfaces,
getInnerRegion(const std::vector<std::reference_wrapper<const CSGSurface>> & surfaces,

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.

4 participants