OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <AmrParticleBase.h>
Public Member Functions | |
AmrParticleBase () | |
AmrParticleBase (PLayout *layout) | |
~AmrParticleBase () | |
void | initializeAmr () |
const ParticleLevelCounter_t & | getLocalNumPerLevel () const |
ParticleLevelCounter_t & | getLocalNumPerLevel () |
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) |
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) |
ParticleAttribBase & | getAttribute (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) |
Format * | getFormat () |
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 |
DataSourceObject * | findDataSourceObject (DataConnect *) const |
DataConnect * | connect (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 void | setBConds (const ParticleBConds< Position_t, Dim > &bc)=0 |
Public Attributes | |
ParticleIndex_t | Level |
ParticleIndex_t | Grid |
Public Attributes inherited from IpplParticleBase< PLayout > | |
ParticlePos_t | R |
ParticleIndex_t | ID |
Public Attributes inherited from AbstractParticle< PLayout::Position_t, PLayout::Dimension > | |
ParticlePos_t * | R_p |
ParticleIndex_t * | ID_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 DataSourceObject * | createDataSourceObject (const char *nm, DataConnect *dc, int tm) |
Definition at line 46 of file AmrParticleBase.h.
typedef PLayout::AmrField_t AmrParticleBase< PLayout >::AmrField_t |
Definition at line 52 of file AmrParticleBase.h.
typedef PLayout::AmrScalarFieldContainer_t AmrParticleBase< PLayout >::AmrScalarFieldContainer_t |
Definition at line 54 of file AmrParticleBase.h.
typedef PLayout::AmrVectorField_t AmrParticleBase< PLayout >::AmrVectorField_t |
Definition at line 53 of file AmrParticleBase.h.
typedef PLayout::AmrVectorFieldContainer_t AmrParticleBase< PLayout >::AmrVectorFieldContainer_t |
Definition at line 55 of file AmrParticleBase.h.
typedef std::vector<ParticleAttribBase *> AmrParticleBase< PLayout >::attrib_container_t |
Definition at line 59 of file AmrParticleBase.h.
typedef PLayout::ParticleIndex_t AmrParticleBase< PLayout >::ParticleIndex_t |
Definition at line 50 of file AmrParticleBase.h.
typedef AmrParticleLevelCounter<size_t, size_t> AmrParticleBase< PLayout >::ParticleLevelCounter_t |
Definition at line 64 of file AmrParticleBase.h.
typedef PLayout::ParticlePos_t AmrParticleBase< PLayout >::ParticlePos_t |
Definition at line 49 of file AmrParticleBase.h.
typedef PLayout::SingleParticlePos_t AmrParticleBase< PLayout >::SingleParticlePos_t |
Definition at line 51 of file AmrParticleBase.h.
typedef std::vector<SortListIndex_t> AmrParticleBase< PLayout >::SortList_t |
Definition at line 58 of file AmrParticleBase.h.
typedef long AmrParticleBase< PLayout >::SortListIndex_t |
Definition at line 57 of file AmrParticleBase.h.
AmrParticleBase< PLayout >::AmrParticleBase |
Definition at line 43 of file AmrParticleBase.hpp.
References AmrParticleBase< PLayout >::domainMappingTimer_m, IpplTimings::getTimer(), AmrParticleBase< PLayout >::sortParticlesTimer_m, and AmrParticleBase< PLayout >::updateParticlesTimer_m.
AmrParticleBase< PLayout >::AmrParticleBase | ( | PLayout * | layout | ) |
Definition at line 56 of file AmrParticleBase.hpp.
References AmrParticleBase< PLayout >::domainMappingTimer_m, IpplTimings::getTimer(), AmrParticleBase< PLayout >::sortParticlesTimer_m, and AmrParticleBase< PLayout >::updateParticlesTimer_m.
|
inline |
Definition at line 72 of file AmrParticleBase.h.
|
virtual |
Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.
Definition at line 135 of file AmrParticleBase.hpp.
References IpplParticleBase< PLayout >::create().
|
virtual |
Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.
Definition at line 152 of file AmrParticleBase.hpp.
References IpplParticleBase< PLayout >::createWithID().
|
virtual |
Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.
Definition at line 95 of file AmrParticleBase.hpp.
References IpplParticleBase< PLayout >::destroy().
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.
PData | is the particle data |
inverse | is true if we want to do the inverse operation |
Definition at line 265 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().
|
inline |
Definition at line 125 of file AmrParticleBase.h.
References IpplParticleBase< PLayout >::getLayout().
Referenced by AmrPartBunch::set_meshEnlargement(), AmrPartBunch::setAmrDomainRatio(), and AmrYtWriter::writeBunch().
|
inline |
Definition at line 126 of file AmrParticleBase.h.
References IpplParticleBase< PLayout >::getLayout().
|
private |
Definition at line 370 of file AmrParticleBase.hpp.
References allreduce(), and min().
|
private |
Definition at line 349 of file AmrParticleBase.hpp.
References max(), and Attrib::Distribution::R.
AmrParticleBase< PLayout >::ParticleLevelCounter_t & AmrParticleBase< PLayout >::getLocalNumPerLevel |
Definition at line 80 of file AmrParticleBase.hpp.
const AmrParticleBase< PLayout >::ParticleLevelCounter_t & AmrParticleBase< PLayout >::getLocalNumPerLevel |
Definition at line 72 of file AmrParticleBase.hpp.
Referenced by AmrPartBunch::gatherLevelStatistics(), AmrBoxLib::postRegrid_m(), AmrBoxLib::tagForMaxNumParticles_m(), AmrBoxLib::tagForMinNumParticles_m(), AmrBoxLib::tagForMomenta_m(), AmrYtWriter::writeBunch(), and AmrYtWriter::writeParticles_m().
|
inline |
This function is used during the cell tagging routines.
Definition at line 338 of file AmrParticleBase.hpp.
Referenced by AmrPartBunch::get_hr(), and AmrBoxLib::tagForChargeDensity_m().
|
inline |
Definition at line 75 of file AmrParticleBase.h.
References IpplParticleBase< PLayout >::addAttribute().
|
inline |
Definition at line 259 of file AmrParticleBase.hpp.
Referenced by AmrPartBunch::boundp(), AmrPartBunch::do_binaryRepart(), and AmrBoxLib::initFineLevels().
|
virtual |
Implements AbstractParticle< PLayout::Position_t, PLayout::Dimension >.
Definition at line 110 of file AmrParticleBase.hpp.
References IpplParticleBase< PLayout >::performDestroy().
|
inline |
This method is used in the AmrPartBunch::boundp() function in order to avoid multpile particle mappings during the mesh regridding process.
forbidTransform | true if we don't want to map particles onto \([-1, 1]^3\) |
Definition at line 253 of file AmrParticleBase.hpp.
Referenced by AmrPartBunch::boundp(), AmrBoxLib::computeSelfFields_cycl(), AmrPartBunch::do_binaryRepart(), and AmrBoxLib::initFineLevels().
void AmrParticleBase< PLayout >::setLocalNumPerLevel | ( | const ParticleLevelCounter_t & | LocalNumPerLevel | ) |
Definition at line 87 of file AmrParticleBase.hpp.
void AmrParticleBase< PLayout >::setLorentzFactor | ( | const Vector_t & | lorentzFactor | ) |
Definition at line 343 of file AmrParticleBase.hpp.
Referenced by AmrPartBunch::updateLorentzFactor().
void AmrParticleBase< PLayout >::sort |
Definition at line 215 of file AmrParticleBase.hpp.
References IpplTimings::startTimer(), and IpplTimings::stopTimer().
void AmrParticleBase< PLayout >::sort | ( | SortList_t & | sortlist | ) |
Definition at line 244 of file AmrParticleBase.hpp.
References begin(), and end().
|
virtual |
Reimplemented from IpplParticleBase< PLayout >.
Definition at line 166 of file AmrParticleBase.hpp.
Referenced by AmrBoxLib::computeSelfFields_cycl(), AmrBoxLib::postRegrid_m(), AmrBoxLib::tagForChargeDensity_m(), AmrBoxLib::tagForMaxNumParticles_m(), AmrBoxLib::tagForMinNumParticles_m(), and AmrBoxLib::tagForMomenta_m().
|
virtual |
Reimplemented from IpplParticleBase< PLayout >.
Definition at line 194 of file AmrParticleBase.hpp.
References INCIPPLSTAT, PAssert, IpplTimings::startTimer(), and IpplTimings::stopTimer().
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.
lev_min | is the start level to update |
lev_max | is the last level to update |
isRegrid | is true if we are updating the grids (default: false) |
Definition at line 173 of file AmrParticleBase.hpp.
References INCIPPLSTAT, PAssert, IpplTimings::startTimer(), and IpplTimings::stopTimer().
|
protected |
Definition at line 173 of file AmrParticleBase.h.
Referenced by AmrParticleBase< PLayout >::AmrParticleBase().
|
protected |
To avoid multiple transformations during regrid.
Definition at line 175 of file AmrParticleBase.h.
ParticleIndex_t AmrParticleBase< PLayout >::Grid |
Definition at line 62 of file AmrParticleBase.h.
Referenced by AmrYtWriter::writeParticles_m().
ParticleIndex_t AmrParticleBase< PLayout >::Level |
Definition at line 61 of file AmrParticleBase.h.
|
private |
Definition at line 194 of file AmrParticleBase.h.
|
protected |
Lorentz factor used for the domain mapping. Is updated in AmrBoxLib
Definition at line 188 of file AmrParticleBase.h.
|
protected |
Scaling factor for particle coordinate transform (used for Poisson solve and particle-to-core distribution)
Definition at line 181 of file AmrParticleBase.h.
|
protected |
Definition at line 172 of file AmrParticleBase.h.
Referenced by AmrParticleBase< PLayout >::AmrParticleBase().
|
protected |
Definition at line 171 of file AmrParticleBase.h.
Referenced by AmrParticleBase< PLayout >::AmrParticleBase().