-
Notifications
You must be signed in to change notification settings - Fork 1.2k
CSG Transformations #32403
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?
CSG Transformations #32403
Changes from all commits
e129cd2
76789a5
b77d2c2
3891b2c
c66af2e
8ed5e55
2d2b032
2b8e7b2
daa3fd2
ae942e8
90622da
9f11c18
229c104
97bdc17
0bf54e6
14862c9
b2751c1
e36ef7c
e2e24ac
847d014
a38a4d9
ce517fe
c07e899
6c341a1
735736a
4e2558e
9b7461f
6210b19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| #endif | ||
|
|
||
| #include "MooseApp.h" | ||
| #include "CSGTransformation.h" | ||
|
|
||
| namespace CSG | ||
| { | ||
|
|
@@ -93,6 +94,17 @@ class CSGSurface | |
| */ | ||
| const std::string & getName() const { return _name; } | ||
|
|
||
| /** | ||
| * @brief Get the list of transformations applied to this surface | ||
| * | ||
| * @return const reference to the list of transformations | ||
| */ | ||
| const std::vector<std::pair<TransformationType, std::tuple<Real, Real, Real>>> & | ||
| getTransformations() const | ||
| { | ||
| return _transformations; | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right my question is more that transformations are not usually applied to surfaces in MC codes?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Surfaces are the primary entities that can have transformations applied to them across all MC codes, various codes allow for cells and universes too under different circumstances (these are less consistent across codes). But pretty much all codes support surface transformations directly with built-in methods. At the end of the day, it is really all the surfaces that need to be transformed to alter the geometry with a transformation. |
||
|
|
||
| /// Operator overload for checking if two CSGSurface objects are equal | ||
| bool operator==(const CSGSurface & other) const; | ||
|
|
||
|
|
@@ -111,20 +123,33 @@ class CSGSurface | |
| // name needs to be managed at the CSGSurfaceList level | ||
| void setName(const std::string & name) { _name = name; } | ||
|
|
||
| /** | ||
| * @brief add a transformation to a surface | ||
| * | ||
| * @param type type of transformation to apply | ||
| * @param values values for the transformation (3 values for any transformation type) | ||
| */ | ||
| void addTransformation(TransformationType type, const std::tuple<Real, Real, Real> & values); | ||
|
|
||
| /// Name of surface | ||
| std::string _name; | ||
|
|
||
| /// Type of surface that is being represented | ||
| /// string is taken directly from the surface class name | ||
| const std::string _surface_type; | ||
|
|
||
| /// list of transformations applied to the surface (type, value) in the order they are applied | ||
| std::vector<std::pair<TransformationType, std::tuple<Real, Real, Real>>> _transformations; | ||
|
|
||
| // CSGSurfaceList needs to be friend to access setName() | ||
| friend class CSGSurfaceList; | ||
| friend class CSGBase; // needed for addTransformation() access | ||
|
|
||
| #ifdef MOOSE_UNIT_TEST | ||
| /// Friends for unit testing | ||
| ///@{ | ||
| FRIEND_TEST(CSGSurfaceTest, testSetName); | ||
| FRIEND_TEST(CSGSurfaceTest, testSurfaceEquality); | ||
| ///@} | ||
| #endif | ||
| }; | ||
|
|
||
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.
positive no?
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.
So I had this as a positive, non-zero restriction initially, but @shikhar413 pointed out that negative values were allowed in the
TransformGenerator. I did look the source code there and did not see a restriction on any of the values for scaling, including the fact that the values could be zero. We decided to allow negative values to be consistent with that generator, but restrict zero values because that wouldn't make any sense from a CSG/MC standpoint. I am fine with going back to restricting it to positive values only if we think it makes most sense even though the TransformGenerator allows negative.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.
ok seems fine.
TransformGenerator negative scaling needs an extra step to flip the elements back to a positive volume.
I guess it's a way to do a central symmetry