Skip to content
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

Use a simpler expression for particle energy for reduced diagnostics #3650

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

dpgrote
Copy link
Member

@dpgrote dpgrote commented Jan 30, 2023

For the reduced diagnostic calculating the particle energy, this uses a simpler expression that does not have any approximations and is accurate for all values of beta.

The Taylor series expansion that was being used was very good, which a peak error of 1.e-12 at beta = 0.09. But the new expression has no error (beyond round off) and is much simpler.

Is there particle energy being calculated anywhere else in WarpX that could use the same simpler expression?

@dpgrote dpgrote added the component: diagnostics all types of outputs label Jan 30, 2023
Copy link
Member

@lucafedeli88 lucafedeli88 left a comment

Choose a reason for hiding this comment

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

A very good solution! Thanks a lot for this PR!

I've quickly skimmed through the code and I haven't found other places were this expression could be used (but I haven't performed an exhaustive search).

@ax3l ax3l requested review from ax3l and RemiLehe February 1, 2023 22:41
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Naice!

@RemiLehe RemiLehe enabled auto-merge (squash) February 1, 2023 22:41
@ax3l ax3l closed this Feb 1, 2023
auto-merge was automatically disabled February 1, 2023 22:43

Pull request was closed

@ax3l ax3l reopened this Feb 1, 2023
@ax3l ax3l enabled auto-merge (squash) February 1, 2023 22:43
@ax3l ax3l merged commit b886db5 into ECP-WarpX:development Feb 1, 2023
@dpgrote dpgrote deleted the better_particle_energy_diag branch June 21, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagnostics all types of outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants