IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
SAMRAI::mesh::BergerRigoutsos< DIM > Class Template Reference

BergerRigoutsos<DIM> provides operations that construct boxes to cover a collection of tagged cells on a single AMR hierarchy patch level. This class is derived from the abstract base class BoxGeneratorStrategy<DIM>. Thus, it serves as a concrete implementation of the box generator Strategy pattern interface. More...

#include <BergerRigoutsos.h>

Inheritance diagram for SAMRAI::mesh::BergerRigoutsos< DIM >:
Inheritance graph
[legend]

Public Member Functions

virtual ~BergerRigoutsos ()
 
 BergerRigoutsos ()
 
void findBoxesContainingTags (hier::BoxList< DIM > &boxes, const tbox::Pointer< hier::PatchLevel< DIM > > level, const int index, const int tag_val, const hier::Box< DIM > &bound_box, const hier::IntVector< DIM > &min_box, const double efficiency_tol, const double combine_tol) const
 

Static Public Member Functions

static void setClusteringOption (const std::string &method=std::string())
 

Private Member Functions

void findBoxesContainingTagsOriginal (hier::BoxList< DIM > &boxes, const tbox::Pointer< hier::PatchLevel< DIM > > level, const int index, const int tag_val, const hier::Box< DIM > &bound_box, const hier::IntVector< DIM > &min_box, const double efficiency_tol, const double combine_tol) const
 
void findBoxesContainingTagsCommunicators (hier::BoxList< DIM > &boxes, const tbox::Pointer< hier::PatchLevel< DIM > > level, const int index, const int tag_val, const hier::Box< DIM > &bound_box, const hier::IntVector< DIM > &min_box, const double efficiency_tol, const double combine_tol, int recurse_level, tbox::SAMRAI_MPI::comm comm) const
 
void findBoxesContainingTagsBinaryTree (hier::BoxList< DIM > &boxes, const tbox::Pointer< hier::PatchLevel< DIM > > level, const int index, const int tag_val, const hier::Box< DIM > &bound_box, const hier::IntVector< DIM > &min_box, const double efficiency_tol, const double combine_tol, int recurse_level) const
 
bool splitTagBoundBox (hier::Box< DIM > &box_lft, hier::Box< DIM > &box_rgt, const hier::Box< DIM > &bound_box, const HistogramBox< DIM > &hist_box, const hier::IntVector< DIM > &min_box) const
 
bool findZeroCutPoint (int &cut_pt, const int id, const int lo, const int hi, const HistogramBox< DIM > &hist_box, const int min_size) const
 
void cutAtLaplacian (int &cut_pt, const int id, const int lo, const int hi, const HistogramBox< DIM > &hist_box, const int min_size) const
 
 BergerRigoutsos (const BergerRigoutsos< DIM > &)
 
void operator= (const BergerRigoutsos< DIM > &)
 

Static Private Member Functions

static void freeTimers ()
 

Static Private Attributes

static std::string s_tag_reduce_method
 
static bool s_tag_reduce_method_initialized
 
static tbox::Pointer< tbox::Timert_cluster
 
static tbox::Pointer< tbox::Timert_globalize_boxes
 
static tbox::Pointer< tbox::Timert_compute
 
static tbox::Pointer< tbox::Timert_commwait
 

Detailed Description

template<int DIM>
class SAMRAI::mesh::BergerRigoutsos< DIM >

The box generation algorithm is described in Berger and Rigoutsos, tbox::IEEE Trans. on Sys, Man, and Cyber (21)5:1278-1286.

NOTE: Algorithmic variations which may affect performance are available by calling the the static method BergerRigoutsos<DIM>::setClusteringOption(), which sets the option for all instances of the class.

See also
mesh::HistogramBox
mesh::BoxGeneratorStrategy

Constructor & Destructor Documentation

◆ ~BergerRigoutsos()

template<int DIM>
virtual SAMRAI::mesh::BergerRigoutsos< DIM >::~BergerRigoutsos ( )
virtual

Virtual destructor.

◆ BergerRigoutsos() [1/2]

template<int DIM>
SAMRAI::mesh::BergerRigoutsos< DIM >::BergerRigoutsos ( )

The constructor queries the tbox::InputManager to determine which of the various findBoxesContainingTags algorithms should be used.

◆ BergerRigoutsos() [2/2]

template<int DIM>
SAMRAI::mesh::BergerRigoutsos< DIM >::BergerRigoutsos ( const BergerRigoutsos< DIM > &  )
private

Member Function Documentation

◆ setClusteringOption()

template<int DIM>
static void SAMRAI::mesh::BergerRigoutsos< DIM >::setClusteringOption ( const std::string &  method = std::string())
static

Static function to set tag reduction option for clustering algorithm.

Parameters
methodstring identifying box intersection method. Valid choices are: "ORIGINAL" (default case for single processor), "ORIG_FAST_REDUCE", "COMMUNICATOR", and "BINARY_TREE" (default case for multiple processors). The default empty string argument resets the method to the default case.

Each of these four options produces identical results but may result in different performance characteristics depending on the machine architecture on which the code is run. The defaults appear to be the most efficient choices for the tests we have performed. The options are:

  • ORIGINAL - original algorithm used in SAMRAI through v1.3.1; uses global reductions to collect tag information.
  • ORIG_FAST_REDUCE - original algorithm but with a faster reduce operation.
  • COMMUNICATOR - uses communicators to store data in each recursion of the algorithm.
  • BINARY_TREE - uses a binary tree communication scheme with hand-coded sends and receives.

If an invalid non-empty string is passed, an unrecoverable error will result.

◆ findBoxesContainingTags()

template<int DIM>
void SAMRAI::mesh::BergerRigoutsos< DIM >::findBoxesContainingTags ( hier::BoxList< DIM > &  boxes,
const tbox::Pointer< hier::PatchLevel< DIM > >  level,
const int  index,
const int  tag_val,
const hier::Box< DIM > &  bound_box,
const hier::IntVector< DIM > &  min_box,
const double  efficiency_tol,
const double  combine_tol 
) const
virtual

Create a list of boxes that covers all integer tags on the patch level that match the specified tag value. Each box will be at least as large as the given minimum size and the tolerances will be met. The

The efficiency tolerance is a threshold value for the percentage of tagged cells in each box. If this percentage is below the tolerance, the box will continue to be split into smaller boxes.

The combine tolerance is a threshold value for the sum of the volumes of two boxes into which a box may be potentially split. If ratio of that sum and the volume of the original box, the box will not be split.

Implements SAMRAI::mesh::BoxGeneratorStrategy< DIM >.

◆ findBoxesContainingTagsOriginal()

template<int DIM>
void SAMRAI::mesh::BergerRigoutsos< DIM >::findBoxesContainingTagsOriginal ( hier::BoxList< DIM > &  boxes,
const tbox::Pointer< hier::PatchLevel< DIM > >  level,
const int  index,
const int  tag_val,
const hier::Box< DIM > &  bound_box,
const hier::IntVector< DIM > &  min_box,
const double  efficiency_tol,
const double  combine_tol 
) const
private

◆ findBoxesContainingTagsCommunicators()

template<int DIM>
void SAMRAI::mesh::BergerRigoutsos< DIM >::findBoxesContainingTagsCommunicators ( hier::BoxList< DIM > &  boxes,
const tbox::Pointer< hier::PatchLevel< DIM > >  level,
const int  index,
const int  tag_val,
const hier::Box< DIM > &  bound_box,
const hier::IntVector< DIM > &  min_box,
const double  efficiency_tol,
const double  combine_tol,
int  recurse_level,
tbox::SAMRAI_MPI::comm  comm 
) const
private

◆ findBoxesContainingTagsBinaryTree()

template<int DIM>
void SAMRAI::mesh::BergerRigoutsos< DIM >::findBoxesContainingTagsBinaryTree ( hier::BoxList< DIM > &  boxes,
const tbox::Pointer< hier::PatchLevel< DIM > >  level,
const int  index,
const int  tag_val,
const hier::Box< DIM > &  bound_box,
const hier::IntVector< DIM > &  min_box,
const double  efficiency_tol,
const double  combine_tol,
int  recurse_level 
) const
private

◆ splitTagBoundBox()

template<int DIM>
bool SAMRAI::mesh::BergerRigoutsos< DIM >::splitTagBoundBox ( hier::Box< DIM > &  box_lft,
hier::Box< DIM > &  box_rgt,
const hier::Box< DIM > &  bound_box,
const HistogramBox< DIM > &  hist_box,
const hier::IntVector< DIM > &  min_box 
) const
private

◆ findZeroCutPoint()

template<int DIM>
bool SAMRAI::mesh::BergerRigoutsos< DIM >::findZeroCutPoint ( int cut_pt,
const int  id,
const int  lo,
const int  hi,
const HistogramBox< DIM > &  hist_box,
const int  min_size 
) const
private

◆ cutAtLaplacian()

template<int DIM>
void SAMRAI::mesh::BergerRigoutsos< DIM >::cutAtLaplacian ( int cut_pt,
const int  id,
const int  lo,
const int  hi,
const HistogramBox< DIM > &  hist_box,
const int  min_size 
) const
private

◆ freeTimers()

template<int DIM>
static void SAMRAI::mesh::BergerRigoutsos< DIM >::freeTimers ( )
staticprivate

Free static timers.

To be called by shutdown registry to make sure memory for timers does not leak.

◆ operator=()

template<int DIM>
void SAMRAI::mesh::BergerRigoutsos< DIM >::operator= ( const BergerRigoutsos< DIM > &  )
private

Member Data Documentation

◆ s_tag_reduce_method

template<int DIM>
std::string SAMRAI::mesh::BergerRigoutsos< DIM >::s_tag_reduce_method
staticprivate

◆ s_tag_reduce_method_initialized

template<int DIM>
bool SAMRAI::mesh::BergerRigoutsos< DIM >::s_tag_reduce_method_initialized
staticprivate

◆ t_cluster

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::mesh::BergerRigoutsos< DIM >::t_cluster
staticprivate

◆ t_globalize_boxes

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::mesh::BergerRigoutsos< DIM >::t_globalize_boxes
staticprivate

◆ t_compute

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::mesh::BergerRigoutsos< DIM >::t_compute
staticprivate

◆ t_commwait

template<int DIM>
tbox::Pointer<tbox::Timer> SAMRAI::mesh::BergerRigoutsos< DIM >::t_commwait
staticprivate

The documentation for this class was generated from the following file: