Chombo + EB + MF
3.2
|
#include <ListBox.H>
Public Member Functions | |
ListBox () | |
Null constructor. More... | |
ListBox (const Box &a_box, const RealVect &a_meshSpacing, const RealVect &a_origin) | |
virtual | ~ListBox () |
Destructor. More... | |
virtual void | define (const Box &a_box, const RealVect &a_meshSpacing, const RealVect &a_origin) |
Same as the constructor. More... | |
virtual void | undefine () |
Free the memory associated with this ListBox. More... | |
List< T > & | listItems () |
Returns the list of items contained in this ListBox. More... | |
const List< T > & | listItems () const |
Returns the list of items contained in this ListBox, const version. More... | |
virtual void | getItems (List< T > &a_list, const Box &a_valid) const |
virtual void | getItemsDestructive (List< T > &a_list, const Box &a_valid) |
virtual void | getInvalid (List< T > &a_list, const Box &a_valid) const |
virtual void | getInvalidDestructive (List< T > &a_list, const Box &a_valid) |
virtual void | addItem (const T &a_item) |
Add a_item to this ListBox if it is contained within m_box. More... | |
virtual void | addItems (const List< T > &a_list) |
virtual void | addItemsDestructive (List< T > &a_list) |
virtual void | addItemsDestructive (List< T > &a_list, const Box &a_valid) |
virtual void | transfer (ListBox< T > &a_src, const Box &a_srcBox, const Box &a_destBox, const int a_srcComp=0, const int a_destComp=0, const int a_numComp=1) |
virtual void | copy (const Box &a_RegionFrom, const Interval &a_Cdest, const Box &a_RegionTo, const ListBox< T > &a_src, const Interval &a_Csrc) |
virtual size_t | numItems () const |
Return the number of items in this ListBox. More... | |
virtual size_t | numItems (const Box &a_box, const bool a_in=true) const |
virtual int | size (const Box &a_box, const Interval &a_comps=Interval()) const |
The number of bytes used by linearIn()/linearOut(). More... | |
virtual void | linearOut (void *a_buf, const Box &a_box, const Interval &a_comps=Interval()) const |
Write a serialized (packed) representation into a_buf. More... | |
virtual void | linearOutDestructive (void *buf, const Box &a_box, const Interval &a_comps=Interval()) |
virtual void | linearIn (void *a_buf, const Box &a_box, const Interval &a_comps=Interval()) |
Extract a serialized (packed) representation from a_buf. More... | |
virtual const RealVect & | meshSpacing () const |
Retrieve the mesh size. More... | |
const Box & | box () const |
Retrieve the box. More... | |
virtual void | clear () |
Delete all items in this ListBox and reset it to the null Box. More... | |
IntVect | size () const |
as in BaseFab; needed for loop-unroll macro More... | |
Static Public Member Functions | |
static int | preAllocatable () |
Lists are not pre-allocatable. This function is needed so that ListBox. More... | |
Protected Member Functions | |
virtual bool | isEnclosed (const T &a_item, const Box &a_box) const |
Determines whether a_item is enclosed in a_box. More... | |
Static Protected Member Functions | |
static std::string | name () |
Protected Attributes | |
Box | m_box |
The Box that defines the valid region of this ListBox. More... | |
List< T > * | m_dptr |
Pointer to the List that stores our items. More... | |
RealVect | m_mesh_spacing |
The cell size in physical space. More... | |
RealVect | m_origin |
The center of our coordinate system. Used for binning our items. More... | |
Static Protected Attributes | |
static Arena * | s_Arena = NULL |
Private Member Functions | |
ListBox< T > & | operator= (const ListBox< T > &) |
ListBox (const ListBox< T > &) | |
A class for storing and sorting particle items. Particles are held in a List and belong to this ListBox if their position is within the domain represented by the object Box.. Class <T> must have a RealVect
<T>::position() const function which is used to assign the item to the ListBox. See class BinItem
for a base class for particles.
ListBox< T >::ListBox | ( | const Box & | a_box, |
const RealVect & | a_meshSpacing, | ||
const RealVect & | a_origin | ||
) |
Constructs an empty ListBox
on a_box. a_meshSpacing is the cell size in each direction, and a_origin is the location in physical coordinates of the lower left corner of the problem domain.
References ListBox< T >::define().
Destructor.
References ListBox< T >::undefine().
|
virtual |
Same as the constructor.
References Arena::alloc(), CH_assert, MayDay::Error(), ListBox< T >::m_box, ListBox< T >::m_dptr, ListBox< T >::m_mesh_spacing, ListBox< T >::m_origin, ListBox< T >::name(), and ListBox< T >::s_Arena.
Referenced by ListBox< T >::ListBox().
|
virtual |
Free the memory associated with this ListBox.
References CH_assert, Arena::free(), ListBox< T >::m_dptr, and ListBox< T >::s_Arena.
Referenced by ListBox< T >::clear(), and ListBox< T >::~ListBox().
Returns the list of items contained in this ListBox.
References CH_assert, and ListBox< T >::m_dptr.
Referenced by ListBox< T >::addItem(), ListBox< T >::addItems(), ListBox< T >::addItemsDestructive(), ListBox< T >::copy(), ListBox< T >::getInvalid(), ListBox< T >::getInvalidDestructive(), ListBox< T >::getItems(), ListBox< T >::getItemsDestructive(), ListBox< T >::linearIn(), ListBox< T >::numItems(), and ListBox< T >::transfer().
Returns the list of items contained in this ListBox, const version.
References CH_assert, and ListBox< T >::m_dptr.
|
virtual |
Copy items from this ListBox into a_list only if they are contained in a_valid. This operation does not remove the items from this ListBox.
References List< T >::add(), CH_assert, ListBox< T >::isEnclosed(), List< T >::join(), ListBox< T >::listItems(), ListBox< T >::m_box, and ListBox< T >::m_dptr.
Referenced by ListBox< T >::copy(), and ListBox< T >::linearOut().
|
virtual |
Transfer items from this ListBox into a_list only if they are contained in a_valid. This operation removes the items from this ListBox.
References List< T >::catenate(), CH_assert, ListBox< T >::isEnclosed(), ListBox< T >::listItems(), ListBox< T >::m_box, ListBox< T >::m_dptr, and List< T >::transfer().
Referenced by ListBox< T >::copy(), ListBox< T >::linearOutDestructive(), and ListBox< T >::transfer().
|
virtual |
Copy items from this ListBox into a_list if they are NOT contained in a_valid. Does not remove the items from this ListBox.
References List< T >::add(), CH_assert, ListBox< T >::isEnclosed(), ListBox< T >::listItems(), and ListBox< T >::m_dptr.
Referenced by ParticleData< P >::fillGhosts().
|
virtual |
Transfer items from this ListBox into a_list if they are NOT contained in a_valid. This removes the items from this ListBox.
References CH_assert, ListBox< T >::isEnclosed(), ListBox< T >::listItems(), ListBox< T >::m_dptr, and List< T >::transfer().
|
virtual |
Add a_item to this ListBox if it is contained within m_box.
References ListBox< T >::isEnclosed(), ListBox< T >::listItems(), and ListBox< T >::m_box.
Add each item in a_list into this ListBox if they are contained within m_box. Does not remove the items from a_list.
References List< T >::add(), ListBox< T >::isEnclosed(), List< T >::isNotEmpty(), ListBox< T >::listItems(), ListBox< T >::m_box, and ListIterator< T >::ok().
Transfer each item in a_list into this ListBox if it is contained within m_box. This removes the items from a_list.
References ListBox< T >::m_box.
Referenced by ListBox< T >::copy().
|
virtual |
Transfer each item in a_list into this ListBox if it is contained within a_valid. This removes the items from a_list.
References ListBox< T >::isEnclosed(), List< T >::isNotEmpty(), ListBox< T >::listItems(), and List< T >::transfer().
|
virtual |
Performs transfer of the items from src to dest. Notice that as a result both *this and a_src are modified.
References CH_assert, Box::contains(), ListBox< T >::getItemsDestructive(), ListBox< T >::listItems(), ListBox< T >::m_box, ListBox< T >::m_dptr, and Box::sameSize().
|
virtual |
Remove all the items from this ListBox that are within a_RegionTo, and add all the particles from the ListBox a_src that are within a_RegionFrom.
References ListBox< T >::addItemsDestructive(), ListBox< T >::getItems(), ListBox< T >::getItemsDestructive(), and ListBox< T >::listItems().
|
virtual |
Return the number of items in this ListBox.
References ListBox< T >::listItems().
Referenced by ListBox< T >::linearIn(), ListBox< T >::numItems(), and ListBox< T >::size().
|
virtual |
The number of bytes used by linearIn()/linearOut().
Returns the size, in number of bytes, of a flat linear representation of the items in the specified Box
.
References ListBox< T >::numItems().
|
virtual |
Write a serialized (packed) representation into a_buf.
Write a linear representation of the items in the specified Box
. Assumes that sufficient memory for the buffer has already been allocated by the caller.
References ListBox< T >::getItems(), and List< T >::length().
|
virtual |
References ListBox< T >::getItemsDestructive(), and List< T >::length().
|
virtual |
Extract a serialized (packed) representation from a_buf.
Given a linear representation of the class data previously made using linearIn() in a_buf, set the data for this class on the specified Box
.
References List< T >::append(), ListBox< T >::listItems(), and ListBox< T >::numItems().
Retrieve the mesh size.
References ListBox< T >::m_mesh_spacing.
Retrieve the box.
References ListBox< T >::m_box.
|
virtual |
Delete all items in this ListBox and reset it to the null Box.
References ListBox< T >::m_box, ListBox< T >::m_mesh_spacing, ListBox< T >::m_origin, ListBox< T >::undefine(), and RealVect::Zero.
|
inlinestatic |
Lists are not pre-allocatable. This function is needed so that ListBox.
can be stored inside LevelData<T> containers
as in BaseFab; needed for loop-unroll macro
References ListBox< T >::m_box, and Box::size().
|
inlinestaticprotected |
Referenced by ListBox< T >::define().
|
inlineprotectedvirtual |
Determines whether a_item is enclosed in a_box.
References Box::bigEnd(), D_TERM6, ListBox< T >::m_mesh_spacing, ListBox< T >::m_origin, and Box::smallEnd().
Referenced by ListBox< T >::addItem(), ListBox< T >::addItems(), ListBox< T >::addItemsDestructive(), ListBox< T >::getInvalid(), ListBox< T >::getInvalidDestructive(), ListBox< T >::getItems(), ListBox< T >::getItemsDestructive(), and ListBox< T >::numItems().
These functions are made private to prevent use of the default functions provided by the C++ compiler.
Referenced by ListBox< T >::define(), and ListBox< T >::undefine().
The Box that defines the valid region of this ListBox.
Referenced by ListBox< T >::addItem(), ListBox< T >::addItems(), ListBox< T >::addItemsDestructive(), ListBox< T >::box(), ListBox< T >::clear(), ListBox< T >::define(), ListBox< T >::getItems(), ListBox< T >::getItemsDestructive(), ListBox< T >::size(), and ListBox< T >::transfer().
Pointer to the List that stores our items.
Referenced by ListBox< T >::define(), ListBox< T >::getInvalid(), ListBox< T >::getInvalidDestructive(), ListBox< T >::getItems(), ListBox< T >::getItemsDestructive(), ListBox< T >::listItems(), ListBox< T >::transfer(), and ListBox< T >::undefine().
The cell size in physical space.
Referenced by ListBox< T >::clear(), ListBox< T >::define(), ListBox< T >::isEnclosed(), and ListBox< T >::meshSpacing().
The center of our coordinate system. Used for binning our items.
Referenced by ListBox< T >::clear(), ListBox< T >::define(), and ListBox< T >::isEnclosed().