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

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

Class OuternodeData is a templated node-centered patch data structure derived from hier::PatchData. It differs from the NodeData<DIM> class in that, given a box, an outernode data object represents node-centered data living only on the border of the patch. More...

#include <source/patchdata/outernode/OuternodeData.h>

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

 OuternodeData (const hier::Box< DIM > &box, const int depth, tbox::Pointer< tbox::Arena > pool=tbox::Pointer< tbox::Arena >(NULL))
 Constructor for an outernode data object.
virtual ~OuternodeData ()
 Virtual destructor for a outernode data object.
virtual void copy (const hier::PatchData< DIM > &src)
 A fast copy between the source and destination (i.e., this) patch data objects.
virtual void copy2 (hier::PatchData< DIM > &dst) const
 A fast copy between the source and destination.
virtual void copy (const hier::PatchData< DIM > &src, const hier::BoxOverlap< DIM > &overlap)
 Copy data from the source into the destination using the designated overlap descriptor.
virtual void copy2 (hier::PatchData< DIM > &dst, const hier::BoxOverlap< DIM > &overlap) const
 Copy data from the source into the destination using the designated overlap descriptor.
void copyDepth (int dst_depth, const NodeData< DIM, TYPE > &src, int src_depth)
 Fast copy between the source and destination at the specified depths.
virtual bool canEstimateStreamSizeFromBox () const
 Determines whether the patch data subclass can estinate the necessary stream size using only index space information.
virtual int getDataStreamSize (const hier::BoxOverlap< DIM > &overlap) const
 Calculate the number of bytes needed to stream the data lying in the specified box domain.
virtual void packStream (tbox::AbstractStream &stream, const hier::BoxOverlap< DIM > &overlap) const
 Pack data lying on the specified index set into the output stream.
virtual void unpackStream (tbox::AbstractStream &stream, const hier::BoxOverlap< DIM > &overlap)
 Unpack data from the message stream into the specified index set.
int getDepth () const
 Return the depth (e.g., the number of components in each spatial location) of the array.
bool dataExists (const int axis) const
 Returns whether outernodes exists for the side normal to a given axis.
TYPE * getPointer (const int axis, const int side, const int d=0)
 Get a pointer to the beginning of a particular component of the outernode centered array.
const TYPE * getPointer (const int axis, const int side, const int d=0) const
 Get a const pointer to the beginning of a particular component of the outernode centered array.
ArrayData< DIM, TYPE > & getArrayData (const int axis, const int side)
 Get a pointer to the array data object of a particular component of the outernode centered array.
const ArrayData< DIM, TYPE > & getArrayData (const int axis, const int side) const
 Get a const pointer to the array data object of a particular component of the outernode centered array.
TYPE & operator() (const NodeIndex< DIM > &i, const int depth=0)
 Index<DIM> into the outernode data array using a node index.
const TYPE & operator() (const NodeIndex< DIM > &i, const int depth=0) const
 Index<DIM> into the outernode data array (via a const reference) using a node index.
hier::Box< DIM > getDataBox (int dim, int side)
void fill (const TYPE &t, const int d=0)
 Fill all values of component d with the value t.
void 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.
void fillAll (const TYPE &t)
 Fill all components with value t.
void fillAll (const TYPE &t, const hier::Box< DIM > &box)
 Fill all components within the box with value t.
void print (const hier::Box< DIM > &box, ostream &os=tbox::plog, int prec=-1) const
 Print all outernode data residing in the specified box.
void print (const hier::Box< DIM > &box, const int d, ostream &os=tbox::plog, int prec=-1) const
 Print the specified component of the outernode data residing in the specified box.
void printAxisSide (const int axis, const int side, const hier::Box< DIM > &box, ostream &os=tbox::plog, int prec=-1) const
 Print all outernode centered data for specified axis index residing in the specified box, axis, and side.
void printAxisSide (const int axis, const int side, const hier::Box< DIM > &box, const int d, ostream &os=tbox::plog, int prec=-1) const
 Print specified component for all outernode centered data for the specified axis index, side index, and spatial component residing in the specified box.
virtual void getSpecializedFromDatabase (tbox::Pointer< tbox::Database > database)
 Check that class version and restart file version are equal. If so, read data members from the database.
virtual void putSpecializedToDatabase (tbox::Pointer< tbox::Database > database)
 Write out the class version number and other data members to the database.

Static Public Member Functions

static size_t getSizeOfData (const hier::Box< DIM > &box, const int depth)
 Calculate the amount of memory needed to represent the data in an outernode centered grid.

Detailed Description

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

Class OuternodeData is a templated node-centered patch data structure derived from hier::PatchData. It differs from the NodeData<DIM> class in that, given a box, an outernode data object represents node-centered data living only on the border of the patch.

It is templated on TYPE with a specified depth (that is, number of components for each spatial location). See the node geometry and patch data classes for more information about the translation between the AMR index space and node-centered data.

Outernode data is stored in 2*DIM arrays, containing the data for the patch boundary sides with each of the possible outward pointing normal directions. Where an outernode falls on more than one side (patch edges and corners), the outernode belongs to the array associated with the higher dimensional direction. In each of these arrays, 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 outernode data object instantiated with a box [l0:u0,l1:u1,l2:u2] allocates six data (i.e., three pairs) arrays dimensioned as:

 *
 *    
 *    X:  [ l1+1 : u1   ,
 *          l2+1 : u2   , d ]   ,
 *
 *    Y:  [ l0   : u0+1 ,
 *          l2+1 : u2   , d ]   ,
 *
 *    Z:  [ l0   : u0+1 ,
 *          l1   : u1+1 , d ]   ,
 *
 * 
for the upper and lower x, y, and z (or 0, 1, 2) face directions, respectively. One- and two-dimensional node data arrays are managed similary.

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::OuternodeDataFactory

pdat::OuternodeIndex

pdat::NodeIterator

pdat::OuternodeGeometry


Constructor & Destructor Documentation

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

Constructor for an outernode data object.

Parameters:
box describes the interior of the index space Note that the ghost cell width is currently fixed at zero.
depth gives the number of components for each spatial location in the array.
pool memory arena. If not given, then the standard arena is used.

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

Virtual destructor for a outernode data object.


Member Function Documentation

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

A fast copy between the source and destination (i.e., this) patch data objects.

Data is copied 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). Currently, source data must be NodeData<DIM>. If copy() does not understand the source object type, then copy2() is called.

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< 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.

Currently, the destination data must be NodeData<DIM>.

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< 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. Currently, this function does nothing since copying to Outernode from Outernode is not defined on all box overlap configurations.

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< 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. Currently, the destination data must be NodeData<DIM>.

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< DIM, TYPE >::copyDepth int  dst_depth,
const NodeData< 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::OuternodeData< 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::OuternodeData< 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::OuternodeData< 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::OuternodeData< 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::OuternodeData< 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>
bool SAMRAI::pdat::OuternodeData< DIM, TYPE >::dataExists const int  axis  )  const [inline]
 

Returns whether outernodes exists for the side normal to a given axis.

The axis gives the I=0, J=1, or K=2 axis.

Recall that outernodes that lie on corners or edges are seen on multiple sides of a box. By convention, duplicated nodes belong to the side of the box normal to the axis with the higher dimension. If a side consists of only outnerodes that are owned by a higher dimension, no data exists on that side. This method is used to determine whether any data exists on the given side.

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

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

The axis gives the X=0, Y=1, or Z=2 axis and the side gives the lower=0 or upper=1 side. See class description for the size of the array returned.

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

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

The axis gives the X=0, Y=1, or Z=2 axis and the side gives the lower=0 or upper=1 side. See class description for the size of the array returned.

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

Get a pointer to the array data object of a particular component of the outernode centered array.

The axis gives the X=0, Y=1, or Z=2 axis and the side gives the lower=0 or upper=1 side.

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

Get a const pointer to the array data object of a particular component of the outernode centered array.

The axis gives the X=0, Y=1, or Z=2 axis and the side gives the lower=0 or upper=1 side.

template<int DIM, class TYPE>
TYPE & SAMRAI::pdat::OuternodeData< DIM, TYPE >::operator() const NodeIndex< DIM > &  i,
const int  depth = 0
[inline]
 

Index<DIM> into the outernode data array using a node index.

The index MUST be an index on the outernode of the box.

template<int DIM, class TYPE>
const TYPE & SAMRAI::pdat::OuternodeData< DIM, TYPE >::operator() const NodeIndex< DIM > &  i,
const int  depth = 0
const [inline]
 

Index<DIM> into the outernode data array (via a const reference) using a node index.

The index MUST be an index on the outernode of the box.

template<int DIM, class TYPE>
hier::Box< DIM > SAMRAI::pdat::OuternodeData< DIM, TYPE >::getDataBox int  dim,
int  side
 

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< 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::OuternodeData< 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::OuternodeData< DIM, TYPE >::fillAll const TYPE &  t  ) 
 

Fill all components with value t.

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< 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>
size_t SAMRAI::pdat::OuternodeData< DIM, TYPE >::getSizeOfData const hier::Box< DIM > &  box,
const int  depth
[static]
 

Calculate the amount of memory needed to represent the data in an outernode 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::OuternodeData< DIM, TYPE >::print const hier::Box< DIM > &  box,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print all outernode 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::OuternodeData< 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 outernode 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::OuternodeData< DIM, TYPE >::printAxisSide const int  axis,
const int  side,
const hier::Box< DIM > &  box,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print all outernode centered data for specified axis index residing in the specified box, axis, and side.

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::OuternodeData< DIM, TYPE >::printAxisSide const int  axis,
const int  side,
const hier::Box< DIM > &  box,
const int  d,
ostream &  os = tbox::plog,
int  prec = -1
const
 

Print specified component for all outernode centered data for the specified axis index, side index, and spatial component 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::OuternodeData< 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 a non-null pointer.

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

template<int DIM, class TYPE>
void SAMRAI::pdat::OuternodeData< 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 a 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:30:00 2005 for SAMRAI by  doxygen 1.4.2