35 #include "libmesh/getpot.h"
36 #include "libmesh/string_to_enum.h"
50 const std::string& var_name )
56 const std::vector<std::string>& var_names,
57 const std::string& fe_family,
58 const std::string& order,
59 std::vector<VariableIndex>& var_indices,
60 const std::set<libMesh::subdomain_id_type>& subdomain_ids )
62 const unsigned int n_vars = var_names.size();
65 libmesh_assert( var_indices.empty() );
66 var_indices.resize(n_vars);
68 if( subdomain_ids.empty() )
69 for(
unsigned int v = 0; v < n_vars; v++ )
70 var_indices[v] = system.add_variable( var_names[v],
71 libMesh::Utility::string_to_enum<GRINSEnums::Order>(order),
72 libMesh::Utility::string_to_enum<GRINSEnums::FEFamily>(fe_family) );
75 for(
unsigned int v = 0; v < n_vars; v++ )
76 var_indices[v] = system.add_variable( var_names[v],
77 libMesh::Utility::string_to_enum<GRINSEnums::Order>(order),
78 libMesh::Utility::string_to_enum<GRINSEnums::FEFamily>(fe_family),
83 const std::vector<std::string>& var_names,
84 const std::vector<VariableIndex>& var_indices,
85 const std::set<libMesh::subdomain_id_type>& subdomain_ids )
95 return SharedPtr<FEVariablesBase>( var.release() );
static void set_var_indices(const std::vector< VariableIndex > &var_indices)
Set the variable indices before calling create()
static void set_var_names(const std::vector< std::string > &var_names)
Set the variable names before calling create()
static libMesh::UniquePtr< FEVariablesBase > build(const std::string &name)
Use this method to build objects of type Base.
static void set_subdomain_ids(const std::set< libMesh::subdomain_id_type > &subdomain_ids)
void add_variable_to_warehouse(SharedPtr< FEVariablesBase > &fe_var, const std::string &var_name)
Adds/registers the fe_var to VariableWarehouse.
void add_vars_to_system(MultiphysicsSystem &system, const std::vector< std::string > &var_names, const std::string &fe_family, const std::string &order, std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
Given the names, family, and order, this adds the variables to the system and populates var_indices...
static void build_variables(const GetPot &input, MultiphysicsSystem &system)
virtual void build_variables_impl(const GetPot &input, MultiphysicsSystem &system)
Implementation of Variable construction done in subclasses.
static void register_variable(const std::string &var_name, SharedPtr< FEVariablesBase > &variable)
Interface with libMesh for solving Multiphysics problems.
SharedPtr< FEVariablesBase > build_fe_var(const std::string &var_type, const std::vector< std::string > &var_names, const std::vector< VariableIndex > &var_indices, const std::set< libMesh::subdomain_id_type > &subdomain_ids)
Sets appropriate data in the VariableFactoryAbstract and calls VariableFactoryAbstract::build() ...