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

◆ ParticleData() [1/2]

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

Weak Constructor.

References ParticleData< P >::m_isDefined.

◆ ParticleData() [2/2]

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.

References ParticleData< P >::define().

Member Function Documentation

◆ define()

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 
)

◆ getBoxes()

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

◆ clear()

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

◆ numParticlesLocal()

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

◆ numParticles()

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(), ParticleData< P >::m_isDefined, ParticleData< P >::numParticlesLocal(), numProc(), and procID().

Referenced by ParticleData< P >::numParticlesLocal().

◆ numValidLocal()

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 LayoutData< ListBox< P > >::dataIterator(), ParticleData< P >::m_isDefined, ParticleData< P >::numValid(), and LayoutIterator::ok().

Referenced by ParticleData< P >::numValid().

◆ numValid()

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(), ParticleData< P >::m_isDefined, numProc(), ParticleData< P >::numValidLocal(), and procID().

Referenced by ParticleData< P >::numValidLocal().

◆ numOutcastLocal()

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.

References List< T >::length(), ParticleData< P >::m_isDefined, ParticleData< P >::m_outcast, and ParticleData< P >::numOutcast().

Referenced by ParticleData< P >::numOutcast().

◆ numOutcast()

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(), ParticleData< P >::m_isDefined, ParticleData< P >::numOutcastLocal(), numProc(), and procID().

Referenced by ParticleData< P >::numOutcastLocal().

◆ outcast()

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.

References ParticleData< P >::m_outcast.

◆ isClosed()

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

◆ physDomain()

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

Get the physical domain associated with this ParticleData.

References ParticleData< P >::m_physDomain.

◆ meshSpacing()

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

Get the mesh spacing associated with this ParticleData,.

References ParticleData< P >::m_meshSpacing.

◆ origin()

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

Get the origin of the coordinate system.

References ParticleData< P >::m_origin.

◆ fixedBoxSize()

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

Get the fixed Box size.

References ParticleData< P >::m_fixedBoxSize.

◆ gatherOutcast()

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

◆ remapOutcast()

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

◆ fillGhosts()

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

◆ isDefined()

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

◆ allocateVector()

template<class P >
void ParticleData< P >::allocateVector ( )
inlineprivate

◆ enforcePeriodic()

template<class P >
IntVect ParticleData< P >::enforcePeriodic ( const IntVect a_index) const
private

Member Data Documentation

◆ m_outcast

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

◆ m_physDomain

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

◆ m_meshSpacing

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

◆ m_origin

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

◆ m_fixedBoxSize

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

◆ m_factory

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

◆ m_isDefined

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

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