OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BoxLibParticle< PLayout > Class Template Reference

#include <BoxLibParticle.h>

Inheritance diagram for BoxLibParticle< PLayout >:
Inheritance graph
[legend]
Collaboration diagram for BoxLibParticle< PLayout >:
Collaboration graph
[legend]

Public Types

typedef AmrParticleBase
< PLayout >::ParticlePos_t 
ParticlePos_t
 
typedef AmrParticleBase
< PLayout >::ParticleIndex_t 
ParticleIndex_t
 
typedef AmrParticleBase
< PLayout >
::SingleParticlePos_t 
SingleParticlePos_t
 
typedef AmrParticleBase
< PLayout >::AmrField_t 
AmrField_t
 
typedef AmrParticleBase
< PLayout >
::AmrScalarFieldContainer_t 
AmrScalarFieldContainer_t
 
typedef AmrParticleBase
< PLayout >
::AmrVectorFieldContainer_t 
AmrVectorFieldContainer_t
 
typedef AmrParticleBase
< PLayout >::AmrVectorField_t 
AmrVectorField_t
 
typedef AmrParticleBase
< PLayout >
::ParticleLevelCounter_t 
ParticleLevelCounter_t
 
typedef PLayout::AmrProcMap_t AmrProcMap_t
 
typedef PLayout::AmrGrid_t AmrGrid_t
 
typedef PLayout::AmrGeometry_t AmrGeometry_t
 
typedef PLayout::AmrIntVect_t AmrIntVect_t
 
typedef PLayout::AmrBox_t AmrBox_t
 
typedef PLayout::AmrReal_t AmrReal_t
 
typedef amrex::FArrayBox FArrayBox_t
 
- Public Types inherited from AmrParticleBase< PLayout >
typedef PLayout::ParticlePos_t ParticlePos_t
 
typedef PLayout::ParticleIndex_t ParticleIndex_t
 
typedef
PLayout::SingleParticlePos_t 
SingleParticlePos_t
 
typedef PLayout::AmrField_t AmrField_t
 
typedef PLayout::AmrVectorField_t AmrVectorField_t
 
typedef
PLayout::AmrScalarFieldContainer_t 
AmrScalarFieldContainer_t
 
typedef
PLayout::AmrVectorFieldContainer_t 
AmrVectorFieldContainer_t
 
typedef long SortListIndex_t
 
typedef std::vector
< SortListIndex_t
SortList_t
 
typedef std::vector
< ParticleAttribBase * > 
attrib_container_t
 
typedef
AmrParticleLevelCounter
< size_t, size_t > 
ParticleLevelCounter_t
 
- Public Types inherited from IpplParticleBase< PLayout >
enum  { Dim = PLayout::Dimension }
 
typedef PLayout Layout_t
 
typedef PLayout::Position_t Position_t
 
typedef PLayout::Index_t Index_t
 
typedef PLayout::ParticlePos_t ParticlePos_t
 
typedef PLayout::ParticleIndex_t ParticleIndex_t
 
typedef PLayout::pair_iterator pair_iterator
 
typedef PLayout::pair_t pair_t
 
typedef PLayout::UpdateFlags UpdateFlags
 
typedef std::vector
< ParticleAttribBase * > 
attrib_container_t
 
typedef
attrib_container_t::iterator 
attrib_iterator
 
typedef
ParticleAttribBase::SortList_t 
SortList_t
 
- Public Types inherited from DataSource
enum  DsMode { INPUT, OUTPUT, BOTH, DEFAULT }
 
typedef std::vector
< DataSourceObject * > 
container_t
 
- Public Types inherited from AbstractParticle< PLayout::Position_t, PLayout::Dimension >
typedef ParticleLayout
< PLayout::Position_t, Dim >
::SingleParticlePos_t 
SingleParticlePos_t
 
typedef ParticleLayout
< PLayout::Position_t, Dim >
::Index_t 
Index_t
 
typedef ParticleAttrib
< SingleParticlePos_t
ParticlePos_t
 
typedef ParticleAttrib< Index_tParticleIndex_t
 
typedef ParticleLayout
< PLayout::Position_t, Dim >
::UpdateFlags 
UpdateFlags
 
typedef ParticleLayout
< PLayout::Position_t, Dim >
::Position_t 
Position_t
 
typedef ParticleLayout
< PLayout::Position_t, Dim
Layout_t
 

Public Member Functions

 BoxLibParticle ()
 
 BoxLibParticle (PLayout *layout)
 
template<class FT , unsigned Dim, class PT >
void scatter (ParticleAttrib< FT > &attrib, AmrScalarFieldContainer_t &f, ParticleAttrib< Vektor< PT, Dim > > &pp, int lbase, int lfine, const ParticleAttrib< int > &pbin, int bin=-1)
 
template<class FT , unsigned Dim, class PT >
void scatter (ParticleAttrib< FT > &attrib, AmrField_t &f, ParticleAttrib< Vektor< PT, Dim > > &pp, const ParticleAttrib< int > &pbin, int bin=-1, int level=0)
 
template<class FT , unsigned Dim, class PT >
void gather (ParticleAttrib< FT > &attrib, AmrVectorFieldContainer_t &f, ParticleAttrib< Vektor< PT, Dim > > &pp, int lbase, int lfine)
 
- Public Member Functions inherited from AmrParticleBase< PLayout >
 AmrParticleBase ()
 
 AmrParticleBase (PLayout *layout)
 
 ~AmrParticleBase ()
 
void initializeAmr ()
 
const ParticleLevelCounter_tgetLocalNumPerLevel () const
 
ParticleLevelCounter_tgetLocalNumPerLevel ()
 
void setLocalNumPerLevel (const ParticleLevelCounter_t &LocalNumPerLevel)
 
void createWithID (unsigned id)
 
void create (size_t M)
 
void destroy (size_t M, size_t I, bool doNow=false)
 
void performDestroy (bool updateLocalNum=false)
 
void update ()
 
void update (int lev_min, int lev_max, bool isRegrid=false)
 
void update (const ParticleAttrib< char > &canSwap)
 
void sort ()
 
void sort (SortList_t &sortlist)
 
PLayout & getAmrLayout ()
 
const PLayout & getAmrLayout () const
 
void setForbidTransform (bool forbidTransform)
 
bool isForbidTransform () const
 
const double & domainMapping (bool inverse=false)
 
const double & getScalingFactor () const
 
void setLorentzFactor (const Vector_t &lorentzFactor)
 
- Public Member Functions inherited from IpplParticleBase< PLayout >
 IpplParticleBase ()
 
 IpplParticleBase (PLayout *layout)
 
 ~IpplParticleBase ()
 
void initialize (PLayout *)
 
size_t getTotalNum () const
 
size_t getLocalNum () const
 
size_t getDestroyNum () const
 
size_t getGhostNum () const
 
void setTotalNum (size_t n)
 
void setLocalNum (size_t n)
 
unsigned int getMinimumNumberOfParticlesPerCore () const
 
void setMinimumNumberOfParticlesPerCore (unsigned int n)
 
PLayout & getLayout ()
 
const PLayout & getLayout () const
 
ParticleBConds< Position_t,
PLayout::Dimension > & 
getBConds ()
 
void setBConds (const ParticleBConds< Position_t, PLayout::Dimension > &bc)
 
bool singleInitNode () const
 
bool getUpdateFlag (UpdateFlags f) const
 
void setUpdateFlag (UpdateFlags f, bool val)
 
void addAttribute (ParticleAttribBase &pa)
 
ParticleAttribBasegetAttribute (attrib_container_t::size_type N)
 
attrib_container_t::size_type numAttributes () const
 
attrib_iterator begin ()
 
attrib_iterator end ()
 
void resetID ()
 
void createWithID (unsigned id)
 
void create (size_t)
 
void globalCreate (size_t np)
 
void destroy (size_t, size_t, bool=false)
 
size_t putMessage (Message &, size_t, size_t)
 
size_t putMessage (Message &, const std::vector< size_t > &)
 
size_t putMessage (Message &, size_t)
 
FormatgetFormat ()
 
size_t writeMsgBuffer (MsgBuffer *&, const std::vector< size_t > &)
 
template<class O >
size_t writeMsgBufferWithOffsets (MsgBuffer *&, const std::vector< size_t > &, const std::vector< O > &)
 
size_t readMsgBuffer (MsgBuffer *)
 
size_t readGhostMsgBuffer (MsgBuffer *, int)
 
size_t getMessage (Message &)
 
size_t getSingleMessage (Message &)
 
size_t getMessageAndCreate (Message &)
 
void performDestroy (bool updateLocalNum=false)
 
void sort (SortList_t &)
 
size_t ghostPutMessage (Message &, size_t, size_t)
 
size_t ghostPutMessage (Message &, const std::vector< size_t > &)
 
size_t ghostGetMessage (Message &, int)
 
size_t ghostGetSingleMessage (Message &, int)
 
void ghostDestroy (size_t, size_t)
 
void printDebug (Inform &)
 
- Public Member Functions inherited from DataSource
 DataSource ()
 
virtual ~DataSource ()
 
bool connected (DataConnect *=0) const
 
DataSourceObjectfindDataSourceObject (DataConnect *) const
 
DataConnectconnect (const char *, DataConnect *=0, int=DataSource::DEFAULT)
 
bool connect (DataSourceObject *)
 
bool disconnect (DataConnect *=0)
 
bool updateConnection (DataConnect *=0)
 
void interact (DataConnect *=0)
 
void interact (const char *, DataConnect *=0)
 
- Public Member Functions inherited from AbstractParticle< PLayout::Position_t, PLayout::Dimension >
 AbstractParticle ()
 
virtual ~AbstractParticle ()
 
virtual bool getUpdateFlag (UpdateFlags f) const =0
 
virtual void setUpdateFlag (UpdateFlags f, bool val)=0
 
virtual void setBConds (const ParticleBConds< Position_t, Dim > &bc)=0
 

Private Member Functions

template<class AType >
void AssignDensityFort (ParticleAttrib< AType > &pa, AmrScalarFieldContainer_t &mf_to_be_filled, int lev_min, int ncomp, int finest_level, const ParticleAttrib< int > &pbin, int bin=-1) const
 
template<class AType >
void InterpolateFort (ParticleAttrib< AType > &pa, AmrVectorFieldContainer_t &mesh_data, int lev_min, int lev_max)
 
template<class AType >
void InterpolateSingleLevelFort (ParticleAttrib< AType > &pa, AmrVectorField_t &mesh_data, int lev)
 
template<class AType >
void InterpolateMultiLevelFort (ParticleAttrib< AType > &pa, AmrVectorFieldContainer_t &mesh_data, int lev)
 
template<class AType >
void AssignCellDensitySingleLevelFort (ParticleAttrib< AType > &pa, AmrField_t &mf, int level, const ParticleAttrib< int > &pbin, int bin=-1, int ncomp=1, int particle_lvl_offset=0) const
 

Private Attributes

IpplTimings::TimerRef AssignDensityTimer_m
 

Additional Inherited Members

- Public Attributes inherited from AmrParticleBase< PLayout >
ParticleIndex_t Level
 
ParticleIndex_t Grid
 
- Public Attributes inherited from IpplParticleBase< PLayout >
unsigned int MIN_NUM_PART_PER_CORE
 
ParticlePos_t R
 
ParticleIndex_t ID
 
- Public Attributes inherited from AbstractParticle< PLayout::Position_t, PLayout::Dimension >
ParticlePos_tR_p
 
ParticleIndex_tID_p
 
- Protected Member Functions inherited from IpplParticleBase< PLayout >
virtual DataSourceObjectcreateDataSourceObject (const char *nm, DataConnect *dc, int tm)
 
- Protected Attributes inherited from AmrParticleBase< PLayout >
IpplTimings::TimerRef updateParticlesTimer_m
 
IpplTimings::TimerRef sortParticlesTimer_m
 
IpplTimings::TimerRef domainMappingTimer_m
 
bool forbidTransform_m
 To avoid multiple transformations during regrid. More...
 
double scale_m
 
Vector_t lorentzFactor_m
 
- Protected Attributes inherited from IpplParticleBase< PLayout >
std::vector< std::pair< size_t,
size_t > > 
DestroyList
 

Detailed Description

template<class PLayout>
class BoxLibParticle< PLayout >

Particle class for AMReX. It works together with BoxLibLayout.

Particle class that does the scatter and gather operations of attributes to and from grid. In contrast to Ippl where it is implemented in the attribute class, i.e. src/ippl/src/Particle/ParticleAttrib.h we do it in the particle class. This way Ippl does not need to be modified if another AMR framework is used.

Definition at line 23 of file BoxLibParticle.h.

Member Typedef Documentation

template<class PLayout >
typedef PLayout::AmrBox_t BoxLibParticle< PLayout >::AmrBox_t

Definition at line 40 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::AmrField_t BoxLibParticle< PLayout >::AmrField_t

Definition at line 29 of file BoxLibParticle.h.

template<class PLayout >
typedef PLayout::AmrGeometry_t BoxLibParticle< PLayout >::AmrGeometry_t

Definition at line 38 of file BoxLibParticle.h.

template<class PLayout >
typedef PLayout::AmrGrid_t BoxLibParticle< PLayout >::AmrGrid_t

Definition at line 37 of file BoxLibParticle.h.

template<class PLayout >
typedef PLayout::AmrIntVect_t BoxLibParticle< PLayout >::AmrIntVect_t

Definition at line 39 of file BoxLibParticle.h.

template<class PLayout >
typedef PLayout::AmrProcMap_t BoxLibParticle< PLayout >::AmrProcMap_t

Definition at line 36 of file BoxLibParticle.h.

template<class PLayout >
typedef PLayout::AmrReal_t BoxLibParticle< PLayout >::AmrReal_t

Definition at line 41 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::AmrScalarFieldContainer_t BoxLibParticle< PLayout >::AmrScalarFieldContainer_t

Definition at line 31 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::AmrVectorField_t BoxLibParticle< PLayout >::AmrVectorField_t

Definition at line 33 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::AmrVectorFieldContainer_t BoxLibParticle< PLayout >::AmrVectorFieldContainer_t

Definition at line 32 of file BoxLibParticle.h.

template<class PLayout >
typedef amrex::FArrayBox BoxLibParticle< PLayout >::FArrayBox_t

Definition at line 43 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::ParticleIndex_t BoxLibParticle< PLayout >::ParticleIndex_t

Definition at line 27 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::ParticleLevelCounter_t BoxLibParticle< PLayout >::ParticleLevelCounter_t

Definition at line 34 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::ParticlePos_t BoxLibParticle< PLayout >::ParticlePos_t

Definition at line 26 of file BoxLibParticle.h.

template<class PLayout >
typedef AmrParticleBase<PLayout>::SingleParticlePos_t BoxLibParticle< PLayout >::SingleParticlePos_t

Definition at line 28 of file BoxLibParticle.h.

Constructor & Destructor Documentation

template<class PLayout >
BoxLibParticle< PLayout >::BoxLibParticle ( )

Definition at line 13 of file BoxLibParticle.hpp.

References BoxLibParticle< PLayout >::AssignDensityTimer_m, and IpplTimings::getTimer().

Here is the call graph for this function:

template<class PLayout >
BoxLibParticle< PLayout >::BoxLibParticle ( PLayout *  layout)
Parameters
layoutthat does the particle-to-core management

Definition at line 20 of file BoxLibParticle.hpp.

References BoxLibParticle< PLayout >::AssignDensityTimer_m, and IpplTimings::getTimer().

Here is the call graph for this function:

Member Function Documentation

template<class PLayout >
template<class AType >
void BoxLibParticle< PLayout >::AssignCellDensitySingleLevelFort ( ParticleAttrib< AType > &  pa,
AmrField_t mf,
int  level,
const ParticleAttrib< int > &  pbin,
int  bin = -1,
int  ncomp = 1,
int  particle_lvl_offset = 0 
) const
private

Single-level scatter (adjusted from AMReX).

Parameters
pais the attribute to scatter onto the grid
mfwhere attribute is scatterd to
levelwhere we want to scatter
ncompis the number of the component in the MultiFab (ncomp = 1)
particle_lvl_offsetis zero

Definition at line 156 of file BoxLibParticle.hpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), and Attrib::Distribution::R.

Here is the call graph for this function:

template<class PLayout >
template<class AType >
void BoxLibParticle< PLayout >::AssignDensityFort ( ParticleAttrib< AType > &  pa,
AmrScalarFieldContainer_t mf_to_be_filled,
int  lev_min,
int  ncomp,
int  finest_level,
const ParticleAttrib< int > &  pbin,
int  bin = -1 
) const
private

Multi-level scatter (adjusted from AMReX).

Parameters
pais the attribute to scatter onto the grid
mf_to_be_filledis the MultiFab container to be filled (i.e. grid data)
lev_minlevel we want to start
ncompis the number of components of MultiFab (equal to 1)
finest_levellevel we want to end

Definition at line 94 of file BoxLibParticle.hpp.

References IpplTimings::startTimer(), and IpplTimings::stopTimer().

Here is the call graph for this function:

template<class PLayout >
template<class FT , unsigned Dim, class PT >
void BoxLibParticle< PLayout >::gather ( ParticleAttrib< FT > &  attrib,
AmrVectorFieldContainer_t f,
ParticleAttrib< Vektor< PT, Dim > > &  pp,
int  lbase,
int  lfine 
)

Multi-level gather. Gather the data from the given Field into the given attribute, using the given Position attribute.

Parameters
attribto gather from grid
fvector field on grid
ppparticle position (not used for AMReX call)
lbasebase level to gather from
lfinefinest level to gather from

Definition at line 82 of file BoxLibParticle.hpp.

Referenced by AmrBoxLib::computeSelfFields_cycl().

template<class PLayout >
template<class AType >
void BoxLibParticle< PLayout >::InterpolateFort ( ParticleAttrib< AType > &  pa,
AmrVectorFieldContainer_t mesh_data,
int  lev_min,
int  lev_max 
)
private

Multi-level gather (adjusted from AMReX).

Parameters
pais the attribute to gather to.
mesh_datawhere the information is
lev_minlevel to start
lev_maxlevel to end

Definition at line 278 of file BoxLibParticle.hpp.

template<class PLayout >
template<class AType >
void BoxLibParticle< PLayout >::InterpolateMultiLevelFort ( ParticleAttrib< AType > &  pa,
AmrVectorFieldContainer_t mesh_data,
int  lev 
)
private

Multi-level gather.

Parameters
pais the attribute to be updated
mesh_datawhere the information is taken from
levfor which we get the mesh data

Definition at line 386 of file BoxLibParticle.hpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), and Attrib::Distribution::R.

Here is the call graph for this function:

template<class PLayout >
template<class AType >
void BoxLibParticle< PLayout >::InterpolateSingleLevelFort ( ParticleAttrib< AType > &  pa,
AmrVectorField_t mesh_data,
int  lev 
)
private

Single-level gather (adjusted from AMReX).

Parameters
pais the attribute to be updated
mesh_datawhere the information is taken from
levfor which we get the mesh data

Definition at line 293 of file BoxLibParticle.hpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), AmrParticleLevelCounter< Key, T, Compare, Allocator >::end(), and Attrib::Distribution::R.

Here is the call graph for this function:

template<class PLayout >
template<class FT , unsigned Dim, class PT >
void BoxLibParticle< PLayout >::scatter ( ParticleAttrib< FT > &  attrib,
AmrScalarFieldContainer_t f,
ParticleAttrib< Vektor< PT, Dim > > &  pp,
int  lbase,
int  lfine,
const ParticleAttrib< int > &  pbin,
int  bin = -1 
)

Multi-level scatter. Scatter the data from the given attribute onto the given field, using the given position attribute. It calls the AMReX method.

Parameters
attribto scatter onto grid
ffield on grid
ppparticle position (not used for AMReX call)
lbasebase level we want to start
lfinefinest level we want to stop
pbinthe particle bin attribute
binto scatter (default: -1 –> scatter all particles)

Definition at line 28 of file BoxLibParticle.hpp.

References scatter().

Referenced by AmrBoxLib::computeSelfFields_cycl(), and AmrBoxLib::tagForChargeDensity_m().

Here is the call graph for this function:

template<class PLayout >
template<class FT , unsigned Dim, class PT >
void BoxLibParticle< PLayout >::scatter ( ParticleAttrib< FT > &  attrib,
AmrField_t f,
ParticleAttrib< Vektor< PT, Dim > > &  pp,
const ParticleAttrib< int > &  pbin,
int  bin = -1,
int  level = 0 
)

Single-level scatter. Scatter the data from the given attribute onto the given field, using the given position attribute. It calls the AMReX methods.

Parameters
attribto scatter onto grid
ffield on grid
ppparticle position (not used for AMReX call)
pbinthe particle bin attribute
binto scatter (default: -1 –> scatter all particles)
levelfor which we put particles onto the grid

Definition at line 61 of file BoxLibParticle.hpp.

Member Data Documentation

template<class PLayout >
IpplTimings::TimerRef BoxLibParticle< PLayout >::AssignDensityTimer_m
private

Definition at line 180 of file BoxLibParticle.h.

Referenced by BoxLibParticle< PLayout >::BoxLibParticle().


The documentation for this class was generated from the following files: