26 #ifndef GRINS_VARIABLE_WAREHOUSE_H
27 #define GRINS_VARIABLE_WAREHOUSE_H
33 #include "libmesh/libmesh_common.h"
38 namespace GRINSPrivate
70 template <
typename DerivedType>
75 const DerivedType& derived_var = libMesh::cast_ref<const DerivedType&>( var_base);
86 static std::map<std::string,const FEVariablesBase*>&
var_map();
110 libmesh_error_msg(
"ERROR: Duplicate FEVariable registration not allowed!");
112 var_map()[var_name] = &variable;
119 libmesh_error_msg(
"ERROR: Could not find FEVariable "+var_name+
"!");
124 libmesh_error_msg(
"ERROR: FEVariable "+var_name+
" is an invalid pointer!");
133 #endif // GRINS_VARIABLE_WAREHOUSE_H
static std::map< std::string, const FEVariablesBase * > & var_map()
Track what FEVariablesBase objects have been created.
static void check_and_register_variable(const std::string &var_name, const FEVariablesBase &variable)
First check if var_name is registered and then register.
static const DerivedType & get_variable_subclass(const std::string &var_name)
static void register_variable(const std::string &var_name, const FEVariablesBase &variable)
static void clear()
Clears the var_map()
static const FEVariablesBase & get_variable(const std::string &var_name)
static bool is_registered(const std::string &var_name)
Check if variable is registered.