diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 5aca5ad89da..7078947cab0 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -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(); diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index 9c316b110ee..636a0707f47 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -496,13 +496,8 @@ public: TmpIdx::nattribs>; using TmpParticles = amrex::Vector >; - 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;