IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
SAMRAI::hier::VariableDatabase< DIM > Class Template Reference

Class VariableDatabase<DIM> is a Singleton class that manages mapping information between variables and patch data objects in ways that are configurable to the needs of an application built using SAMRAI. In SAMRAI, a single patch descriptor object is shared by all patches in an SAMR hierarchy. This database generates and maintain mappings (for lookup) between integer patch data indices and either variable-context pairs or just variables when contexts are not used.
Users define which variables are included in the database, which variable
contexts are in the database, and which contexts are associated with which variables via registration operations described below. More...

#include <VariableDatabase.h>

Public Member Functions

virtual int getNumberOfRegisteredPatchDataIndices () const
 
virtual int getNumberOfRegisteredVariableContexts () const
 
virtual tbox::Pointer< hier::PatchDescriptor< DIM > > getPatchDescriptor () const
 
virtual tbox::Pointer< hier::VariableContextgetContext (const std::string &name)
 
virtual bool checkContextExists (const std::string &name) const
 
virtual void addVariable (const tbox::Pointer< hier::Variable< DIM > > variable)
 
virtual tbox::Pointer< hier::Variable< DIM > > getVariable (const std::string &name) const
 
virtual bool checkVariableExists (const std::string &name) const
 
virtual int registerClonedPatchDataIndex (const tbox::Pointer< hier::Variable< DIM > > variable, int old_id)
 
virtual int registerPatchDataIndex (const tbox::Pointer< hier::Variable< DIM > > variable, int data_id=-1)
 
virtual void removePatchDataIndex (int data_id)
 
virtual bool checkVariablePatchDataIndex (const tbox::Pointer< hier::Variable< DIM > > variable, int data_id) const
 
virtual bool checkVariablePatchDataIndexType (const tbox::Pointer< hier::Variable< DIM > > variable, int data_id) const
 
virtual int registerVariableAndContext (const tbox::Pointer< hier::Variable< DIM > > variable, const tbox::Pointer< hier::VariableContext > context, const hier::IntVector< DIM > &ghosts=hier::IntVector< DIM >(0))
 
virtual int mapVariableAndContextToIndex (const tbox::Pointer< hier::Variable< DIM > > variable, const tbox::Pointer< hier::VariableContext > context) const
 
virtual bool mapIndexToVariable (const int index, tbox::Pointer< hier::Variable< DIM > > &variable) const
 
virtual bool mapIndexToVariableAndContext (const int index, tbox::Pointer< hier::Variable< DIM > > &variable, tbox::Pointer< hier::VariableContext > &context) const
 
virtual hier::ComponentSelector getPatchDataRestartTable () const
 
virtual bool isPatchDataRegisteredForRestart (int index) const
 
virtual void registerPatchDataForRestart (int index)
 
virtual void unregisterPatchDataForRestart (int index)
 
virtual void printClassData (std::ostream &os=tbox::plog, bool print_only_user_defined_variables=true) const
 
virtual int registerInternalSAMRAIVariable (const tbox::Pointer< hier::Variable< DIM > > variable, const hier::IntVector< DIM > &ghosts)
 
virtual void removeInternalSAMRAIVariablePatchDataIndex (int data_id)
 

Static Public Member Functions

static VariableDatabase< DIM > * getDatabase ()
 
static void freeDatabase ()
 

Protected Member Functions

 VariableDatabase ()
 
virtual ~VariableDatabase ()
 
int idUndefined () const
 
int getVariableId (const std::string &name) const
 
void registerSingletonSubclassInstance (hier::VariableDatabase< DIM > *subclass_instance)
 

Private Member Functions

int getContextId_Private (const std::string &name) const
 
void addContext_Private (const tbox::Pointer< hier::VariableContext > context)
 
bool addVariable_Private (const tbox::Pointer< hier::Variable< DIM > > variable, bool user_variable)
 
void addVariablePatchDataIndexPairToDatabase_Private (const tbox::Pointer< hier::Variable< DIM > > variable, int data_id, bool user_variable)
 
int registerVariableAndContext_Private (const tbox::Pointer< hier::Variable< DIM > > variable, const tbox::Pointer< hier::VariableContext > context, const hier::IntVector< DIM > &ghosts, bool user_variable)
 

Private Attributes

tbox::Pointer< hier::PatchDescriptor< DIM > > d_patch_descriptor
 
tbox::Pointer< hier::VariableContextd_internal_SAMRAI_context
 
int d_num_registered_patch_data_ids
 
int d_max_context_id
 
tbox::Array< tbox::Pointer< hier::VariableContext > > d_contexts
 
int d_max_variable_id
 
tbox::Array< tbox::Pointer< hier::Variable< DIM > > > d_variables
 
tbox::Array< tbox::Array< int > > d_variable_context2index_map
 
int d_max_descriptor_id
 
tbox::Array< tbox::Pointer< hier::Variable< DIM > > > d_index2variable_map
 
tbox::Array< boold_is_user_variable
 
hier::ComponentSelector d_patchdata_restart_table
 

Static Private Attributes

static VariableDatabase< DIM > * s_variable_database_instance
 
static bool s_registered_callback
 
static int s_context_array_alloc_size
 
static int s_variable_array_alloc_size
 
static int s_descriptor_array_alloc_size
 

Friends

class LocallyActiveVariableDatabase< DIM >
 

Detailed Description

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

Since the database is a Singleton class, it serves as a globally accessible container for bookkeeping information related to variable storage on an SAMR patch hierarchy. For example, a time-dependent problem may require distinct "OLD" and "NEW" storage for some quantities. A context is a name describing some storage for a collection of variables in a given problem.
Each variable and context pair maps to a unique integer patch data index.
This integer indices are the same for every patch in the hierarchy and so data objects are accessed identically for all patches.

Typically, classes that contains numerical routines for patches access the appropriate data in terms of variables. Classes that provide solution algorithms manage variable storage in terms of storage "contexts", such as "OLD" and "NEW". Typical usage of the database for managing variable storage bookkeeping in this way is as follows:

Alternatively, the database can be used to maintain a map between a single patch data index and a variable that created the patch data factory at that index. Such a mapping can be constructed using the functions registerVariablePatchDataIndex() and registerClonedVariablePatchDataIndex(). These operations may be helpful when managing variables and contexts is inconvenient. However, in contrast to the functions above, these functions do not allow using a single variable to define multiple patch data indices. One may use this functionality as follows:

Note that the database can be used to allocate and free patch data indices using the registerClonedVariablePatchDataIndex() and removeVariablePatchDataIndex() functions. The registerVariableAndContext() function will also create a new patch data index when needed. In general, variables and contexts persist once create and cannot be removed from the database.

Finally, this database is used in SAMRAI to manage the reading/writing of patch data objects from/to restart files.

* Important notes:
* 
*    (1) Having two different variables or two different contexts in 
*        the database with the same name string identifier is not allowed.
*        This eliminates the need to resolve ambiguities when querying the
*        database for variables or contexts based on string identifiers.
*        The error checking in this class implementation will catch
*        any attempt to improperly register variables and contexts and
*        report a descriptive log message.
* 
*    (2) It is STRONGLY recommended that variable contexts be generated by 
*        using the getContext() function in this class.  While contexts 
*        may be created by other means and passed into the member functions 
*        of this database class, doing so may produce unexpected results 
*        due to potentially non-unique integer and name string context 
*        identifiers.
*
* 
See also
hier::VariableContext
hier::Patch
hier::PatchDescriptor

Constructor & Destructor Documentation

◆ VariableDatabase()

template<int DIM>
SAMRAI::hier::VariableDatabase< DIM >::VariableDatabase ( )
protected

The constructor for VariableDatabase<DIM> is protected. Consistent with the definition of a Singleton class, only the database object has access to the constructor for the class.

The constructor initializes the state of database contents.

◆ ~VariableDatabase()

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

The destructor for VariableDatabase<DIM> is protected. See the comments for the constructor.

The destructor deallocates database contents.

Member Function Documentation

◆ getDatabase()

template<int DIM>
static VariableDatabase<DIM>* SAMRAI::hier::VariableDatabase< DIM >::getDatabase ( )
static

Return a pointer to the singleton instance of the variable database.
All access to the VariableDatabase<DIM> object is through the getDatabase() function. For example, to access the context with string name "my_context", use the following call: VariableDatabase<DIM>::getDatabase()->getContext("my_context").

Note that when the database is accessed for the first time, the Singleton instance is registered with the ShutdownRegistry class which destroys such objects at program completion. Thus, users of this class do not explicitly allocate or deallocate the Singleton instance.

Returns
Bare pointer to variable database instance.

◆ freeDatabase()

template<int DIM>
static void SAMRAI::hier::VariableDatabase< DIM >::freeDatabase ( )
static

Deallocate the Singleton VariableDatabase<DIM> instance.
It is not necessary to call this function at program termination, since it is automatically called by the ShutdownRegistry class.

◆ getNumberOfRegisteredPatchDataIndices()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::getNumberOfRegisteredPatchDataIndices ( ) const
virtual

Return number of patch data indices registered with the database.

◆ getNumberOfRegisteredVariableContexts()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::getNumberOfRegisteredVariableContexts ( ) const
virtual

Return number of variable contexts registered with the database.

◆ getPatchDescriptor()

template<int DIM>
virtual tbox::Pointer< hier::PatchDescriptor<DIM> > SAMRAI::hier::VariableDatabase< DIM >::getPatchDescriptor ( ) const
virtual

Return pointer to the patch descriptor managed by the database (and shared by all patches in an SAMR hierarchy).

Returns
tbox::Pointer to patch descriptor instance.

◆ getContext()

template<int DIM>
virtual tbox::Pointer<hier::VariableContext> SAMRAI::hier::VariableDatabase< DIM >::getContext ( const std::string &  name)
virtual

Return a variable context object with the given name string identifier. If a context whose name matches the argument string exists in the database, it is returned. Otherwise, a new context is created and returned. Note that it is impossible to add two distinct variable context objects to the database with the same name.

If the string identifier is empty, the context pointer return value will be null. Thus, you cannot create a variable context with an empty string identifier using this function.

Returns
tbox::Pointer to variable context.
Parameters
nameConst reference to name string identifying the context.

◆ checkContextExists()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::checkContextExists ( const std::string &  name) const
virtual

Check whether context with given name exists in the database.

Returns
Boolean true if context with name exists in database; otherwise, false.
Parameters
nameConst reference to name string identifying the context.

◆ addVariable()

template<int DIM>
virtual void SAMRAI::hier::VariableDatabase< DIM >::addVariable ( const tbox::Pointer< hier::Variable< DIM > >  variable)
virtual

Add the given variable to the database. This function checks whether the variable already exists in the database, or whether a different variable exists with the same name string identifier. If the variable does not already exist in the database and its name string is distinct from all variables in the database, the variable is added to the database. Having two different variables in the database with the same name is not allowed. If this is attempted, an error message will be logged and the program will abort. If the variable already exists in the database, the routine essentially does nothing.

Parameters
variabletbox::Pointer to variable. When assertion checking is active, an assertion will result if the variable pointer is null.

◆ getVariable()

template<int DIM>
virtual tbox::Pointer< hier::Variable<DIM> > SAMRAI::hier::VariableDatabase< DIM >::getVariable ( const std::string &  name) const
virtual

Get variable in database with given name string identifier.

Returns
tbox::Pointer to variable in database with given name.
If no such variable exists, a null pointer is returned.
Parameters
nameConst reference to name string identifying the variable.

◆ checkVariableExists()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::checkVariableExists ( const std::string &  name) const
virtual

Check whether variable with given name exists in the database.

Returns
Boolean true if variable with name exists in database; otherwise, false.
Parameters
nameConst reference to name string identifying the variable.

◆ registerClonedPatchDataIndex()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::registerClonedPatchDataIndex ( const tbox::Pointer< hier::Variable< DIM > >  variable,
int  old_id 
)
virtual

Create a new patch data index by cloning the data factory for the given variable at the given index and return the patch data index of the new data location. The new index and variable pair is added to the variable database. A variable-patch data index pair generated using this function cannot be looked up using a VariableContext. Note that this function does not deallocate
any patch data storage associated with the new patch data index.

Returns
New integer patch data index. If new patch data not added, return value is an invalid patch data index (< 0).
Parameters
variabletbox::Pointer to variable. If the variable is unknown to the database, then an invalid patch data index (< 0) will be returned. When assertion checking is active,
an assertion will result when the variable pointer is null.
old_idInteger patch data index currently associated with variable. If this value is not a valid patch data index (e.g., < 0) or does not map to patch data matching the type of the given variable, the program will abort with an error message.

◆ registerPatchDataIndex()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::registerPatchDataIndex ( const tbox::Pointer< hier::Variable< DIM > >  variable,
int  data_id = -1 
)
virtual

Add given patch data index and variable pair to the database if not already there. This registration function is primarily intended for variables (i.e., not internal SAMRAI variables) that are not associated with a VariableContext and for which a patch data index is already known.

If the index is unspecified (default case), the default variable factory is cloned and the variable and new index are added to the database; in this case, the patch data will have the default number of ghost cells associated with the given variable (defined by the patch data factory it generates). Also, a variable-patch data index pair generated with this function cannot be looked up using a VariableContext. Note that this function does not allocate any patch data storage associated with the integer index.

NOTE: This function must not be used by SAMRAI developers for creating patch data indices for internal SAMRAI variables. The routine registerInternalSAMRAIVariable() must be used for that case.

Returns
New integer patch data index. If new patch data index not added, return value is an invalid patch data index (< 0).
Parameters
variabletbox::Pointer to variable. When assertion checking is active, an assertion will result when the variable pointer is null.
data_idOptional integer patch data index to be added (along with variable) to the database. If the value is unspecified (default case), the default variable patch data factory is used to generate a new factory. If the value is provided and does not map to patch data matching the type of th given variable, the program will abort with an error message.

◆ removePatchDataIndex()

template<int DIM>
virtual void SAMRAI::hier::VariableDatabase< DIM >::removePatchDataIndex ( int  data_id)
virtual

Remove the given patch index from the variable database if it exists in the database. Also, remove the given index from the patch descriptor and remove any mapping between the index and a variable from the variable database. Note that this function does not deallocate any patch data storage associated with the integer index.

Parameters
data_idInteger patch data index to be removed from the database. When assertion checking is active, an assertion will result when the patch data index is invalid (i.e., < 0).

◆ checkVariablePatchDataIndex()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::checkVariablePatchDataIndex ( const tbox::Pointer< hier::Variable< DIM > >  variable,
int  data_id 
) const
virtual

Check whether the given variable is mapped to the given patch data index in the database.

Returns
Boolean true if the variable is mapped the given patch data index; false otherwise.
Parameters
variabletbox::Pointer to variable. When assertion checking is active, an unrecoverable assertion will result if the variable pointer is null.
data_idInteger patch data index. When assertion checking is active, an unrecoverable assertion will result if the value is an invalid identifier (either < 0 or larger than the maximum allowed patch data id).

◆ checkVariablePatchDataIndexType()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::checkVariablePatchDataIndexType ( const tbox::Pointer< hier::Variable< DIM > >  variable,
int  data_id 
) const
virtual

Check whether the given variable matches the patch data type associated with the given patch data index in the database.

Returns
Boolean true if the type of the variable matches the type of the patch data at the given patch data index; false otherwise.
Parameters
variabletbox::Pointer to variable. When assertion checking is active, an unrecoverable assertion will result if the variable pointer is null.
data_idInteger patch data index. When assertion checking is active, an unrecoverable assertion will result if the value is an invalid identifier (either < 0 or larger than the maximum allowed patch data id).

◆ registerVariableAndContext()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::registerVariableAndContext ( const tbox::Pointer< hier::Variable< DIM > >  variable,
const tbox::Pointer< hier::VariableContext context,
const hier::IntVector< DIM > &  ghosts = hier::IntVector< DIM >(0) 
)
virtual

Register variable and context pair along with the number of ghost cells required for storage with the variable database. Typically, this function will generate a new patch data index for the variable and ghost cell width and add the variable-context pair and index to the database. If the variable-context pair is already mapped to some patch data index in the database, then that index will be returned and the function will do nothing. However, if the variable-context pair is already mapped to some patch data index with a different ghost cell width, the program will abort with a descriptive error message. When the number of ghost cells is not provided (default case), a default value of zero ghosts will be used.

If either the variable or the context is unknown to the database prior to calling this routine, both items will be added to the database, if possible. The constraints for the getContext() and addVariable() routines apply.

Returns
Integer patch data index of variable-context pair in database.
Parameters
variabletbox::Pointer to variable. When assertion checking is active, an unrecoverable assertion will result if the variable pointer is null.
contexttbox::Pointer to variable context. When assertion checking is active, an unrecoverable assertion will result if the context pointer is null.
ghostsOptional ghost cell width for patch data associated with variable-context pair. If the ghost cell width is given, all entries of the vector must be >= 0.
When assertion checking is active, an unrecoverable assertion will result if the ghost width vector contains a negative entry.

◆ mapVariableAndContextToIndex()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::mapVariableAndContextToIndex ( const tbox::Pointer< hier::Variable< DIM > >  variable,
const tbox::Pointer< hier::VariableContext context 
) const
virtual

Map variable-context pair in database to patch data index. If there is no such pair in the database (either the variable does not exist, the context does not exist, or the pair has not been registered), then an invalid patch data index (i.e., < 0) is returned. Note that for this function to operate as expected, the database mapping information must have been generated using the registerVariableAndContext() function. If the variable was registered without a variable context, then the patch data index associated with the variable will not be returned. See the other map...() functions declared in this class.

Returns
Integer patch data index of variable-context pair in database. If the variable-context pair was not regisetered with the database, then an invalid data index (< 0) will be returned.
Parameters
variabletbox::Pointer to variable. When assertion checking is active, an unrecoverable assertion will result if the variable pointer is null.
contexttbox::Pointer to variable context. When assertion checking is active, an unrecoverable assertion will result if the variable context pointer is null.

◆ mapIndexToVariable()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::mapIndexToVariable ( const int  index,
tbox::Pointer< hier::Variable< DIM > > &  variable 
) const
virtual

Map patch data index to variable associated with the data, if possible, and set the variable pointer to the variable in the database.

Returns
Boolean true if patch data index maps to variable in the database; otherwise false.
Parameters
indexInteger patch data index. When assertion checking is active, an unrecoverable assertion will if the index is invalid (i.e., < 0).
variabletbox::Pointer to variable that maps to patch data index in database. If there is no index in the database matching the index input value, then the variable pointer is set to null.

◆ mapIndexToVariableAndContext()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::mapIndexToVariableAndContext ( const int  index,
tbox::Pointer< hier::Variable< DIM > > &  variable,
tbox::Pointer< hier::VariableContext > &  context 
) const
virtual

Map patch data index to variable-context pair associated with the data, if possible, and set the variable and context pointers to the corresponding database entries. Note that for this function to operate as expected, the database mapping information must have been generated using the registerVariableAndContext() function. If the variable was registered without a variable context, then the variable and variable context returned may not be what is expected by the user; e.g., they may be associated with internal SAMRAI variables.

Returns
Boolean true if patch data index maps to variable-context pair in the database; otherwise false.
Parameters
indexpatch data index
variabletbox::Pointer to variable set to matching variable in database. If no match is found, it is set to null.
contexttbox::Pointer to variable context set to matching variable context in database. If no match is found, it is set to null.

◆ getPatchDataRestartTable()

template<int DIM>
virtual hier::ComponentSelector SAMRAI::hier::VariableDatabase< DIM >::getPatchDataRestartTable ( ) const
virtual

Return copy of component selector that holds information about which patch data entries are written to restart.

Returns
Component selector describing patch data items registered for restart. That is, the flags set in the component selector will correspond to the patch data indices that have been registered for restart.

◆ isPatchDataRegisteredForRestart()

template<int DIM>
virtual bool SAMRAI::hier::VariableDatabase< DIM >::isPatchDataRegisteredForRestart ( int  index) const
virtual

Check whether given patch data index is registered with the database for restart.

Returns
Boolean true if the patch data with the given index is registered for restart; otherwise false.
Parameters
indexInteger patch data index to check.

◆ registerPatchDataForRestart()

template<int DIM>
virtual void SAMRAI::hier::VariableDatabase< DIM >::registerPatchDataForRestart ( int  index)
virtual

Register the given patch data index for restart.

Parameters
indexInteger patch data index to set.

◆ unregisterPatchDataForRestart()

template<int DIM>
virtual void SAMRAI::hier::VariableDatabase< DIM >::unregisterPatchDataForRestart ( int  index)
virtual

Unregister the given patch data index for restart.

Parameters
indexInteger patch data index to unset.

◆ printClassData()

template<int DIM>
virtual void SAMRAI::hier::VariableDatabase< DIM >::printClassData ( std::ostream &  os = tbox::plog,
bool  print_only_user_defined_variables = true 
) const
virtual

Print variable, context, and patch descriptor information contained in the database to the specified output stream.

Parameters
osOptional output stream. If not given, tbox::plog is used.
print_only_user_defined_variablesOptional boolean value indicating whether to print information for all variables in database or only those that are associated with user- defined quantities; i.e., not internal SAMRAI variables. The default is true, indicating that only user-defined variable information will be printed.

◆ registerInternalSAMRAIVariable()

template<int DIM>
virtual int SAMRAI::hier::VariableDatabase< DIM >::registerInternalSAMRAIVariable ( const tbox::Pointer< hier::Variable< DIM > >  variable,
const hier::IntVector< DIM > &  ghosts 
)
virtual

Register internal SAMRAI variable and number of ghost cells with the variable database.

This function will generate a new patch data index for the variable and ghost cell width unless the variable is already mapped to some patch data index in the database with a different ghost cell width or as a user-defined variable. If the variable is unknown to the database prior to calling this routine, it will be added to the database.

Note that this routine is intended for managing internal SAMRAI work variables that are typically unseen by users. It should not be called by users for registering variables, or within SAMRAI for registering any user-defined variables with the variable database.
This function enforces the same constrants on variable registration that are applied for registering user-defined variables; e.g., using the routine registerVariableAndContext(). Thus, it is the responsibility of SAMRAI developers to avoid naming and ghost cell width conflicts with user-defined variables or other internal SAMRAI variables.

Returns
Integer patch data index of variable-ghost cell width pair in database.
Parameters
variabletbox::Pointer to variable. When assertion checking is active, an unrecoverable assertion will result if the variable pointer is null.
ghostsGhost cell width for patch data associated with the variable. All entries of the vector must be >= 0.
When assertion checking is active, an unrecoverable assertion results if the vector contains a negative entry.

◆ removeInternalSAMRAIVariablePatchDataIndex()

template<int DIM>
virtual void SAMRAI::hier::VariableDatabase< DIM >::removeInternalSAMRAIVariablePatchDataIndex ( int  data_id)
virtual

Remove the given index from the variable database if it exists in the database and is associated with an internal SAMRAI variable registered with the function registerInternalSAMRAIVariable(). Also, remove the given index from the patch descriptor and remove any mapping between the index and a variable from the variable database. Note that this function does not deallocate any patch data storage associated with the integer index.

Note that this routine is intended for managing internal SAMRAI work variables that are typically unseen by users. It should not be called by users for removing patch data indices, or within SAMRAI for removing any patch data indices associated with user-defined variables.

Note that the given index will not be removed if is not associated with an internal SAMRAI variable in the variable database; i.e., a user-defined variable.

Parameters
data_idInteger patch data identifier to be removed from the database.

◆ idUndefined()

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::idUndefined ( ) const
protected

Return integer value used to indicate undefined variable or context identifier. This routine is protected to allow subclasses to be consistent with this database class.

◆ getVariableId()

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::getVariableId ( const std::string &  name) const
protected

Return integer identifier for first variable found matching given string name identifier, or return an undefined integer id if no such variable exists in the database.

◆ registerSingletonSubclassInstance()

template<int DIM>
void SAMRAI::hier::VariableDatabase< DIM >::registerSingletonSubclassInstance ( hier::VariableDatabase< DIM > *  subclass_instance)
protected

Initialize Singleton instance with instance of subclass. This function is used to make the singleton object unique when inheriting from this base class.

◆ getContextId_Private()

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::getContextId_Private ( const std::string &  name) const
private

◆ addContext_Private()

template<int DIM>
void SAMRAI::hier::VariableDatabase< DIM >::addContext_Private ( const tbox::Pointer< hier::VariableContext context)
private

◆ addVariable_Private()

template<int DIM>
bool SAMRAI::hier::VariableDatabase< DIM >::addVariable_Private ( const tbox::Pointer< hier::Variable< DIM > >  variable,
bool  user_variable 
)
private

◆ addVariablePatchDataIndexPairToDatabase_Private()

template<int DIM>
void SAMRAI::hier::VariableDatabase< DIM >::addVariablePatchDataIndexPairToDatabase_Private ( const tbox::Pointer< hier::Variable< DIM > >  variable,
int  data_id,
bool  user_variable 
)
private

◆ registerVariableAndContext_Private()

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::registerVariableAndContext_Private ( const tbox::Pointer< hier::Variable< DIM > >  variable,
const tbox::Pointer< hier::VariableContext context,
const hier::IntVector< DIM > &  ghosts,
bool  user_variable 
)
private

Friends And Related Function Documentation

◆ LocallyActiveVariableDatabase< DIM >

template<int DIM>
friend class LocallyActiveVariableDatabase< DIM >
friend

Member Data Documentation

◆ s_variable_database_instance

template<int DIM>
VariableDatabase<DIM>* SAMRAI::hier::VariableDatabase< DIM >::s_variable_database_instance
staticprivate

◆ s_registered_callback

template<int DIM>
bool SAMRAI::hier::VariableDatabase< DIM >::s_registered_callback
staticprivate

◆ s_context_array_alloc_size

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::s_context_array_alloc_size
staticprivate

◆ s_variable_array_alloc_size

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::s_variable_array_alloc_size
staticprivate

◆ s_descriptor_array_alloc_size

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::s_descriptor_array_alloc_size
staticprivate

◆ d_patch_descriptor

template<int DIM>
tbox::Pointer< hier::PatchDescriptor<DIM> > SAMRAI::hier::VariableDatabase< DIM >::d_patch_descriptor
private

◆ d_internal_SAMRAI_context

template<int DIM>
tbox::Pointer<hier::VariableContext> SAMRAI::hier::VariableDatabase< DIM >::d_internal_SAMRAI_context
private

◆ d_num_registered_patch_data_ids

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::d_num_registered_patch_data_ids
private

◆ d_max_context_id

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::d_max_context_id
private

◆ d_contexts

template<int DIM>
tbox::Array< tbox::Pointer<hier::VariableContext> > SAMRAI::hier::VariableDatabase< DIM >::d_contexts
private

◆ d_max_variable_id

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::d_max_variable_id
private

◆ d_variables

template<int DIM>
tbox::Array< tbox::Pointer< hier::Variable<DIM> > > SAMRAI::hier::VariableDatabase< DIM >::d_variables
private

◆ d_variable_context2index_map

template<int DIM>
tbox::Array< tbox::Array<int> > SAMRAI::hier::VariableDatabase< DIM >::d_variable_context2index_map
private

◆ d_max_descriptor_id

template<int DIM>
int SAMRAI::hier::VariableDatabase< DIM >::d_max_descriptor_id
private

◆ d_index2variable_map

template<int DIM>
tbox::Array< tbox::Pointer< hier::Variable<DIM> > > SAMRAI::hier::VariableDatabase< DIM >::d_index2variable_map
private

◆ d_is_user_variable

template<int DIM>
tbox::Array<bool> SAMRAI::hier::VariableDatabase< DIM >::d_is_user_variable
private

◆ d_patchdata_restart_table

template<int DIM>
hier::ComponentSelector SAMRAI::hier::VariableDatabase< DIM >::d_patchdata_restart_table
private

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