libMesh::Variable Class Reference

#include <variable.h>

Inheritance diagram for libMesh::Variable:

List of all members.

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)
 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)
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
unsigned int _number
unsigned int _first_scalar_number
FEType _type
std::set< subdomain_id_type_active_subdomains

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.

Definition at line 44 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 
) [inline]

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

Definition at line 53 of file variable.h.

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

00057                                     :
00058     _sys(sys),
00059     _name(var_name),
00060     _number(var_number),
00061     _first_scalar_number(first_scalar_num),
00062     _type(var_type),
00063     _active_subdomains()
00064   {}

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 
) [inline]

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

Definition at line 70 of file variable.h.

00075                                                                     :
00076     _sys(sys),
00077     _name(var_name),
00078     _number(var_number),
00079     _first_scalar_number(first_scalar_num),
00080     _type(var_type),
00081     _active_subdomains(var_active_subdomains)
00082   {}


Member Function Documentation

bool libMesh::Variable::active_on_subdomain ( subdomain_id_type  sid  )  const [inline]

returns true if this variable is active on subdomain sid, false otherwise. Note that we interperet the special case of an empty _active_subdomains container as active everywhere, i.e. for all subdomains.

Definition at line 129 of file variable.h.

References _active_subdomains.

Referenced by libMesh::EquationSystems::build_solution_vector(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::EquationSystems::get_solution(), libMesh::BoundaryProjectSolution::operator()(), libMesh::ProjectFEMSolution::operator()(), libMesh::ProjectSolution::operator()(), and libMesh::DofMap::reinit().

00130   { return (_active_subdomains.empty() || _active_subdomains.count(sid));  }

const std::set<subdomain_id_type>& libMesh::Variable::active_subdomains (  )  const [inline]

Returns set of subdomain ids this variable lives on

Definition at line 143 of file variable.h.

References _active_subdomains.

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

00144   { return _active_subdomains; }

unsigned int libMesh::Variable::first_scalar_number (  )  const [inline]

The index of the first scalar component of this variable in the system.

Definition at line 108 of file variable.h.

References _first_scalar_number.

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

00109   { return _first_scalar_number; }

bool libMesh::Variable::implicitly_active (  )  const [inline]

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 137 of file variable.h.

References _active_subdomains.

Referenced by libMesh::EquationSystems::build_solution_vector().

00138   { return _active_subdomains.empty(); }

unsigned int libMesh::Variable::n_components (  )  const [inline]

The number of components of this variable.

Definition at line 120 of file variable.h.

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

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

00121   { return type().family == SCALAR ? _type.order : 1; }

const std::string& libMesh::Variable::name (  )  const [inline]

Arbitrary, user-specified name of the variable.

Definition at line 95 of file variable.h.

References _name.

Referenced by DMLibMeshSetSystem(), and libMesh::VariableGroup::variable().

00096   { return _name; }

unsigned int libMesh::Variable::number (  )  const [inline]

The rank of this variable in the system.

Definition at line 101 of file variable.h.

References _number.

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

00102   { return _number; }

System* libMesh::Variable::system (  )  const [inline]

The System this Variable is part of.

Definition at line 87 of file variable.h.

References _sys.

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

00088   {
00089     return _sys;
00090   }


Member Data Documentation

unsigned int libMesh::Variable::_first_scalar_number [protected]

Definition at line 150 of file variable.h.

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

std::string libMesh::Variable::_name [protected]

Definition at line 148 of file variable.h.

Referenced by name().

unsigned int libMesh::Variable::_number [protected]

Definition at line 149 of file variable.h.

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

Definition at line 147 of file variable.h.

Referenced by system().

Definition at line 151 of file variable.h.

Referenced by n_components(), and type().


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

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:43 UTC

Hosted By:
SourceForge.net Logo