#include <source/patchdata/side/SideData.h>
Inheritance diagram for SAMRAI::pdat::SideData< DIM, TYPE >:
Public Types | |
typedef SideIterator< DIM > | Iterator |
Public Member Functions | |
SideData (const hier::Box< DIM > &box, const int depth, const hier::IntVector< DIM > &ghosts, const hier::IntVector< DIM > &directions=hier::IntVector< DIM >(1), tbox::Pointer< tbox::Arena > pool=tbox::Pointer< tbox::Arena >((0))) | |
virtual | ~SideData () |
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 SideData< 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) |
const hier::IntVector< DIM > & | getDirectionVector () const |
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 SideIndex< DIM > &i, const int d=0) |
const TYPE & | operator() (const SideIndex< 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 SideData< 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, const hier::IntVector< DIM > &directions) |
Side data is stored in DIM arrays, each of which contains the data for the sides with normal in 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 side data object instantiated with a box [l0:u0,l1:u1,l2:u2] allocates three data arrays dimensioned as:
[ l0 : u0+1 , l1 : u1 , l2 : u2 , d ] , [ l0 : u0 , l1 : u1+1 , l2 : u2 , d ] , [ l0 : u0 , l1 : u1 , l2 : u2+1 , d ] , *
IMPORTANT: The FaceData<DIM> class provides the same storage as this side data class, except that the individual arrays are permuted in the face data type.
Note that it is possible to create a side data object for managing data at cell sides associated with a single coordinate direction only. See the constructor for more information. All operations are defined only for the case where data storage is alike between two objects.
The data type TYPE must define a default constructor (that takes no arguments) and also the assignment operator.
|
The side iterator iterates over the elements on one axis of a side centered box geometry. This typedef is a convenient link to the SideIterator<DIM> class. |
|
The constructor creates a side data object according to the argument parameters. The box describes the interior of the index space and the ghost vector gives the the number of ghost cells for each coordinate direction. The depth gives the number of components for each spatial index location in the array. The direction vector indicates which coordinate directions will have data associated with them. The default state is to maintain data for all coordinate directions. The last argument specifies the memory arena from which data will be allocated. If the memory arena is not given, then the standard arena is used. |
|
The virtual destructor for a side data object. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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). |
|
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 >. |
|
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). |
|
Pack data lying on the specified index set into the output stream. |
|
Unpack data from the message stream into the specified index set. |
|
Return constant reference to vector describing which coordinate directions have data associated with this side data object. A vector entry of zero indicates that there is no data array allocated for the corresponding coordinate direction. A non-zero value indicates that a valid data array is maintained for that coordinate direction. |
|
Return the depth (e.g., the number of components in each spatial location) of the array. |
|
Get a pointer to the beginning of a particular component of the side centered array. |
|
Get a const pointer to the beginning of a particular component of the side centered array. |
|
hier::Index into the side data array using a side index. |
|
hier::Index into the side data array (via a const reference) using a side index. |
|
Retrieve the array data corresponding to the specified axis. |
|
Retrieve the const array data corresponding to the specified axis. |
|
Fill all values of component d with the value t. |
|
Fill all values of component d within the box with the value t. |
|
Fill all components with value t. |
|
Fill all components within the box with value t. |
|
Copy data from supplied source over the supplied box. |
|
Calculate the amount of memory needed to represent the data in a side-centered data object of given depth on a grid defined by the box grown by the specified ghost width. The directions vector indicates which coordinate directions are assumed to have data for the purposes of the calculation. 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. |
|
Print all side 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. |
|
Print the specified component of the side 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. |
|
Print all side 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. |
|
Print specified component for all side 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. |
|
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 >. |
|
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 >. |