Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

BinFab< T > Class Template Reference

Base class for particle data on a Box. More...

#include <BinFab.H>

Inheritance diagram for BinFab< T >:

Inheritance graph
[legend]
Collaboration diagram for BinFab< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BinFab ()
 Null constructor, copy constructor and operator= can be compiler defined.

 BinFab (const Box &a_domain, const RealVect &a_mesh_spacing, const RealVect &a_origin, const ProblemDomain &a_probdomain)
 Constructs an empty BinFab on a_domain.

 BinFab (const BinFab &a_binfab)
 Copy constructor.

virtual ~BinFab ()
 Destructor.

virtual void define (const Box &a_domain, const RealVect &a_mesh_spacing, const RealVect &a_origin, const ProblemDomain &a_probdomain)
 Same as the constructor.

virtual void reBin ()
 Sort all the items into the appropriate bins.

virtual void addItem (const T &a_item)
 Copy one item into the appropriate bin.

virtual void addItems (const List< T > &a_list)
 Copy a list of items into the appropriate bins.

virtual void addItemsDestructive (List< T > &a_list)
 Move items off the argument list and into the appropriate bins.

virtual void addItemsDestructive (List< T > &a_list,const Box &a_valid, bool a_in=true)
 Move items into the appropriate bins and remove from the arg list only if the dest is in the Box.

virtual void clear ()
 Delete all the items in this BinFab and reset it to the null Box.

virtual int numItems (const Box &a_box=Box(), const Interval &a_comps=Interval()) const
 Count the number of items in this BinFab.

virtual int size (const Box &a_box, const Interval &a_comps) const
 The number of bytes used by linearIn()/linearOut().

virtual void linearOut (void *a_buf, const Box &a_box, const Interval &a_comps) const
 Write a serialized (packed) representation into a_buf.

virtual void linearIn (void *a_buf, const Box &a_box, const Interval &a_comps)
 Extract a serialized (packed) representation from a_buf.


Static Public Member Functions

int preAllocatable ()

Protected Member Functions

IntVect locateBin (const T &a_item) const
 compute the cell index containing the physical position of the item


Protected Attributes

RealVect m_origin
 location in physical space of the 0 index

RealVect m_mesh_spacing
 cell size in physical space

ProblemDomain m_probdomain
 contains the Box on which this BinFab is defined


Detailed Description

template<class T>
class BinFab< T >

Base class for particle data on a Box.

This is a class for holding and sorting particle items. Class must have a RealVect ::position() const function which is used to place the item in an appropriate bin. See class BinItem for a base class for particles. All BinFabs are assumed to have 1 component.


Constructor & Destructor Documentation

template<class T>
BinFab< T >::BinFab  ) 
 

Null constructor, copy constructor and operator= can be compiler defined.

template<class T>
BinFab< T >::BinFab const Box a_domain,
const RealVect a_mesh_spacing,
const RealVect a_origin,
const ProblemDomain a_probdomain
 

Constructs an empty BinFab on a_domain.

template<class T>
BinFab< T >::BinFab const BinFab< T > &  a_binfab  ) 
 

Copy constructor.

template<class T>
BinFab< T >::~BinFab  )  [virtual]
 

Destructor.


Member Function Documentation

template<class T>
void BinFab< T >::addItem const T &  a_item  )  [virtual]
 

Copy one item into the appropriate bin.

template<class T>
void BinFab< T >::addItems const List< T > &  a_list  )  [virtual]
 

Copy a list of items into the appropriate bins.

template<class T>
void BinFab< T >::addItemsDestructive List< T > &  a_List,
const Box a_valid,
bool  a_in = true
[virtual]
 

Move items into the appropriate bins and remove from the arg list only if the dest is in the Box.

If the destination cell is in the specified box (on not in if a_in is false) then remove the particle from the argument List, else copy it.

template<class T>
void BinFab< T >::addItemsDestructive List< T > &  a_list  )  [virtual]
 

Move items off the argument list and into the appropriate bins.

template<class T>
void BinFab< T >::clear  )  [virtual]
 

Delete all the items in this BinFab and reset it to the null Box.

Reimplemented from BaseFab< List< T > >.

template<class T>
void BinFab< T >::define const Box a_domain,
const RealVect a_mesh_spacing,
const RealVect a_origin,
const ProblemDomain a_probdomain
[virtual]
 

Same as the constructor.

template<class T>
void BinFab< T >::linearIn void *  a_buf,
const Box a_box,
const Interval a_comps
[virtual]
 

Extract a serialized (packed) representation from a_buf.

Given a linear representation of the class data previously made using linearIn() in a_buf, set the data for this class on the specified Box.

Reimplemented from BaseFab< List< T > >.

template<class T>
void BinFab< T >::linearOut void *  a_buf,
const Box a_box,
const Interval a_comps
const [virtual]
 

Write a serialized (packed) representation into a_buf.

Write a linear representation of the items in the specified Box. Assumes that sufficient memory for the buffer has already been allocated by the caller.

Reimplemented from BaseFab< List< T > >.

template<class T>
IntVect BinFab< T >::locateBin const T &  a_item  )  const [inline, protected]
 

compute the cell index containing the physical position of the item

template<class T>
int BinFab< T >::numItems const Box a_box = Box(),
const Interval a_comps = Interval()
const [virtual]
 

Count the number of items in this BinFab.

The default is to do the whole Fab for all components. This is slow, so use it sparingly.

template<class T>
int BinFab< T >::preAllocatable  )  [inline, static]
 

Reimplemented from BaseFab< List< T > >.

template<class T>
void BinFab< T >::reBin  )  [virtual]
 

Sort all the items into the appropriate bins.

template<class T>
int BinFab< T >::size const Box a_box,
const Interval a_comps
const [virtual]
 

The number of bytes used by linearIn()/linearOut().

Returns the size, in number of bytes, of a flat linear representation of the items in the specified Box.

Reimplemented from BaseFab< List< T > >.


Member Data Documentation

template<class T>
RealVect BinFab< T >::m_mesh_spacing [protected]
 

cell size in physical space

template<class T>
RealVect BinFab< T >::m_origin [protected]
 

location in physical space of the 0 index

template<class T>
ProblemDomain BinFab< T >::m_probdomain [protected]
 

contains the Box on which this BinFab is defined


The documentation for this class was generated from the following files:
Generated on Wed Jun 2 13:58:17 2004 for Chombo&INSwithParticles by doxygen 1.3.2