Chombo + EB + MF
3.2
|
#include <ParticleData.H>
Public Member Functions | |
ParticleData () | |
Weak Constructor. More... | |
ParticleData (const BoxLayout &a_dp, const ProblemDomain &a_domain, const int &a_fixedBoxSize, const RealVect &a_meshSpacing, const RealVect &a_origin) | |
void | define (const BoxLayout &a_dp, const ProblemDomain &a_domain, const int &a_fixedBoxSize, const RealVect &a_meshSpacing, const RealVect &a_origin) |
Define function. Same as the full constructor. More... | |
const BoxLayout & | getBoxes () const |
Get the BoxLayout on which this ParticleData. More... | |
void | clear () |
Removes all the items from all the boxes in the container. More... | |
size_t | numParticlesLocal () const |
Return the number of particles in the container, outcast and valid. More... | |
size_t | numParticles () const |
size_t | numValidLocal () const |
Return the number of valid particles in the container, not counting outcasts. More... | |
size_t | numValid () const |
size_t | numOutcastLocal () const |
Return the number of particles in the outcast list. More... | |
size_t | numOutcast () const |
List< P > & | outcast () |
bool | isClosed () const |
Is this ParticleData. More... | |
const ProblemDomain & | physDomain () const |
Get the physical domain associated with this ParticleData. More... | |
const RealVect & | meshSpacing () const |
Get the mesh spacing associated with this ParticleData,. More... | |
const RealVect & | origin () const |
Get the origin of the coordinate system. More... | |
const int & | fixedBoxSize () const |
Get the fixed Box size. More... | |
void | gatherOutcast () |
void | remapOutcast () |
void | fillGhosts (ParticleData< P > &a_particlesWithGhosts, const int a_numGhost) const |
bool | isDefined () const |
Public Member Functions inherited from LayoutData< ListBox< P > > | |
LayoutData () | |
LayoutData (const BoxLayout &a_dp) | |
virtual | ~LayoutData () |
virtual void | define (const BoxLayout &a_dp) |
DataIterator | dataIterator () const |
TimedDataIterator | timedDataIterator () const |
const ListBox< P > & | operator[] (const DataIndex &a_index) const |
const accessor function More... | |
const ListBox< P > & | operator[] (const DataIterator &a_iterator) const |
const accessor function More... | |
ListBox< P > & | operator[] (const DataIndex &a_index) |
non-const accessor function More... | |
ListBox< P > & | operator[] (const DataIterator &a_iterator) |
non-const accessor function More... | |
Box | box (const DataIndex &a_index) const |
Box | box (const DataIterator &a_iterator) const |
const BoxLayout & | boxLayout () const |
Private Member Functions | |
void | allocateVector () |
IntVect | enforcePeriodic (const IntVect &a_index) const |
Private Attributes | |
List< P > | m_outcast |
ProblemDomain | m_physDomain |
RealVect | m_meshSpacing |
RealVect | m_origin |
int | m_fixedBoxSize |
ListBoxFactory< P > | m_factory |
bool | m_isDefined |
Additional Inherited Members | |
Protected Attributes inherited from LayoutData< ListBox< P > > | |
BoxLayout | m_boxLayout |
Vector< ListBox< P > *> | m_vector |
bool | m_callDelete |
This is a class for holding and sorting particle items. Class <T> must have a RealVect
<T>::position() const function which is used to assign the item in a list. See class BinItem
for a base class for particles.
ParticleData< P >::ParticleData | ( | ) |
Weak Constructor.
References ParticleData< P >::m_isDefined.
ParticleData< P >::ParticleData | ( | const BoxLayout & | a_dp, |
const ProblemDomain & | a_domain, | ||
const int & | a_fixedBoxSize, | ||
const RealVect & | a_meshSpacing, | ||
const RealVect & | a_origin | ||
) |
Full Constructor. Arguments:
a_dp: The BoxLayout on which the particle data will be defined. Note that this must be a 'fixed size' layout. a_fixedBoxSize: The (fixed) box size in cells. a_domain: the problem domain, used for enforcing periodic boundary conditions. a_meshSpacing: the physical mesh spacing, used for binning the particles. a_origin: the origin of the coordinate system, also for particle binning.
References ParticleData< P >::define().
void ParticleData< P >::define | ( | const BoxLayout & | a_dp, |
const ProblemDomain & | a_domain, | ||
const int & | a_fixedBoxSize, | ||
const RealVect & | a_meshSpacing, | ||
const RealVect & | a_origin | ||
) |
Define function. Same as the full constructor.
References ParticleData< P >::allocateVector(), ListBoxFactory< T >::define(), ParticleData< P >::m_factory, ParticleData< P >::m_fixedBoxSize, ParticleData< P >::m_isDefined, ParticleData< P >::m_meshSpacing, ParticleData< P >::m_origin, and ParticleData< P >::m_physDomain.
Referenced by ParticleData< P >::ParticleData().
const BoxLayout & ParticleData< P >::getBoxes | ( | ) | const |
Get the BoxLayout on which this ParticleData.
is defined.
References LayoutData< ListBox< P > >::boxLayout().
Referenced by collectValidParticles(), ParticleBC::enforcePeriodic(), ParticleData< P >::fillGhosts(), ParticleData< P >::gatherOutcast(), readParticlesFromHDF(), ParticleData< P >::remapOutcast(), and writeParticlesToHDF().
void ParticleData< P >::clear | ( | ) |
Removes all the items from all the boxes in the container.
References List< T >::clear(), LayoutData< ListBox< P > >::dataIterator(), ParticleData< P >::m_isDefined, ParticleData< P >::m_outcast, and LayoutIterator::ok().
size_t ParticleData< P >::numParticlesLocal | ( | ) | const |
Return the number of particles in the container, outcast and valid.
returns the total number of particles in all the boxes it owns.
References LayoutData< ListBox< P > >::dataIterator(), List< T >::length(), ParticleData< P >::m_isDefined, ParticleData< P >::m_outcast, ParticleData< P >::numParticles(), and LayoutIterator::ok().
Referenced by ParticleData< P >::numParticles().
size_t ParticleData< P >::numParticles | ( | ) | const |
Return the number of particles in the container, outcast and valid. This version does a parallel reduce to count all the particles on all processes.
References broadcast(), gather(), ParticleData< P >::m_isDefined, ParticleData< P >::numParticlesLocal(), numProc(), and procID().
Referenced by ParticleData< P >::numParticlesLocal().
size_t ParticleData< P >::numValidLocal | ( | ) | const |
Return the number of valid particles in the container, not counting outcasts.
returns the total number of particles in all the boxes it owns.
References LayoutData< ListBox< P > >::dataIterator(), ParticleData< P >::m_isDefined, ParticleData< P >::numValid(), and LayoutIterator::ok().
Referenced by ParticleData< P >::numValid().
size_t ParticleData< P >::numValid | ( | ) | const |
Return the number of valid particles in the container, not counting outcasts. This version does a parallel reduce to count all the particles on all processes.
References broadcast(), gather(), ParticleData< P >::m_isDefined, numProc(), ParticleData< P >::numValidLocal(), and procID().
Referenced by ParticleData< P >::numValidLocal().
size_t ParticleData< P >::numOutcastLocal | ( | ) | const |
Return the number of particles in the outcast list.
returns the total number of outcasts it owns.
References List< T >::length(), ParticleData< P >::m_isDefined, ParticleData< P >::m_outcast, and ParticleData< P >::numOutcast().
Referenced by ParticleData< P >::numOutcast().
size_t ParticleData< P >::numOutcast | ( | ) | const |
Return the number of particles in the outcast list. This version does a parallel reduce to count all the outcasts on all processes.
References broadcast(), gather(), ParticleData< P >::m_isDefined, ParticleData< P >::numOutcastLocal(), numProc(), and procID().
Referenced by ParticleData< P >::numOutcastLocal().
List< P > & ParticleData< P >::outcast | ( | ) |
Return a reference to the list of "outcast" particles - a list with particles not currently associated with any box in the container.
References ParticleData< P >::m_outcast.
bool ParticleData< P >::isClosed | ( | ) | const |
Is this ParticleData.
closed - i.e. is the outcast list empty?
References List< T >::isEmpty(), and ParticleData< P >::m_outcast.
const ProblemDomain & ParticleData< P >::physDomain | ( | ) | const |
Get the physical domain associated with this ParticleData.
References ParticleData< P >::m_physDomain.
const RealVect & ParticleData< P >::meshSpacing | ( | ) | const |
Get the mesh spacing associated with this ParticleData,.
References ParticleData< P >::m_meshSpacing.
const RealVect & ParticleData< P >::origin | ( | ) | const |
Get the origin of the coordinate system.
References ParticleData< P >::m_origin.
const int & ParticleData< P >::fixedBoxSize | ( | ) | const |
Get the fixed Box size.
References ParticleData< P >::m_fixedBoxSize.
void ParticleData< P >::gatherOutcast | ( | ) |
After the particles have moved, they might not still belong in the same ListBox they started in. This function collects all the particles that are no longer in the right box and puts them in the outcast list.
References ParticleData< P >::getBoxes(), ParticleData< P >::m_outcast, and LayoutIterator::ok().
void ParticleData< P >::remapOutcast | ( | ) |
Redistribute the particles in the outcast list onto the proper box and process.
References CH_TIMERS, coarsen(), ParticleData< P >::getBoxes(), BoxLayout::index(), List< T >::isEmpty(), BoxLayout::layoutIterator(), locateBin(), ParticleData< P >::m_fixedBoxSize, ParticleData< P >::m_meshSpacing, ParticleData< P >::m_origin, ParticleData< P >::m_outcast, myrotate(), numProc(), LayoutIterator::ok(), ListIterator< T >::ok(), procID(), BoxLayout::procID(), and Box::smallEnd().
void ParticleData< P >::fillGhosts | ( | ParticleData< P > & | a_particlesWithGhosts, |
const int | a_numGhost | ||
) | const |
Routine for filling ghost particles. This function will augment each ListBox in a_particlesWithGhosts with copies of all the particles that lie within a_numGhost cells of the box boundaries. If the problem domain used to define this ParticleData is periodic, then ghost particles will be grabbed from the opposite sides of the domain as well. Ghost particles that are copied from accross periodic boundaries in this fashion will have their position coordinates periodically shifted such that computing the distance between them and the "valid" particles will return the shortest distance defined on the periodic domain.
Arguments: a_particlesWithGhost: this is a ParticleData built on a BoxLayout like this one, except that each box has been grown by a_numGhosts cells. On exit, each ListBox in a_particlesWithGhost will contain both "valid" and "ghost" particls. a_numGhost the number of ghost cells to fill
References Box::bigEnd(), List< T >::catenate(), CH_TIMERS, coarsen(), D_DECL6, D_TERM6, BoxLayout::dataIterator(), ProblemDomain::domainBox(), ParticleData< P >::enforcePeriodic(), ParticleData< P >::getBoxes(), ListBox< T >::getInvalid(), grow(), BoxLayout::index(), ParticleData< P >::isDefined(), BoxLayout::layoutIterator(), locateBin(), ParticleData< P >::m_fixedBoxSize, ParticleData< P >::m_isDefined, ParticleData< P >::m_meshSpacing, ParticleData< P >::m_origin, ParticleData< P >::m_physDomain, numProc(), LayoutIterator::ok(), ListIterator< T >::ok(), procID(), BoxLayout::procID(), Box::smallEnd(), SpaceDim, and IntVect::Unit.
bool ParticleData< P >::isDefined | ( | ) | const |
Referenced by ParticleData< P >::fillGhosts().
|
inlineprivate |
References LayoutData< ListBox< P > >::box(), DataFactory< T >::callDelete(), ListBoxFactory< T >::create(), LayoutData< ListBox< P > >::dataIterator(), MayDay::Error(), LayoutData< ListBox< P > >::m_callDelete, ParticleData< P >::m_factory, LayoutData< ListBox< P > >::m_vector, Vector< T >::resize(), Vector< T >::size(), and DataIterator::size().
Referenced by ParticleData< P >::define().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by ParticleData< P >::allocateVector(), and ParticleData< P >::define().
|
private |
Referenced by ParticleData< P >::clear(), ParticleData< P >::define(), ParticleData< P >::fillGhosts(), ParticleData< P >::numOutcast(), ParticleData< P >::numOutcastLocal(), ParticleData< P >::numParticles(), ParticleData< P >::numParticlesLocal(), ParticleData< P >::numValid(), ParticleData< P >::numValidLocal(), and ParticleData< P >::ParticleData().