|
IBAMR
IBAMR version 0.19.
|
Class SideData<DIM> provides an implementation for data defined at cell sides (faces) on AMR patches. It is derived from the hier::PatchData interface common to all SAMRAI patch data types. Given a CELL-centered AMR index space box, a side data object represents data of some template TYPE and depth on the sides (faces) of the cells in the box. Here, depth indicates the number of data values at each side index location. The SideGeometry class provides the translation between the standard SAMRAI cell-centered AMR index space and side-centered data. More...
#include <ibtk/StaggeredPhysicalBoundaryHelper.h>

Public Types | |
| typedef SideIterator< DIM > | Iterator |
Public Member Functions | |
| SideData (const hier::Box< DIM > &box, 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 >(NULL)) | |
| The constructor for a side data object. More... | |
| virtual | ~SideData () |
| The virtual destructor for a side data object. More... | |
| const hier::IntVector< DIM > & | getDirectionVector () const |
| Return constant reference to vector describing which coordinate directions have data associated with this side data object. More... | |
| int | getDepth () const |
| Return the depth (e.g., the number of components in each spatial location) of the array. More... | |
| TYPE * | getPointer (int side_normal, int depth=0) |
| Get a pointer to the beginning of a particular side normal and depth component of the side centered array. More... | |
| const TYPE * | getPointer (int side_normal, int depth=0) const |
| Get a const pointer to the beginning of a particular side normal and depth component of the side centered array. More... | |
| TYPE & | operator() (const SideIndex< DIM > &i, int depth=0) |
| Return a reference to the data entry corresponding to a given side index and depth. More... | |
| const TYPE & | operator() (const SideIndex< DIM > &i, int depth=0) const |
| Return a const reference to the data entry corresponding to a given side index and depth. More... | |
| ArrayData< DIM, TYPE > & | getArrayData (int side_normal) |
| Return a reference to the array data object for the given side normal of the side centered data object. More... | |
| const ArrayData< DIM, TYPE > & | getArrayData (int side_normal) const |
| Return a const reference to the array data object for the given side normal of the side centered data object. More... | |
| virtual void | copy (const hier::PatchData< DIM > &src) |
| A fast copy from source to destination (i.e., this) patch data object. More... | |
| virtual void | copy2 (hier::PatchData< DIM > &dst) const |
| A fast copy from source (i.e., this) to destination patch data object. More... | |
| virtual void | copy (const hier::PatchData< DIM > &src, const hier::BoxOverlap< DIM > &overlap) |
| Copy data from source to destination (i.e., this) patch data object on the given overlap. More... | |
| virtual void | copy2 (hier::PatchData< DIM > &dst, const hier::BoxOverlap< DIM > &overlap) const |
| Copy data from source (i.e., this) to destination patch data object on the given overlap. More... | |
| void | copyOnBox (const SideData< DIM, TYPE > &src, const hier::Box< DIM > &box) |
| Copy data from source to destination (i.e., this) patch data object on the given CELL-centered AMR index box. More... | |
| void | copyDepth (int dst_depth, const SideData< DIM, TYPE > &src, int src_depth) |
| Fast copy (i.e., source and this side data objects are defined over the same box) to this destination side data object from the given source side data object at the specified depths. More... | |
| virtual bool | canEstimateStreamSizeFromBox () const |
| Return true if the patch data object can estimate the stream size required to fit its data using only index space information (i.e., a box). More... | |
| virtual int | getDataStreamSize (const hier::BoxOverlap< DIM > &overlap) const |
| Return the number of bytes needed to stream the data in this patch data object lying in the specified box overlap region. More... | |
| virtual void | packStream (tbox::AbstractStream &stream, const hier::BoxOverlap< DIM > &overlap) const |
| Pack data in this patch data object lying in the specified box overlap region into the stream. The overlap must be an SideOverlap of the same DIM. More... | |
| virtual void | unpackStream (tbox::AbstractStream &stream, const hier::BoxOverlap< DIM > &overlap) |
| Unpack data from stream into this patch data object over the specified box overlap region. The overlap must be an SideOverlap of the same DIM. More... | |
| void | fill (const TYPE &t, int d=0) |
| Fill all values at depth d with the value t. More... | |
| void | fill (const TYPE &t, const hier::Box< DIM > &box, int d=0) |
| Fill all values at depth d within the box with the value t. More... | |
| void | fillAll (const TYPE &t) |
| Fill all depth components with value t. More... | |
| void | fillAll (const TYPE &t, const hier::Box< DIM > &box) |
| Fill all depth components within the box with value t. More... | |
| void | print (const hier::Box< DIM > &box, std::ostream &os=tbox::plog, int prec=12) const |
| Print all side data values residing in the specified box. If the depth of the array is greater than one, all depths are printed. More... | |
| void | print (const hier::Box< DIM > &box, int depth, std::ostream &os=tbox::plog, int prec=12) const |
| Print all side data values at the given array depth in the specified box. More... | |
| void | printAxis (int side_normal, const hier::Box< DIM > &box, std::ostream &os=tbox::plog, int prec=12) const |
| Print all side centered data values for specified side normal direction residing in the specified box. If the depth of the data is greater than one, all depths are printed. More... | |
| void | printAxis (int side_normal, const hier::Box< DIM > &box, int depth, std::ostream &os=tbox::plog, int prec=12) const |
| Print all side centered data values for specified side normal direction residing in the specified box. If the depth of the data is greater than one, all depths are printed. More... | |
| virtual void | getSpecializedFromDatabase (tbox::Pointer< tbox::Database > database) |
| virtual void | putSpecializedToDatabase (tbox::Pointer< tbox::Database > database) |
| const Box< DIM > & | getBox () const |
| const Box< DIM > & | getGhostBox () const |
| const IntVector< DIM > & | getGhostCellWidth () const |
| void | setTime (const double timestamp) |
| double | getTime () const |
| virtual void | getFromDatabase (tbox::Pointer< tbox::Database > database) |
| virtual void | putToDatabase (tbox::Pointer< tbox::Database > database) |
Static Public Member Functions | |
| static size_t | getSizeOfData (const hier::Box< DIM > &box, int depth, const hier::IntVector< DIM > &ghosts, const hier::IntVector< DIM > &directions) |
| Calculate the amount of memory needed to represent side- centered data over a CELL-centered AMR index space box. More... | |
Protected Member Functions | |
| void | setGhostBox (const Box< DIM > &ghost_box) |
Private Member Functions | |
| SideData (const SideData< DIM, TYPE > &) | |
| void | operator= (const SideData< DIM, TYPE > &) |
Private Attributes | |
| int | d_depth |
| hier::IntVector< DIM > | d_directions |
| ArrayData< DIM, TYPE > | d_data [DIM] |
| Box< DIM > | d_box |
| Box< DIM > | d_ghost_box |
| IntVector< DIM > | d_ghosts |
| double | d_timestamp |
IMPORTANT: The FaceData<DIM> class provides the same storage as this side data class, except that the coordinate directions of the individual arrays are permuted in the face data implementation.
Side data is stored in DIM arrays, each of which contains the data for the sides normal to a corresponding 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 created over a CELL-centered AMR index space [l0:u0,l1:u1,l2:u2] allocates three data arrays dimensioned as follows:
side normal 0
[ l0 : u0+1 ,
l1 : u1 ,
l2 : u2 , d ] ,
side normal 1
[ l0 : u0 ,
l1 : u1+1 ,
l2 : u2 , d ] ,
side normal 2
[ l0 : u0 ,
l1 : u1 ,
l2 : u2+1 , d ] ,
* Here the side normal directions 0, 1, 2 can be thought of as the x, y, and z side normal directions, respectively, and d is the depth index (i.e., number of values at each side index location). Other spatial dimensions are represented similarly.
Note also 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 side data objects.
The data type TYPE must define a default constructor (that takes no arguments) and also the assignment operator.
| typedef SideIterator<DIM> SAMRAI::pdat::SideData< DIM, TYPE >::Iterator |
The side iterator iterates over the elements on one axis of a side centered box geometry. This typedef is a convenience for using the SideIterator<DIM> class.
| SAMRAI::pdat::SideData< DIM, TYPE >::SideData | ( | const hier::Box< DIM > & | box, |
| 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 >(NULL) |
||
| ) |
| box | const Box reference describing the interior of the standard CELL-centered index box over which the side data object will be created. |
| depth | gives the number of components for each spatial location in the array. |
| ghosts | const IntVector reference indicating the width of the ghost cell region around the box over which the side data will be allocated. |
| directions | const IntVector reference indicating which coordinate directions will have data associated with them. The default state is to create data for all coordinate directions. |
| pool | memory arena. If not given, then the standard arena is used. |
|
virtual |
|
private |
|
static |
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.
| box | const Box reference describing the interior of the standard CELL-centered index box over which the side data object will be created. |
| depth | gives the number of components for each spatial location in the array. |
| ghosts | const IntVector reference indicating the width of the ghost cell region around the box over which the side data will be allocated. |
| directions | const IntVector reference indicating which coordinate directions are assumed to have data for the purposes of the calculation. |
| const hier::IntVector<DIM>& SAMRAI::pdat::SideData< DIM, TYPE >::getDirectionVector | ( | ) | const |
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.
| int SAMRAI::pdat::SideData< DIM, TYPE >::getDepth | ( | ) | const |
| TYPE* SAMRAI::pdat::SideData< DIM, TYPE >::getPointer | ( | int | side_normal, |
| int | depth = 0 |
||
| ) |
| const TYPE* SAMRAI::pdat::SideData< DIM, TYPE >::getPointer | ( | int | side_normal, |
| int | depth = 0 |
||
| ) | const |
| TYPE& SAMRAI::pdat::SideData< DIM, TYPE >::operator() | ( | const SideIndex< DIM > & | i, |
| int | depth = 0 |
||
| ) |
| const TYPE& SAMRAI::pdat::SideData< DIM, TYPE >::operator() | ( | const SideIndex< DIM > & | i, |
| int | depth = 0 |
||
| ) | const |
| ArrayData<DIM,TYPE>& SAMRAI::pdat::SideData< DIM, TYPE >::getArrayData | ( | int | side_normal | ) |
| const ArrayData<DIM,TYPE>& SAMRAI::pdat::SideData< DIM, TYPE >::getArrayData | ( | int | side_normal | ) | const |
|
virtual |
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 an SideData of the same DIM and TYPE. If not, then an unrecoverable error results.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
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, destination data must be an SideData of the same DIM and TYPE. If not, then an unrecoverable error results.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Currently, source data must be SideData of the same DIM and TYPE and the overlap must be a SideOverlap of the same DIM. If not, then an unrecoverable error results.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Currently, destination data must be SideData of the same DIM and TYPE and the overlap must be a SideOverlap of the same DIM. If not, then an unrecoverable error results.
Implements SAMRAI::hier::PatchData< DIM >.
| void SAMRAI::pdat::SideData< DIM, TYPE >::copyOnBox | ( | const SideData< DIM, TYPE > & | src, |
| const hier::Box< DIM > & | box | ||
| ) |
| void SAMRAI::pdat::SideData< DIM, TYPE >::copyDepth | ( | int | dst_depth, |
| const SideData< DIM, TYPE > & | src, | ||
| int | src_depth | ||
| ) |
|
virtual |
This routine is defined for the standard types (bool, char, double, float, int, and dcomplex).
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
This routine is defined for the standard types (bool, char, double, float, int, and dcomplex).
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Implements SAMRAI::hier::PatchData< DIM >.
| void SAMRAI::pdat::SideData< DIM, TYPE >::fill | ( | const TYPE & | t, |
| int | d = 0 |
||
| ) |
| void SAMRAI::pdat::SideData< DIM, TYPE >::fill | ( | const TYPE & | t, |
| const hier::Box< DIM > & | box, | ||
| int | d = 0 |
||
| ) |
| void SAMRAI::pdat::SideData< DIM, TYPE >::fillAll | ( | const TYPE & | t | ) |
| void SAMRAI::pdat::SideData< DIM, TYPE >::fillAll | ( | const TYPE & | t, |
| const hier::Box< DIM > & | box | ||
| ) |
| void SAMRAI::pdat::SideData< DIM, TYPE >::print | ( | const hier::Box< DIM > & | box, |
| std::ostream & | os = tbox::plog, |
||
| int | prec = 12 |
||
| ) | const |
| box | const reference to box over whioch to print data. Note box is assumed to reside in standard cell-centered index space and will be converted to side index space. |
| os | reference to output stream. |
| prec | integer precision for printing floating point numbers (i.e., TYPE = float, double, or dcomplex). 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 value is ignored. |
| void SAMRAI::pdat::SideData< DIM, TYPE >::print | ( | const hier::Box< DIM > & | box, |
| int | depth, | ||
| std::ostream & | os = tbox::plog, |
||
| int | prec = 12 |
||
| ) | const |
| box | const reference to box over whioch to print data. Note box is assumed to reside in standard cell-centered index space and will be converted to side index space. |
| depth | integer depth component, must satisfy 0 <= depth < actual depth of data array |
| os | reference to output stream. |
| prec | integer precision for printing floating point numbers (i.e., TYPE = float, double, or dcomplex). 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 value is ignored. |
| void SAMRAI::pdat::SideData< DIM, TYPE >::printAxis | ( | int | side_normal, |
| const hier::Box< DIM > & | box, | ||
| std::ostream & | os = tbox::plog, |
||
| int | prec = 12 |
||
| ) | const |
| side_normal | integer side normal coordinate direction, must satisfy 0 <= side_normal < DIM |
| box | const reference to box over whioch to print data. Note box is assumed to reside in standard cell-centered index space and will be converted to side index space. |
| os | reference to output stream. |
| prec | integer precision for printing floating point numbers (i.e., TYPE = float, double, or dcomplex). 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 value is ignored. |
| void SAMRAI::pdat::SideData< DIM, TYPE >::printAxis | ( | int | side_normal, |
| const hier::Box< DIM > & | box, | ||
| int | depth, | ||
| std::ostream & | os = tbox::plog, |
||
| int | prec = 12 |
||
| ) | const |
| side_normal | integer side normal coordinate direction, must satisfy 0 <= side_normal < DIM |
| box | const reference to box over whioch to print data. Note box is assumed to reside in standard cell-centered index space and will be converted to side index space. |
| depth | integer depth component, must satisfy 0 <= depth < actual depth of data array |
| os | reference to output stream. |
| prec | integer precision for printing floating point numbers (i.e., TYPE = float, double, or dcomplex). 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 value is ignored. |
|
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 >.
|
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 >.
|
private |
|
inherited |
Return the box over which this patch data object is defined. All objects in the same patch are defined over the same box, although the patch data objects may interpret how to allocate storage for that box in different ways.
|
inherited |
Return the ghost cell box. The ghost cell box is defined to be the interior box grown by the ghost cell width.
|
inherited |
Get the ghost cell width associated with this patch data object.
|
inherited |
Set the simulation time stamp for the patch data type. The simulation time is initialized to zero when the patch data type is created.
|
inherited |
Get the simulation time stamp for the patch data type.
|
virtualinherited |
Checks that class version and restart file version are equal. If so, reads in the data members common to all patch data types from database. This method then calls the getSpecializedFromDatabase() method to retrieve the data special to the concrete patch data type.
|
virtualinherited |
Writes out the class version number to the database. Then, writes the data members common to all patch data types from database. After the common data is written to the database, the putSpecializedToDatabase() method is invoked.
|
protectedinherited |
This protected method is used by concrete patch data subclasses to set the ghost box over which the patch data will be allocated. Note that this allows the ghost box to be inconsistant with its standard interpretation as the patch domain box grown by the ghost cell width (as set in the constructor).
This function is included to treat some special cases for concrete patch data types and should be used with caution.
|
private |
|
private |
|
private |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
1.8.17