#include <BoxLayout.H>
Inheritance diagram for BoxLayout:


A BoxLayout is a collection of Box objects that are assigned to process numbers. Each box is associated with only one process. Processes are numbered from 0 to n-1 (for a job with n processes).
A BoxLayout can be either open or closed.
Open BoxLayout:
Closed BoxLayout:
Ref-counting
BoxLayout is an explicitly ref-counted object.
Assignment and copy are compiler-generated. They increment the refcount on the contained data members. They perform shallow, ref-counted operations.
Refcounting is a process whereby multiple instantiations make use of a single implementation of that object and keep a tally of how many instantiations are sharing. Thus:
BoxLayout b1(boxes, procIDs);
b1 ----> refcount = 1 ----> m_boxes ----> m_processors
BoxLayout b2(b1)
b1 ----> refcount = 2 <---- b2 ----> m_boxes <---- ----> m_processors <----
BoxLayout b3; b3 = b2;
b1 ----> refcount = 3 <---- b2 ----> m_boxes <---- ----> m_processors <---- ^^^ ||| b3
Modification functions | |
| void | addBox (const Box &box, int procID) |
| virtual void | close () |
| virtual void | closeNoSort () |
| virtual void | deepCopy (const BoxLayout &a_source) |
| bool | coarsenable (int refRatio) const |
| void | setProcID (const LayoutIndex &a_index, unsigned int a_procID) |
| void | sort () |
| void | aliasAddBox (const Box &box) |
| void | aliasClose () |
| void | coarsen (BoxLayout &output, const BoxLayout &input, int refinement) |
| void | refine (BoxLayout &output, const BoxLayout &input, int refinement) |
Public Member Functions | |
| Vector< Box > | boxArray () const |
| Vector< int > | procIDs () const |
Constructors, destructors, assignments, defines | |
| BoxLayout () | |
| BoxLayout (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs) | |
| BoxLayout (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs, const Vector< int > &a_blockID) | |
| virtual | ~BoxLayout () |
| BoxLayout & | operator= (const BoxLayout &a_rhs) |
| virtual void | define (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs) |
| virtual void | define (const Vector< Box > &a_boxes, const Vector< int > &a_procIDs, const Vector< int > &a_blockIDs) |
| Multi-Block form of constructor. | |
Accessors | |
| const Box & | operator[] (const LayoutIndex &it) const |
| Box & | ref (const LayoutIndex &it) |
| const Box & | operator[] (const LayoutIterator &it) const |
| const Box & | operator[] (const DataIterator &it) const |
| Box | get (const LayoutIndex &it) const |
| Box | get (const DataIterator &it) const |
| Box | get (const LayoutIterator &it) const |
| unsigned int | procID (const LayoutIndex &a_index) const |
| unsigned int | blockID (const LayoutIndex &a_index) const |
| int | numBoxes (const int procID) const |
| Returns the number of boxes assigned to a given procID. | |
| unsigned int | size () const |
| unsigned int | index (const LayoutIndex &index) const |
Checks | |
| bool | operator== (const BoxLayout &rhs) const |
| bool | eq (const BoxLayout &rhs) const |
| bool | isClosed () const |
| bool | isSorted () const |
| bool | check (const LayoutIndex &index) const |
| bool | compatible (const BoxLayout &a_rhs) const |
Iterators | |
| DataIterator | dataIterator () const |
| Parallel iterator. | |
| LayoutIterator | layoutIterator () const |
| Iterator that processes through ALL the boxes in a BoxLayout. | |
I/O functions | |
| void | print () const |
| void | p () const |
Protected Member Functions | |
| void | setIndexVector () |
| virtual void | computeNeighbors () |
| void | checkDefine (const Vector< Box > &a_boxes, const Vector< int > &procIDs) |
Protected Attributes | |
| RefCountedPtr< Vector< Entry > > | m_boxes |
| RefCountedPtr< Vector< unsigned int > > | m_index |
| RefCountedPtr< int > | m_layout |
| RefCountedPtr< bool > | m_closed |
| RefCountedPtr< DataIterator > | m_dataIterator |
| RefCountedPtr< Vector< int > > | m_neighbors |
|
|
Construct BoxLayout with no boxes. |
|
||||||||||||
|
Construct from a Vector of Boxes and a Vector of processor assignments. On exit, the BoxLayout will be closed. |
|
||||||||||||||||
|
Multi-Block form of constructor |
|
|
Ref-counted destruction. Once the last reference to the implementation of this class is destroyed, the data members are cleaned up |
|
|
Ref-counted assignment. |
|
||||||||||||
|
Define this BoxLayout from a Vector of Boxes and a Vector of processor assignments. Any pre-existing layout will be lost (ref-count dropped by one). The processor assignment Vector must be the same length as the Box Vector. On exit, the BoxLayout will be closed. Reimplemented in DisjointBoxLayout. |
|
||||||||||||||||
|
Multi-Block form of constructor.
Reimplemented in DisjointBoxLayout. |
|
|
const accessor operator. See also get(const LayoutIndex&). |
|
|
accessor operator. See also get(const LayoutIndex&). not overloaded with operator[] on purpose. |
|
|
accessor operator. See also get(const LayoutIndex&). |
|
|
accessor operator. See also get(const LayoutIndex&). |
|
|
Get box indexed by it. As a consequence of the C++ compiler being free to choose which version of operator[] when the object is technically non-const, we very often get 'BoxLayout closed' errors. This is a non-overloaded get method. |
|
|
Get box indexed by it. equivalent to get(it()), just does the extra() for you. |
|
|
Get box indexed by it. equivalent to get(it()), just does the extra() for you. |
|
|
Returns the processor to which this box has been assigned. Not a user function, at least, not a new user function. It can be used safely at anytime, closed or open. A person needing this level of knowledge of the processor assignment should have non-trivial needs, like writing your own load balancer or such. Most user-level parallel |
|
|
Returns the Multiblock block which this box is a member of. This function is used in conjunction with the MappedDomain class. |
|
|
Returns the number of boxes assigned to a given procID. Returns the number of boxes assigned to a given procID. |
|
|
Returns the total number of boxes in the BoxLayout. |
|
|
Not a user function. Used in I/O routine. |
|
|
Refcounted pointer check. Return |
|
|
Refcounted pointer check. Return |
|
|
Return |
|
|
Return |
|
|
not a user function |
|
|
returns 'true' if you can use the same LayoutIterator and DataIterator on these two layouts and data holders built on top of these layouts |
|
||||||||||||
|
Add a box to this BoxLayout. Takes the processor assignment. The input box is copied. BoxLayout must be "open" for this operation, or else a runtime error will occur. |
|
|
Mark this BoxLayout as complete and unchangeable. Reimplemented in DisjointBoxLayout. |
|
|
|
|
|
Actual deep copy operation. New object created with copied data. This object disassociates itself with original implementation safely. This object now is considered 'open' and can be non-const modified. There is no assurance that the order in which this BoxLayout is indexed corresponds to the indexing of a_source.
|
|
|
returns true iff: |
|
||||||||||||
|
Assign a Box in the BoxLayout to a processor. Requires the BoxLayout to be open. |
|
|
Sort the boxes of an open BoxLayout. No change if the BoxLayout is closed. |
|
|
Not a user function, used in Chombo interface to AMRData.H interoperability tools. |
|
|
Not a user function, used in Chombo interface to AMRData.H interoperability tools. |
|
|
Parallel iterator. Parallel iterator. Returns DataIndex object that corresponds to boxes on the local processor only. |
|
|
Iterator that processes through ALL the boxes in a BoxLayout. Iterator that processes through ALL the boxes in a BoxLayout. If BoxLayout is closed, then LayoutIterator will return the Boxes in sorted order. |
|
|
Invokes cout<<*this; pretty-print dump of BoxLayout. |
|
|
Invokes cout<<*this; pretty-print dump of BoxLayout. |
|
|
|
|
|
Return the processor id numbers corresponding to the boxes as returned by this->boxArray(). |
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
Coarsen a BoxLayout:
output is first deepCopy'ed from input, then coarsen(refinement) is called on each box of output. output returns from this function closed. LayoutIterators and DataIterators from input and output can be used interchangeably. |
|
||||||||||||||||
|
Refine a BoxLayout:
output is first deepCopy'ed from input, then refine(refinement) is called on each box of output. output returns from this function closed. LayoutIterators and DataIterators from input and output can be used interchangeably. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.6