Skip to content

Conversation

@ax3l
Copy link
Member

@ax3l ax3l commented Mar 8, 2025

Add a helper to split a lattice every ds to insert another thin element, e.g., a BeamMonitor.

Close #537

Tasks

  • better name? insert_elements(), insert(...), splice(...), ...?
  • implementation
  • Python bindings
  • user-facing docs
  • example/test

@ax3l ax3l added enhancement New feature or request component: elements Elements/external fields labels Mar 8, 2025
@ax3l ax3l changed the title Lattice Helper: insert_element_every_ds [WIP] Lattice Helper: insert_element_every_ds Mar 8, 2025
@ax3l ax3l added this to the Advanced Methods (SciDAC-5) milestone Mar 9, 2025
@ax3l ax3l force-pushed the topic-split-every-ds-helper branch 2 times, most recently from 015e28b to d7ef26a Compare March 10, 2025 17:29
Add a helper to split a lattice every `ds` to insert another thin
element, e.g., a BeamMonitor.
@ax3l ax3l changed the title [WIP] Lattice Helper: insert_element_every_ds Lattice Helper: insert_element_every_ds Mar 17, 2025
@ax3l ax3l force-pushed the topic-split-every-ds-helper branch from d7ef26a to 15354bf Compare March 17, 2025 18:55
@ax3l
Copy link
Member Author

ax3l commented Mar 17, 2025

@cemitch99 I think we could merge this one and then cut the 25.03 release? :)

s_next_insert += ds;
}
// case 2: current element ends exactly with next insert
else if (s_next_insert == cur_s_out) {

Check notice

Code scanning / CodeQL

Equality test on floating-point values Note

Equality checks on floating point values can yield unexpected results.
Copy link
Member Author

Choose a reason for hiding this comment

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

That is intentional to cover this corner case.

Copy link
Member

@cemitch99 cemitch99 left a comment

Choose a reason for hiding this comment

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

Great capability to have.

@ax3l ax3l merged commit b131f7b into BLAST-ImpactX:development Mar 18, 2025
16 checks passed
@ax3l ax3l deleted the topic-split-every-ds-helper branch March 18, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: elements Elements/external fields enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitor Helper: Add every ds & Slice Elements

2 participants