ParticleData< P > Class Template Reference

#include <ParticleData.H>

Inheritance diagram for ParticleData< P >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class P>
class ParticleData< P >

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.

Public Member Functions

 ParticleData ()
 Weak Constructor.
 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.
const BoxLayoutgetBoxes () const
 Get the BoxLayout on which this ParticleData.
void clear ()
 Removes all the items from all the boxes in the container.
size_t numParticlesLocal () const
 Return the number of particles in the container, outcast and valid.
size_t numParticles () const
size_t numValidLocal () const
 Return the number of valid particles in the container, not counting outcasts.
size_t numValid () const
size_t numOutcastLocal () const
 Return the number of particles in the outcast list.
size_t numOutcast () const
List< P > & outcast ()
bool isClosed () const
 Is this ParticleData.
const ProblemDomainphysDomain () const
 Get the physical domain associated with this ParticleData.
const RealVectmeshSpacing () const
 Get the mesh spacing associated with this ParticleData,.
const RealVectorigin () const
 Get the origin of the coordinate system.
const int & fixedBoxSize () const
 Get the fixed Box size.
void gatherOutcast ()
void remapOutcast ()
void fillGhosts (ParticleData< P > &a_particlesWithGhosts, const int a_numGhost) const
bool isDefined () 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

Constructor & Destructor Documentation

template<class P>
ParticleData< P >::ParticleData (  )  [inline]

Weak Constructor.

References ParticleData< P >::m_isDefined.

template<class P>
ParticleData< P >::ParticleData ( const BoxLayout a_dp,
const ProblemDomain a_domain,
const int &  a_fixedBoxSize,
const RealVect a_meshSpacing,
const RealVect a_origin 
) [inline]

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().


Member Function Documentation

template<class P>
void ParticleData< P >::define ( const BoxLayout a_dp,
const ProblemDomain a_domain,
const int &  a_fixedBoxSize,
const RealVect a_meshSpacing,
const RealVect a_origin 
) [inline]

template<class P>
const BoxLayout & ParticleData< P >::getBoxes (  )  const [inline]

template<class P>
void ParticleData< P >::clear (  )  [inline]

template<class P>
size_t ParticleData< P >::numParticlesLocal (  )  const [inline]

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().

template<class P>
size_t ParticleData< P >::numParticles (  )  const [inline]

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().

template<class P>
size_t ParticleData< P >::numValidLocal (  )  const [inline]

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().

template<class P>
size_t ParticleData< P >::numValid (  )  const [inline]

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().

template<class P>
size_t ParticleData< P >::numOutcastLocal (  )  const [inline]

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().

template<class P>
size_t ParticleData< P >::numOutcast (  )  const [inline]

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().

template<class P>
List< P > & ParticleData< P >::outcast (  )  [inline]

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.

template<class P>
bool ParticleData< P >::isClosed (  )  const [inline]

Is this ParticleData.

closed - i.e. is the outcast list empty?

References List< T >::isEmpty(), and ParticleData< P >::m_outcast.

template<class P>
const ProblemDomain & ParticleData< P >::physDomain (  )  const [inline]

Get the physical domain associated with this ParticleData.

References ParticleData< P >::m_physDomain.

template<class P>
const RealVect & ParticleData< P >::meshSpacing (  )  const [inline]

Get the mesh spacing associated with this ParticleData,.

References ParticleData< P >::m_meshSpacing.

template<class P>
const RealVect & ParticleData< P >::origin (  )  const [inline]

Get the origin of the coordinate system.

References ParticleData< P >::m_origin.

template<class P>
const int & ParticleData< P >::fixedBoxSize (  )  const [inline]

Get the fixed Box size.

References ParticleData< P >::m_fixedBoxSize.

template<class P>
void ParticleData< P >::gatherOutcast (  )  [inline]

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(), and ParticleData< P >::m_outcast.

template<class P>
void ParticleData< P >::remapOutcast (  )  [inline]

template<class P>
void ParticleData< P >::fillGhosts ( ParticleData< P > &  a_particlesWithGhosts,
const int  a_numGhost 
) const [inline]

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(), 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(), procID(), BoxLayout::procID(), Box::smallEnd(), SpaceDim, and IntVect::Unit.

template<class P>
bool ParticleData< P >::isDefined (  )  const

template<class P>
void ParticleData< P >::allocateVector (  )  [inline, private]

template<class P>
IntVect ParticleData< P >::enforcePeriodic ( const IntVect a_index  )  const [inline, private]


Member Data Documentation

template<class P>
List<P> ParticleData< P >::m_outcast [private]

template<class P>
ProblemDomain ParticleData< P >::m_physDomain [private]

template<class P>
RealVect ParticleData< P >::m_meshSpacing [private]

template<class P>
RealVect ParticleData< P >::m_origin [private]

template<class P>
int ParticleData< P >::m_fixedBoxSize [private]

template<class P>
ListBoxFactory<P> ParticleData< P >::m_factory [private]

template<class P>
bool ParticleData< P >::m_isDefined [private]


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

Generated on Fri Mar 24 03:27:22 2017 for Chombo + EB + MF by  doxygen 1.5.5