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

#include <AmrParticleBase.h>

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

Public Types

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

 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
 

Public Attributes

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 Attributes

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
 

Private Member Functions

void getLocalBounds_m (Vector_t &rmin, Vector_t &rmax)
 
void getGlobalBounds_m (Vector_t &rmin, Vector_t &rmax)
 

Private Attributes

ParticleLevelCounter_t LocalNumPerLevel_m
 

Additional Inherited Members

- Protected Member Functions inherited from IpplParticleBase< PLayout >
virtual DataSourceObjectcreateDataSourceObject (const char *nm, DataConnect *dc, int tm)
 

Detailed Description

template<class PLayout>
class AmrParticleBase< PLayout >

Definition at line 32 of file AmrParticleBase.h.

Member Typedef Documentation

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

Definition at line 38 of file AmrParticleBase.h.

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

Definition at line 40 of file AmrParticleBase.h.

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

Definition at line 39 of file AmrParticleBase.h.

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

Definition at line 41 of file AmrParticleBase.h.

template<class PLayout>
typedef std::vector<ParticleAttribBase *> AmrParticleBase< PLayout >::attrib_container_t

Definition at line 45 of file AmrParticleBase.h.

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

Definition at line 36 of file AmrParticleBase.h.

template<class PLayout>
typedef AmrParticleLevelCounter<size_t, size_t> AmrParticleBase< PLayout >::ParticleLevelCounter_t

Definition at line 50 of file AmrParticleBase.h.

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

Definition at line 35 of file AmrParticleBase.h.

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

Definition at line 37 of file AmrParticleBase.h.

template<class PLayout>
typedef std::vector<SortListIndex_t> AmrParticleBase< PLayout >::SortList_t

Definition at line 44 of file AmrParticleBase.h.

template<class PLayout>
typedef long AmrParticleBase< PLayout >::SortListIndex_t

Definition at line 43 of file AmrParticleBase.h.

Constructor & Destructor Documentation

template<class PLayout >
AmrParticleBase< PLayout >::AmrParticleBase ( )
template<class PLayout>
AmrParticleBase< PLayout >::AmrParticleBase ( PLayout *  layout)
template<class PLayout>
AmrParticleBase< PLayout >::~AmrParticleBase ( )
inline

Definition at line 58 of file AmrParticleBase.h.

Member Function Documentation

template<class PLayout >
void AmrParticleBase< PLayout >::create ( size_t  M)
virtual

Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.

Definition at line 100 of file AmrParticleBase.hpp.

References IpplParticleBase< PLayout >::create().

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::createWithID ( unsigned  id)
virtual

Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.

Definition at line 117 of file AmrParticleBase.hpp.

References IpplParticleBase< PLayout >::createWithID().

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::destroy ( size_t  M,
size_t  I,
bool  doNow = false 
)
virtual

Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.

Definition at line 60 of file AmrParticleBase.hpp.

References IpplParticleBase< PLayout >::destroy().

Here is the call graph for this function:

template<class PLayout >
const double & AmrParticleBase< PLayout >::domainMapping ( bool  inverse = false)

Linear mapping to AMReX computation domain [-1, 1]^3 including the Lorentz transform. All dimensions are mapped by the same scaling factor. The potential and electric field need to be scaled afterwards appropriately.

Parameters
PDatais the particle data
inverseis true if we want to do the inverse operation
Returns
scaling factor

Definition at line 230 of file AmrParticleBase.hpp.

References abs(), matheval::detail::math::isinf(), matheval::detail::math::isnan(), max(), IpplInfo::myNode(), Attrib::Distribution::R, IpplTimings::startTimer(), and IpplTimings::stopTimer().

Referenced by AmrPartBunch::boundp(), AmrBoxLib::computeSelfFields_cycl(), AmrPartBunch::do_binaryRepart(), and AmrBoxLib::initFineLevels().

Here is the call graph for this function:

template<class PLayout>
PLayout& AmrParticleBase< PLayout >::getAmrLayout ( )
inline

Definition at line 111 of file AmrParticleBase.h.

References IpplParticleBase< PLayout >::getLayout().

Referenced by AmrPartBunch::set_meshEnlargement(), AmrPartBunch::setAmrDomainRatio(), and AmrYtWriter::writeBunch().

Here is the call graph for this function:

template<class PLayout>
const PLayout& AmrParticleBase< PLayout >::getAmrLayout ( ) const
inline

Definition at line 112 of file AmrParticleBase.h.

References IpplParticleBase< PLayout >::getLayout().

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::getGlobalBounds_m ( Vector_t rmin,
Vector_t rmax 
)
private

Definition at line 335 of file AmrParticleBase.hpp.

References allreduce(), and min().

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::getLocalBounds_m ( Vector_t rmin,
Vector_t rmax 
)
private

Definition at line 314 of file AmrParticleBase.hpp.

References max(), and Attrib::Distribution::R.

Here is the call graph for this function:

template<class PLayout >
const AmrParticleBase< PLayout >::ParticleLevelCounter_t & AmrParticleBase< PLayout >::getLocalNumPerLevel ( ) const
template<class PLayout >
AmrParticleBase< PLayout >::ParticleLevelCounter_t & AmrParticleBase< PLayout >::getLocalNumPerLevel ( )

Definition at line 45 of file AmrParticleBase.hpp.

template<class PLayout >
const double & AmrParticleBase< PLayout >::getScalingFactor ( ) const
inline

This function is used during the cell tagging routines.

Returns
the scaling factor of the particle domain mapping.

Definition at line 303 of file AmrParticleBase.hpp.

Referenced by AmrPartBunch::get_hr(), and AmrBoxLib::tagForChargeDensity_m().

template<class PLayout>
void AmrParticleBase< PLayout >::initializeAmr ( )
inline

Definition at line 61 of file AmrParticleBase.h.

References IpplParticleBase< PLayout >::addAttribute(), AmrParticleBase< PLayout >::Grid, and AmrParticleBase< PLayout >::Level.

Referenced by AmrPartBunch::AmrPartBunch().

Here is the call graph for this function:

template<class PLayout >
bool AmrParticleBase< PLayout >::isForbidTransform ( ) const
inline
Returns
true if we are not mapping the particles onto \([-1, 1]^3\) during an update call.

Definition at line 224 of file AmrParticleBase.hpp.

Referenced by AmrPartBunch::boundp(), AmrPartBunch::do_binaryRepart(), and AmrBoxLib::initFineLevels().

template<class PLayout >
void AmrParticleBase< PLayout >::performDestroy ( bool  updateLocalNum = false)
virtual

Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.

Definition at line 75 of file AmrParticleBase.hpp.

References IpplParticleBase< PLayout >::performDestroy().

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::setForbidTransform ( bool  forbidTransform)
inline

This method is used in the AmrPartBunch::boundp() function in order to avoid multpile particle mappings during the mesh regridding process.

Parameters
forbidTransformtrue if we don't want to map particles onto \([-1, 1]^3\)

Definition at line 218 of file AmrParticleBase.hpp.

Referenced by AmrPartBunch::boundp(), AmrBoxLib::computeSelfFields_cycl(), AmrPartBunch::do_binaryRepart(), and AmrBoxLib::initFineLevels().

template<class PLayout >
void AmrParticleBase< PLayout >::setLocalNumPerLevel ( const ParticleLevelCounter_t LocalNumPerLevel)

Definition at line 52 of file AmrParticleBase.hpp.

template<class PLayout >
void AmrParticleBase< PLayout >::setLorentzFactor ( const Vector_t lorentzFactor)

Definition at line 308 of file AmrParticleBase.hpp.

Referenced by AmrPartBunch::updateLorentzFactor().

template<class PLayout >
void AmrParticleBase< PLayout >::sort ( )

Definition at line 180 of file AmrParticleBase.hpp.

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

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::sort ( SortList_t sortlist)

Definition at line 209 of file AmrParticleBase.hpp.

template<class PLayout >
void AmrParticleBase< PLayout >::update ( )
virtual
template<class PLayout >
void AmrParticleBase< PLayout >::update ( int  lev_min,
int  lev_max,
bool  isRegrid = false 
)

There's is NO check performed if lev_min <= lev_max and lev_min >= 0.

Parameters
lev_minis the start level to update
lev_maxis the last level to update
isRegridis true if we are updating the grids (default: false)

Definition at line 138 of file AmrParticleBase.hpp.

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

Here is the call graph for this function:

template<class PLayout >
void AmrParticleBase< PLayout >::update ( const ParticleAttrib< char > &  canSwap)
virtual

Reimplemented from IpplParticleBase< PLayout >.

Definition at line 159 of file AmrParticleBase.hpp.

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

Here is the call graph for this function:

Member Data Documentation

template<class PLayout>
IpplTimings::TimerRef AmrParticleBase< PLayout >::domainMappingTimer_m
protected

Definition at line 159 of file AmrParticleBase.h.

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

template<class PLayout>
bool AmrParticleBase< PLayout >::forbidTransform_m
protected

To avoid multiple transformations during regrid.

Definition at line 161 of file AmrParticleBase.h.

template<class PLayout>
ParticleIndex_t AmrParticleBase< PLayout >::Grid
template<class PLayout>
ParticleIndex_t AmrParticleBase< PLayout >::Level

Definition at line 47 of file AmrParticleBase.h.

Referenced by AmrParticleBase< PLayout >::initializeAmr().

template<class PLayout>
ParticleLevelCounter_t AmrParticleBase< PLayout >::LocalNumPerLevel_m
private

Definition at line 180 of file AmrParticleBase.h.

template<class PLayout>
Vector_t AmrParticleBase< PLayout >::lorentzFactor_m
protected

Lorentz factor used for the domain mapping. Is updated in AmrBoxLib

Definition at line 174 of file AmrParticleBase.h.

template<class PLayout>
double AmrParticleBase< PLayout >::scale_m
protected

Scaling factor for particle coordinate transform (used for Poisson solve and particle-to-core distribution)

Definition at line 167 of file AmrParticleBase.h.

template<class PLayout>
IpplTimings::TimerRef AmrParticleBase< PLayout >::sortParticlesTimer_m
protected

Definition at line 158 of file AmrParticleBase.h.

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

template<class PLayout>
IpplTimings::TimerRef AmrParticleBase< PLayout >::updateParticlesTimer_m
protected

Definition at line 157 of file AmrParticleBase.h.

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


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