18 #ifndef LIBMESH_VARIABLE_H
19 #define LIBMESH_VARIABLE_H
22 #include "libmesh/libmesh_common.h"
23 #include "libmesh/fe_type.h"
24 #include "libmesh/id_types.h"
60 const unsigned int var_number,
61 const unsigned int first_scalar_num,
62 const FEType & var_type) :
64 _name(std::move(var_name)),
77 const unsigned int var_number,
78 const unsigned int first_scalar_num,
79 const FEType & var_type,
80 const std::set<subdomain_id_type> & var_active_subdomains) :
82 _name(std::move(var_name)),
121 const std::string &
name()
const
147 {
return type().family == SCALAR ?
_type.order.get_order() : 1; }
202 std::vector<std::string> var_names,
203 const unsigned int var_number,
204 const unsigned int first_scalar_num,
205 const FEType & var_type) :
211 _names(std::move(var_names))
220 std::vector<std::string> var_names,
221 const unsigned int var_number,
222 const unsigned int first_scalar_num,
223 const FEType & var_type,
224 const std::set<subdomain_id_type> & var_active_subdomains) :
231 var_active_subdomains),
232 _names(std::move(var_names))
249 return (this->Variable::operator==(other)) &&
257 {
return cast_int<unsigned int>(
_names.size()); }
285 const std::string &
name(
unsigned int v)
const
294 unsigned int number(
unsigned int v)
const
319 {
_names.push_back (std::move(var_name)); }
327 #endif // LIBMESH_VARIABLE_H
const FEType & type() const
std::set< subdomain_id_type > _active_subdomains
unsigned int first_scalar_number(unsigned int v) const
VariableGroup(System *sys, std::vector< std::string > var_names, const unsigned int var_number, const unsigned int first_scalar_num, const FEType &var_type, const std::set< subdomain_id_type > &var_active_subdomains)
Constructor.
const std::string & name() const
Variable operator()(unsigned int v) const
Support vg(v).
VariableGroup & operator=(const VariableGroup &)=default
bool operator==(const Variable &other) const
bool operator==(const VariableGroup &other) const
bool implicitly_active() const
Variable(System *sys, std::string var_name, const unsigned int var_number, const unsigned int first_scalar_num, const FEType &var_type)
Constructor.
unsigned int first_scalar_number() const
VariableGroup(System *sys, std::vector< std::string > var_names, const unsigned int var_number, const unsigned int first_scalar_num, const FEType &var_type)
Constructor.
unsigned int number() const
void append(std::string var_name)
Appends a variable to the group.
unsigned int _first_scalar_number
This class defines the notion of a variable in the system.
unsigned int number(unsigned int v) const
unsigned int n_variables() const
Variable & operator=(const Variable &)=default
bool active_on_subdomain(subdomain_id_type sid) const
std::vector< std::string > _names
Variable variable(unsigned int v) const
This class defines a logically grouped set of variables in the system.
unsigned int n_components() const
const std::set< subdomain_id_type > & active_subdomains() const
const std::string & name(unsigned int v) const
Variable(System *sys, std::string var_name, const unsigned int var_number, const unsigned int first_scalar_num, const FEType &var_type, const std::set< subdomain_id_type > &var_active_subdomains)
Constructor.