Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

SAMRAI::pdat::EdgeData< DIM, TYPE > Class Template Reference

Class EdgeData<DIM> manages data defined on edges of cells in patches. It is a templated edge-centered patch data structure derived from hier::PatchData<DIM>. Given a box, an edge data object represents edge-centered data of some template TYPE with a specified depth (that is, number of components for each spatial location). See the edge geometry class for more information about the translation between the AMR index space and edge-centered data. More...

#include <source/patchdata/edge/EdgeData.h>

Inheritance diagram for SAMRAI::pdat::EdgeData< DIM, TYPE >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef EdgeIterator< DIM > Iterator

Public Member Functions

 EdgeData (const hier::Box< DIM > &box, const int depth, const hier::IntVector< DIM > &ghosts, tbox::Pointer< tbox::Arena > pool=tbox::Pointer< tbox::Arena >((0)))
virtual ~EdgeData ()
virtual void copy (const hier::PatchData< DIM > &src)
virtual void copy2 (hier::PatchData< DIM > &dst) const
virtual void copy (const hier::PatchData< DIM > &src, const hier::BoxOverlap< DIM > &overlap)
virtual void copy2 (hier::PatchData< DIM > &dst, const hier::BoxOverlap< DIM > &overlap) const
void copyDepth (int dst_depth, const EdgeData< DIM, TYPE > &src, int src_depth)
 Fast copy between the source and destination at the specified depths.
virtual bool canEstimateStreamSizeFromBox () const
virtual int getDataStreamSize (const hier::BoxOverlap< DIM > &overlap) const
virtual void packStream (tbox::AbstractStream &stream, const hier::BoxOverlap< DIM > &overlap) const
virtual void unpackStream (tbox::AbstractStream &stream, const hier::BoxOverlap< DIM > &overlap)
int getDepth () const
TYPE * getPointer (const int axis, const int d=0)
const TYPE * getPointer (const int axis, const int d=0) const
TYPE & operator() (const EdgeIndex< DIM > &i, const int d=0)
const TYPE & operator() (const EdgeIndex< DIM > &i, const int d=0) const
ArrayData< DIM, TYPE > & getArrayData (const int axis)
const ArrayData< DIM, TYPE > & getArrayData (const int axis) const
void fill (const TYPE &t, const int d=0)
void fill (const TYPE &t, const hier::Box< DIM > &box, const int d=0)
void fillAll (const TYPE &t)
void fillAll (const TYPE &t, const hier::Box< DIM > &box)
void copyOnBox (const EdgeData< DIM, TYPE > &src, const hier::Box< DIM > &box)
void print (const hier::Box< DIM > &box, ostream &os=tbox::plog, int prec=-1) const
void print (const hier::Box< DIM > &box, const int d, ostream &os=tbox::plog, int prec=-1) const
void printAxis (const int axis, const hier::Box< DIM > &box, ostream &os=tbox::plog, int prec=-1) const
void printAxis (const int axis, const hier::Box< DIM > &box, const int d, ostream &os=tbox::plog, int prec=-1) const
virtual void getSpecializedFromDatabase (tbox::Pointer< tbox::Database > database)
virtual void putSpecializedToDatabase (tbox::Pointer< tbox::Database > database)

Static Public Member Functions

static size_t getSizeOfData (const hier::Box< DIM > &box, const int depth, const hier::IntVector< DIM > &ghosts)

Detailed Description

template<int DIM, class TYPE>
class SAMRAI::pdat::EdgeData< DIM, TYPE >

Class EdgeData<DIM> manages data defined on edges of cells in patches. It is a templated edge-centered patch data structure derived from hier::PatchData<DIM>. Given a box, an edge data object represents edge-centered data of some template TYPE with a specified depth (that is, number of components for each spatial location). See the edge geometry class for more information about the translation between the AMR index space and edge-centered data.

Edge data is stored in DIM arrays, each of which contains the data for the edges tangent to a single coordinate direction. Memory allocation is in column-major ordering (e.g., Fortran style) so that the leftmost index runs fastest in memory. For example, a three-dimensional edge data object instantiated with a box [l0:u0,l1:u1,l2:u2] allocates three data arrays dimensioned as

     [ l0 : u0 ,
       l1 : u1+1 ,
       l2 : u2+1 , d ]   ,

     [ l0 : u0+1 ,
       l1 : u1 ,
       l2 : u2+1 , d ]   ,

     [ l0 : u0+1 ,
       l1 : u1+1 ,
       l2 : u2 , d ]   ,
 
 * 
for the x, y, and z (or 0, 1, 2) edge directions, respectively, and where d is the depth index (i.e., number of values at each face index location). One- and two-dimensional edge data arrays are managed similarly.

The data type TYPE must define a default constructor (that takes no arguments) and also the assignment operator.

See also:
pdat::ArrayData

hier::PatchData

pdat::EdgeDataFactory

pdat::EdgeIndex

pdat::EdgeIterator

pdat::EdgeGeometry


Member Typedef Documentation

template<int DIM, class TYPE>
typedef EdgeIterator<DIM> SAMRAI::pdat::EdgeData< DIM, TYPE >::Iterator
 

The edge iterator iterates over the elements on one axis of an edge centered box geometry. This typedef is a convenient link to the EdgeIterator<DIM> class.


Constructor & Destructor Documentation

template<int DIM, class TYPE>
SAMRAI::pdat::EdgeData< DIM, TYPE >::EdgeData const hier::Box< DIM > &  box,
const int  depth,
const hier::IntVector< DIM > &  ghosts,
tbox::Pointer< tbox::Arena pool = tbox::Pointertbox::Arena >((0))
 

The constructor for an edge data object. The box describes the interior of the index space and the ghosts vector describes the ghost cells in each coordinate direction. The depth gives the number of components for each spatial location in the array. If the memory arena is not given, then the standard arena is used.

template<int DIM, class TYPE>
SAMRAI::pdat::EdgeData< DIM, TYPE >::~EdgeData  )  [virtual]
 

The virtual destructor for an edge data object.


Member Function Documentation

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::copy const hier::PatchData< DIM > &  src  )  [virtual]
 

A fast copy between the source and destination. Data is copied from the source into the destination where there is overlap in the underlying index space. The copy is performed on the interior plus the ghost cell width (for both the source and destination). If copy() does not understand the source object type, then copy2() is called.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::copy2 hier::PatchData< DIM > &  dst  )  const [virtual]
 

A fast copy between the source and destination. Member function copy2() is similar to copy() except that the location of source and destination are reversed and copy2() throws an exception (aka dumps core) if it does not understand the type of the argument.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::copy const hier::PatchData< DIM > &  src,
const hier::BoxOverlap< DIM > &  overlap
[virtual]
 

Copy data from the source into the destination using the designated overlap descriptor. The overlap description will have been computed using the appropriate box geometry objects. If copy() does not understand the source object type, then copy2() is called.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::copy2 hier::PatchData< DIM > &  dst,
const hier::BoxOverlap< DIM > &  overlap
const [virtual]
 

Copy data from the source into the destination using the designated overlap descriptor. Member function copy2() is similar to the copy() member function except that the location of source and destination are reversed and copy2() throws an exception (aka dumps core) if it does not understand the type of the argument.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::copyDepth int  dst_depth,
const EdgeData< DIM, TYPE > &  src,
int  src_depth
 

Fast copy between the source and destination at the specified depths.

Data is copied from the source into the destination where there is overlap in the underlying index space. The copy is performed on the interior plus the ghost cell width (for both the source and destination).

template<int DIM, class TYPE>
bool SAMRAI::pdat::EdgeData< DIM, TYPE >::canEstimateStreamSizeFromBox  )  const [virtual]
 

Determines whether the patch data subclass can estinate the necessary stream size using only index space information. This routine is defined for the standard built-in types (bool, char, double, float, and int).

Implements SAMRAI::hier::PatchData< DIM >.

template<int DIM, class TYPE>
int SAMRAI::pdat::EdgeData< DIM, TYPE >::getDataStreamSize const hier::BoxOverlap< DIM > &  overlap  )  const [virtual]
 

Calculate the number of bytes needed to stream the data lying in the specified box domain. This routine is defined for the standard built-in types (bool, char, double, float, and int).

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::packStream tbox::AbstractStream stream,
const hier::BoxOverlap< DIM > &  overlap
const [virtual]
 

Pack data lying on the specified index set into the output stream.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::unpackStream tbox::AbstractStream stream,
const hier::BoxOverlap< DIM > &  overlap
[virtual]
 

Unpack data from the message stream into the specified index set.

template<int DIM, class TYPE>
int SAMRAI::pdat::EdgeData< DIM, TYPE >::getDepth  )  const [inline]
 

Return the depth (e.g., the number of components in each spatial location) of the array.

template<int DIM, class TYPE>
TYPE * SAMRAI::pdat::EdgeData< DIM, TYPE >::getPointer const int  axis,
const int  d = 0
[inline]
 

Get a pointer to the beginning of a particular component of the edge centered array.

template<int DIM, class TYPE>
const TYPE * SAMRAI::pdat::EdgeData< DIM, TYPE >::getPointer const int  axis,
const int  d = 0
const [inline]
 

Get a const pointer to the beginning of a particular component of the edge centered array.

template<int DIM, class TYPE>
TYPE & SAMRAI::pdat::EdgeData< DIM, TYPE >::operator() const EdgeIndex< DIM > &  i,
const int  d = 0
[inline]
 

hier::Index into the edge data array using an edge index.

template<int DIM, class TYPE>
const TYPE & SAMRAI::pdat::EdgeData< DIM, TYPE >::operator() const EdgeIndex< DIM > &  i,
const int  d = 0
const [inline]
 

hier::Index into the edge data array (via a const reference) using an edge index.

template<int DIM, class TYPE>
ArrayData< DIM, TYPE > & SAMRAI::pdat::EdgeData< DIM, TYPE >::getArrayData const int  axis  )  [inline]
 

Retrieve the array data corresponding to the specified axis.

template<int DIM, class TYPE>
const ArrayData< DIM, TYPE > & SAMRAI::pdat::EdgeData< DIM, TYPE >::getArrayData const int  axis  )  const [inline]
 

Retrieve the const array data corresponding to the specified axis.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::fill const TYPE &  t,
const int  d = 0
 

Fill all values of component d with the value t.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::fill const TYPE &  t,
const hier::Box< DIM > &  box,
const int  d = 0
 

Fill all values of component d within the box with the value t.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::fillAll const TYPE &  t  ) 
 

Fill all components with value t.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::fillAll const TYPE &  t,
const hier::Box< DIM > &  box
 

Fill all components within the box with value t.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::copyOnBox const EdgeData< DIM, TYPE > &  src,
const hier::Box< DIM > &  box
[inline]
 

Copy data from supplied source over the supplied box.

template<int DIM, class TYPE>
size_t SAMRAI::pdat::EdgeData< DIM, TYPE >::getSizeOfData const hier::Box< DIM > &  box,
const int  depth,
const hier::IntVector< DIM > &  ghosts
[static]
 

Calculate the amount of memory needed to represent the data in a edge centered grid. This function assumes that the amount of memory needed for TYPE is sizeof(TYPE). If this is not the case, then a specialized function must be defined.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::print const hier::Box< DIM > &  box,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print all edge centered data residing in the specified box. If the depth of the array is greater than one, all components are printed. Precision of floating point numbers (i.e., TYPE = float, double, or dcomplex) can be specified using the provided argument. The default is 12 decimal places for double and complex floating point numbers, and the default is 6 decimal places floats. For other types, this is ignored.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::print const hier::Box< DIM > &  box,
const int  d,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print the specified component of the edge centered data residing in the specified box. Precision of floating point numbers (i.e., TYPE = float, double, or dcomplex) can be specified using the provided argument. The default is 12 decimal places for double and complex floating point numbers, and the default is 6 decimal places floats. For other types, this is ignored.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::printAxis const int  axis,
const hier::Box< DIM > &  box,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print all edge centered data for specified axis index residing in the specified box. If the depth of the data is greater than one, then all components are printed. Precision of floating point numbers (i.e., TYPE = float, double, or dcomplex) can be specified using the provided argument. The default is 12 decimal places for double and complex floating point numbers, and the default is 6 decimal places floats. For other types, this is ignored.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::printAxis const int  axis,
const hier::Box< DIM > &  box,
const int  d,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print specified component for all edge centered data for the specified axis index residing in the specified box. Precision of floating point numbers (i.e., TYPE = float, double, or dcomplex) can be specified using the provided argument. The default is 12 decimal places for double and complex floating point numbers, and the default is 6 decimal places floats. For other types, this is ignored.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::getSpecializedFromDatabase tbox::Pointer< tbox::Database database  )  [virtual]
 

Check that class version and restart file version are equal. If so, read data members from the database.

Assertions: database must be non-null pointer.

Implements SAMRAI::hier::PatchData< DIM >.

template<int DIM, class TYPE>
void SAMRAI::pdat::EdgeData< DIM, TYPE >::putSpecializedToDatabase tbox::Pointer< tbox::Database database  )  [virtual]
 

Write out the class version number and other data members to the database.

Assertions: database must be non-null pointer.

Implements SAMRAI::hier::PatchData< DIM >.


The documentation for this class was generated from the following files:
Generated on Fri Dec 2 11:29:32 2005 for SAMRAI by  doxygen 1.4.2