29 #include "libmesh/getpot.h"
30 #include "libmesh/string_to_enum.h"
31 #include "libmesh/fem_system.h"
50 if( !input.have_variable(
"Physics/"+this->_physics_name+
"/Variables/names") )
52 libMesh::err <<
"Error: Must have at least one variable for source function." << std::endl
53 <<
" Ensure that Physics/"+this->
_physics_name+
"/Variables/names is set." << std::endl;
57 unsigned int n_vars = input.vector_variable_size(
"Physics/"+this->
_physics_name+
"/Variables/names");
62 unsigned int n_fe_types = input.vector_variable_size(
"Physics/"+this->
_physics_name+
"/Variables/FE_types");
64 unsigned int n_fe_orders = input.vector_variable_size(
"Physics/"+this->
_physics_name+
"/Variables/FE_orders");
66 if( n_fe_types != n_vars )
68 libMesh::err <<
"Error: Must have matching number of variable names and FE types." << std::endl
69 <<
" Found " << n_fe_types <<
" FE types and " << n_vars <<
" variables." << std::endl
70 <<
" Ensure Physics/"+this->
_physics_name+
"/Variables/FE_types is consistent." << std::endl;
74 if( n_fe_orders != n_vars )
76 libMesh::err <<
"Error: Must have matching number of variable names and FE orders." << std::endl
77 <<
" Found " << n_fe_orders <<
" FE orders and " << n_vars <<
" variables." << std::endl
78 <<
" Ensure Physics/"+this->
_physics_name+
"/Variables/FE_orders is consistent." << std::endl;
85 for(
unsigned int v = 0; v < n_vars; v++ )
88 _var_FE.push_back( libMesh::Utility::string_to_enum<GRINSEnums::FEFamily>(input(
"Physics/"+this->
_physics_name+
"/Variables/FE_types",
"DIE!", v)) );
89 _var_order.push_back( libMesh::Utility::string_to_enum<GRINSEnums::Order>(input(
"Physics/"+this->
_physics_name+
"/Variables/FE_orders",
"DIE!", v)) );
102 for(
unsigned int var = 0; var <
_vars.size(); var++ )
std::vector< VariableIndex > _vars
virtual ~SourceTermBase()
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
void parse_var_info(const GetPot &input)
Helper function.
std::vector< std::string > _var_names
const PhysicsName _physics_name
Name of the physics object. Used for reading physics specific inputs.
virtual void init_variables(libMesh::FEMSystem *system)
Initialize variables for this physics.
std::vector< GRINSEnums::Order > _var_order
std::vector< GRINSEnums::FEFamily > _var_FE