Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Remove NamedComponentParticleContainer from WarpX #5481

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion Source/Particles/MultiParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# include "Particles/ElementaryProcess/QEDPhotonEmission.H"
#endif
#include "Particles/LaserParticleContainer.H"
#include "Particles/NamedComponentParticleContainer.H"
#include "Particles/ParticleCreation/FilterCopyTransform.H"
#ifdef WARPX_QED
# include "Particles/ParticleCreation/FilterCreateTransformFromFAB.H"
Expand Down
31 changes: 0 additions & 31 deletions Source/Particles/NamedComponentParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,6 @@
#include <string>
#include <utility>


/** Real Particle Attributes stored in amrex::ParticleContainer's struct of array
*/
struct PIdx
{
enum {
#if !defined (WARPX_DIM_1D_Z)
x,
#endif
#if defined (WARPX_DIM_3D)
y,
#endif
z,
w, ///< weight
ux, uy, uz,
#ifdef WARPX_DIM_RZ
theta, ///< RZ needs all three position components
#endif
nattribs ///< number of compile-time attributes
};
};

/** Integer Particle Attributes stored in amrex::ParticleContainer's struct of array
*/
struct PIdxInt
{
enum {
nattribs ///< number of compile-time attributes
};
};

/** Particle Container class that allows to add/access particle components
* with a name (string) instead of doing so with an integer index.
* (The "components" are all the particle amrex::Real quantities.)
Expand Down
4 changes: 2 additions & 2 deletions Source/Particles/ParticleBoundaryBuffer.H
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public:
/** Copy operator for ParticleBoundaryBuffer */
ParticleBoundaryBuffer& operator= ( const ParticleBoundaryBuffer & ) = delete;

/** Move constructor for NamedComponentParticleContainer */
/** Move constructor for ParticleBoundaryBuffer */
ParticleBoundaryBuffer ( ParticleBoundaryBuffer && ) = default;
/** Move operator for NamedComponentParticleContainer */
/** Move operator for ParticleBoundaryBuffer */
ParticleBoundaryBuffer& operator= ( ParticleBoundaryBuffer && ) = default;

int numSpecies() const { return static_cast<int>(getSpeciesNames().size()); }
Expand Down
23 changes: 21 additions & 2 deletions Source/Particles/WarpXParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# include "ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper_fwd.H"
#endif
#include "MultiParticleContainer_fwd.H"
#include "NamedComponentParticleContainer.H"

#include <ablastr/fields/MultiFabRegister.H>

Expand All @@ -49,6 +48,26 @@
#include <string>
#include <utility>

/** Real Particle Attributes stored in amrex::ParticleContainer's struct of array
*/
struct PIdx
{
enum {
#if !defined (WARPX_DIM_1D_Z)
x,
#endif
#if defined (WARPX_DIM_3D)
y,
#endif
z,
w, ///< weight
ux, uy, uz,
#ifdef WARPX_DIM_RZ
theta, ///< RZ needs all three position components
#endif
nattribs ///< number of compile-time attributes
};
};

class WarpXParIter
: public amrex::ParIterSoA<PIdx::nattribs, 0>
Expand Down Expand Up @@ -109,7 +128,7 @@ public:
* derived classes, e.g., Evolve) or actual functions (e.g. CurrentDeposition).
*/
class WarpXParticleContainer
: public NamedComponentParticleContainer<amrex::DefaultAllocator>
: public amrex::ParticleContainerPureSoA<PIdx::nattribs, 0>
{
public:
friend MultiParticleContainer;
Expand Down