System::Variable Class Reference

#include <system.h>

List of all members.

Public Member Functions

 Variable (const std::string &var_name, const unsigned int var_number, const FEType &var_type)
 Variable (const std::string &var_name, const unsigned int var_number, const FEType &var_type, const std::set< subdomain_id_type > &var_active_subdomains)
const std::string & name () const
unsigned int number () const
const FETypetype () const
bool active_on_subdomain (const subdomain_id_type sid) const
bool implicitly_active () const

Private Attributes

std::string _name
unsigned int _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 687 of file system.h.


Constructor & Destructor Documentation

System::Variable::Variable ( const std::string &  var_name,
const unsigned int  var_number,
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 696 of file system.h.

00698                                       :
00699       _name(var_name),
00700       _number(var_number),
00701       _type(var_type)
00702     {}
    

System::Variable::Variable ( const std::string &  var_name,
const unsigned int  var_number,
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 708 of file system.h.

00711                                                                       :
00712       _name(var_name),
00713       _number(var_number),
00714       _type(var_type),
00715       _active_subdomains(var_active_subdomains)
00716     {}
    


Member Function Documentation

bool System::Variable::active_on_subdomain ( const 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 742 of file system.h.

References _active_subdomains.

Referenced by EquationSystems::build_solution_vector(), DofMap::distribute_local_dofs_var_major(), and DofMap::reinit().

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

bool System::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 750 of file system.h.

References _active_subdomains.

Referenced by EquationSystems::build_solution_vector().

00751     { return _active_subdomains.empty(); }

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

Arbitrary, user-specified name of the variable.

Definition at line 721 of file system.h.

References _name.

00722     { return _name; }

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

The rank of this variable in the system.

Definition at line 727 of file system.h.

References _number.

00728     { return _number; }

const FEType& System::Variable::type (  )  const [inline]


Member Data Documentation

Definition at line 757 of file system.h.

Referenced by active_on_subdomain(), and implicitly_active().

std::string System::Variable::_name [private]

Definition at line 754 of file system.h.

Referenced by name().

unsigned int System::Variable::_number [private]

Definition at line 755 of file system.h.

Referenced by number().

Definition at line 756 of file system.h.

Referenced by type().


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

Site Created By: libMesh Developers
Last modified: November 25 2009 03:45:00.

Hosted By:
SourceForge.net Logo