26 #ifndef GRINS_VARIABLE_WAREHOUSE_H
27 #define GRINS_VARIABLE_WAREHOUSE_H
33 #include "libmesh/libmesh_common.h"
63 SharedPtr<FEVariablesBase>& variable );
66 SharedPtr<FEVariablesBase>& variable );
68 static SharedPtr<FEVariablesBase>
get_variable_ptr(
const std::string& var_name );
72 template <
typename DerivedType>
81 static std::map<std::string,SharedPtr<FEVariablesBase> >&
var_map();
94 SharedPtr<FEVariablesBase>& variable )
102 SharedPtr<FEVariablesBase>& variable )
105 libmesh_error_msg(
"ERROR: Duplicate FEVariable registration not allowed!");
107 var_map()[var_name] = variable;
117 template <
typename DerivedType>
123 DerivedType& derived_var = libMesh::cast_ref<DerivedType&>(var_base);
132 #endif // GRINS_VARIABLE_WAREHOUSE_H
static void check_and_register_variable(const std::string &var_name, SharedPtr< FEVariablesBase > &variable)
First check if var_name is registered and then register.
static SharedPtr< FEVariablesBase > get_variable_ptr(const std::string &var_name)
Track what FEVariablesBase objects have been created.
static DerivedType & get_variable_subclass(const std::string &var_name)
static FEVariablesBase & get_variable(const std::string &var_name)
static std::map< std::string, SharedPtr< FEVariablesBase > > & var_map()
static void register_variable(const std::string &var_name, SharedPtr< FEVariablesBase > &variable)
static void clear()
Clears the var_map()
static bool is_registered(const std::string &var_name)
Check if variable is registered.