|
IBAMR
IBAMR version 0.19.
|
#include <IndexData.h>

Public Types | |
| typedef IndexIterator< DIM, TYPE, BOX_GEOMETRY > | Iterator |
| typedef ConstIndexIterator< DIM, TYPE, BOX_GEOMETRY > | ConstIterator |
Public Member Functions | |
| IndexData (const hier::Box< DIM > &box, const hier::IntVector< DIM > &ghosts) | |
| virtual | ~IndexData () |
| 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 |
| 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) |
| void | appendItem (const hier::Index< DIM > &index, const TYPE &item) |
| void | appendItemPointer (const hier::Index< DIM > &index, TYPE *item) |
| void | addItem (const hier::Index< DIM > &index, const TYPE &item) |
| void | addItemPointer (const hier::Index< DIM > &index, TYPE *item) |
| void | replaceAddItem (const hier::Index< DIM > &index, const TYPE &item) |
| void | replaceAddItemPointer (const hier::Index< DIM > &index, TYPE *item) |
| void | replaceAppendItem (const hier::Index< DIM > &index, const TYPE &item) |
| void | replaceAppendItemPointer (const hier::Index< DIM > &index, TYPE *item) |
| void | removeItem (const hier::Index< DIM > &index) |
| int | getNumberOfItems () const |
| void | removeInsideBox (const hier::Box< DIM > &box) |
| void | removeOutsideBox (const hier::Box< DIM > &box) |
| void | removeGhostItems () |
| void | removeAllItems () |
| bool | isElement (const hier::Index< DIM > &index) const |
| TYPE * | getItem (const hier::Index< DIM > &index) const |
| 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) |
Protected Member Functions | |
| void | setGhostBox (const Box< DIM > &ghost_box) |
Private Member Functions | |
| bool | isElement (int offset) const |
| void | removeItem (const int offset) |
| void | addItemToList (const hier::Index< DIM > &index, const int offset, TYPE &item) |
| void | appendItemToList (const hier::Index< DIM > &index, const int offset, TYPE &item) |
| void | removeNodeFromList (IndexDataNode< DIM, TYPE, BOX_GEOMETRY > *node) |
| IndexData (const IndexData< DIM, TYPE, BOX_GEOMETRY > &) | |
| void | operator= (const IndexData< DIM, TYPE, BOX_GEOMETRY > &) |
Private Attributes | |
| std::vector< IndexDataNode< DIM, TYPE, BOX_GEOMETRY > * > | d_data |
| IndexDataNode< DIM, TYPE, BOX_GEOMETRY > * | d_list_head |
| IndexDataNode< DIM, TYPE, BOX_GEOMETRY > * | d_list_tail |
| int | d_number_items |
| Box< DIM > | d_box |
| Box< DIM > | d_ghost_box |
| IntVector< DIM > | d_ghosts |
| double | d_timestamp |
Friends | |
| class | IndexIterator< DIM, TYPE, BOX_GEOMETRY > |
| class | ConstIndexIterator< DIM, TYPE, BOX_GEOMETRY > |
IndexData is used for storing sparse data. The iteration over the data preserves insertion order similar to a linked list, hence data may be inserted at the front (AddItem) or tail (AppendItem).
For example, this class is used to represent embedded * boundary features as a regular patch data type using the BoundaryCell class as the template type. The iteration ordering property is used to visit the boundary cells in a well defined way.
Additional insertion methods are provided for optimization in specific use cases. An extra constructor call can be avoided if the "Pointer" versions of Add/AppendItem are used. These methods assume that the items are being "given" to IndexData thus IndexData will delete them when needed. The items must be dynamically allocated for this to work correctly, E.G.
index_data.addItemPointer(someIndex, new ItemToInsert());
The "replace" versions of the insert routines may be used when one wishes to preserve the existing iteration ordering. If an item already exists the replace insert will delete the old item and put the item provided in it's place (inserting it into that location in the linked list).
If one does not care about the iteration order and is frequently updating the items stored, the "replace" versions are significantly faster.
The template parameter TYPE * defines the storage at each index location. IndexDaga is derived from * hier::PatchData.
The data type TYPE must define the following five methods which are require by this class:
The BOX_GEOMETRY template parameter defines the geometry. BOX_GEOMETRY must have a nested class name Overlap that implements he following methods:
More information about the templated TYPE is provided in the IndexData README file.
IndexData<DIM> objects are created by the IndexDataFactory<DIM> factory object just as all other patch data types.
| typedef IndexIterator<DIM,TYPE,BOX_GEOMETRY> SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::Iterator |
Define the iterator.
| typedef ConstIndexIterator<DIM,TYPE,BOX_GEOMETRY> SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::ConstIterator |
| SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::IndexData | ( | const hier::Box< DIM > & | box, |
| const hier::IntVector< DIM > & | ghosts | ||
| ) |
The constructor for an IndexData object. The box describes the interior of the index space and the ghosts vector describes the ghost nodes in each coordinate direction.
|
virtual |
The virtual destructor for an IndexData object.
|
private |
|
virtual |
A fast copy between the source and destination. All data is copied from the source into the destination where there is overlap in the index space.
Implements SAMRAI::hier::PatchData< DIM >.
|
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 this copy does not understand how to copy data from the destination, then it may throw an exception (aka dump core in a failed assertion).
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Copy data from the source into the destination using the designated overlap descriptor. The overlap description should have been computed previously from computeIntersection().
Implements SAMRAI::hier::PatchData< DIM >.
|
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 this member function cannot complete the copy from the destination, then it may throw an exception (aka dump core in a failed assertion).
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Determines whether the hier::PatchData subclass can estinate the necessary stream size using only index space information.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Calculate the number of bytes needed to stream the data lying in the specified box domain.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Pack data lying on the specified index set into the output stream.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Unpack data from the message stream into the specified index set.
Implements SAMRAI::hier::PatchData< DIM >.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::appendItem | ( | const hier::Index< DIM > & | index, |
| const TYPE & | item | ||
| ) |
Add a new item to the tail of the irregular index set.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::appendItemPointer | ( | const hier::Index< DIM > & | index, |
| TYPE * | item | ||
| ) |
Add a pointer to a new item to the tail of the irregular index set. IndexData will delete the item when it is no longer needed by IndexData. Due to this behavior item must be dynamically created (e.g. new) so that it may be deleted.
NOTE: This is an optimization to avoid an extra constructor call. It should be used with caution, the caller MUST NOT delete the referenced item. Think of this as giving up control of the item to IndexData.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::addItem | ( | const hier::Index< DIM > & | index, |
| const TYPE & | item | ||
| ) |
Add a new item to the head of the irregular index set
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::addItemPointer | ( | const hier::Index< DIM > & | index, |
| TYPE * | item | ||
| ) |
Add a pointer to a new item to the head of the irregular index set. IndexData will delete the item when it is no longer needed by IndexData. Due to this behavior item must be dynamically created (e.g. new) so that it may be deleted.
NOTE: This is an optimization to avoid an extra constructor call. It should be used with caution, the caller MUST NOT delete the referenced item. Think of this as giving up control of the item to IndexData.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::replaceAddItem | ( | const hier::Index< DIM > & | index, |
| const TYPE & | item | ||
| ) |
Remove (deallocate) the item in the irregular index set located at the specified hier::Index and replace it with a new item.
This preserves the iteration order of the orginal insertions.
If an item does not already exist at index this is equivelent to addItem.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::replaceAddItemPointer | ( | const hier::Index< DIM > & | index, |
| TYPE * | item | ||
| ) |
Remove (deallocate) the item in the irregular index set located at the specified hier::Index and replace it with a new item.
This preserves the iteration order of the original insertions.
If an item does not already exist at index this is equivelent to addItemPointer.
See addItemPointer for additional comments on pointer semantics.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::replaceAppendItem | ( | const hier::Index< DIM > & | index, |
| const TYPE & | item | ||
| ) |
Remove (deallocate) the item in the irregular index set located at the specified hier::Index and replace it with a new item.
This preserves the iteration order of the orginal insertions.
If an item does not already exist at index this is equivelent to appendItem.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::replaceAppendItemPointer | ( | const hier::Index< DIM > & | index, |
| TYPE * | item | ||
| ) |
Remove (deallocate) the item in the irregular index set located at the specified hier::Index and replace it with a new item.
This preserves the iteration order of the original insertions.
If an item does not already exist at index this is equivelent to appendItemPointer.
See addItemPointer for additional comments on pointer semantics.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::removeItem | ( | const hier::Index< DIM > & | index | ) |
Remove (deallocate) the item in the irregular index set located at the specified hier::Index.
| int SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::getNumberOfItems | ( | ) | const |
Return the number of data items (i.e. the number of indices) in
the index data list.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::removeInsideBox | ( | const hier::Box< DIM > & | box | ) |
Remove (deallocate) any items in the irregular index set located in the index space of the hier::Box.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::removeOutsideBox | ( | const hier::Box< DIM > & | box | ) |
Remove (deallocate) any items in the irregular index set located outside of the index space of the hier::Box.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::removeGhostItems | ( | ) |
Remove (deallocate) the items in the irregular index set located in the ghost region of the patch.
| void SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::removeAllItems | ( | ) |
Remove (deallocate) all items in the irregular index set.
| bool SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::isElement | ( | const hier::Index< DIM > & | index | ) | const |
Returns true if there is an element of the irregular index set at the specified hier::Index.
| TYPE* SAMRAI::pdat::IndexData< DIM, TYPE, BOX_GEOMETRY >::getItem | ( | const hier::Index< DIM > & | index | ) | const |
Given an index, return a pointer to the item located at that index. If there is no item at the index, null is returned.
|
virtual |
Check to make sure that the class version number is the same as the restart file version number.
Assertions: database must be a non-null pointer.
Implements SAMRAI::hier::PatchData< DIM >.
|
virtual |
Write out the class version number to the database.
Assertions: database must be a non-null pointer.
Implements SAMRAI::hier::PatchData< DIM >.
|
private |
Returns true if element exists at offset
|
private |
Remove (deallocate) the item in the irregular index set located at the offset.
NOTE: This is for optimization to avoid computing offset repeatedly.
|
private |
Internal routine to append item to the linked list representation.
NOTE: Offset is not strictly necessary but was include to avoid computing it repeatedly.
|
private |
|
private |
Remove the specified node from the linked list.
|
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.
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
1.8.17