#include <source/mesh/clustering/AsyncBergerRigoutsosNode.h>
Inheritance diagram for SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >:
Public Types | |
enum | OwnerMode { SINGLE_OWNER = 0, MOST_OVERLAP = 1, FEWEST_OWNED = 2, LEAST_ACTIVE = 3 } |
typedef hier::LayerNodeSet< DIM >::Node | GraphNode |
Shorthand for the box-graph node corresponding to boxes. | |
typedef hier::LayerNodeSet< DIM >::NodeContainer | GraphNodeContainer |
Shorthand for a container of graph-nodes. | |
typedef hier::LayerEdgeSet< DIM >::NabrContainer | GraphNabrContainer |
Shorthand for a container of neighbor graph-nodes. | |
typedef hier::LayerEdgeSet< DIM >::Connectivity | Connectivity |
Shortthand for the connectivity between two sets of graph nodes. | |
typedef std::set< int > | IntSet |
Shorthand for a sorted, possibly incontiguous, set of integers. | |
Public Member Functions | |
AsyncBergerRigoutsosNode (CommonParams *common_params, const hier::Box< DIM > *bound_box=NULL, mesh::AsyncBergerRigoutsosNode< DIM > *parent=NULL, const int child_number=1) | |
Construct a node of a BR dendogram. | |
~AsyncBergerRigoutsosNode (void) | |
Destructor. | |
void | runAlgorithm () |
Run the BR algorithm to find boxes. | |
Algorithm mode settings | |
void | setMaxGhostCellWidth (const hier::IntVector< DIM > &max_gcw) |
Set the maximum ghost cell width used for checking overlaps. | |
void | setAlgorithmAdvanceMode (const std::string &algo_advance_mode) |
Set the mode for advancing the asynchronous implementation. | |
void | setOwnerMode (const std::string &mode) |
Set the method for choosing the owner. Choices:
| |
void | setUseLevelBoxes (bool flag) |
Switch on or off the use of global level boxes. | |
void | setComputeEdges (int compute_edges) |
Edge computation flag. | |
Access to outputs | |
const hier::LayerNodeSet< DIM > & | getNewNodes () const |
Get the output boxes in a hier::LayerNodeSet<DIM> form. | |
const Connectivity & | getNewCnect () const |
Get the connectivity between input and output graph nodes (between the tagged and new graph nodes). | |
Developer's methods for analysis and debugging this class. | |
virtual void | printClassData (std::ostream &os, int detail_level=0) const |
int | getMaxNodes () const |
Max number of local nodes for dendogram. | |
int | getMaxGeneration () const |
max generation count for the local nodes in the dendogram. | |
int | getMaxOwnership () const |
Max number of locally owned nodes in the dendogram. | |
double | getAvgNumberOfCont () const |
Average number of continuations for local nodes in dendogram. | |
int | getMaxNumberOfCont () const |
Max number of continuations for local nodes in dendogram. | |
int | getNumBoxesGenerated () const |
Number of boxes generated (but not necessarily owned) on the local process. | |
void | setLogNodeHistory (bool flag) |
Set whether to log dendogram node action history (useful for debugging). | |
Classes | |
struct | CommonParams |
Parameters shared among all dendogram nodes in an dendogram and collectively managed by those nodes. More... |
In mesh generation, the BR algorithm can be used to cluster tagged cells into boxes. This algorithm is described in Berger and Rigoutsos, IEEE Trans. on Sys, Man, and Cyber (21)5:1278-1286.
This class implements the BR algorithm to execute in a non-recursive way, in order to improve parallel efficiency over recursive implementations. To facilitate a non-recursive implementation, data in the recursive tree is maintained in a "BR dendogram", nodes of which are instances of this class.
Clarification on the uses of the word "node":
Each dendogram node is associated with a candidate box, an owner process coordinating distributed computations on the box and a group of processors participating in those computations. Should the candidate box be one of the final output boxes, the owner also owns the graph node associated with the box.
To use this class:
This class creates its output in a distributed nested-level box-graph (DNBG) format. The output is distributed over all processes running the algorithm, with each process owning a subset of the DNBG. The 2 primary outputs of this implementation are:
typedef hier::LayerNodeSet<DIM>::Node SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::GraphNode |
Shorthand for the box-graph node corresponding to boxes.
typedef hier::LayerNodeSet<DIM>::NodeContainer SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::GraphNodeContainer |
Shorthand for a container of graph-nodes.
typedef hier::LayerEdgeSet<DIM>::NabrContainer SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::GraphNabrContainer |
Shorthand for a container of neighbor graph-nodes.
typedef hier::LayerEdgeSet<DIM>::Connectivity SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::Connectivity |
Shortthand for the connectivity between two sets of graph nodes.
typedef std::set<int> SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::IntSet |
Shorthand for a sorted, possibly incontiguous, set of integers.
enum SAMRAI::mesh::AsyncBergerRigoutsosNode::OwnerMode |
SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::AsyncBergerRigoutsosNode | ( | CommonParams * | common_params, | |
const hier::Box< DIM > * | bound_box = NULL , |
|||
mesh::AsyncBergerRigoutsosNode< DIM > * | parent = NULL , |
|||
const int | child_number = 1 | |||
) |
Construct a node of a BR dendogram.
Construct a node node of a BR dendogram, which you can use to run the BR algorithm.
common_params | The common parameter object you plan to use to run the ABR algorithm. | |
bound_box | Bounding box for tagged cells. | |
parent | Parent node of the node being constructed. Set to NULL if you are constructing the root node of the BR dendogram. | |
child_number | 0 if constructing left child and 1 if constructing right child. Set to 1 if you are constructing the root node of the BR dendogram. |
SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::~AsyncBergerRigoutsosNode | ( | void | ) |
Destructor.
Deallocate internal data.
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::setMaxGhostCellWidth | ( | const hier::IntVector< DIM > & | max_gcw | ) |
Set the maximum ghost cell width used for checking overlaps.
Overlap checking is done to determine nearest-neighbor relationships when generating connectivity to new graph nodes. If a box grown by this ammount intersects another box, the two boxes are considered neighbors.
By default the max ghost cell width is one in each direction.
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::setAlgorithmAdvanceMode | ( | const std::string & | algo_advance_mode | ) |
Set the mode for advancing the asynchronous implementation.
Choices are:
The default is "ADVANCE_SOME".
Asynchronous modes are NOT guaranteed to compute the output graph nodes in any particular order. The order depends on the ordering of message completion, which is not deterministic. If you require consistent outputs, we suggest you have a scheme for reordering the output boxes.
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::setOwnerMode | ( | const std::string & | mode | ) |
Set the method for choosing the owner. Choices:
Experiments show that "MOST_OVERLAP" gives the best clustering speed, while "SINGLE_OWNER" may give a faster output globalization (since you don't need an all-gather).
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::setUseLevelBoxes | ( | bool | flag | ) |
Switch on or off the use of global level boxes.
If off, the global level boxes will neither be used nor be generated. This feature is in anticipation of future support for the distributed nested-level box graph in SAMRAI.
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::setComputeEdges | ( | int | compute_edges | ) |
Edge computation flag.
Valid values to set are:
By default, the value is 2.
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::runAlgorithm | ( | ) |
Run the BR algorithm to find boxes.
const hier::LayerNodeSet< DIM > & SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getNewNodes | ( | ) | const |
Get the output boxes in a hier::LayerNodeSet<DIM> form.
const hier::LayerEdgeSet< DIM >::Connectivity & SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getNewCnect | ( | ) | const |
Get the connectivity between input and output graph nodes (between the tagged and new graph nodes).
The connectivity data generated depend on the flag set using setComputeEdges().
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::printClassData | ( | std::ostream & | os, | |
int | detail_level = 0 | |||
) | const [virtual] |
int SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getMaxNodes | ( | ) | const |
Max number of local nodes for dendogram.
int SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getMaxGeneration | ( | ) | const |
max generation count for the local nodes in the dendogram.
int SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getMaxOwnership | ( | ) | const |
Max number of locally owned nodes in the dendogram.
double SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getAvgNumberOfCont | ( | ) | const |
Average number of continuations for local nodes in dendogram.
int SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getMaxNumberOfCont | ( | ) | const |
Max number of continuations for local nodes in dendogram.
int SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::getNumBoxesGenerated | ( | ) | const |
Number of boxes generated (but not necessarily owned) on the local process.
void SAMRAI::mesh::AsyncBergerRigoutsosNode< DIM >::setLogNodeHistory | ( | bool | flag | ) |
Set whether to log dendogram node action history (useful for debugging).