-
Notifications
You must be signed in to change notification settings - Fork 29
Polygon aperture #1199
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: development
Are you sure you want to change the base?
Polygon aperture #1199
Conversation
initializer for member object m_id Co-authored-by: Axel Huebl <[email protected]>
for more information, see https://pre-commit.ci
| #endif | ||
|
|
||
| // if the aperture is periodic, shift sx,sy coordinates to the fundamental domain | ||
| T_Real u = (m_repeat_x == 0_prt) ? sx : (fmod(abs(sx)+dx, m_repeat_x)-dx); |
Check notice
Code scanning / CodeQL
Equality test on floating-point values Note
|
|
||
| // if the aperture is periodic, shift sx,sy coordinates to the fundamental domain | ||
| T_Real u = (m_repeat_x == 0_prt) ? sx : (fmod(abs(sx)+dx, m_repeat_x)-dx); | ||
| T_Real v = (m_repeat_y == 0_prt) ? sy : (fmod(abs(sy)+dy, m_repeat_y)-dy); |
Check notice
Code scanning / CodeQL
Equality test on floating-point values Note
| * @param action specify action of domain (transmit/absorb) | ||
| * @param vertices_xx array of coordinates of the horizontal vertex positions (m) | ||
| * @param vertices_yy array of coordinates of the vertical vertex positions (m) | ||
| * @param min_radius2 a minimum radius**2 below which all particles are transmitted |
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 min_radius2 a minimum radius**2 below which all particles are transmitted | |
| * @param min_radius2x a minimum radius**2 below which all particles are transmitted |
Doxygen requires that the name in the documentation here coincides with the name of the function argument.
|
I can't seem to do that because I get warnings of shadowed variables.
That's why it is the way it is now. These are the warnings as I changed it
in branch egstern-polygon-apertures-xx.
````
n file included from
/home/egstern/src/impactx-test/src/elements/PolygonAperture.cpp:10:
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H: In
constructor
'impactx::elements::PolygonAperture::PolygonAperture(std::vector<double>,
std::vector<double>, amrex::ParticleReal, amrex::ParticleReal,
amrex::ParticleReal, bool, Action, amrex::ParticleReal,
amrex::ParticleReal, amrex::ParticleReal,
std::optional<std::__cxx11::basic_string<char> >)':
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H:97:33:
warning: declaration of 'min_radius2' shadows a member of
'impactx::elements::PolygonAperture' [-Wshadow]
97 | amrex::ParticleReal min_radius2,
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H:285:29: note:
shadowed declaration is here
285 | amrex::ParticleReal min_radius2; // minimum radius in which
all pass squared
| ^~~~~~~~~~~
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H:96:47:
warning: declaration of 'vertices_y' shadows a member of
'impactx::elements::PolygonAperture' [-Wshadow]
96 | std::vector< amrex::ParticleReal> vertices_y,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H:284:43: note:
shadowed declaration is here
284 | std::vector< amrex::ParticleReal> vertices_y;
| ^~~~~~~~~~
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H:95:47:
warning: declaration of 'vertices_x' shadows a member of
'impactx::elements::PolygonAperture' [-Wshadow]
95 | std::vector< amrex::ParticleReal> vertices_x,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/egstern/src/impactx-test/src/elements/PolygonAperture.H:283:43: note:
shadowed declaration is here
283 | std::vector< amrex::ParticleReal> vertices_x;
| ^~~~~~~~~~
```
…On Tue, Nov 4, 2025 at 2:11 PM Chad Mitchell ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/elements/PolygonAperture.H
<#1199 (comment)>
:
> + {
+ transmit,
+ absorb
+ };
+
+ static std::string
+ action_name (Action const & action);
+
+ /** A thin collimator element that applies a transverse aperture boundary defined
+ * by points of a polygon vertices.
+ * Particles outside the boundary are considered lost.
+ *
+ * @param action specify action of domain (transmit/absorb)
+ * @param vertices_xx array of coordinates of the horizontal vertex positions (m)
+ * @param vertices_yy array of coordinates of the vertical vertex positions (m)
+ * @param min_radius2 a minimum radius**2 below which all particles are transmitted
⬇️ Suggested change
- * @param min_radius2 a minimum radius**2 below which all particles are transmitted
+ * @param min_radius2x a minimum radius**2 below which all particles are transmitted
Doxygen requires that the name in the documentation here coincides with
the name of the function argument.
—
Reply to this email directly, view it on GitHub
<#1199 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4V5DBWQCFFZQSKUD6RWAL33ECAFAVCNFSM6AAAAACKEJHM3GVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTIMJYGQ3TMNZXHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
it should work on CPU and GPU and eliminate out-of-order initialization warnings.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| @@ -0,0 +1,46 @@ | |||
| ############################################################################### | |||
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.
Wonderful!
Please add your tests to examples/CMakeLists.txt
This PR adds the polygon aperture that defines an accepted region for transmitting particles defined by a set or vertices.