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 Methods

 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)
 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)
 Same as the constructor.

virtual void reBin ()
 Sort all the items into the appropriate bins, losing items not in the FAB's domain.

virtual void reBin (List< T > &a_lost, const Box &a_valid=Box(), bool a_in=true)
 Sort all the items into the appropriate bins and return items in (or not in) the Box.

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

virtual void addItem (const T &a_item, const IntVect &a_bin)
 Copy one item into the specified bin.

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

virtual void addItemsDestructive (List< T > &a_list)
 Copy items into the appropriate bins and remove them from the List.

virtual void addItemsDestructive (List< T > &a_list, const Box &a_valid, bool a_in=true)
 Copy items into the appropriate bins. Remove items that are in (or not in) the Box from the List.

virtual void transfer (BinFab< T > &a_src, const Box &a_srcBox, const Box &a_destBox)
 Move particles from a BinFab to the overlapping cells in this one.

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
 Count the number of items in this BinFab in the specified Box.

virtual RealVect meshSpacing () const
 Retrieve the mesh cell size, in physical coordinates.

virtual void meshSpacing (const RealVect &a_mesh_spacing)
 Set the mesh cell size, in physical coordinates.

RealVect origin () const
 Retrieve the physical coordinates of the lower corner of cell zero.

void origin (const RealVect &a_origin)
 Set the physical coordinates of the lower corner of cell zero.

virtual int size (const Box &a_box, const Interval &a_comps=Interval(0, 0)) 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 linearOutDestructive (void *buf, const Box &a_box, const Interval &a_comps=Interval(0, 0))
 Write a serialized (packed) representation into a_buf and remove from *this.

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

const int * size () const
 Should be inherited from BaseFab but it isn't, sigh; code is the same.


Static Public Methods

int preAllocatable ()

Protected Methods

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


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 <T> must have a RealVect <T>::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
 

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,
const IntVect   a_bin
[virtual]
 

Copy one item into the specified bin.

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 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]
 

Copy items into the appropriate bins. Remove items that are in (or not in) the Box from the List.

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

Copy items into the appropriate bins and remove them from the List.

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
[virtual]
 

Same as the constructor.

template<class T>
void BinFab< T >::linearIn void *    a_buf,
const Box   a_box,
const Interval   a_comps = Interval(0, 0)
[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>
void BinFab< T >::linearOutDestructive void *    buf,
const Box   a_box,
const Interval   a_comps = Interval(0, 0)
[virtual]
 

Write a serialized (packed) representation into a_buf and remove from *this.

Write a linear representation of the items in the specified Box and removes them from this BinFab. Assumes that sufficient memory for the buffer has already been allocated by the caller.

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>
void BinFab< T >::meshSpacing const RealVect   a_mesh_spacing [virtual]
 

Set the mesh cell size, in physical coordinates.

template<class T>
RealVect BinFab< T >::meshSpacing   const [virtual]
 

Retrieve the mesh cell size, in physical coordinates.

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

Count the number of items in this BinFab in the specified Box.

The default is to do the whole FAB. This is slow, so use it sparingly.

template<class T>
void BinFab< T >::origin const RealVect   a_origin
 

Set the physical coordinates of the lower corner of cell zero.

template<class T>
RealVect BinFab< T >::origin   const
 

Retrieve the physical coordinates of the lower corner of cell zero.

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

Reimplemented from BaseFab< List< T > >.

template<class T>
void BinFab< T >::reBin List< T > &    a_lost,
const Box   a_valid = Box(),
bool    a_in = true
[virtual]
 

Sort all the items into the appropriate bins and return items in (or not in) the Box.

This is used after "pushing" particles, to find which have left the domain of the BinFab.

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

Sort all the items into the appropriate bins, losing items not in the FAB's domain.

This is used after "pushing" particles (i.e. updating physical positions).

template<class T>
const int* BinFab< T >::size   const [inline]
 

Should be inherited from BaseFab but it isn't, sigh; code is the same.

needed for loop-unroll macro

Reimplemented from BaseFab< List< T > >.

template<class T>
int BinFab< T >::size const Box   a_box,
const Interval   a_comps = Interval(0, 0)
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 > >.

template<class T>
void BinFab< T >::transfer BinFab< T > &    a_src,
const Box   a_srcBox,
const Box   a_destBox
[virtual]
 

Move particles from a BinFab to the overlapping cells in this one.

Performs a point-wise transfer of the whole List<T> in src cells to the corresponding cells in *this. Notice that as a result both this and a_src are modified.


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


The documentation for this class was generated from the following files:
Generated on Wed Jan 19 17:55:35 2005 for Chombo&INSwithParticles by doxygen1.2.16