Skip to content

Commit

Permalink
Merge branch 'development' into disable_solve
Browse files Browse the repository at this point in the history
  • Loading branch information
EyaDammak authored Feb 11, 2025
2 parents eb2f136 + c0ac640 commit 47ebca4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/source/buildDoxygen
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ curl -L -o amrex-doxygen-web.tag.xml \
https://amrex-codes.github.io/amrex/docs_xml/doxygen/amrex-doxygen-web.tag.xml

# treat all warnings as errors
#echo "WARN_AS_ERROR = YES" >> Doxyfile
echo "WARN_AS_ERROR = YES" >> Doxyfile

doxygen
4 changes: 2 additions & 2 deletions src/Hipace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ Hipace::SolveOneSlice (int islice, int step)

// Push plasma particles
for (int lev=0; lev<current_N_level; ++lev) {
m_multi_plasma.AdvanceParticles(m_fields, m_3D_geom, false, lev);
m_multi_plasma.AdvanceParticles(m_fields, m_3D_geom, false, lev, current_N_level);
}


Expand Down Expand Up @@ -970,7 +970,7 @@ Hipace::PredictorCorrectorLoopToSolveBxBy (const int islice, const int current_N

for (int lev=0; lev<current_N_level; ++lev) {
// Push particles to the next temp slice
m_multi_plasma.AdvanceParticles(m_fields, m_3D_geom, true, lev);
m_multi_plasma.AdvanceParticles(m_fields, m_3D_geom, true, lev, current_N_level);
}

if (m_N_level > 1) {
Expand Down
4 changes: 3 additions & 1 deletion src/particles/plasma/MultiPlasma.H
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ public:
* \param[in] gm Geometry of the simulation, to get the cell size etc.
* \param[in] temp_slice if true, the temporary data (x_temp, ...) will be used
* \param[in] lev MR level
* \param[in] current_N_level number of MR levels
*/
void AdvanceParticles (
const Fields & fields, amrex::Vector<amrex::Geometry> const& gm, bool temp_slice, int lev);
const Fields & fields, amrex::Vector<amrex::Geometry> const& gm, bool temp_slice, int lev,
int const current_N_level);

/** \brief Loop over plasma species and deposit their neutralizing background, if needed
*
Expand Down
3 changes: 2 additions & 1 deletion src/particles/plasma/MultiPlasma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ MultiPlasma::ExplicitDeposition (Fields& fields, amrex::Vector<amrex::Geometry>

void
MultiPlasma::AdvanceParticles (
const Fields & fields, amrex::Vector<amrex::Geometry> const& gm, bool temp_slice, int lev)
const Fields & fields, amrex::Vector<amrex::Geometry> const& gm, bool temp_slice, int lev,
int const current_N_level)
{
for (int i=0; i<m_nplasmas; i++) {
if (m_all_plasmas[i].m_do_push){
Expand Down
3 changes: 2 additions & 1 deletion src/particles/pusher/PlasmaParticleAdvance.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
* \param[in] gm Geometry of the simulation, to get the cell size etc.
* \param[in] temp_slice if true, the temporary data (x_temp, ...) will be used
* \param[in] lev MR level
* \param[in] current_N_level number of MR levels
*/
void
AdvancePlasmaParticles (PlasmaParticleContainer& plasma, const Fields & fields,
amrex::Vector<amrex::Geometry> const& gm, const bool temp_slice,
int const lev);
int const lev, int const current_N_level);

#endif // PLASMAPARTICLEADVANCE_H_
4 changes: 2 additions & 2 deletions src/particles/pusher/PlasmaParticleAdvance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ template struct PlasmaMomentumDerivative<DualNumber>;
void
AdvancePlasmaParticles (PlasmaParticleContainer& plasma, const Fields & fields,
amrex::Vector<amrex::Geometry> const& gm, const bool temp_slice,
int const lev)
int const lev, int const current_N_level)
{
HIPACE_PROFILE("AdvancePlasmaParticles()");
using namespace amrex::literals;
Expand Down Expand Up @@ -272,7 +272,7 @@ AdvancePlasmaParticles (PlasmaParticleContainer& plasma, const Fields & fields,
});

#ifdef HIPACE_USE_AB5_PUSH
if (!temp_slice) {
if (!temp_slice && lev == current_N_level - 1) {
auto& rd = pti.GetStructOfArrays().GetRealData();

// shift force terms
Expand Down
3 changes: 2 additions & 1 deletion src/salame/Salame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ SalameModule (Hipace* hipace, const int n_iter, const bool do_advance, int& last

for (int lev=0; lev<current_N_level; ++lev) {
// advance plasma to the temp slice
hipace->m_multi_plasma.AdvanceParticles(hipace->m_fields, hipace->m_3D_geom, true, lev);
hipace->m_multi_plasma.AdvanceParticles(hipace->m_fields, hipace->m_3D_geom, true, lev,
current_N_level);

hipace->m_fields.duplicate(lev, WhichSlice::Salame, {"jx", "jy"},
WhichSlice::Next, {"jx_beam", "jy_beam"});
Expand Down

0 comments on commit 47ebca4

Please sign in to comment.