Skip to content

Conversation

@qianglbl
Copy link
Member

@qianglbl qianglbl commented Oct 6, 2025

added 3 input parameters for the 2.5D Gaussian solver, modified Gauss2p5dPush.cpp, added examples in fodo_space_charge.

Enhances the implementation from #1127

@qianglbl qianglbl requested review from ax3l and cemitch99 October 6, 2025 22:37
int tp5d_bins = 129;
pp_algo.queryAddWithParser("gauss2p5_bins", tp5d_bins);

// Measure beam size, extract the min, max of particle positions

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable x_min is not used.
int tp5d_bins = 129;
pp_algo.queryAddWithParser("gauss2p5_bins", tp5d_bins);

// Measure beam size, extract the min, max of particle positions

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable y_min is not used.
int tp5d_bins = 129;
pp_algo.queryAddWithParser("gauss2p5_bins", tp5d_bins);

// Measure beam size, extract the min, max of particle positions

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable x_max is not used.
int tp5d_bins = 129;
pp_algo.queryAddWithParser("gauss2p5_bins", tp5d_bins);

// Measure beam size, extract the min, max of particle positions

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable y_max is not used.
Comment on lines +231 to +233
//field integrals from a 3D Gaussian bunch
// int const nint = 401;
// amrex::Real const delta=0.01;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
This was referenced Oct 7, 2025
Comment on lines 896 to 900
...

* ``algo.space_charge.gauss_charge_z_bins`` (``int``, default: ``129``)

...
Copy link
Member

Choose a reason for hiding this comment

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

Let's add nice and verbose, user-facing sentences here.

Comment on lines 91 to 95
... (default: ``0.01``)

.. py:property:: space_charge_gauss_charge_z_bins
... (default: ``129``)
Copy link
Member

Choose a reason for hiding this comment

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

Let's add nice and verbose, user-facing sentences here.

@ax3l ax3l changed the title Topic gauss2p5dv2 2.5D Gaussian Solver Oct 8, 2025
@ax3l ax3l added component: space charge Space charge & potential solver tracking: particles labels Oct 8, 2025
@cemitch99
Copy link
Member

Great! Changing the tolerance now allows the test of the initial beam moments to pass in all cases. For the final beam moments, the Gauss3d test still fails in a few cases, and this does not appear to be due to noise or tolerance. (For example, the initial and final beam moments output by the test on macOS are identical to each other.)

@cemitch99
Copy link
Member

Summary of failed tests (on macOS / AppleClang, OpenMP / GCC w/MPI w/Python, Tooling / Clang ASAN UBSAN): FODO.Gauss3d.sc fails, and the initial and final beam moments are identical.

@qianglbl
Copy link
Member Author

qianglbl commented Oct 16, 2025 via email

// Input particle locations (x,y) and RMS sizes (sigx,sigy) and return the integrals for SC fields.
//
AMREX_GPU_DEVICE
void potInt(amrex::ParticleReal delta, int nint, amrex::ParticleReal xin, amrex::ParticleReal yin, amrex::ParticleReal sigx, amrex::ParticleReal sigy,
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
void potInt(amrex::ParticleReal delta, int nint, amrex::ParticleReal xin, amrex::ParticleReal yin, amrex::ParticleReal sigx, amrex::ParticleReal sigy,
void potInt (amrex::ParticleReal delta, int nint, amrex::ParticleReal xin, amrex::ParticleReal yin, amrex::ParticleReal sigx, amrex::ParticleReal sigy,

@cemitch99
Copy link
Member

I think I see why the remaining tests are failing now. I can help you resolve those tomorrow if you have time.


print("Initial Beam:")
sig_xi, sig_yi, sig_ti, emittance_xi, emittance_yi, emittance_ti = get_moments(initial)
sig_xi, sig_yi, sig_ti, emittance_xi, emittance_yi, emittance_ti = get_moments(final)
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
sig_xi, sig_yi, sig_ti, emittance_xi, emittance_yi, emittance_ti = get_moments(final)
sig_xi, sig_yi, sig_ti, emittance_xi, emittance_yi, emittance_ti = get_moments(initial)

Copy link
Member

Choose a reason for hiding this comment

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

Initial and final moments are switched here.

@cemitch99
Copy link
Member

@qianglbl It looks like the Gauss3d tests are all passing! The failing Gauss2p5d tests are now due to errors in the final sigma_x and sigma_y of around 10% and 5%, respectively. (The tolerance is 3%.) Those errors seems too large...

Comment on lines +82 to +87
9.22e-05,
8.55e-05,
0.000996,
2.04e-09,
2.01e-09,
1.97e-06,
Copy link
Member

Choose a reason for hiding this comment

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

@qianglbl Let's double check these values are correct/converged.

@cemitch99
Copy link
Member

@qianglbl @ax3l I tried running this test locally on my Mac with 12 OMP threads, and it worked fine. It is notable that the three failing checks above all return the same wrong answer.

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

Labels

component: space charge Space charge & potential solver tracking: particles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants