Skip to content

Commit

Permalink
Remove temporary particle container
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Jan 17, 2025
1 parent e4bdcae commit ed9b30d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
22 changes: 22 additions & 0 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,28 @@ WarpX::InitFromScratch ()
m_implicit_solver->CreateParticleAttributes();
}

if (m_do_back_transformed_particles)
{
// Set comm to false so that the attributes are not communicated
// nor written to the checkpoint files
int const comm = 0;

// Add space to save the positions and velocities at the start of the time steps
for (auto const& pc : m_WarpX->GetPartContainer())
{
#if (AMREX_SPACEDIM >= 2)
pc->NewRealComp("x_n_btd", comm);
#endif
#if defined(WARPX_DIM_3D) || defined(WARPX_DIM_RZ)
pc->NewRealComp("y_n_btd", comm);
#endif
pc->NewRealComp("z_n_btd", comm);
pc->NewRealComp("ux_n_btd", comm);
pc->NewRealComp("uy_n_btd", comm);
pc->NewRealComp("uz_n_btd", comm);
}
}

mypc->AllocData();
mypc->InitData();

Expand Down
5 changes: 0 additions & 5 deletions Source/Particles/WarpXParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,8 @@ public:
TmpIdx::nattribs>;
using TmpParticles = amrex::Vector<std::map<PairIndex, TmpParticleTile> >;

TmpParticles getTmpParticleData () const noexcept {return tmp_particle_data;}

int getIonizationInitialLevel () const noexcept {return ionization_initial_level;}

protected:
TmpParticles tmp_particle_data;

private:
void particlePostLocate(ParticleType& p, const amrex::ParticleLocData& pld, int lev) override;

Expand Down

0 comments on commit ed9b30d

Please sign in to comment.