Skip to content

Conversation

@cemitch99
Copy link
Member

@cemitch99 cemitch99 commented Mar 26, 2025

This PR modifies the main tracking loop with collective effects to use a second-order Strang splitting.

  • increases the accuracy of the space charge calculation by moving from first-order to second-order with respect to the slice step size, currently set by nslice
  • ensures that integration in s is time-symmetric, which is needed for reversible back-tracking

Close #846

  • simple implementation for the case that nslice is an even integer
  • implement and test in the envelope tracking loop
  • implement and test in the particle tracking loop
  • modify implementation for the case of general nslice
  • add benchmark test(s)

A follow-up PR will address Issue #794

9.029112e-04,
9.029112e-04,
1.841402e-06,
8.94427191e-04,
Copy link
Member Author

Choose a reason for hiding this comment

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

Here the targets were tuned to analytically-determined values, instead of being set to coincide with a low-resolution run.

atol = 0.0 # ignored
rtol = 2.0e-3 # from random sampling of a smooth distribution
rtol = 3.5e-3 # from random sampling of a smooth distribution
print(f" rtol={rtol} (ignored: atol~={atol})")
Copy link
Member Author

Choose a reason for hiding this comment

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

The original tolerance was too tight.

@cemitch99
Copy link
Member Author

cemitch99 commented Mar 28, 2025

The attached result illustrates the improvement in numerical convergence obtained when running the expanding beam test with envelope tracking (input_expanding_envelope.in).

ImpactX_StrangSplitting.pdf

Add linear return maps for additional elements (BLAST-ImpactX#923)
<< " slice_step=" << slice_step << "\n";
}

std::visit([&ref, &cm](auto&& element)
Copy link
Member

Choose a reason for hiding this comment

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

Is the reference particle pushed twice now? o.0

Happens again in line 176 below

Copy link
Member Author

@cemitch99 cemitch99 Jun 27, 2025

Choose a reason for hiding this comment

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

Clarified in person:

  • also includes envelope push
  • note the difference in weights (half step for push, full step for SC & CSR, another half step for push)

Copy link
Member Author

@cemitch99 cemitch99 Jun 27, 2025

Choose a reason for hiding this comment

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

We have to make sure that thin elements, which only go through this loop body once, are still only kicked once though.

@ax3l ax3l force-pushed the strang_splitting_test branch from 3d57bbb to dcae328 Compare August 1, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Element Slicing: Strang Splitting

2 participants