#include <source/mesh/clustering/HistogramBox.h>
Public Types | |
enum | { ORIGINAL_MODE = 0, ORIG_FAST_REDUCE_MODE = 1, BINARY_TREE_MODE = 2, COMMUNICATOR_MODE = 3 } |
Public Member Functions | |
HistogramBox () | |
HistogramBox (const hier::Box< DIM > &box) | |
~HistogramBox () | |
void | findBoundBoxForTags (hier::Box< DIM > &bound_box, const hier::IntVector< DIM > &min_box) const |
void | boundTagHistogram (int &box_lo, int &box_hi, const int id, const int min_size) const |
void | setCommunicationMode (int mode) |
void | setCommunicator (tbox::SAMRAI_MPI::comm comm) |
int | computeTagHistogram (const tbox::Pointer< hier::PatchLevel< DIM > > level, const int tag_index, const int tag_val) |
const hier::Box< DIM > & | getBox () const |
tbox::Array< int > & | histogram (const int id) |
const tbox::Array< int > & | histogram (const int id) const |
int & | histogramElt (const int id, const int ic) |
const int & | histogramElt (const int id, const int ic) const |
void | setBox (const hier::Box< DIM > &box) |
void | resetHistogram () |
void | reduceTags (const tbox::Pointer< hier::PatchLevel< DIM > > level) |
void | reduceTags (const int id, const tbox::Pointer< hier::PatchLevel< DIM > > level, const int tag_index, const int tag_val) |
anonymous enum |
Enumerated type for the communication mode. For a description of each of these modes,
SAMRAI::mesh::HistogramBox< DIM >::HistogramBox | ( | ) |
Default constructor for HistogramBox<DIM>. Note that the HistogramBox<DIM> must be initialized with a box before it can be used.
SAMRAI::mesh::HistogramBox< DIM >::HistogramBox | ( | const hier::Box< DIM > & | box | ) |
Constructor for the HistogramBox<DIM>. The HistogramBox<DIM> will be initialized with the box and the histogram elements will be allocated and initialized to zero.
SAMRAI::mesh::HistogramBox< DIM >::~HistogramBox | ( | ) |
Destructor for the HistogramBox.
void SAMRAI::mesh::HistogramBox< DIM >::findBoundBoxForTags | ( | hier::Box< DIM > & | bound_box, | |
const hier::IntVector< DIM > & | min_box | |||
) | const |
Given histogram information in a box region, determine smallest box containing non-zero histogram points. Note that this routine assumes that histogram values are already computed.
void SAMRAI::mesh::HistogramBox< DIM >::boundTagHistogram | ( | int & | box_lo, | |
int & | box_hi, | |||
const int | id, | |||
const int | min_size | |||
) | const |
Bound the non-zero histogram elements within the specified interval (box_lo, box_hi) in the given coordinate direction.
void SAMRAI::mesh::HistogramBox< DIM >::setCommunicationMode | ( | int | mode | ) |
Set the method used to perform historgram reduction. (This function should only by called from within BergerRigoutsos<DIM>::findBoxesContainingTags.)
void SAMRAI::mesh::HistogramBox< DIM >::setCommunicator | ( | tbox::SAMRAI_MPI::comm | comm | ) |
Set the communicator to use during histogram reduction. This call only has an effect when used in conjunction with setCommunicationMode(COMMUNICATOR_MODE); (This function should only by called from within BergerRigoutsos<DIM>::findBoxesContainingTags.)
int SAMRAI::mesh::HistogramBox< DIM >::computeTagHistogram | ( | const tbox::Pointer< hier::PatchLevel< DIM > > | level, | |
const int | tag_index, | |||
const int | tag_val | |||
) |
Compute histogram for integer tags (matching tag_val) within the histogram box on the patch level.
void SAMRAI::mesh::HistogramBox< DIM >::reduceTags | ( | const tbox::Pointer< hier::PatchLevel< DIM > > | level | ) |
Compute global histogram by performing a reduction sum on the local histograms. Note that the reduction is needed since the histogram box will not be contained within any single patch, in general. Also, if the integer tag patch data corresponding to the given descriptor index has ghost cells, the values in these cells are ignored so that the reduction sums data over patch interiors only.
void SAMRAI::mesh::HistogramBox< DIM >::reduceTags | ( | const int | id, | |
const tbox::Pointer< hier::PatchLevel< DIM > > | level, | |||
const int | tag_index, | |||
const int | tag_val | |||
) |
const hier::Box< DIM > & SAMRAI::mesh::HistogramBox< DIM >::getBox | ( | ) | const [inline] |
Return const reference to box represented by histogram.
tbox::Array< int > & SAMRAI::mesh::HistogramBox< DIM >::histogram | ( | const int | id | ) | [inline] |
Return non-const reference to histogram array for given direction. Note that there is no bounds-checking on direction number.
const tbox::Array< int > & SAMRAI::mesh::HistogramBox< DIM >::histogram | ( | const int | id | ) | const [inline] |
Return const reference to histogram array for given direction. Note that there is no bounds-checking on direction number.
int & SAMRAI::mesh::HistogramBox< DIM >::histogramElt | ( | const int | id, | |
const int | ic | |||
) | [inline] |
Return non-const histogram element corresponding to given direction and cell index. Note cell index and histogram array location are distinct, in general. Also, there is no bounds checking done to assure the cell index lies within the box.
const int & SAMRAI::mesh::HistogramBox< DIM >::histogramElt | ( | const int | id, | |
const int | ic | |||
) | const [inline] |
Return const histogram element corresponding to given direction and cell index. Note cell index and histogram array location are distinct, in general. Also, there is no bounds checking done to assure the cell index lies within the box.
void SAMRAI::mesh::HistogramBox< DIM >::setBox | ( | const hier::Box< DIM > & | box | ) |
Set the box for the HistogramBox, allocate storage for the histogram signature arrays, and initialize the histogram elements to zero.
void SAMRAI::mesh::HistogramBox< DIM >::resetHistogram | ( | ) |
Set all histogram elements to zero.