Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c3c86ff
add flag to diable laser evolution
huixingjian Dec 8, 2025
740eccb
Update src/Hipace.H
huixingjian Dec 9, 2025
3a7d04d
add disable uz push
huixingjian Dec 9, 2025
a5bb41d
Merge branch 'desable_laser_evo' of https://github.com/huixingjian/hi…
huixingjian Dec 9, 2025
f1fa948
fix several typos and bug
huixingjian Dec 9, 2025
db16937
add 'disable' in laser solver type
huixingjian Dec 9, 2025
7541c59
add on more condition in assert
huixingjian Dec 9, 2025
b536153
init data every slice
huixingjian Dec 10, 2025
2d3a71c
try the other function
huixingjian Dec 10, 2025
fb173b9
comment out laser slice
huixingjian Dec 10, 2025
7fdb033
Update Hipace.cpp
huixingjian Dec 10, 2025
1dd6726
copy laser to next step
AlexanderSinn Dec 10, 2025
3ac6021
Merge pull request #2 from AlexanderSinn/desable_laser_evo
huixingjian Dec 10, 2025
6118a40
add instruction in the document
huixingjian Dec 10, 2025
7691452
Update parameters.rst
huixingjian Dec 10, 2025
2d1bf0b
Update Hipace.H
huixingjian Dec 10, 2025
46095cd
Merge branch 'Hi-PACE:development' into desable_laser_evo
huixingjian Jan 20, 2026
6d8cc58
change Ezp =0
Jan 20, 2026
dd6c477
update uz
huixingjian Jan 20, 2026
db70a8f
Merge branch 'Hi-PACE:development' into desable_laser_evo
huixingjian Jan 27, 2026
2b3f03c
Update parameters.rst
huixingjian Jan 29, 2026
ea503b5
Update BeamParticleContainer.cpp
huixingjian Jan 29, 2026
954c47d
Update BeamParticleContainer.H
huixingjian Jan 29, 2026
d3173cc
Update BeamParticleAdvance.cpp
huixingjian Jan 29, 2026
c6b285d
Update BeamParticleAdvance.cpp
huixingjian Jan 29, 2026
9ebf246
Update BeamParticleAdvance.cpp
huixingjian Feb 3, 2026
6adb9ca
Update BeamParticleAdvance.cpp
huixingjian Feb 3, 2026
adaf649
Update BeamParticleAdvance.cpp
huixingjian Feb 3, 2026
0e3d0ec
Update BeamParticleAdvance.cpp
huixingjian Feb 3, 2026
da9d45e
Update BeamParticleAdvance.cpp
huixingjian Feb 3, 2026
70b8d81
Update BeamParticleAdvance.cpp
huixingjian Feb 6, 2026
765fdfb
Update docs/source/run/parameters.rst
huixingjian Mar 31, 2026
c7e2736
Update MultiLaser.cpp
huixingjian Mar 31, 2026
c85e5ed
Update MultiLaser.cpp
huixingjian Mar 31, 2026
e29b09a
Update parameters.rst
huixingjian Mar 31, 2026
345722d
Merge branch 'development' into desable_laser_evo
huixingjian Apr 9, 2026
7bf1fe0
Update BeamParticleAdvance.cpp
huixingjian Apr 9, 2026
7f5ad58
Update MultiLaser.cpp
huixingjian Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/source/run/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,10 @@ which are valid only for certain beam types, are introduced further below under
Whether the beam particles are pushed along the z-axis. The momentum is still fully updated.
Note: using ``do_z_push = 0`` results in unphysical behavior.

``<beam name>.accelerate`` (`bool`) optional (default `1`)
Comment thread
huixingjian marked this conversation as resolved.
Whether the beam particles are accelerated. The transverse momentum is still fully updated.
Note: using ``accelerate = 0`` results in unphysical behavior.

* ``<beam name> or beams.do_push`` (`bool`) optional (default `1`)
When set to `0`, disables the beam particle pusher.

Expand Down Expand Up @@ -959,10 +963,11 @@ Parameters starting with ``lasers.`` apply to all laser pulses, parameters start
the field to laser interpolation of chi. Currently, `0,1,2,3` are implemented.

* ``lasers.solver_type`` (`string`) optional (default `multigrid`)
Type of solver for the laser envelope solver, either ``fft`` or ``multigrid``.
Type of solver for the laser envelope solver, either ``fft``, ``multigrid`` or ``off``.
Currently, the approximation that the phase is evaluated on-axis only is made with both solvers.
With the multigrid solver, we could drop this assumption.
For now, the fft solver should be faster, more accurate and more stable, so only use the multigrid one with care.
If set ``off``, the laser will not evolve and remain as the initial profile through the simulation.

* ``lasers.MG_tolerance_rel`` (`float`) optional (default `1e-4`)
Relative error tolerance of the multigrid solver used for the laser pulse.
Expand Down
18 changes: 16 additions & 2 deletions src/laser/MultiLaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ MultiLaser::ReadParameters ()
m_linear_polarization = polarization == "linear";
queryWithParser(pp, "use_phase", m_use_phase);
queryWithParser(pp, "solver_type", m_solver_type);
AMREX_ALWAYS_ASSERT(m_solver_type == "multigrid" || m_solver_type == "fft");
AMREX_ALWAYS_ASSERT(m_solver_type == "multigrid" || m_solver_type == "fft" ||
m_solver_type == "off");
queryWithParser(pp, "interp_order", m_interp_order);
AMREX_ALWAYS_ASSERT(m_interp_order <= 3 && m_interp_order >= 0);

Expand Down Expand Up @@ -463,8 +464,21 @@ MultiLaser::AdvanceSlice (const int islice, const Fields& fields, amrex::Real dt
AdvanceSliceMG(dt, is_first_step);
} else if (m_solver_type == "fft") {
AdvanceSliceFFT(dt, is_first_step);
} else if (m_solver_type == "off") {
for ( amrex::MFIter mfi(m_slices, DfltMfi); mfi.isValid(); ++mfi ){
Array3<amrex::Real> arr = m_slices.array(mfi);
amrex::ParallelFor(
to2D(mfi.tilebox()),
[=] AMREX_GPU_DEVICE (int i, int j) {
using namespace WhichLaserSlice;
// copy current laser to slice of the next time step
arr(i, j, np1j00_r) = arr(i, j, n00j00_r);
arr(i, j, np1j00_i) = arr(i, j, n00j00_i);
}
);
}
} else {
amrex::Abort("laser.solver_type must be fft or multigrid");
amrex::Abort("laser.solver_type must be fft, multigrid or off");
}
}

Expand Down
1 change: 1 addition & 0 deletions src/particles/beam/BeamParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public:
amrex::Real m_spin_anom = 0.00115965218128;
/** ratio of beam particles that are written to the openPMD output */
int m_output_ratio = 1;
bool m_acc_z = true; /**<if accelerator the beam on z */
private:
std::string m_name; /**< name of the species */
/** injection type, fixed_width or fixed_ppc */
Expand Down
1 change: 1 addition & 0 deletions src/particles/beam/BeamParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ BeamParticleContainer::ReadParameters ()
getWithParser(pp, "injection_type", m_injection_type);
queryWithParser(pp, "duz_per_uz0_dzeta", m_duz_per_uz0_dzeta);
queryWithParser(pp, "do_z_push", m_do_z_push);
queryWithParser(pp, "accelerate", m_acc_z);
Comment thread
huixingjian marked this conversation as resolved.
queryWithParserAlt(pp, "do_push", m_do_push, pp_alt);
queryWithParserAlt(pp, "do_radiation_reaction", m_do_radiation_reaction, pp_alt);
queryWithParserAlt(pp, "insitu_period", m_insitu_period.m_func_str, pp_alt);
Expand Down
5 changes: 2 additions & 3 deletions src/particles/pusher/BeamParticleAdvance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AdvanceBeamParticlesSlice (
using namespace amrex::literals;

const PhysConst phys_const = get_phys_const();

const bool acc_z = beam.m_acc_z;
const bool do_z_push = beam.m_do_z_push;
const int n_subcycles = beam.m_n_subcycles;
const bool radiation_reaction = beam.m_do_radiation_reaction;
Expand Down Expand Up @@ -200,7 +200,6 @@ AdvanceBeamParticlesSlice (
auto [shape_n, ncell] = shape_factor<2>(zmid, 0);

Ezp *= (1._rt - shape_p - shape_n);

// Gather Ez field on particle from grid
for (int iy=0; iy<=depos_order.value; iy++){
for (int ix=0; ix<=depos_order.value; ix++){
Expand All @@ -218,7 +217,7 @@ AdvanceBeamParticlesSlice (
ApplyExternalField(xp, yp, zp, time, clight, ExmByp, EypBxp, Ezp, Bxp, Byp, Bzp,
external_fields);
}

if(!acc_z) Ezp = 0;
ExmByp *= inv_clight;
EypBxp *= inv_clight;
Ezp *= inv_clight;
Expand Down
Loading