|
| enum | Locality { DST_IS_LOCAL,
DST_IS_NONLOCAL
} |
| |
| BoxArray< DIM > | d_src_boxes |
| |
| tbox::Array< int > | d_src_idx |
| |
| tbox::Array< int > | d_src_map |
| |
| BoxArray< DIM > | d_dst_boxes |
| |
| IntVector< DIM > | d_grow_dst_boxes |
| |
| int | d_sort_dimension |
| |
| tbox::Array< tbox::Array< int > > | d_adj |
| |
| tbox::Array< tbox::Array< int > > | d_adj_local |
| |
| tbox::Pointer< tbox::Timer > | t_setup_total |
| |
| tbox::Pointer< tbox::Timer > | t_setup_add_edges |
| |
| tbox::Pointer< tbox::Timer > | t_setup_sort |
| |
| | BoxGraph (const BoxArray< DIM > &src_box_array, const tbox::Array< tbox::List< IntVector< DIM > > > &src_shifts, const ProcessorMapping &src_mapping, const BoxArray< DIM > &dst_box_array, const IntVector< DIM > &dst_grow=IntVector< DIM >(1), int sort_dimension=-1) |
| | Constructor for use with getSrcOverlapIndices(). More...
|
| |
| | BoxGraph (const BoxArray< DIM > &src_box_array, const tbox::Array< tbox::List< IntVector< DIM > > > &src_shifts, const BoxArray< DIM > &dst_box_array, const IntVector< DIM > &dst_grow=IntVector< DIM >(1), int sort_dimension=-1) |
| | Constructor for use with removeIntersections(). More...
|
| |
| | BoxGraph (const BoxArray< DIM > &src_box_array, const BoxArray< DIM > &dst_box_array, const IntVector< DIM > &dst_grow=IntVector< DIM >(1), int sort_dimension=-1) |
| |
| | ~BoxGraph () |
| |
| const tbox::Array< int > & | getSrcOverlapIndices (int dst_index) |
| | Compute the indices of boxes from the src_box_array that overlap with the box dst_box_array[index]. More...
|
| |
| const tbox::Array< int > & | getLocalSrcOverlapIndices (int dst_index) |
| | Computes the indices of boxes from the src_box_array that overlap with the box dst_box_array[index] and that are mapped to the same processor. More...
|
| |
| void | removeIntersections (BoxList< DIM > &list) |
| | Remove from the dst_box_array the portions that intersect the boxes in src_box_array. More...
|
| |
| void | printGraph (std::ostream &os=tbox::plog) |
| | Undocumented function, used during development and testing. More...
|
| |
| | BoxGraph (const BoxGraph< DIM > &) |
| |
| BoxGraph< DIM > & | operator= (const BoxGraph< DIM > &) |
| |
| void | addEdges (tbox::Array< typename BoxGraph< DIM >::GraphNode > &src, int src_ct, tbox::Array< typename BoxGraph< DIM >::GraphNode > &dst, int dst_ct, tbox::Array< tbox::List< int > > &adj_lists) |
| |
| void | buildLocalOverlapArrays () |
| |
| void | findBinLimits (int binNumberIN, int dim, tbox::Array< typename BoxGraph< DIM >::GraphNode > &sortedNodesIN, int &firstOUT, int &lastOUT, int &rightEdgeOfBinOUT) |
| |
| void | findSortDimension () |
| |
| void | sortNodeList (tbox::Array< typename BoxGraph< DIM >::GraphNode > &list, int len) |
| |
| void | sortIndices (tbox::Array< tbox::Array< int > > &graph) |
| |
| void | buildGraph () |
| |
| void | print (tbox::Array< typename BoxGraph< DIM >::GraphNode > &list, int len) |
| |
| static int | qsortCompare (const void *v, const void *w) |
| |
| static int | qsortIntCompare (const void *v, const void *w) |
| |
template<int DIM>
class SAMRAI::hier::BoxGraph< DIM >
Class BoxGraph is a utility class that provides functionality that can be used to reduce the runtime complexity of certain box calculus operations. Two types of functionality are provided. First, there is a getSrcOverlapIndices() method; second, there is a removeIntersections() method. These are described below.
BoxGraph is designed around the premise that you have two sets of boxes: an array or source boxes (src_box_array), and an array of destination boxes (dst_box_array). The dst boxes are grown by some number of cells in each coordinate direction to determine overlaps with the source boxes. Typically, this is related to the ghost width of that data that resides on AMR hierachy patches that correspond to the boxes. The getSrcOverlapIndices() and getLocalSrcOverlapIndices() methods provide efficient methods to determine which boxes from the src_box_array overlap with a specified box from the dst_box_array.
getSrcOverlapIndices() returns the indices of all source boxes that overlap with a specified destination box. getLocalSrcOverlapIndices() returns the indices of all source boxes that overlap with a specified destination box and are mapped to the same processor as the specified destination box.
The removeIntersections() method is similar in concept to the BoxList<DIM>::removeIntersections() method. Here, however, we operate on the two arrays of boxes that are passed to the constructor. The BoxGraph::removeIntersections() method is functionally equivalent to the following:
* BoxList<DIM> dst_box_list(dst_box_array);
* BoxList<DIM> src_box_list(src_box_array);
* dst_box_list.removeIntersections(src_box_list);
*
Note that the dst_box_array may be the same as the src_box_array. This occurs, for example, during regridding operations when both both levels are the same.
The above sequence of calls, however, has O(N^2) runtime complexity, assuming both arrays of boxes contain N items. This class typically performs removeIntersections in O(N^3/2), although worst case behavior can be shown to be O(N^5/2).
Internally BoxGraph operates by constructing a bipartite graph; (this is performed in the constructor). One set of independent vertices contains a vertex for each box in the src_box_array; the other independent set contains vertices corresponding to the dst_box_array. The graph contains an edge (i,j) if (1) vertices i and j belong to different independent sets; (2) the boxes corresponding to the vertices overlap each other.
Methods in this class were originally designed to improve efficiency in xfer_RefineSchedule<DIM>::generateCommunicationSchedule().