#include <source/hierarchy/variables/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 () |
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.
SAMRAI::hier::VariableContext::~VariableContext | ( | ) | [virtual] |
The virtual destructor does nothing interesting.
int SAMRAI::hier::VariableContext::getCurrentMaximumInstanceNumber | ( | ) | [inline, 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 [inline] |
Return integer index for VariableContext object.
const std::string & SAMRAI::hier::VariableContext::getName | ( | ) | const [inline] |
Return name string identifier for VariableContext object.
bool SAMRAI::hier::VariableContext::operator== | ( | const VariableContext & | other | ) | const [inline] |
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.