libMesh
Public Member Functions | Protected Attributes | List of all members
libMesh::Variable Class Reference

This class defines the notion of a variable in the system. More...

#include <variable.h>

Inheritance diagram for libMesh::Variable:
[legend]

Public Member Functions

 Variable (System *sys, const std::string &var_name, const unsigned int var_number, const unsigned int first_scalar_num, const FEType &var_type)
 Constructor. More...
 
 Variable (System *sys, const 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. More...
 
Systemsystem () const
 
const std::string & name () const
 
unsigned int number () const
 
unsigned int first_scalar_number () const
 
const FETypetype () const
 
unsigned int n_components () const
 
bool active_on_subdomain (subdomain_id_type sid) const
 
bool implicitly_active () const
 
const std::set< subdomain_id_type > & active_subdomains () const
 

Protected Attributes

System_sys
 
std::string _name
 
std::set< subdomain_id_type_active_subdomains
 
unsigned int _number
 
unsigned int _first_scalar_number
 
FEType _type
 

Detailed Description

This class defines the notion of a variable in the system.

A variable is one of potentially several unknowns in the problem at hand. A variable is described by a unique name, a finite element approximation family, and (optionally) a list of subdomains to which the variable is restricted.

Author
Roy Stogner
Date
2010 A variable which is solved for in a System of equations.

Definition at line 49 of file variable.h.

Constructor & Destructor Documentation

libMesh::Variable::Variable ( System sys,
const std::string &  var_name,
const unsigned int  var_number,
const unsigned int  first_scalar_num,
const FEType var_type 
)

Constructor.

Omits the subdomain mapping, hence this constructor creates a variable which is active on all subdomains.

Definition at line 58 of file variable.h.

Referenced by libMesh::VariableGroup::variable().

62  :
63  _sys(sys),
64  _name(var_name),
66  _number(var_number),
67  _first_scalar_number(first_scalar_num),
68  _type(var_type)
69  {}
std::set< subdomain_id_type > _active_subdomains
Definition: variable.h:156
std::string _name
Definition: variable.h:155
ImplicitSystem & sys
unsigned int _first_scalar_number
Definition: variable.h:158
System * _sys
Definition: variable.h:154
unsigned int _number
Definition: variable.h:157
libMesh::Variable::Variable ( System sys,
const 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.

Takes a set which contains the subdomain indices for which this variable is active.

Definition at line 75 of file variable.h.

80  :
81  _sys(sys),
82  _name(var_name),
83  _active_subdomains(var_active_subdomains),
84  _number(var_number),
85  _first_scalar_number(first_scalar_num),
86  _type(var_type)
87  {}
std::set< subdomain_id_type > _active_subdomains
Definition: variable.h:156
std::string _name
Definition: variable.h:155
ImplicitSystem & sys
unsigned int _first_scalar_number
Definition: variable.h:158
System * _sys
Definition: variable.h:154
unsigned int _number
Definition: variable.h:157

Member Function Documentation

bool libMesh::Variable::active_on_subdomain ( subdomain_id_type  sid) const
const std::set<subdomain_id_type>& libMesh::Variable::active_subdomains ( ) const
Returns
The set of subdomain ids this variable lives on.

Definition at line 150 of file variable.h.

References _active_subdomains.

Referenced by libMesh::DifferentiableSystem::add_second_order_dot_vars(), main(), and libMesh::VariableGroup::variable().

151  { return _active_subdomains; }
std::set< subdomain_id_type > _active_subdomains
Definition: variable.h:156
unsigned int libMesh::Variable::first_scalar_number ( ) const
Returns
The index of the first scalar component of this variable in the system.

Definition at line 113 of file variable.h.

References _first_scalar_number.

Referenced by libMesh::System::n_components(), and libMesh::VariableGroup::variable().

114  { return _first_scalar_number; }
unsigned int _first_scalar_number
Definition: variable.h:158
bool libMesh::Variable::implicitly_active ( ) const
Returns
true if this variable is active on all subdomains because it has no specified activity map. This can be used to perform more efficient computations in some places.

Definition at line 144 of file variable.h.

References _active_subdomains.

145  { return _active_subdomains.empty(); }
std::set< subdomain_id_type > _active_subdomains
Definition: variable.h:156
unsigned int libMesh::Variable::n_components ( ) const
Returns
The number of components of this variable.

Definition at line 125 of file variable.h.

References _type, libMesh::FEType::family, libMesh::OrderWrapper::get_order(), libMesh::FEType::order, libMesh::SCALAR, and type().

Referenced by libMesh::WrappedFunction< Output >::component(), libMesh::System::n_components(), libMesh::WrappedFunction< Output >::operator()(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), and libMesh::BoundaryVolumeSolutionTransfer::transfer_volume_boundary().

126  { return type().family == SCALAR ? _type.order.get_order() : 1; }
FEFamily family
The type of finite element.
Definition: fe_type.h:203
int get_order() const
Explicitly request the order as an int.
Definition: fe_type.h:77
const FEType & type() const
Definition: variable.h:119
OrderWrapper order
The approximation order of the element.
Definition: fe_type.h:197
const std::string& libMesh::Variable::name ( ) const
unsigned int libMesh::Variable::number ( ) const
System* libMesh::Variable::system ( ) const
const FEType& libMesh::Variable::type ( ) const

Member Data Documentation

std::set<subdomain_id_type> libMesh::Variable::_active_subdomains
protected

Definition at line 156 of file variable.h.

Referenced by active_on_subdomain(), active_subdomains(), and implicitly_active().

unsigned int libMesh::Variable::_first_scalar_number
protected

Definition at line 158 of file variable.h.

Referenced by first_scalar_number(), and libMesh::VariableGroup::first_scalar_number().

std::string libMesh::Variable::_name
protected

Definition at line 155 of file variable.h.

Referenced by name().

unsigned int libMesh::Variable::_number
protected

Definition at line 157 of file variable.h.

Referenced by number(), and libMesh::VariableGroup::number().

System* libMesh::Variable::_sys
protected

Definition at line 154 of file variable.h.

Referenced by system().

FEType libMesh::Variable::_type
protected

Definition at line 159 of file variable.h.

Referenced by n_components(), and type().


The documentation for this class was generated from the following file: