Skip to content

Commit

Permalink
Merge branch 'Hi-PACE:development' into laser_ion_momentum_2
Browse files Browse the repository at this point in the history
  • Loading branch information
EyaDammak authored Feb 12, 2025
2 parents ff4dc77 + 4680512 commit a314292
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
sphinx>=5.3
sphinx-copybutton
sphinx_rtd_theme>=1.1.1
sphinxcontrib-googleanalytics
recommonmark
# docutils 0.17 breaks HTML tags & RTD theme
# https://github.com/sphinx-doc/sphinx/issues/9001
Expand Down
5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@
extensions = [
"breathe",
"sphinx_copybutton",
"sphinxcontrib.googleanalytics",
]

# Google Analytics
googleanalytics_id = "G-Z1D5ZZDNC6"
googleanalytics_enabled = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
3 changes: 3 additions & 0 deletions docs/source/run/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ When both are specified, the per-species value is used.
the domain. However, this will also result in a gap at the domain boundary,
which can lead to noise.

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

Beam parameters
---------------

Expand Down
4 changes: 4 additions & 0 deletions src/particles/beam/BeamParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ BeamParticleContainer::initializeSlice (int slice, int which_slice) {
}
);
}

// remove invalid particles so they don't show up in the beam diagnostic of the first time step
amrex::removeInvalidParticles(getBeamSlice(which_slice));
resize(which_slice, getBeamSlice(which_slice).size(), 0);
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/particles/beam/BeamParticleContainerInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace
ptd.rdata(BeamIdx::ux )[ip] = uxp;
ptd.rdata(BeamIdx::uy )[ip] = uyp;
ptd.rdata(BeamIdx::uz )[ip] = uz * speed_of_light;
ptd.rdata(BeamIdx::w )[ip] = std::abs(weight);
ptd.rdata(BeamIdx::w )[ip] = is_valid ? std::abs(weight) : amrex::Real{0};

ptd.idata(BeamIdx::nsubcycles)[ip] = 0;
ptd.idata(BeamIdx::mr_level)[ip] = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/particles/plasma/MultiPlasma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ MultiPlasma::AdvanceParticles (
int const current_N_level)
{
for (int i=0; i<m_nplasmas; i++) {
AdvancePlasmaParticles(m_all_plasmas[i], fields, gm, temp_slice, lev, current_N_level);
if (m_all_plasmas[i].m_do_push){
AdvancePlasmaParticles(m_all_plasmas[i], fields, gm, temp_slice, lev, current_N_level);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/particles/plasma/PlasmaParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public:
amrex::Real m_mass = 0; /**< mass of each particle of this species */
amrex::Real m_charge = 0; /**< charge of each particle of this species, per Ion level */
int m_n_subcycles = 1; /**< number of subcycles in the plasma particle push */
bool m_do_push = true; /**< whether the plasma pusher is enabled */

// ionization:

Expand Down
1 change: 1 addition & 0 deletions src/particles/plasma/PlasmaParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ PlasmaParticleContainer::ReadParameters ()
"Both 'fine_ppc' and 'fine_patch(x,y)' must be specified "
"to use the fine plasma patch feature");
queryWithParserAlt(pp, "prevent_centered_particle", m_prevent_centered_particle, pp_alt);
queryWithParser(pp, "do_push", m_do_push);
}

void
Expand Down
1 change: 0 additions & 1 deletion src/salame/Salame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ SalameMultiplyBeamWeight (const amrex::Real W, Hipace* hipace)
// invalidate particles with a weight of zero
if (W == 0) {
id.make_invalid();
return;
}

// Multiply SALAME beam particles on this slice with W
Expand Down

0 comments on commit a314292

Please sign in to comment.