Skip to content

Conversation

@egstern
Copy link
Member

@egstern egstern commented Oct 24, 2025

This PR adds the polygon aperture that defines an accepted region for transmitting particles defined by a set or vertices.

@ax3l ax3l added the component: elements Elements/external fields label Oct 25, 2025
#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

Equality checks on floating point values can yield unexpected results.

// 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

Equality checks on floating point values can yield unexpected results.
@cemitch99 cemitch99 marked this pull request as ready for review November 4, 2025 18:06
@cemitch99 cemitch99 changed the title [WIP] polygon aperture Polygon aperture Nov 4, 2025
* @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
Copy link
Member

Choose a reason for hiding this comment

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

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.

@egstern
Copy link
Member Author

egstern commented Nov 4, 2025 via email

@@ -0,0 +1,46 @@
###############################################################################
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: elements Elements/external fields

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants