SAMRAI::algs::PatchBoundaryNodeSum< DIM > Class Template Reference

Class PatchBoundaryNodeSum provides operations for summing node data values at nodes that are shared by multiple patches on a single level or across multiple hierarchy levels. More...

#include <source/algorithm/femutils/standard/PatchBoundaryNodeSum.h>

List of all members.

Public Member Functions

 PatchBoundaryNodeSum (const std::string &object_name)
 Constructor initializes object to default (mostly undefined) state.
 ~PatchBoundaryNodeSum ()
 Destructor for the schedule releases all internal storage.
void registerSum (int node_data_id)
 Register node data with given patch data identifier for summing.
void setupSum (tbox::Pointer< hier::PatchLevel< DIM > > level)
 Set up summation operations for node data across shared nodes on a single level.
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.
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.

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 PatchBoundaryNodeSum objects (i.e., static members). To get a correct count, this routine should only be called once.
static int getNumUniquePatchDataSlots (int max_variables_to_register)
 Static function used to predetermine number of patch data slots unique to each PatchBoundaryNodeSum 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.


Detailed Description

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

Class PatchBoundaryNodeSum provides operations for summing node data values at nodes that are shared by multiple patches on a single level or across multiple hierarchy levels.

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

  1. Construct a patch boundry node sum object. For example,
     *         PatchBoundaryNodeSum<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);    // 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 PatchBoundaryNodeSum<DIM> object is created.


Constructor & Destructor Documentation

template<int DIM>
SAMRAI::algs::PatchBoundaryNodeSum< DIM >::PatchBoundaryNodeSum ( const std::string &  object_name  ) 

Constructor initializes object to default (mostly undefined) state.

Parameters:
object_name const std::string reference for name of object used in error reporting. When assertion checking is on, the string cannot be empty.

template<int DIM>
SAMRAI::algs::PatchBoundaryNodeSum< DIM >::~PatchBoundaryNodeSum (  ) 

Destructor for the schedule releases all internal storage.


Member Function Documentation

template<int DIM>
int SAMRAI::algs::PatchBoundaryNodeSum< DIM >::getNumSharedPatchDataSlots ( int  max_variables_to_register  )  [static]

Static function used to predetermine number of patch data slots ahared among all PatchBoundaryNodeSum objects (i.e., static members). To get a correct count, this routine should only be called once.

Returns:
integer number of internal patch data slots required to perform sum.
Parameters:
max_variables_to_register integer value indicating maximum number of patch data ids that will be registered with node sum objects.

template<int DIM>
int SAMRAI::algs::PatchBoundaryNodeSum< DIM >::getNumUniquePatchDataSlots ( int  max_variables_to_register  )  [static]

Static function used to predetermine number of patch data slots unique to each PatchBoundaryNodeSum 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.

Returns:
integer number of internal patch data slots required to perform sum.
Parameters:
max_variables_to_register integer value indicating maximum number of patch data ids that will be registered with node sum objects.

template<int DIM>
void SAMRAI::algs::PatchBoundaryNodeSum< DIM >::registerSum ( int  node_data_id  ) 

Register node data with given patch data identifier for summing.

Parameters:
node_data_id integer 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.

template<int DIM>
void SAMRAI::algs::PatchBoundaryNodeSum< DIM >::setupSum ( tbox::Pointer< hier::PatchLevel< DIM > >  level  ) 

Set up summation operations for node data across shared nodes on a single level.

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

Parameters:
level pointer to level on which to perform node sum
When assertion checking is active, the level pointer cannot be null.

template<int DIM>
void SAMRAI::algs::PatchBoundaryNodeSum< DIM >::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.

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

Parameters:
hierarchy pointer to hierarchy on which to perform node sum
coarsest_level coarsest level number for node sum
finest_level finest level number for node sum
When assertion checking is active, the hierarchy pointer cannot be null, and the range of levels must be valid.

template<int DIM>
void SAMRAI::algs::PatchBoundaryNodeSum< DIM >::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.

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_nodes Optional boolean value specifying whether hanging node values should be set to values interpolated from neighboring non-hanging node values. The default is false.


The documentation for this class was generated from the following files:
Generated on Thu Jun 18 11:28:20 2009 for SAMRAI by  doxygen 1.5.1