|
IBAMR
IBAMR version 0.19.
|
#include <VariableContext.h>

Public Member Functions | |
| VariableContext (const std::string &name) | |
| virtual | ~VariableContext () |
| int | getIndex () const |
| const std::string & | getName () const |
| bool | operator== (const VariableContext &other) const |
Static Public Member Functions | |
| static int | getCurrentMaximumInstanceNumber () |
Private Member Functions | |
| VariableContext (const VariableContext &) | |
| void | operator= (const VariableContext &) |
Private Attributes | |
| std::string | d_name |
| int | d_index |
Static Private Attributes | |
| static int | s_instance_counter |
Class VariableContext is a simple class that is used to manage variable storage in a meaningful, customizable manner. A variable context has a name string and a unique integer instance identifier. Context objects are typically generated and used by the variable database for mapping names to storage locations, but they may also be created independently of the variable database.
SAMRAI applications use contexts and the variable database to manage patch storage locations for variables. For example, an integration algorithm may require multiple unique contexts to manage storage for a problem variable, such as "OLD" and "NEW". The algorithm interacts with the database to obtain the contexts and the mapping between the context and the patch descriptor index to access data on the patch hierarchy.
* Important note: * * It is strongly recommended that context objects be generated by * the variable database and obtained via the getContext() function. * While contexts can be created by using the variable context * constructor directly and used with the database, this may produce * unexpected results due to potentially improperly generated and name * string context identifiers. * *
| SAMRAI::hier::VariableContext::VariableContext | ( | const std::string & | name | ) |
The variable context constructor creates a context with the given name and increments the context index counter.
When assertion checking is active, an unrecoverable assertion results when the name string is empty.
|
virtual |
The virtual destructor does nothing interesting.
|
private |
|
static |
Return the current maximum instance number over all variable context objects. The instance identifiers returned from variable context objects are guaranteed to be between 0 and this number minus one. Note that this number changes as new variable contexts are created.
| int SAMRAI::hier::VariableContext::getIndex | ( | ) | const |
Return integer index for VariableContext object.
| const std::string& SAMRAI::hier::VariableContext::getName | ( | ) | const |
Return name string identifier for VariableContext object.
| bool SAMRAI::hier::VariableContext::operator== | ( | const VariableContext & | other | ) | const |
Check whether two contexts are the same. Return true if the index of the argument context matches the index of this context object. Otherwise, return false.
|
private |
|
staticprivate |
|
private |
|
private |
1.8.17