www.mooseframework.org
MooseVariableBase.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef MOOSEVARIABLEBASE_H
16 #define MOOSEVARIABLEBASE_H
17 
18 #include "MooseTypes.h"
19 #include "MooseArray.h"
20 
21 #include "libmesh/tensor_value.h"
22 #include "libmesh/vector_value.h"
23 #include "libmesh/fe_type.h"
24 
25 // libMesh forward declarations
26 namespace libMesh
27 {
28 class DofMap;
29 class Variable;
30 }
31 
35 
39 
43 
44 class Assembly;
45 class SubProblem;
46 class SystemBase;
47 class MooseMesh;
48 
50 {
51 public:
52  MooseVariableBase(unsigned int var_num,
53  const FEType & fe_type,
54  SystemBase & sys,
55  Assembly & assembly,
56  Moose::VarKindType var_kind);
57  virtual ~MooseVariableBase();
58 
63  unsigned int number() const { return _var_num; }
64 
68  const FEType & feType() const { return _fe_type; }
69 
73  SystemBase & sys() { return _sys; }
74 
78  const std::string & name() const;
79 
83  const std::vector<dof_id_type> & allDofIndices() const;
84  unsigned int totalVarDofs() { return allDofIndices().size(); }
85 
89  Moose::VarKindType kind() const { return _var_kind; }
90 
94  void scalingFactor(Real factor) { _scaling_factor = factor; }
95 
99  Real scalingFactor() const { return _scaling_factor; }
100 
105  Order order() const;
106 
110  const DofMap & dofMap() const { return _dof_map; }
111 
112  std::vector<dof_id_type> & dofIndices() { return _dof_indices; }
113 
114  const std::vector<dof_id_type> & dofIndices() const { return _dof_indices; }
115 
116  unsigned int numberOfDofs() { return _dof_indices.size(); }
117 
122  virtual bool isNodal() const = 0;
123 
124 protected:
126  unsigned int _var_num;
128  FEType _fe_type;
130  unsigned int _index;
136 
138  const Variable & _variable;
139 
143  const DofMap & _dof_map;
145  std::vector<dof_id_type> _dof_indices;
146 
149 
152 };
153 
154 #endif /* MOOSEVARIABLEBASE_H */
MooseArray< std::vector< RealTensor > > VariableTestSecond
FEType _fe_type
The FEType associated with this variable.
const FEType & feType() const
Get the type of finite element object.
Keeps track of stuff related to assembling.
Definition: Assembly.h:63
MooseArray< Real > VariableValue
const DofMap & _dof_map
DOF map.
Moose::VarKindType kind() const
Kind of the variable (Nonlinear, Auxiliary, ...)
unsigned int numberOfDofs()
const std::vector< dof_id_type > & dofIndices() const
const Variable & _variable
libMesh variable object for this variable
unsigned int _index
variable number within MOOSE
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Base class for a system (of equations)
Definition: SystemBase.h:91
MooseArray< RealTensor > VariableSecond
std::vector< dof_id_type > _dof_indices
DOF indices.
const DofMap & dofMap() const
The DofMap associated with the system this variable is in.
MooseArray< std::vector< RealGradient > > VariableTestGradient
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:156
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
Moose::VarKindType _var_kind
Real _scaling_factor
scaling factor for this variable
MooseMesh & _mesh
mesh the variable is active in
unsigned int number() const
Get variable number coming from libMesh.
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::vector< dof_id_type > & dofIndices()
Assembly & _assembly
Assembly data.
MooseArray< std::vector< RealGradient > > VariablePhiGradient
unsigned int _var_num
variable number (from libMesh)
unsigned int totalVarDofs()
MooseArray< std::vector< Real > > VariableTestValue
Real scalingFactor() const
Get the scaling factor for this variable.
SystemBase & sys()
Get the system this variable is part of.
MooseArray< std::vector< Real > > VariablePhiValue
MooseArray< RealGradient > VariableGradient
MooseArray< std::vector< RealTensor > > VariablePhiSecond
void scalingFactor(Real factor)
Set the scaling factor for this variable.