Chombo + EB + MF  3.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ParticleData< P > Class Template Reference

#include <ParticleData.H>

Inheritance diagram for ParticleData< P >:
Inheritance graph
[legend]

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 BoxLayoutgetBoxes () 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 ProblemDomainphysDomain () const
 Get the physical domain associated with this ParticleData. More...
 
const RealVectmeshSpacing () const
 Get the mesh spacing associated with this ParticleData,. More...
 
const RealVectorigin () 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 BoxLayoutboxLayout () 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
 

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.

Constructor & Destructor Documentation

template<class P >
ParticleData< P >::ParticleData ( )

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 
)

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.

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 
)

Define function. Same as the full constructor.

template<class P >
const BoxLayout & ParticleData< P >::getBoxes ( ) const
template<class P >
void ParticleData< P >::clear ( )

Removes all the items from all the boxes in the container.

References LayoutIterator::ok().

template<class P >
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 LayoutIterator::ok().

template<class P >
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(), numProc(), and procID().

template<class P >
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 LayoutIterator::ok().

template<class P >
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(), numProc(), and procID().

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

Return the number of particles in the outcast list.

returns the total number of outcasts it owns.

template<class P >
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(), numProc(), and procID().

template<class P >
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.

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

Is this ParticleData.

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

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

Get the physical domain associated with this ParticleData.

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

Get the mesh spacing associated with this ParticleData,.

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

Get the origin of the coordinate system.

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

Get the fixed Box size.

template<class P >
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 getBoxes(), and LayoutIterator::ok().

template<class P >
void ParticleData< P >::remapOutcast ( )
template<class P >
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(), getBoxes(), ParticleData< P >::getBoxes(), ListBox< T >::getInvalid(), grow(), BoxLayout::index(), ParticleData< P >::isDefined(), BoxLayout::layoutIterator(), locateBin(), numProc(), LayoutIterator::ok(), ListIterator< T >::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 ( )
inlineprivate
template<class P >
IntVect ParticleData< P >::enforcePeriodic ( const IntVect a_index) const
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: