IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SAMRAI::hier::Variable< DIM > Class Template Referenceabstract

#include <ibtk/PoissonFACPreconditionerStrategy.h>

Inheritance diagram for SAMRAI::hier::Variable< DIM >:
Inheritance graph
[legend]

Public Member Functions

 Variable (const std::string &name, const tbox::Pointer< PatchDataFactory< DIM > > factory)
 
virtual ~Variable ()
 
int getInstanceIdentifier () const
 
const std::string & getName () const
 
virtual bool fineBoundaryRepresentsVariable () const =0
 
virtual bool dataLivesOnPatchBorder () const =0
 
void setPatchDataFactory (tbox::Pointer< PatchDataFactory< DIM > > factory)
 
tbox::Pointer< PatchDataFactory< DIM > > getPatchDataFactory () const
 

Static Public Member Functions

static int getCurrentMaximumInstanceNumber ()
 

Private Member Functions

 Variable (const Variable< DIM > &)
 
void operator= (const Variable< DIM > &)
 

Private Attributes

std::string d_name
 
int d_instance
 
tbox::Pointer< PatchDataFactory< DIM > > d_factory
 

Static Private Attributes

static int s_instance_counter
 

Detailed Description

template<int DIM>
class SAMRAI::hier::Variable< DIM >

Class Variable<DIM> provides a description of a variable quantity in an AMR application. A variable has the following attributes: (1) a name, (2) a unique instance number, and (3) a way to create the proper type of storage on the patches in an AMR hierarchy.

Variable is a base class for all variables; subclasses for each data type (e.g., cell-centered variables or node-centered variables) will define member functions to create the appropriate storage management classes.
Note that a variable object is distinct from the storage for the quantity to which the variable refers.

The user defines a set of variables and the role they play in the solution algorithm when describing an AMR application. Each variable type knows how to create instances of the associated data objects on patches in an AMR patch hierarchy via the getPatchDataFactory() member function. For example, we might have a concrete myVariable3<double> object that is derived from Variable3. The myVariable3<double> object returns a myVariableFactory3<double> object from its member function getPatchDataFactory(), and this factory is used to create the myVariable3<double> objects on the patches. Thus, a solution algorithm may be implemented to manage storage of variable quantities through the abstract interface without knowing the specific concrete variable types in use. This approach gives maximum flexibility when defining new user data types and variables and solution algorithms.

Each variable is assigned an `‘instance number,’' a unique integer identifier numbered from 0 through MAX-1, where MAX is the value returned by static function getCurrentMaximumInstanceNumber(). These identifiers can be used to rapidly look up variable instances in a table. For example, the instance number can be used to map variables to algorithmic data within an algorithm as alluded to above..

Variable types for which data exists on the borders of patches (such as node, side, etc.), the data will thus live on the interface between coarse and fine patch levels. Thus, it must be specified whether coarse or fine data values take precedence on the interface between levels. This information is provided by the fineBoundaryRepresentsVariable() function. Each concrete variable subclass defines the behavior of this function.

See also
hier::PatchDataFactory

Constructor & Destructor Documentation

◆ Variable() [1/2]

template<int DIM>
SAMRAI::hier::Variable< DIM >::Variable ( const std::string &  name,
const tbox::Pointer< PatchDataFactory< DIM > >  factory 
)

Create a variable object with the specified name and patch data factory. On creation, each variable is assigned a unique instance identifier.

◆ ~Variable()

template<int DIM>
virtual SAMRAI::hier::Variable< DIM >::~Variable ( )
virtual

Virtual destructor for variable objects.

◆ Variable() [2/2]

template<int DIM>
SAMRAI::hier::Variable< DIM >::Variable ( const Variable< DIM > &  )
private

Member Function Documentation

◆ getCurrentMaximumInstanceNumber()

template<int DIM>
static int SAMRAI::hier::Variable< DIM >::getCurrentMaximumInstanceNumber ( )
static

Return the current maximum instance number over all variable objects. The instance identifier returned from each variable objhect is guaranteed to be between 0 and this number minus one. Note that this number changes as new variable instances are created.

◆ getInstanceIdentifier()

template<int DIM>
int SAMRAI::hier::Variable< DIM >::getInstanceIdentifier ( ) const

Return the instance identifier for this particular variable object. The instance identifiers are unique integers numbered starting from zero.

◆ getName()

template<int DIM>
const std::string& SAMRAI::hier::Variable< DIM >::getName ( ) const

Return the name assigned to this variable.

◆ fineBoundaryRepresentsVariable()

template<int DIM>
virtual bool SAMRAI::hier::Variable< DIM >::fineBoundaryRepresentsVariable ( ) const
pure virtual

◆ dataLivesOnPatchBorder()

template<int DIM>
virtual bool SAMRAI::hier::Variable< DIM >::dataLivesOnPatchBorder ( ) const
pure virtual

◆ setPatchDataFactory()

template<int DIM>
void SAMRAI::hier::Variable< DIM >::setPatchDataFactory ( tbox::Pointer< PatchDataFactory< DIM > >  factory)

Set the patch data factory object. Normally, the factory is set in the constructor, but this member function enables the factory to be changed later in the lifetime of the variable.

◆ getPatchDataFactory()

template<int DIM>
tbox::Pointer< PatchDataFactory<DIM> > SAMRAI::hier::Variable< DIM >::getPatchDataFactory ( ) const

Return a non-const pointer to a patch data factory that will be used to instantiate instances of this variable on the patches. The factory returned will have been set by the variable subclasses.

◆ operator=()

template<int DIM>
void SAMRAI::hier::Variable< DIM >::operator= ( const Variable< DIM > &  )
private

Member Data Documentation

◆ d_name

template<int DIM>
std::string SAMRAI::hier::Variable< DIM >::d_name
private

◆ d_instance

template<int DIM>
int SAMRAI::hier::Variable< DIM >::d_instance
private

◆ d_factory

template<int DIM>
tbox::Pointer< PatchDataFactory<DIM> > SAMRAI::hier::Variable< DIM >::d_factory
private

◆ s_instance_counter

template<int DIM>
int SAMRAI::hier::Variable< DIM >::s_instance_counter
staticprivate

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