www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
MooseVariableBase Class Referenceabstract

#include <MooseVariableBase.h>

Inheritance diagram for MooseVariableBase:
[legend]

Public Member Functions

 MooseVariableBase (unsigned int var_num, const FEType &fe_type, SystemBase &sys, Assembly &assembly, Moose::VarKindType var_kind)
 
virtual ~MooseVariableBase ()
 
unsigned int number () const
 Get variable number coming from libMesh. More...
 
const FEType & feType () const
 Get the type of finite element object. More...
 
SystemBasesys ()
 Get the system this variable is part of. More...
 
const std::string & name () const
 Get the variable name. More...
 
const std::vector< dof_id_type > & allDofIndices () const
 Get all global dofindices for the variable. More...
 
unsigned int totalVarDofs ()
 
Moose::VarKindType kind () const
 Kind of the variable (Nonlinear, Auxiliary, ...) More...
 
void scalingFactor (Real factor)
 Set the scaling factor for this variable. More...
 
Real scalingFactor () const
 Get the scaling factor for this variable. More...
 
Order order () const
 Get the order of this variable Note: Order enum can be implicitly converted to unsigned int. More...
 
const DofMap & dofMap () const
 The DofMap associated with the system this variable is in. More...
 
std::vector< dof_id_type > & dofIndices ()
 
const std::vector< dof_id_type > & dofIndices () const
 
unsigned int numberOfDofs ()
 
virtual bool isNodal () const =0
 Is this variable nodal. More...
 

Protected Attributes

unsigned int _var_num
 variable number (from libMesh) More...
 
FEType _fe_type
 The FEType associated with this variable. More...
 
unsigned int _index
 variable number within MOOSE More...
 
Moose::VarKindType _var_kind
 
SubProblem_subproblem
 Problem this variable is part of. More...
 
SystemBase_sys
 System this variable is part of. More...
 
const Variable & _variable
 libMesh variable object for this variable More...
 
Assembly_assembly
 Assembly data. More...
 
const DofMap & _dof_map
 DOF map. More...
 
std::vector< dof_id_type > _dof_indices
 DOF indices. More...
 
MooseMesh_mesh
 mesh the variable is active in More...
 
Real _scaling_factor
 scaling factor for this variable More...
 

Detailed Description

Definition at line 49 of file MooseVariableBase.h.

Constructor & Destructor Documentation

MooseVariableBase::MooseVariableBase ( unsigned int  var_num,
const FEType &  fe_type,
SystemBase sys,
Assembly assembly,
Moose::VarKindType  var_kind 
)

Definition at line 24 of file MooseVariableBase.C.

29  : _var_num(var_num),
30  _fe_type(fe_type),
31  _var_kind(var_kind),
32  _subproblem(sys.subproblem()),
33  _sys(sys),
34  _variable(sys.system().variable(_var_num)),
35  _assembly(assembly),
36  _dof_map(sys.dofMap()),
38  _scaling_factor(1.0)
39 {
40 }
virtual MooseMesh & mesh()=0
FEType _fe_type
The FEType associated with this variable.
const DofMap & _dof_map
DOF map.
const Variable & _variable
libMesh variable object for this variable
virtual DofMap & dofMap()
Gets the dof map.
Definition: SystemBase.C:610
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
Moose::VarKindType _var_kind
virtual SubProblem & subproblem()
Definition: SystemBase.h:103
virtual System & system()=0
Get the reference to the libMesh system.
Real _scaling_factor
scaling factor for this variable
MooseMesh & _mesh
mesh the variable is active in
Assembly & _assembly
Assembly data.
unsigned int _var_num
variable number (from libMesh)
MooseVariableBase::~MooseVariableBase ( )
virtual

Definition at line 42 of file MooseVariableBase.C.

42 {}

Member Function Documentation

const std::vector< dof_id_type > & MooseVariableBase::allDofIndices ( ) const

Get all global dofindices for the variable.

Definition at line 51 of file MooseVariableBase.C.

Referenced by FEProblemBase::addJacobianBlock(), NonlocalIntegratedBC::computeNonlocalJacobian(), NonlocalKernel::computeNonlocalJacobian(), NonlocalKernel::computeNonlocalOffDiagJacobian(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), FEProblemBase::prepare(), Assembly::prepareNonlocal(), and Assembly::prepareVariableNonlocal().

52 {
53  const auto it = _sys.subproblem()._var_dof_map.find(name());
54  if (it != _sys.subproblem()._var_dof_map.end())
55  return it->second;
56  else
57  mooseError("VariableAllDoFMap not prepared for ",
58  name(),
59  " . Check nonlocal coupling requirement for the variable.");
60 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
const std::string & name() const
Get the variable name.
std::map< std::string, std::vector< dof_id_type > > _var_dof_map
Definition: SubProblem.h:413
SystemBase & _sys
System this variable is part of.
virtual SubProblem & subproblem()
Definition: SystemBase.h:103
std::vector<dof_id_type>& MooseVariableBase::dofIndices ( )
inline
const std::vector<dof_id_type>& MooseVariableBase::dofIndices ( ) const
inline

Definition at line 114 of file MooseVariableBase.h.

114 { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
DOF indices.
const DofMap& MooseVariableBase::dofMap ( ) const
inline

The DofMap associated with the system this variable is in.

Definition at line 110 of file MooseVariableBase.h.

Referenced by AuxScalarKernel::compute(), and ScalarVariable::getValue().

110 { return _dof_map; }
const DofMap & _dof_map
DOF map.
const FEType& MooseVariableBase::feType ( ) const
inline
virtual bool MooseVariableBase::isNodal ( ) const
pure virtual

Is this variable nodal.

Returns
true if it nodal, otherwise false

Implemented in MooseVariable, and MooseVariableScalar.

Moose::VarKindType MooseVariableBase::kind ( ) const
inline

Kind of the variable (Nonlinear, Auxiliary, ...)

Definition at line 89 of file MooseVariableBase.h.

Referenced by ShapeUserObject< T >::coupled(), Coupleable::coupled(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), and VariableResidual::VariableResidual().

89 { return _var_kind; }
Moose::VarKindType _var_kind
const std::string & MooseVariableBase::name ( ) const

Get the variable name.

Definition at line 45 of file MooseVariableBase.C.

Referenced by SetupResidualDebugAction::act(), InitialConditionWarehouse::addObject(), allDofIndices(), BlockRestrictable::checkVariable(), MultiAppNearestNodeTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppDTKUserObjectTransfer::execute(), GapValueAux::GapValueAux(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), DerivativeMaterialInterface< T >::isNotKernelVariable(), MooseVariable::nodalValue(), MooseVariable::nodalValueDot(), MooseVariable::nodalValueDotNeighbor(), MooseVariable::nodalValueNeighbor(), MooseVariable::nodalValueOld(), MooseVariable::nodalValueOlder(), MooseVariable::nodalValueOlderNeighbor(), MooseVariable::nodalValueOldNeighbor(), MooseVariable::nodalValuePreviousNL(), MooseVariable::nodalValuePreviousNLNeighbor(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), MooseVariable::setNodalValueNeighbor(), ConstraintWarehouse::subdomainsCovered(), and MultiAppMeshFunctionTransfer::transferVariable().

46 {
47  return _sys.system().variable(_var_num).name();
48 }
SystemBase & _sys
System this variable is part of.
virtual System & system()=0
Get the reference to the libMesh system.
unsigned int _var_num
variable number (from libMesh)
unsigned int MooseVariableBase::number ( ) const
inline

Get variable number coming from libMesh.

Returns
the libmesh variable number

Definition at line 63 of file MooseVariableBase.h.

Referenced by AdaptivityAction::act(), Assembly::addJacobianOffDiagScalar(), Assembly::cacheJacobian(), InterfaceKernel::computeElementOffDiagJacobian(), ElemElemConstraint::computeElemNeighJacobian(), InterfaceKernel::computeElemNeighJacobian(), DGKernel::computeElemNeighJacobian(), ElemElemConstraint::computeElemNeighResidual(), InterfaceKernel::computeElemNeighResidual(), DGKernel::computeElemNeighResidual(), ComputeFullJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeInternalFaceJacobian(), FDKernel::computeJacobian(), Kernel::computeJacobian(), MassLumpedTimeDerivative::computeJacobian(), TimeDerivative::computeJacobian(), ODEKernel::computeJacobian(), EigenKernel::computeJacobian(), NodalEqualValueConstraint::computeJacobian(), ComputeFullJacobianThread::computeJacobian(), IntegratedBC::computeJacobian(), NonlocalKernel::computeJacobian(), NonlocalIntegratedBC::computeJacobian(), KernelValue::computeJacobian(), KernelGrad::computeJacobian(), NodeFaceConstraint::computeJacobian(), FaceFaceConstraint::computeJacobian(), DiracKernel::computeJacobian(), NonlocalIntegratedBC::computeJacobianBlock(), IntegratedBC::computeJacobianBlock(), IntegratedBC::computeJacobianBlockScalar(), FaceFaceConstraint::computeJacobianSide(), InterfaceKernel::computeNeighborOffDiagJacobian(), NonlocalKernel::computeNonlocalJacobian(), NonlocalIntegratedBC::computeNonlocalJacobian(), NonlocalKernel::computeNonlocalOffDiagJacobian(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), InterfaceKernel::computeOffDiagElemNeighJacobian(), DGKernel::computeOffDiagElemNeighJacobian(), Kernel::computeOffDiagJacobian(), FDKernel::computeOffDiagJacobian(), ODEKernel::computeOffDiagJacobian(), NodalScalarKernel::computeOffDiagJacobian(), EigenKernel::computeOffDiagJacobian(), NonlocalKernel::computeOffDiagJacobian(), NodalBC::computeOffDiagJacobian(), KernelGrad::computeOffDiagJacobian(), KernelValue::computeOffDiagJacobian(), NodeFaceConstraint::computeOffDiagJacobian(), DiracKernel::computeOffDiagJacobian(), NodalKernel::computeOffDiagJacobian(), DGKernel::computeOffDiagJacobian(), Kernel::computeOffDiagJacobianScalar(), TiedValueConstraint::computeQpJacobian(), CoupledTiedValueConstraint::computeQpJacobian(), TiedValueConstraint::computeQpResidual(), CoupledTiedValueConstraint::computeQpResidual(), Kernel::computeResidual(), ODETimeKernel::computeResidual(), TimeKernel::computeResidual(), ODEKernel::computeResidual(), EigenKernel::computeResidual(), NodalEqualValueConstraint::computeResidual(), IntegratedBC::computeResidual(), KernelValue::computeResidual(), KernelGrad::computeResidual(), NodeFaceConstraint::computeResidual(), FaceFaceConstraint::computeResidual(), DiracKernel::computeResidual(), FaceFaceConstraint::computeResidualSide(), DebugResidualAux::computeValue(), Coupleable::coupled(), ScalarCoupleable::coupledScalar(), VariableResidual::execute(), NodalNormalsEvaluator::execute(), NodalNormalsCorner::execute(), NodalNormalsPreprocessor::execute(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NodalNormalsPreprocessor::initialize(), ComputeDiracThread::onElement(), ComputeNodalKernelBCJacobiansThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Assembly::prepare(), Assembly::prepareNeighbor(), Assembly::prepareNonlocal(), Assembly::prepareVariable(), Assembly::prepareVariableNonlocal(), MultiAppProjectionTransfer::projectSolution(), AddPeriodicBCAction::setPeriodicVars(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), MultiAppCopyTransfer::transferDofObject(), and UpdateErrorVectorsThread::UpdateErrorVectorsThread().

63 { return _var_num; }
unsigned int _var_num
variable number (from libMesh)
unsigned int MooseVariableBase::numberOfDofs ( )
inline

Definition at line 116 of file MooseVariableBase.h.

Referenced by AuxKernel::compute(), and ComputeDiracThread::onElement().

116 { return _dof_indices.size(); }
std::vector< dof_id_type > _dof_indices
DOF indices.
Order MooseVariableBase::order ( ) const
void MooseVariableBase::scalingFactor ( Real  factor)
inline
Real MooseVariableBase::scalingFactor ( ) const
inline

Get the scaling factor for this variable.

Definition at line 99 of file MooseVariableBase.h.

99 { return _scaling_factor; }
Real _scaling_factor
scaling factor for this variable
SystemBase& MooseVariableBase::sys ( )
inline
unsigned int MooseVariableBase::totalVarDofs ( )
inline

Definition at line 84 of file MooseVariableBase.h.

84 { return allDofIndices().size(); }
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.

Member Data Documentation

Assembly& MooseVariableBase::_assembly
protected
std::vector<dof_id_type> MooseVariableBase::_dof_indices
protected
const DofMap& MooseVariableBase::_dof_map
protected
FEType MooseVariableBase::_fe_type
protected
unsigned int MooseVariableBase::_index
protected

variable number within MOOSE

Definition at line 130 of file MooseVariableBase.h.

MooseMesh& MooseVariableBase::_mesh
protected

mesh the variable is active in

Definition at line 148 of file MooseVariableBase.h.

Real MooseVariableBase::_scaling_factor
protected

scaling factor for this variable

Definition at line 151 of file MooseVariableBase.h.

SubProblem& MooseVariableBase::_subproblem
protected
SystemBase& MooseVariableBase::_sys
protected
Moose::VarKindType MooseVariableBase::_var_kind
protected

Definition at line 131 of file MooseVariableBase.h.

unsigned int MooseVariableBase::_var_num
protected
const Variable& MooseVariableBase::_variable
protected

libMesh variable object for this variable

Definition at line 138 of file MooseVariableBase.h.


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