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

Class LocallyActiveDataPatchBoundaryEdgeSum provides operations summing locally-active edge data values at edges that are shared by multiple patches on a single level. Note that this utility only works on a SINGLE patch level, not on a multiple levels in an AMR patch hierarchy like the LocallyActiveDataPatchBoundaryNodeSum class. Unlike node data, edge data at coarse-fine boundaries are not co-located, so the sum operation across levels depends on application requirements. More...

#include <LocallyActiveDataPatchBoundaryEdgeSum.h>

Public Member Functions

 LocallyActiveDataPatchBoundaryEdgeSum (const std::string &object_name)
 Constructor initializes object to default (mostly undefined) state. More...
 
 ~LocallyActiveDataPatchBoundaryEdgeSum ()
 Destructor for the schedule releases all internal storage. More...
 
void registerSum (int edge_data_id)
 Register edge data with given patch data identifier for summing. More...
 
void setupSum (tbox::Pointer< hier::PatchLevel< DIM > > level, tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > level_mgr)
 Set up summation operations for edge data across shared edges on a single level. More...
 
void computeSum () const
 Compute sum of edge values at each shared edge and replace each such edge value with the corresponding sum.
More...
 

Static Public Member Functions

static int getNumSharedPatchDataSlots (int max_variables_to_register)
 Static function used to predetermine number of patch data slots ahared among all LocallyActiveDataPatchBoundaryEdgeSum objects (i.e., static members). To get a correct count, this routine should only be called once. More...
 
static int getNumUniquePatchDataSlots (int max_variables_to_register)
 Static function used to predetermine number of patch data slots unique to each LocallyActiveDataPatchBoundaryEdgeSum object (i.e., non-static members). To get a correct count, this routine should be called exactly once for each object that will be constructed. More...
 

Private Types

enum  PATCH_BDRY_EDGE_SUM_DATA_ID { ID_UNDEFINED = -1 }
 

Private Member Functions

void doLevelSum (tbox::Pointer< hier::PatchLevel< DIM > > level, tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > level_mgr) const
 
void setInternalWorkDataActive (tbox::Pointer< hier::PatchLevel< DIM > > level, tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > level_mgr)
 

Private Attributes

std::string d_object_name
 
bool d_setup_called
 
int d_num_reg_sum
 
tbox::Array< intd_user_edge_data_id
 
tbox::Array< intd_user_edge_depth
 
tbox::Array< intd_num_registered_data_by_depth
 
tbox::Array< tbox::Pointer< hier::Variable< DIM > > > d_tmp_oedge_src_variable
 
tbox::Array< tbox::Pointer< hier::Variable< DIM > > > d_tmp_oedge_dst_variable
 
tbox::Array< intd_oedge_src_id
 
tbox::Array< intd_oedge_dst_id
 
hier::ComponentSelector d_oedge_src_data_set
 
hier::ComponentSelector d_oedge_dst_data_set
 
tbox::Pointer< hier::PatchLevel< DIM > > d_level
 
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > d_level_mgr
 
tbox::Pointer< xfer::LocallyActiveDataRefineTransactionFactory< DIM > > d_sum_transaction_factory
 
tbox::Pointer< xfer::LocallyActiveDataRefineSchedule< DIM > > d_single_level_sum_schedule
 

Static Private Attributes

static int s_instance_counter
 
static tbox::Array< tbox::Array< int > > s_oedge_src_id_array
 
static tbox::Array< tbox::Array< int > > s_oedge_dst_id_array
 

Detailed Description

template<int DIM>
class SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >

Usage of a patch boundry edge sum involves the following sequence of steps:

  1. Construct a patch boundry edge sum object. For example,
    *         LocallyActiveDataPatchBoundaryEdgeSum<DIM> my_edge_sum("My Edge Sum");
    *     
  2. Register edge data quantities to sum. For example,
    *         my_edge_sum.registerSum(edge_data_id1);
    *         my_edge_sum.registerSum(edge_data_id2);
    *         etc...
    *     
  3. Setup the sum operations for a single level involving patches defined to be active by a given level manager. For example,
    *         my_edge_sum.setupSum(level, level_mgr);
    *     
  4. Execute the sum operation. For example,
    *         my_edge_sum.computeSum()
    *     

The result of these operations is that each edge patch data value associated with the registered ids at patch boundaries on the level is replaced by the sum of all data values at the edge.

Member Enumeration Documentation

◆ PATCH_BDRY_EDGE_SUM_DATA_ID

Enumerator
ID_UNDEFINED 

Constructor & Destructor Documentation

◆ LocallyActiveDataPatchBoundaryEdgeSum()

template<int DIM>
SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::LocallyActiveDataPatchBoundaryEdgeSum ( const std::string &  object_name)
Parameters
object_nameconst std::string reference for name of object used in error reporting. When assertion checking is on, the string cannot be empty.

◆ ~LocallyActiveDataPatchBoundaryEdgeSum()

Member Function Documentation

◆ getNumSharedPatchDataSlots()

template<int DIM>
static int SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::getNumSharedPatchDataSlots ( int  max_variables_to_register)
static
Returns
integer number of internal patch data slots required to perform sum.
Parameters
max_variables_to_registerinteger value indicating maximum number of patch data ids that will be registered
with edge sum objects.

◆ getNumUniquePatchDataSlots()

template<int DIM>
static int SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::getNumUniquePatchDataSlots ( int  max_variables_to_register)
static
Returns
integer number of internal patch data slots required to perform sum.
Parameters
max_variables_to_registerinteger value indicating maximum number of patch data ids that will be registered with edge sum objects.

◆ registerSum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::registerSum ( int  edge_data_id)
Parameters
edge_data_idinteger patch data index for edge data to sum

The edge data id must be a valid patch data id (>=0) and must correspond to edge-centered double data. If not, an error will result.

◆ setupSum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::setupSum ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > >  level_mgr 
)
Parameters
levelpointer to level on which to perform edge sum
level_mgrpointer to level mgr defining active patches for edge data registered with the edge sum object

When assertion checking is active, neither pointer can be null.

◆ computeSum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::computeSum ( ) const

At the end of this method, all values at shared edge locations on patch boundaries will have the same value.

◆ doLevelSum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::doLevelSum ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > >  level_mgr 
) const
private

◆ setInternalWorkDataActive()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::setInternalWorkDataActive ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > >  level_mgr 
)
private

Member Data Documentation

◆ s_instance_counter

template<int DIM>
int SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::s_instance_counter
staticprivate

◆ s_oedge_src_id_array

template<int DIM>
tbox::Array< tbox::Array<int> > SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::s_oedge_src_id_array
staticprivate

◆ s_oedge_dst_id_array

template<int DIM>
tbox::Array< tbox::Array<int> > SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::s_oedge_dst_id_array
staticprivate

◆ d_object_name

template<int DIM>
std::string SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_object_name
private

◆ d_setup_called

template<int DIM>
bool SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_setup_called
private

◆ d_num_reg_sum

template<int DIM>
int SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_num_reg_sum
private

◆ d_user_edge_data_id

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_user_edge_data_id
private

◆ d_user_edge_depth

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_user_edge_depth
private

◆ d_num_registered_data_by_depth

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_num_registered_data_by_depth
private

◆ d_tmp_oedge_src_variable

template<int DIM>
tbox::Array< tbox::Pointer< hier::Variable<DIM> > > SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_tmp_oedge_src_variable
private

◆ d_tmp_oedge_dst_variable

template<int DIM>
tbox::Array< tbox::Pointer< hier::Variable<DIM> > > SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_tmp_oedge_dst_variable
private

◆ d_oedge_src_id

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_oedge_src_id
private

◆ d_oedge_dst_id

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_oedge_dst_id
private

◆ d_oedge_src_data_set

template<int DIM>
hier::ComponentSelector SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_oedge_src_data_set
private

◆ d_oedge_dst_data_set

template<int DIM>
hier::ComponentSelector SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_oedge_dst_data_set
private

◆ d_level

template<int DIM>
tbox::Pointer< hier::PatchLevel<DIM> > SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_level
private

◆ d_level_mgr

◆ d_sum_transaction_factory

◆ d_single_level_sum_schedule

template<int DIM>
tbox::Pointer< xfer::LocallyActiveDataRefineSchedule<DIM> > SAMRAI::algs::LocallyActiveDataPatchBoundaryEdgeSum< DIM >::d_single_level_sum_schedule
private

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