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::LocallyActiveDataPatchBoundaryNodeSum< DIM > Class Template Reference

Class LocallyActiveDataPatchBoundaryNodeSum provides operations for summing locally-active node data values at nodes shared by multiple patches on a single level or across multiple hierarchy levels.
More...

#include <LocallyActiveDataPatchBoundaryNodeSum.h>

Public Member Functions

 LocallyActiveDataPatchBoundaryNodeSum (const std::string &object_name)
 Constructor initializes object to default (mostly undefined) state. More...
 
 ~LocallyActiveDataPatchBoundaryNodeSum ()
 Destructor for the schedule releases all internal storage. More...
 
void registerSum (int node_data_id)
 Register node 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 node data across shared nodes on a single level. More...
 
void setupSum (tbox::Pointer< hier::PatchHierarchy< DIM > > hierarchy, const int coarsest_level, const int finest_level)
 Set up for summation operations for node data at shared nodes across a range of hierarchy levels. The active patches for each node quantity on each level is accumed to be defined by the corresponding hier::LocallyActiveDataPatchLevelManager<DIM> objects held by the hier::LocallyActiveVariableDatabase<DIM> Singleton object. More...
 
void computeSum (const bool fill_hanging_nodes=false) const
 Compute sum of node values at each shared node and replace each such node 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 LocallyActiveDataPatchBoundaryNodeSum 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 LocallyActiveDataPatchBoundaryNodeSum object (i.e., non-static members). To get a correct count, this routine should only be called exactly once for each object that will be constructed. More...
 

Private Types

enum  PATCH_BDRY_NODE_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)
 
void doLocalCoarseFineBoundarySum (tbox::Pointer< hier::PatchLevel< DIM > > fine_level, tbox::Pointer< hier::PatchLevel< DIM > > coarsened_fine_level, const tbox::Array< int > &node_data_id, const tbox::Array< int > &onode_data_id, bool fill_hanging_nodes) const
 
void copyNodeToOuternodeOnLevel (tbox::Pointer< hier::PatchLevel< DIM > > level, tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > level_mgr, const tbox::Array< int > &node_data_id, const tbox::Array< int > &onode_data_id) const
 
void copyOuternodeToNodeOnLevel (tbox::Pointer< hier::PatchLevel< DIM > > level, tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > level_mgr, const tbox::Array< int > &onode_data_id, const tbox::Array< int > &node_data_id) const
 

Private Attributes

std::string d_object_name
 
bool d_setup_called
 
int d_num_reg_sum
 
tbox::Array< intd_user_node_data_id
 
tbox::Array< intd_user_node_depth
 
tbox::Array< intd_num_registered_data_by_depth
 
tbox::Array< tbox::Pointer< hier::Variable< DIM > > > d_tmp_onode_src_variable
 
tbox::Array< tbox::Pointer< hier::Variable< DIM > > > d_tmp_onode_dst_variable
 
tbox::Array< intd_onode_src_id
 
tbox::Array< intd_onode_dst_id
 
hier::ComponentSelector d_onode_src_data_set
 
hier::ComponentSelector d_onode_dst_data_set
 
tbox::Pointer< hier::PatchLevel< DIM > > d_level
 
tbox::Pointer< hier::PatchHierarchy< DIM > > d_hierarchy
 
int d_coarsest_level
 
int d_finest_level
 
tbox::Array< tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > > d_level_mgr
 
bool d_level_setup_called
 
bool d_hierarchy_setup_called
 
tbox::Pointer< xfer::LocallyActiveDataRefineTransactionFactory< DIM > > d_sum_transaction_factory
 
tbox::Array< tbox::Pointer< xfer::LocallyActiveDataRefineSchedule< DIM > > > d_single_level_sum_schedule
 
tbox::Array< tbox::Pointer< xfer::LocallyActiveDataRefineSchedule< DIM > > > d_cfbdry_copy_schedule
 
tbox::Array< tbox::Pointer< xfer::LocallyActiveDataCoarsenSchedule< DIM > > > d_sync_coarsen_schedule
 
tbox::Array< tbox::Pointer< hier::PatchLevel< DIM > > > d_cfbdry_tmp_level
 
tbox::Array< tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > > > d_cfbdry_tmp_level_mgr
 

Static Private Attributes

static int s_instance_counter
 
static tbox::Array< tbox::Array< int > > s_onode_src_id_array
 
static tbox::Array< tbox::Array< int > > s_onode_dst_id_array
 

Detailed Description

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

NOTE: Currently, the functionality to sum data across multiple hierarchy levels is unavailable.

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

  1. Construct a patch boundry node sum object. For example,
    *         LocallyActiveDataPatchBoundaryNodeSum<DIM> my_node_sum("My Node Sum");
    *     
  2. Register node data quantities to sum. For example,
    *         my_node_sum.registerSum(node_data_id1);
    *         my_node_sum.registerSum(node_data_id2);
    *         etc...
    *     
  3. Setup the sum operations for either single level or a range of levels in a patch hierarchy.
    For example,
    *         my_node_sum.setupSum(level, level_mgr);    // single level
    *         -- or --
    *         my_node_sum.setupSum(hierarchy, coarsest_ln, finest_ln);  // multiple levels
    *     
  4. Execute the sum operation. For example,
    *         my_node_sum.computeSum()
    *     

The result of these operations is that each node patch data value associated with the registered ids at patch boundaries, on either the single level or range of hierarchy levels, is replaced by the sum of all data values at the node.

Note that only one of the setupSum() functions may be called once a LocallyActiveDataPatchBoundaryNodeSum<DIM> object is created.

Member Enumeration Documentation

◆ PATCH_BDRY_NODE_SUM_DATA_ID

Enumerator
ID_UNDEFINED 

Constructor & Destructor Documentation

◆ LocallyActiveDataPatchBoundaryNodeSum()

template<int DIM>
SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::LocallyActiveDataPatchBoundaryNodeSum ( 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.

◆ ~LocallyActiveDataPatchBoundaryNodeSum()

Member Function Documentation

◆ getNumSharedPatchDataSlots()

template<int DIM>
static int SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< 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 node sum objects.

◆ getNumUniquePatchDataSlots()

template<int DIM>
static int SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< 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 node sum objects.

◆ registerSum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::registerSum ( int  node_data_id)
Parameters
node_data_idinteger patch data index for node data to sum

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

◆ setupSum() [1/2]

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::setupSum ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > >  level_mgr 
)

If the other setupSum() function for a range of hierarchy levels has been called previously for this object, an error will result.

Parameters
levelpointer to level on which to perform node sum
level_mgrpointer to level mgr defining active patches for node data registered with the node sum object

When assertion checking is active, the level pointer cannot be null.

◆ setupSum() [2/2]

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::setupSum ( tbox::Pointer< hier::PatchHierarchy< DIM > >  hierarchy,
const int  coarsest_level,
const int  finest_level 
)

If the other setupSum() function for a single level has been called previously for this object, an error will result.

Parameters
hierarchypointer to hierarchy on which to perform node sum
coarsest_levelcoarsest level number for node sum
finest_levelfinest level number for node sum

When assertion checking is active, the hierarchy pointer cannot be null, and the range of levels must be valid.

◆ computeSum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::computeSum ( const bool  fill_hanging_nodes = false) const

At the end of this method, all values at shared node locations on patch boundaries (on levels indicated by the call to one of the setupSum() routines) will have the same value.

When the setupSum() method taking a range of patch levels in a hierarchy is called, this method will compute the sum of nodal quantities at all the specified patch boundaries. For nodes at a coarse-fine boundary, nodal sums will only be performed where the coarse and fine nodes overlap. A node on a fine level that is not also a node on the next coarser level (a so-called "hanging node") will not be summed.

The boolean "fill_hanging_nodes" argument specifies whether the the hanging nodes should be filled using linearly interpolated values from neighboring non-hanging nodes (i.e. those that overlap nodes on a coarse level). The correct steps required to deal with hanging nodes is algorithm dependent so, if left unspecified, values at the hanging nodes will not be adjusted. However, because many algorithms average hanging nodes we provide the capability to do it here. Note that the hanging node interpolation provided does not take into consideration the spatial location of the nodes. So the interpolation may not be correct for coordinate systems other than standard Cartesian grid geometry.

Parameters
fill_hanging_nodesOptional boolean value specifying whether hanging node values should be set to values interpolated from neighboring non-hanging node values. The default is false.

◆ doLevelSum()

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

◆ setInternalWorkDataActive()

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

◆ doLocalCoarseFineBoundarySum()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::doLocalCoarseFineBoundarySum ( tbox::Pointer< hier::PatchLevel< DIM > >  fine_level,
tbox::Pointer< hier::PatchLevel< DIM > >  coarsened_fine_level,
const tbox::Array< int > &  node_data_id,
const tbox::Array< int > &  onode_data_id,
bool  fill_hanging_nodes 
) const
private

◆ copyNodeToOuternodeOnLevel()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::copyNodeToOuternodeOnLevel ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > >  level_mgr,
const tbox::Array< int > &  node_data_id,
const tbox::Array< int > &  onode_data_id 
) const
private

◆ copyOuternodeToNodeOnLevel()

template<int DIM>
void SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::copyOuternodeToNodeOnLevel ( tbox::Pointer< hier::PatchLevel< DIM > >  level,
tbox::Pointer< hier::LocallyActiveDataPatchLevelManager< DIM > >  level_mgr,
const tbox::Array< int > &  onode_data_id,
const tbox::Array< int > &  node_data_id 
) const
private

Member Data Documentation

◆ s_instance_counter

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

◆ s_onode_src_id_array

template<int DIM>
tbox::Array< tbox::Array<int> > SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::s_onode_src_id_array
staticprivate

◆ s_onode_dst_id_array

template<int DIM>
tbox::Array< tbox::Array<int> > SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::s_onode_dst_id_array
staticprivate

◆ d_object_name

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

◆ d_setup_called

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

◆ d_num_reg_sum

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

◆ d_user_node_data_id

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_user_node_data_id
private

◆ d_user_node_depth

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_user_node_depth
private

◆ d_num_registered_data_by_depth

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

◆ d_tmp_onode_src_variable

template<int DIM>
tbox::Array< tbox::Pointer< hier::Variable<DIM> > > SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_tmp_onode_src_variable
private

◆ d_tmp_onode_dst_variable

template<int DIM>
tbox::Array< tbox::Pointer< hier::Variable<DIM> > > SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_tmp_onode_dst_variable
private

◆ d_onode_src_id

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_onode_src_id
private

◆ d_onode_dst_id

template<int DIM>
tbox::Array<int> SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_onode_dst_id
private

◆ d_onode_src_data_set

template<int DIM>
hier::ComponentSelector SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_onode_src_data_set
private

◆ d_onode_dst_data_set

template<int DIM>
hier::ComponentSelector SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_onode_dst_data_set
private

◆ d_level

◆ d_hierarchy

template<int DIM>
tbox::Pointer<hier::PatchHierarchy<DIM> > SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_hierarchy
private

◆ d_coarsest_level

template<int DIM>
int SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_coarsest_level
private

◆ d_finest_level

template<int DIM>
int SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_finest_level
private

◆ d_level_mgr

◆ d_level_setup_called

template<int DIM>
bool SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_level_setup_called
private

◆ d_hierarchy_setup_called

template<int DIM>
bool SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_hierarchy_setup_called
private

◆ d_sum_transaction_factory

◆ d_single_level_sum_schedule

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

◆ d_cfbdry_copy_schedule

◆ d_sync_coarsen_schedule

◆ d_cfbdry_tmp_level

template<int DIM>
tbox::Array< tbox::Pointer<hier::PatchLevel<DIM> > > SAMRAI::algs::LocallyActiveDataPatchBoundaryNodeSum< DIM >::d_cfbdry_tmp_level
private

◆ d_cfbdry_tmp_level_mgr


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