www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
MooseVariable Class Reference

Class for stuff related to variables. More...

#include <MooseVariable.h>

Inheritance diagram for MooseVariable:
[legend]

Public Member Functions

 MooseVariable (unsigned int var_num, const FEType &fe_type, SystemBase &sys, Assembly &assembly, Moose::VarKindType var_kind)
 
virtual ~MooseVariable ()
 
void clearDofIndices ()
 Clear out the dof indices. More...
 
void prepare ()
 
void prepareNeighbor ()
 
void prepareAux ()
 
void prepareIC ()
 
void reinitNode ()
 
void reinitNodeNeighbor ()
 
void reinitAux ()
 
void reinitAuxNeighbor ()
 
void reinitNodes (const std::vector< dof_id_type > &nodes)
 
void reinitNodesNeighbor (const std::vector< dof_id_type > &nodes)
 
const std::set< SubdomainID > & activeSubdomains () const
 
bool activeOnSubdomain (SubdomainID subdomain) const
 Is the variable active on the subdomain? More...
 
virtual bool isNodal () const override
 Is this variable nodal. More...
 
const Elem *& currentElem ()
 Current element this variable is evaluated at. More...
 
unsigned int & currentSide ()
 Current side this variable is being evaluated on. More...
 
const Elem *& neighbor ()
 Current neighboring element. More...
 
bool computingSecond ()
 Whether or not this variable is computing any second derivatives. More...
 
const VariablePhiValuephi ()
 
const VariablePhiGradientgradPhi ()
 
const VariablePhiSecondsecondPhi ()
 
const VariablePhiValuephiFace ()
 
const VariablePhiGradientgradPhiFace ()
 
const VariablePhiSecondsecondPhiFace ()
 
const VariablePhiValuephiNeighbor ()
 
const VariablePhiGradientgradPhiNeighbor ()
 
const VariablePhiSecondsecondPhiNeighbor ()
 
const VariablePhiValuephiFaceNeighbor ()
 
const VariablePhiGradientgradPhiFaceNeighbor ()
 
const VariablePhiSecondsecondPhiFaceNeighbor ()
 
const MooseArray< Point > & normals ()
 
VariableValueincrement ()
 
const VariableValuesln ()
 
const VariableValueslnOld ()
 
const VariableValueslnOlder ()
 
const VariableValueslnPreviousNL ()
 
const VariableGradientgradSln ()
 
const VariableGradientgradSlnOld ()
 
const VariableGradientgradSlnOlder ()
 
const VariableGradientgradSlnPreviousNL ()
 
const VariableSecondsecondSln ()
 
const VariableSecondsecondSlnOld ()
 
const VariableSecondsecondSlnOlder ()
 
const VariableSecondsecondSlnPreviousNL ()
 
const VariableValueuDot ()
 
const VariableValueduDotDu ()
 
const Node *& node ()
 
dof_id_type & nodalDofIndex ()
 
bool isNodalDefined ()
 
const VariableValuenodalSln ()
 
const VariableValuenodalSlnOld ()
 
const VariableValuenodalSlnOlder ()
 
const VariableValuenodalSlnPreviousNL ()
 
const VariableValuenodalSlnDot ()
 
const VariableValuenodalSlnDuDotDu ()
 
const VariableValuenodalValue ()
 
const VariableValuenodalValueOld ()
 
const VariableValuenodalValueOlder ()
 
const VariableValuenodalValuePreviousNL ()
 
const VariableValuenodalValueDot ()
 
const VariableValuenodalValueNeighbor ()
 
const VariableValuenodalValueOldNeighbor ()
 
const VariableValuenodalValueOlderNeighbor ()
 
const VariableValuenodalValuePreviousNLNeighbor ()
 
const VariableValuenodalValueDotNeighbor ()
 
const VariableValueslnNeighbor ()
 
const VariableValueslnOldNeighbor ()
 
const VariableValueslnOlderNeighbor ()
 
const VariableValueslnPreviousNLNeighbor ()
 
const VariableGradientgradSlnNeighbor ()
 
const VariableGradientgradSlnOldNeighbor ()
 
const VariableGradientgradSlnOlderNeighbor ()
 
const VariableGradientgradSlnPreviousNLNeighbor ()
 
const VariableSecondsecondSlnNeighbor ()
 
const VariableSecondsecondSlnOldNeighbor ()
 
const VariableSecondsecondSlnOlderNeighbor ()
 
const VariableSecondsecondSlnPreviousNLNeighbor ()
 
const VariableValueuDotNeighbor ()
 
const VariableValueduDotDuNeighbor ()
 
const Node *& nodeNeighbor ()
 
dof_id_type & nodalDofIndexNeighbor ()
 
bool isNodalNeighborDefined ()
 
const VariableValuenodalSlnNeighbor ()
 
const VariableValuenodalSlnOldNeighbor ()
 
const VariableValuenodalSlnOlderNeighbor ()
 
const VariableValuenodalSlnPreviousNLNeighbor ()
 
const VariableValuenodalSlnDotNeighbor ()
 
const VariableValuenodalSlnDuDotDuNeighbor ()
 
const DenseVector< Number > & solutionDoFs ()
 
const DenseVector< Number > & solutionDoFsOld ()
 
const DenseVector< Number > & solutionDoFsOlder ()
 
const DenseVector< Number > & solutionDoFsNeighbor ()
 
const DenseVector< Number > & solutionDoFsOldNeighbor ()
 
const DenseVector< Number > & solutionDoFsOlderNeighbor ()
 
void computePerturbedElemValues (unsigned i, Real scale, Real &h)
 Compute values at interior quadrature points when this variable's elem dof i is perturbed by h in the current solution. More...
 
void restoreUnperturbedElemValues ()
 Restore the values the variable had before a call to computePerturbedElemValues(). More...
 
virtual void computeElemValues ()
 Compute values at interior quadrature points. More...
 
virtual void computeElemValuesFace ()
 Compute values at facial quadrature points. More...
 
virtual void computeNeighborValuesFace ()
 Compute values at facial quadrature points for the neighbor. More...
 
virtual void computeNeighborValues ()
 Compute values at quadrature points for the neighbor. More...
 
void computeNodalValues ()
 Compute nodal values of this variable. More...
 
void computeNodalNeighborValues ()
 Compute nodal values of this variable in the neighbor. More...
 
void setNodalValue (Number value, unsigned int idx=0)
 Set the nodal value for this variable to keep everything up to date. More...
 
void setNodalValue (const DenseVector< Number > &value)
 Set values for this variable to keep everything up to date. More...
 
void setNodalValueNeighbor (Number value)
 Set the neighbor nodal value for this variable. More...
 
void setNodalValueNeighbor (const DenseVector< Number > &value)
 Set the neighbor values for this variable. More...
 
void computeIncrementAtQps (const NumericVector< Number > &increment_vec)
 Compute and store incremental change in solution at QPs based on increment_vec. More...
 
void computeIncrementAtNode (const NumericVector< Number > &increment_vec)
 Compute and store incremental change at the current node based on increment_vec. More...
 
std::vector< dof_id_type > & dofIndicesNeighbor ()
 Get DOF indices for currently selected element. More...
 
unsigned int numberOfDofsNeighbor ()
 
void insert (NumericVector< Number > &residual)
 
void add (NumericVector< Number > &residual)
 
Number getNodalValue (const Node &node)
 Get the value of this variable at given node. More...
 
Number getNodalValueOld (const Node &node)
 Get the old value of this variable at given node. More...
 
Number getNodalValueOlder (const Node &node)
 Get the t-2 value of this variable at given node. More...
 
Real getValue (const Elem *elem, const std::vector< std::vector< Real >> &phi) const
 Compute the variable value at a point on an element. More...
 
RealGradient getGradient (const Elem *elem, const std::vector< std::vector< RealGradient >> &phi) const
 
Number getElementalValue (const Elem *elem, unsigned int idx=0) const
 Retrieve the Elemental DOF. More...
 
bool usesPhi ()
 Whether or not this variable is actually using the shape function value. More...
 
bool usesGradPhi ()
 Whether or not this variable is actually using the shape function gradient. More...
 
bool usesSecondPhi ()
 Whether or not this variable is actually using the shape function second derivative. More...
 
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 ()
 

Protected Member Functions

void getDofIndices (const Elem *elem, std::vector< dof_id_type > &dof_indices)
 Get dof indices for the variable. More...
 

Protected Attributes

THREAD_ID _tid
 Thread ID. More...
 
QBase *& _qrule
 Quadrature rule for interior. More...
 
QBase *& _qrule_face
 Quadrature rule for the face. More...
 
QBase *& _qrule_neighbor
 Quadrature rule for the neighbor. More...
 
const Elem *& _elem
 current element More...
 
unsigned int & _current_side
 the side of the current element (valid when doing face assembly) More...
 
const Elem *& _neighbor
 neighboring element More...
 
std::vector< dof_id_type > _dof_indices_neighbor
 DOF indices (neighbor) More...
 
bool _need_u_old
 
bool _need_u_older
 
bool _need_u_previous_nl
 
bool _need_grad_old
 
bool _need_grad_older
 
bool _need_grad_previous_nl
 
bool _need_second
 
bool _need_second_old
 
bool _need_second_older
 
bool _need_second_previous_nl
 
bool _need_u_old_neighbor
 
bool _need_u_older_neighbor
 
bool _need_u_previous_nl_neighbor
 
bool _need_grad_old_neighbor
 
bool _need_grad_older_neighbor
 
bool _need_grad_previous_nl_neighbor
 
bool _need_second_neighbor
 
bool _need_second_old_neighbor
 
bool _need_second_older_neighbor
 
bool _need_second_previous_nl_neighbor
 
bool _need_nodal_u
 
bool _need_nodal_u_old
 
bool _need_nodal_u_older
 
bool _need_nodal_u_previous_nl
 
bool _need_nodal_u_dot
 
bool _need_nodal_u_neighbor
 
bool _need_nodal_u_old_neighbor
 
bool _need_nodal_u_older_neighbor
 
bool _need_nodal_u_previous_nl_neighbor
 
bool _need_nodal_u_dot_neighbor
 
bool _need_solution_dofs
 
bool _need_solution_dofs_old
 
bool _need_solution_dofs_older
 
bool _need_solution_dofs_neighbor
 
bool _need_solution_dofs_old_neighbor
 
bool _need_solution_dofs_older_neighbor
 
const VariablePhiValue_phi
 
const VariablePhiGradient_grad_phi
 
const VariablePhiSecond_second_phi
 
const VariablePhiValue_phi_face
 
const VariablePhiGradient_grad_phi_face
 
const VariablePhiSecond_second_phi_face
 
const VariablePhiValue_phi_neighbor
 
const VariablePhiGradient_grad_phi_neighbor
 
const VariablePhiSecond_second_phi_neighbor
 
const VariablePhiValue_phi_face_neighbor
 
const VariablePhiGradient_grad_phi_face_neighbor
 
const VariablePhiSecond_second_phi_face_neighbor
 
const MooseArray< Point > & _normals
 Normals at QPs on faces. More...
 
VariableValue _u
 
VariableValue _u_bak
 
VariableValue _u_old
 
VariableValue _u_old_bak
 
VariableValue _u_older
 
VariableValue _u_older_bak
 
VariableValue _u_previous_nl
 
VariableGradient _grad_u
 
VariableGradient _grad_u_bak
 
VariableGradient _grad_u_old
 
VariableGradient _grad_u_old_bak
 
VariableGradient _grad_u_older
 
VariableGradient _grad_u_older_bak
 
VariableGradient _grad_u_previous_nl
 
VariableSecond _second_u
 
VariableSecond _second_u_bak
 
VariableSecond _second_u_old
 
VariableSecond _second_u_old_bak
 
VariableSecond _second_u_older
 
VariableSecond _second_u_older_bak
 
VariableSecond _second_u_previous_nl
 
VariableValue _u_neighbor
 
VariableValue _u_old_neighbor
 
VariableValue _u_older_neighbor
 
VariableValue _u_previous_nl_neighbor
 
VariableGradient _grad_u_neighbor
 
VariableGradient _grad_u_old_neighbor
 
VariableGradient _grad_u_older_neighbor
 
VariableGradient _grad_u_previous_nl_neighbor
 
VariableSecond _second_u_neighbor
 
VariableSecond _second_u_old_neighbor
 
VariableSecond _second_u_older_neighbor
 
VariableSecond _second_u_previous_nl_neighbor
 
VariableValue _u_dot
 u_dot (time derivative) More...
 
VariableValue _u_dot_bak
 
VariableValue _u_dot_neighbor
 
VariableValue _u_dot_bak_neighbor
 
VariableValue _du_dot_du
 derivative of u_dot wrt u More...
 
VariableValue _du_dot_du_bak
 
VariableValue _du_dot_du_neighbor
 
VariableValue _du_dot_du_bak_neighbor
 
bool _is_defined
 If the variable is defined at the node (used in compute nodal values) More...
 
bool _has_nodal_value
 If true, the nodal value gets inserted on calling insert() More...
 
bool _has_nodal_value_neighbor
 
const Node *& _node
 
dof_id_type _nodal_dof_index
 
VariableValue _nodal_u
 
VariableValue _nodal_u_old
 
VariableValue _nodal_u_older
 
VariableValue _nodal_u_previous_nl
 
VariableValue _nodal_u_dot
 nodal values of u_dot More...
 
VariableValue _nodal_du_dot_du
 nodal values of derivative of u_dot wrt u More...
 
bool _is_defined_neighbor
 If the variable is defined at the neighbor node (used in compute nodal values) More...
 
const Node *& _node_neighbor
 
dof_id_type _nodal_dof_index_neighbor
 
VariableValue _nodal_u_neighbor
 
VariableValue _nodal_u_old_neighbor
 
VariableValue _nodal_u_older_neighbor
 
VariableValue _nodal_u_previous_nl_neighbor
 
VariableValue _nodal_u_dot_neighbor
 
VariableValue _nodal_du_dot_du_neighbor
 
DenseVector< Number > _solution_dofs
 local elemental DoFs More...
 
DenseVector< Number > _solution_dofs_old
 
DenseVector< Number > _solution_dofs_older
 
DenseVector< Number > _solution_dofs_neighbor
 
DenseVector< Number > _solution_dofs_old_neighbor
 
DenseVector< Number > _solution_dofs_older_neighbor
 
bool _is_nodal
 if variable is nodal More...
 
VariableValue _increment
 
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...
 

Friends

class NodeFaceConstraint
 
class ValueThresholdMarker
 
class ValueRangeMarker
 

Detailed Description

Class for stuff related to variables.

Each variable can compute nodal or elemental (at QPs) values.

Definition at line 43 of file MooseVariable.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file MooseVariable.C.

33  : MooseVariableBase(var_num, fe_type, sys, assembly, var_kind),
34 
38  _elem(_assembly.elem()),
41 
42  _need_u_old(false),
43  _need_u_older(false),
44  _need_u_previous_nl(false),
45 
46  _need_grad_old(false),
47  _need_grad_older(false),
49 
50  _need_second(false),
51  _need_second_old(false),
52  _need_second_older(false),
54 
55  _need_u_old_neighbor(false),
58 
62 
63  _need_second_neighbor(false),
67 
68  _need_nodal_u(false),
69  _need_nodal_u_old(false),
70  _need_nodal_u_older(false),
72  _need_nodal_u_dot(false),
73 
79 
80  _need_solution_dofs(false),
86 
89 
92 
95 
98 
100 
101  _is_defined(false),
102  _has_nodal_value(false),
104 
105  _node(_assembly.node()),
106  _is_defined_neighbor(false),
108 {
110 
111  // FIXME: continuity of FE type seems equivalent with the definition of nodal variables.
112  // Continuity does not depend on the FE dimension, so we just pass in a valid dimension.
113  _is_nodal = _assembly.getFE(feType(), _sys.mesh().dimension())->get_continuity() != DISCONTINUOUS;
114 }
bool _need_grad_older_neighbor
const VariablePhiGradient & _grad_phi
QBase *& qRuleFace()
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:165
bool _need_grad_previous_nl_neighbor
bool _need_second_old_neighbor
bool _need_u_old_neighbor
bool _need_solution_dofs_older_neighbor
FEType _fe_type
The FEType associated with this variable.
bool _need_second_older
bool _need_nodal_u_older
const FEType & feType() const
Get the type of finite element object.
bool _need_nodal_u_previous_nl
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimsension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh m...
Definition: MooseMesh.C:1945
const VariablePhiGradient & feGradPhiFaceNeighbor(FEType type)
Definition: Assembly.C:338
bool _need_grad_previous_nl
bool _need_u_previous_nl_neighbor
const VariablePhiValue & fePhiFace(FEType type)
Definition: Assembly.C:287
bool _is_defined_neighbor
If the variable is defined at the neighbor node (used in compute nodal values)
const VariablePhiValue & fePhiFaceNeighbor(FEType type)
Definition: Assembly.C:331
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
bool _need_grad_old_neighbor
QBase *& _qrule_face
Quadrature rule for the face.
const VariablePhiValue & _phi_neighbor
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
const Node *& _node
const Elem *& neighbor()
Return the neighbor element.
Definition: Assembly.h:235
const VariablePhiGradient & feGradPhiNeighbor(FEType type)
Definition: Assembly.C:316
bool _need_solution_dofs_old
const VariablePhiGradient & feGradPhi(FEType type)
Definition: Assembly.C:272
const VariablePhiGradient & _grad_phi_face
const MooseArray< Point > & normals()
Returns the array of normals for quadrature points on a current side.
Definition: Assembly.h:183
unsigned int & _current_side
the side of the current element (valid when doing face assembly)
bool _need_second_previous_nl
QBase *& qRule()
Returns the reference to the current quadrature being used.
Definition: Assembly.h:129
FEBase *& getFE(FEType type, unsigned int dim)
Get a reference to a pointer that will contain the current volume FE.
Definition: Assembly.C:244
bool _need_nodal_u_older_neighbor
unsigned int & side()
Returns the current side.
Definition: Assembly.h:211
const Node *& node()
Returns the reference to the node.
Definition: Assembly.h:269
QBase *& _qrule
Quadrature rule for interior.
const VariablePhiGradient & _grad_phi_neighbor
const Node *& _node_neighbor
bool _need_nodal_u_previous_nl_neighbor
SystemBase & _sys
System this variable is part of.
const MooseArray< Point > & _normals
Normals at QPs on faces.
bool _need_nodal_u_old_neighbor
bool _need_nodal_u_old
bool _has_nodal_value_neighbor
const VariablePhiValue & _phi_face_neighbor
void buildFE(FEType type)
Build FEs with a type.
Definition: Assembly.C:168
const VariablePhiValue & fePhi(FEType type)
Definition: Assembly.C:265
QBase *& _qrule_neighbor
Quadrature rule for the neighbor.
const VariablePhiValue & _phi_face
bool _need_solution_dofs_neighbor
const VariablePhiGradient & feGradPhiFace(FEType type)
Definition: Assembly.C:294
bool _need_nodal_u_dot_neighbor
const Node *& nodeNeighbor()
Returns the reference to the neighboring node.
Definition: Assembly.h:275
const VariablePhiValue & _phi
bool _need_second_neighbor
bool _need_nodal_u_dot
const VariablePhiValue & fePhiNeighbor(FEType type)
Definition: Assembly.C:309
bool _is_nodal
if variable is nodal
const Elem *& elem()
Return the current element.
Definition: Assembly.h:189
bool _need_solution_dofs_older
Assembly & _assembly
Assembly data.
bool _need_second_previous_nl_neighbor
const Elem *& _elem
current element
QBase *& qRuleNeighbor()
Returns the reference to the current quadrature being used on a current neighbor. ...
Definition: Assembly.h:257
virtual MooseMesh & mesh()
Definition: SystemBase.h:102
bool _need_solution_dofs
const Elem *& _neighbor
neighboring element
const VariablePhiGradient & _grad_phi_face_neighbor
bool _need_solution_dofs_old_neighbor
bool _need_second_older_neighbor
bool _need_u_older_neighbor
bool _need_u_previous_nl
MooseVariableBase(unsigned int var_num, const FEType &fe_type, SystemBase &sys, Assembly &assembly, Moose::VarKindType var_kind)
bool _need_nodal_u_neighbor
MooseVariable::~MooseVariable ( )
virtual

Definition at line 116 of file MooseVariable.C.

117 {
118  _u.release();
119  _u_bak.release();
120  _u_old.release();
122  _u_older.release();
125 
126  _grad_u.release();
133 
134  _second_u.release();
141 
142  _u_dot.release();
146 
151 
152  _nodal_u.release();
158 
165 
167 
172 
177 
182 }
VariableValue _increment
VariableSecond _second_u_previous_nl_neighbor
VariableValue _nodal_u_old
VariableValue _u_older_bak
VariableGradient _grad_u_old_bak
VariableSecond _second_u_older
VariableSecond _second_u_old
VariableGradient _grad_u_neighbor
VariableGradient _grad_u_old_neighbor
VariableValue _nodal_u_older_neighbor
VariableValue _u_old_neighbor
VariableValue _du_dot_du
derivative of u_dot wrt u
VariableValue _u_previous_nl_neighbor
VariableGradient _grad_u_older
VariableValue _u_older_neighbor
VariableGradient _grad_u_old
VariableValue _nodal_u
VariableSecond _second_u
VariableValue _nodal_u_neighbor
VariableValue _nodal_du_dot_du
nodal values of derivative of u_dot wrt u
VariableSecond _second_u_old_neighbor
VariableValue _u
VariableGradient _grad_u
VariableValue _u_dot_neighbor
VariableValue _u_dot_bak_neighbor
VariableValue _nodal_u_previous_nl
VariableGradient _grad_u_previous_nl
VariableValue _du_dot_du_bak_neighbor
VariableValue _u_previous_nl
VariableValue _u_old
VariableValue _nodal_u_previous_nl_neighbor
VariableValue _u_neighbor
VariableSecond _second_u_old_bak
VariableValue _u_bak
VariableValue _nodal_du_dot_du_neighbor
VariableValue _nodal_u_dot
nodal values of u_dot
VariableValue _u_dot_bak
VariableSecond _second_u_older_bak
VariableGradient _grad_u_bak
void release()
Manually deallocates the data pointer.
Definition: MooseArray.h:56
VariableSecond _second_u_previous_nl
VariableValue _du_dot_du_bak
VariableGradient _grad_u_previous_nl_neighbor
VariableValue _nodal_u_old_neighbor
VariableSecond _second_u_older_neighbor
VariableValue _nodal_u_older
VariableSecond _second_u_bak
VariableValue _u_dot
u_dot (time derivative)
VariableSecond _second_u_neighbor
VariableValue _du_dot_du_neighbor
VariableGradient _grad_u_older_neighbor
VariableValue _u_old_bak
VariableValue _u_older
VariableValue _nodal_u_dot_neighbor

Member Function Documentation

bool MooseVariable::activeOnSubdomain ( SubdomainID  subdomain) const

Is the variable active on the subdomain?

Parameters
subdomainThe subdomain id in question
Returns
true if active on subdomain, false otherwise

Definition at line 191 of file MooseVariable.C.

Referenced by ComputeFullJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeInternalFaceJacobian(), ComputeFullJacobianThread::computeJacobian(), FlagElementsThread::onElement(), and ComputeDiracThread::onElement().

192 {
193  return _sys.system().variable(_var_num).active_on_subdomain(subdomain);
194 }
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)
const std::set< SubdomainID > & MooseVariable::activeSubdomains ( ) const

Definition at line 185 of file MooseVariable.C.

Referenced by SetupResidualDebugAction::act(), BlockRestrictable::checkVariable(), BlockRestrictable::initializeBlockRestrictable(), and ConstraintWarehouse::subdomainsCovered().

186 {
187  return _sys.system().variable(_var_num).active_subdomains();
188 }
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)
void MooseVariable::add ( NumericVector< Number > &  residual)

Definition at line 388 of file MooseVariable.C.

Referenced by ComputeIndicatorThread::onElement().

389 {
390  if (_has_nodal_value)
391  residual.add_vector(&_nodal_u[0], _dof_indices);
392 
394  residual.add_vector(&_nodal_u_neighbor[0], _dof_indices_neighbor);
395 }
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
VariableValue _nodal_u_neighbor
bool _has_nodal_value_neighbor
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
const std::vector< dof_id_type > & MooseVariableBase::allDofIndices ( ) const
inherited

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
void MooseVariable::clearDofIndices ( )

Clear out the dof indices.

We do this in case this variable is not going to be prepared at all...

Definition at line 203 of file MooseVariable.C.

204 {
205  _dof_indices.clear();
206 }
std::vector< dof_id_type > _dof_indices
DOF indices.
void MooseVariable::computeElemValues ( )
virtual

Compute values at interior quadrature points.

Reimplemented in MooseVariableConstMonomial.

Definition at line 856 of file MooseVariable.C.

Referenced by AuxiliarySystem::reinitElem().

857 {
858 
859  bool is_transient = _subproblem.isTransient();
860  unsigned int nqp = _qrule->n_points();
861 
862  _u.resize(nqp);
863  _grad_u.resize(nqp);
864 
865  if (_need_second)
866  _second_u.resize(nqp);
867 
869  _u_previous_nl.resize(nqp);
870 
873 
876 
877  if (is_transient)
878  {
879  _u_dot.resize(nqp);
880  _du_dot_du.resize(nqp);
881 
882  if (_need_u_old)
883  _u_old.resize(nqp);
884 
885  if (_need_u_older)
886  _u_older.resize(nqp);
887 
888  if (_need_grad_old)
889  _grad_u_old.resize(nqp);
890 
891  if (_need_grad_older)
892  _grad_u_older.resize(nqp);
893 
894  if (_need_second_old)
895  _second_u_old.resize(nqp);
896 
897  if (_need_second_older)
898  _second_u_older.resize(nqp);
899  }
900 
901  for (unsigned int i = 0; i < nqp; ++i)
902  {
903  _u[i] = 0;
904  _grad_u[i] = 0;
905 
906  if (_need_second)
907  _second_u[i] = 0;
908 
910  _u_previous_nl[i] = 0;
911 
913  _grad_u_previous_nl[i] = 0;
914 
916  _second_u_previous_nl[i] = 0;
917 
918  if (is_transient)
919  {
920  _u_dot[i] = 0;
921  _du_dot_du[i] = 0;
922 
923  if (_need_u_old)
924  _u_old[i] = 0;
925 
926  if (_need_u_older)
927  _u_older[i] = 0;
928 
929  if (_need_grad_old)
930  _grad_u_old[i] = 0;
931 
932  if (_need_grad_older)
933  _grad_u_older[i] = 0;
934 
935  if (_need_second_old)
936  _second_u_old[i] = 0;
937 
938  if (_need_second_older)
939  _second_u_older[i] = 0;
940  }
941  }
942 
943  unsigned int num_dofs = _dof_indices.size();
944 
945  if (_need_nodal_u)
946  _nodal_u.resize(num_dofs);
947 
949  _nodal_u_previous_nl.resize(num_dofs);
950 
951  if (is_transient)
952  {
953  if (_need_nodal_u_old)
954  _nodal_u_old.resize(num_dofs);
956  _nodal_u_older.resize(num_dofs);
957  if (_need_nodal_u_dot)
958  _nodal_u_dot.resize(num_dofs);
959  }
960 
962  _solution_dofs.resize(num_dofs);
963 
965  _solution_dofs_old.resize(num_dofs);
966 
968  _solution_dofs_older.resize(num_dofs);
969 
970  const NumericVector<Real> & current_solution = *_sys.currentSolution();
971  const NumericVector<Real> & solution_old = _sys.solutionOld();
972  const NumericVector<Real> & solution_older = _sys.solutionOlder();
973  const NumericVector<Real> * solution_prev_nl = _sys.solutionPreviousNewton();
974  const NumericVector<Real> & u_dot = _sys.solutionUDot();
975  const Real & du_dot_du = _sys.duDotDu();
976 
977  dof_id_type idx = 0;
978  Real soln_local = 0;
979  Real soln_old_local = 0;
980  Real soln_older_local = 0;
981  Real soln_previous_nl_local = 0;
982  Real u_dot_local = 0;
983 
984  Real phi_local = 0;
985  const RealGradient * dphi_qp = NULL;
986  const RealTensor * d2phi_local = NULL;
987 
988  RealGradient * grad_u_qp = NULL;
989 
990  RealGradient * grad_u_old_qp = NULL;
991  RealGradient * grad_u_older_qp = NULL;
992  RealGradient * grad_u_previous_nl_qp = NULL;
993 
994  RealTensor * second_u_qp = NULL;
995 
996  RealTensor * second_u_old_qp = NULL;
997  RealTensor * second_u_older_qp = NULL;
998  RealTensor * second_u_previous_nl_qp = NULL;
999 
1000  for (unsigned int i = 0; i < num_dofs; i++)
1001  {
1002  idx = _dof_indices[i];
1003  soln_local = current_solution(idx);
1004 
1005  if (_need_nodal_u)
1006  _nodal_u[i] = soln_local;
1007 
1010  soln_previous_nl_local = (*solution_prev_nl)(idx);
1011 
1013  _nodal_u_previous_nl[i] = soln_previous_nl_local;
1014 
1015  if (_need_solution_dofs)
1016  _solution_dofs(i) = soln_local;
1017 
1018  if (is_transient)
1019  {
1021  soln_old_local = solution_old(idx);
1022 
1024  soln_older_local = solution_older(idx);
1025 
1026  if (_need_nodal_u_old)
1027  _nodal_u_old[i] = soln_old_local;
1028  if (_need_nodal_u_older)
1029  _nodal_u_older[i] = soln_older_local;
1030 
1031  u_dot_local = u_dot(idx);
1032  if (_need_nodal_u_dot)
1033  _nodal_u_dot[i] = u_dot_local;
1034 
1036  _solution_dofs_old(i) = solution_old(idx);
1037 
1039  _solution_dofs_older(i) = solution_older(idx);
1040  }
1041 
1042  for (unsigned int qp = 0; qp < nqp; qp++)
1043  {
1044  phi_local = _phi[i][qp];
1045  dphi_qp = &_grad_phi[i][qp];
1046 
1047  grad_u_qp = &_grad_u[qp];
1048 
1050  grad_u_previous_nl_qp = &_grad_u_previous_nl[qp];
1051 
1052  if (is_transient)
1053  {
1054  if (_need_grad_old)
1055  grad_u_old_qp = &_grad_u_old[qp];
1056 
1057  if (_need_grad_older)
1058  grad_u_older_qp = &_grad_u_older[qp];
1059  }
1060 
1062  {
1063  d2phi_local = &(*_second_phi)[i][qp];
1064 
1065  if (_need_second)
1066  {
1067  second_u_qp = &_second_u[qp];
1068  second_u_qp->add_scaled(*d2phi_local, soln_local);
1069  }
1070 
1072  {
1073  second_u_previous_nl_qp = &_second_u_previous_nl[qp];
1074  second_u_previous_nl_qp->add_scaled(*d2phi_local, soln_previous_nl_local);
1075  }
1076 
1077  if (is_transient)
1078  {
1079  if (_need_second_old)
1080  second_u_old_qp = &_second_u_old[qp];
1081 
1082  if (_need_second_older)
1083  second_u_older_qp = &_second_u_older[qp];
1084  }
1085  }
1086 
1087  _u[qp] += phi_local * soln_local;
1088 
1089  grad_u_qp->add_scaled(*dphi_qp, soln_local);
1090 
1091  if (_need_u_previous_nl)
1092  _u_previous_nl[qp] += phi_local * soln_previous_nl_local;
1094  grad_u_previous_nl_qp->add_scaled(*dphi_qp, soln_previous_nl_local);
1095 
1096  if (is_transient)
1097  {
1098  _u_dot[qp] += phi_local * u_dot_local;
1099  _du_dot_du[qp] = du_dot_du;
1100 
1101  if (_need_u_old)
1102  _u_old[qp] += phi_local * soln_old_local;
1103 
1104  if (_need_u_older)
1105  _u_older[qp] += phi_local * soln_older_local;
1106 
1107  if (_need_grad_old)
1108  grad_u_old_qp->add_scaled(*dphi_qp, soln_old_local);
1109 
1110  if (_need_grad_older)
1111  grad_u_older_qp->add_scaled(*dphi_qp, soln_older_local);
1112 
1113  if (_need_second_old)
1114  second_u_old_qp->add_scaled(*d2phi_local, soln_old_local);
1115 
1116  if (_need_second_older)
1117  second_u_older_qp->add_scaled(*d2phi_local, soln_older_local);
1118  }
1119  }
1120  }
1121 }
const VariablePhiGradient & _grad_phi
RealVectorValue RealGradient
Definition: Assembly.h:43
bool _need_second_older
bool _need_nodal_u_older
VariableValue _nodal_u_old
DenseVector< Number > _solution_dofs_older
bool _need_nodal_u_previous_nl
VariableSecond _second_u_older
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
VariableSecond _second_u_old
virtual NumericVector< Number > & solutionOld()=0
bool _need_grad_previous_nl
virtual bool isTransient() const =0
bool _need_solution_dofs_old
RealTensorValue RealTensor
Definition: Assembly.h:46
VariableValue _du_dot_du
derivative of u_dot wrt u
VariableGradient _grad_u_older
bool _need_second_previous_nl
VariableGradient _grad_u_old
virtual NumericVector< Number > * solutionPreviousNewton()=0
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
VariableSecond _second_u
virtual Number & duDotDu()
Definition: SystemBase.h:156
VariableValue _u
QBase *& _qrule
Quadrature rule for interior.
VariableGradient _grad_u
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
SystemBase & _sys
System this variable is part of.
bool _need_nodal_u_old
VariableValue _nodal_u_previous_nl
VariableGradient _grad_u_previous_nl
VariableValue _u_previous_nl
VariableValue _u_old
DenseVector< Number > _solution_dofs_old
const VariablePhiValue & _phi
bool _need_nodal_u_dot
bool _need_solution_dofs_older
VariableValue _nodal_u_dot
nodal values of u_dot
VariableSecond _second_u_previous_nl
virtual NumericVector< Number > & solutionOlder()=0
bool _need_solution_dofs
VariableValue _nodal_u_older
DenseVector< Number > _solution_dofs
local elemental DoFs
VariableValue _u_dot
u_dot (time derivative)
bool _need_u_previous_nl
VariableValue _u_older
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void MooseVariable::computeElemValuesFace ( )
virtual

Compute values at facial quadrature points.

Reimplemented in MooseVariableConstMonomial.

Definition at line 1124 of file MooseVariable.C.

Referenced by AuxiliarySystem::reinitElemFace().

1125 {
1126  bool is_transient = _subproblem.isTransient();
1127  unsigned int nqp = _qrule_face->n_points();
1128  _u.resize(nqp);
1129  _grad_u.resize(nqp);
1130 
1131  if (_need_second)
1132  _second_u.resize(nqp);
1133 
1134  if (_need_u_previous_nl)
1135  _u_previous_nl.resize(nqp);
1136 
1139 
1142 
1143  if (is_transient)
1144  {
1145  _u_dot.resize(nqp);
1146  _du_dot_du.resize(nqp);
1147 
1148  if (_need_u_old)
1149  _u_old.resize(nqp);
1150 
1151  if (_need_u_older)
1152  _u_older.resize(nqp);
1153 
1154  if (_need_grad_old)
1155  _grad_u_old.resize(nqp);
1156 
1157  if (_need_grad_older)
1158  _grad_u_older.resize(nqp);
1159 
1160  if (_need_second_old)
1161  _second_u_old.resize(nqp);
1162 
1163  if (_need_second_older)
1164  _second_u_older.resize(nqp);
1165  }
1166 
1167  for (unsigned int i = 0; i < nqp; ++i)
1168  {
1169  _u[i] = 0;
1170  _grad_u[i] = 0;
1171 
1172  if (_need_second)
1173  _second_u[i] = 0;
1174 
1175  if (_need_u_previous_nl)
1176  _u_previous_nl[i] = 0;
1177 
1179  _grad_u_previous_nl[i] = 0;
1180 
1182  _second_u_previous_nl[i] = 0;
1183 
1184  if (_subproblem.isTransient())
1185  {
1186  _u_dot[i] = 0;
1187  _du_dot_du[i] = 0;
1188 
1189  if (_need_u_old)
1190  _u_old[i] = 0;
1191 
1192  if (_need_u_older)
1193  _u_older[i] = 0;
1194 
1195  if (_need_grad_old)
1196  _grad_u_old[i] = 0;
1197 
1198  if (_need_grad_older)
1199  _grad_u_older[i] = 0;
1200 
1201  if (_need_second_old)
1202  _second_u_old[i] = 0;
1203 
1204  if (_need_second_older)
1205  _second_u_older[i] = 0;
1206  }
1207  }
1208 
1209  unsigned int num_dofs = _dof_indices.size();
1210 
1211  if (_need_nodal_u)
1212  _nodal_u.resize(num_dofs);
1214  _nodal_u_previous_nl.resize(num_dofs);
1215  if (is_transient)
1216  {
1217  if (_need_nodal_u_old)
1218  _nodal_u_old.resize(num_dofs);
1219  if (_need_nodal_u_older)
1220  _nodal_u_older.resize(num_dofs);
1221  if (_need_nodal_u_dot)
1222  _nodal_u_dot.resize(num_dofs);
1223  }
1224 
1225  if (_need_solution_dofs)
1226  _solution_dofs.resize(num_dofs);
1227 
1229  _solution_dofs_old.resize(num_dofs);
1230 
1232  _solution_dofs_older.resize(num_dofs);
1233 
1234  const NumericVector<Real> & current_solution = *_sys.currentSolution();
1235  const NumericVector<Real> & solution_old = _sys.solutionOld();
1236  const NumericVector<Real> & solution_older = _sys.solutionOlder();
1237  const NumericVector<Real> * solution_prev_nl = _sys.solutionPreviousNewton();
1238  const NumericVector<Real> & u_dot = _sys.solutionUDot();
1239  const Real & du_dot_du = _sys.duDotDu();
1240 
1241  dof_id_type idx;
1242  Real soln_local;
1243  Real soln_old_local = 0;
1244  Real soln_older_local = 0;
1245  Real soln_previous_nl_local = 0;
1246  Real u_dot_local = 0;
1247 
1248  Real phi_local;
1249  RealGradient dphi_local;
1250  RealTensor d2phi_local;
1251 
1252  for (unsigned int i = 0; i < num_dofs; ++i)
1253  {
1254  idx = _dof_indices[i];
1255  soln_local = current_solution(idx);
1256 
1257  if (_need_nodal_u)
1258  _nodal_u[i] = soln_local;
1259 
1262  soln_previous_nl_local = (*solution_prev_nl)(idx);
1264  _nodal_u_previous_nl[i] = soln_previous_nl_local;
1265 
1266  if (_need_solution_dofs)
1267  _solution_dofs(i) = soln_local;
1268 
1269  if (is_transient)
1270  {
1272  soln_old_local = solution_old(idx);
1273 
1275  soln_older_local = solution_older(idx);
1276 
1277  if (_need_nodal_u_old)
1278  _nodal_u_old[i] = soln_old_local;
1279  if (_need_nodal_u_older)
1280  _nodal_u_older[i] = soln_older_local;
1281 
1282  u_dot_local = u_dot(idx);
1283  if (_need_nodal_u_dot)
1284  _nodal_u_dot[i] = u_dot_local;
1285 
1287  _solution_dofs_old(i) = solution_old(idx);
1288 
1290  _solution_dofs_older(i) = solution_older(idx);
1291  }
1292 
1293  for (unsigned int qp = 0; qp < nqp; ++qp)
1294  {
1295  phi_local = _phi_face[i][qp];
1296  dphi_local = _grad_phi_face[i][qp];
1297 
1299  d2phi_local = (*_second_phi_face)[i][qp];
1300 
1301  _u[qp] += phi_local * soln_local;
1302  _grad_u[qp] += dphi_local * soln_local;
1303 
1304  if (_need_second)
1305  _second_u[qp] += d2phi_local * soln_local;
1306 
1307  if (_need_u_previous_nl)
1308  _u_previous_nl[qp] += phi_local * soln_previous_nl_local;
1309 
1311  _grad_u_previous_nl[qp] += dphi_local * soln_previous_nl_local;
1312 
1314  _second_u_previous_nl[qp] += d2phi_local * soln_previous_nl_local;
1315 
1316  if (is_transient)
1317  {
1318  _u_dot[qp] += phi_local * u_dot_local;
1319  _du_dot_du[qp] = du_dot_du;
1320 
1321  if (_need_u_old)
1322  _u_old[qp] += phi_local * soln_old_local;
1323 
1324  if (_need_u_older)
1325  _u_older[qp] += phi_local * soln_older_local;
1326 
1327  if (_need_grad_old)
1328  _grad_u_old[qp] += dphi_local * soln_old_local;
1329 
1330  if (_need_grad_older)
1331  _grad_u_older[qp] += dphi_local * soln_older_local;
1332 
1333  if (_need_second_old)
1334  _second_u_old[qp] += d2phi_local * soln_old_local;
1335 
1336  if (_need_second_older)
1337  _second_u_older[qp] += d2phi_local * soln_older_local;
1338  }
1339  }
1340  }
1341 }
RealVectorValue RealGradient
Definition: Assembly.h:43
bool _need_second_older
bool _need_nodal_u_older
VariableValue _nodal_u_old
DenseVector< Number > _solution_dofs_older
bool _need_nodal_u_previous_nl
VariableSecond _second_u_older
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
VariableSecond _second_u_old
virtual NumericVector< Number > & solutionOld()=0
bool _need_grad_previous_nl
QBase *& _qrule_face
Quadrature rule for the face.
virtual bool isTransient() const =0
bool _need_solution_dofs_old
RealTensorValue RealTensor
Definition: Assembly.h:46
const VariablePhiGradient & _grad_phi_face
VariableValue _du_dot_du
derivative of u_dot wrt u
VariableGradient _grad_u_older
bool _need_second_previous_nl
VariableGradient _grad_u_old
virtual NumericVector< Number > * solutionPreviousNewton()=0
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
VariableSecond _second_u
virtual Number & duDotDu()
Definition: SystemBase.h:156
VariableValue _u
VariableGradient _grad_u
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
SystemBase & _sys
System this variable is part of.
bool _need_nodal_u_old
VariableValue _nodal_u_previous_nl
VariableGradient _grad_u_previous_nl
VariableValue _u_previous_nl
VariableValue _u_old
const VariablePhiValue & _phi_face
DenseVector< Number > _solution_dofs_old
bool _need_nodal_u_dot
bool _need_solution_dofs_older
VariableValue _nodal_u_dot
nodal values of u_dot
VariableSecond _second_u_previous_nl
virtual NumericVector< Number > & solutionOlder()=0
bool _need_solution_dofs
VariableValue _nodal_u_older
DenseVector< Number > _solution_dofs
local elemental DoFs
VariableValue _u_dot
u_dot (time derivative)
bool _need_u_previous_nl
VariableValue _u_older
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void MooseVariable::computeIncrementAtNode ( const NumericVector< Number > &  increment_vec)

Compute and store incremental change at the current node based on increment_vec.

Definition at line 1864 of file MooseVariable.C.

1865 {
1866  if (!isNodal())
1867  mooseError("computeIncrementAtNode can only be called for nodal variables");
1868 
1869  _increment.resize(1);
1870 
1871  // Compute the increment for the current DOF
1872  _increment[0] = increment_vec(_dof_indices[0]);
1873 }
VariableValue _increment
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::vector< dof_id_type > _dof_indices
DOF indices.
virtual bool isNodal() const override
Is this variable nodal.
void MooseVariable::computeIncrementAtQps ( const NumericVector< Number > &  increment_vec)

Compute and store incremental change in solution at QPs based on increment_vec.

Definition at line 1848 of file MooseVariable.C.

1849 {
1850  unsigned int nqp = _qrule->n_points();
1851 
1852  _increment.resize(nqp);
1853  // Compute the increment at each quadrature point
1854  unsigned int num_dofs = _dof_indices.size();
1855  for (unsigned int qp = 0; qp < nqp; qp++)
1856  {
1857  _increment[qp] = 0;
1858  for (unsigned int i = 0; i < num_dofs; i++)
1859  _increment[qp] += _phi[i][qp] * increment_vec(_dof_indices[i]);
1860  }
1861 }
VariableValue _increment
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
std::vector< dof_id_type > _dof_indices
DOF indices.
QBase *& _qrule
Quadrature rule for interior.
const VariablePhiValue & _phi
void MooseVariable::computeNeighborValues ( )
virtual

Compute values at quadrature points for the neighbor.

Reimplemented in MooseVariableConstMonomial.

Definition at line 1528 of file MooseVariable.C.

1529 {
1530  bool is_transient = _subproblem.isTransient();
1531  unsigned int nqp = _qrule_neighbor->n_points();
1532 
1533  _u_neighbor.resize(nqp);
1534  _grad_u_neighbor.resize(nqp);
1535 
1538 
1539  if (is_transient)
1540  {
1542  _u_old_neighbor.resize(nqp);
1543 
1546 
1549 
1552 
1555 
1558  }
1559 
1560  for (unsigned int i = 0; i < nqp; ++i)
1561  {
1562  _u_neighbor[i] = 0;
1563  _grad_u_neighbor[i] = 0;
1564 
1566  _second_u_neighbor[i] = 0;
1567 
1568  if (_subproblem.isTransient())
1569  {
1571  _u_old_neighbor[i] = 0;
1572 
1574  _u_older_neighbor[i] = 0;
1575 
1577  _grad_u_old_neighbor[i] = 0;
1578 
1580  _grad_u_older_neighbor[i] = 0;
1581 
1583  _second_u_old_neighbor[i] = 0;
1584 
1586  _second_u_older_neighbor[i] = 0;
1587  }
1588  }
1589 
1590  unsigned int num_dofs = _dof_indices_neighbor.size();
1591 
1593  _nodal_u_neighbor.resize(num_dofs);
1594  if (is_transient)
1595  {
1597  _nodal_u_old_neighbor.resize(num_dofs);
1599  _nodal_u_older_neighbor.resize(num_dofs);
1601  _nodal_u_dot_neighbor.resize(num_dofs);
1602  }
1603 
1605  _solution_dofs_neighbor.resize(num_dofs);
1606 
1608  _solution_dofs_old_neighbor.resize(num_dofs);
1609 
1611  _solution_dofs_older_neighbor.resize(num_dofs);
1612 
1613  const NumericVector<Real> & current_solution = *_sys.currentSolution();
1614  const NumericVector<Real> & solution_old = _sys.solutionOld();
1615  const NumericVector<Real> & solution_older = _sys.solutionOlder();
1616  const NumericVector<Real> & u_dot = _sys.solutionUDot();
1617 
1618  dof_id_type idx;
1619  Real soln_local;
1620  Real soln_old_local = 0;
1621  Real soln_older_local = 0;
1622  Real u_dot_local = 0;
1623 
1624  Real phi_local;
1625  RealGradient dphi_local;
1626  RealTensor d2phi_local;
1627 
1628  for (unsigned int i = 0; i < num_dofs; ++i)
1629  {
1630  idx = _dof_indices_neighbor[i];
1631  soln_local = current_solution(idx);
1632 
1634  _nodal_u_neighbor[i] = soln_local;
1635 
1637  _solution_dofs_neighbor(i) = soln_local;
1638 
1639  if (is_transient)
1640  {
1642  soln_old_local = solution_old(idx);
1643 
1645  soln_older_local = solution_older(idx);
1646 
1648  _nodal_u_old_neighbor[i] = soln_old_local;
1650  _nodal_u_older_neighbor[i] = soln_older_local;
1651 
1652  u_dot_local = u_dot(idx);
1654  _nodal_u_dot_neighbor[i] = u_dot_local;
1655 
1657  _solution_dofs_old_neighbor(i) = solution_old(idx);
1658 
1660  _solution_dofs_older_neighbor(i) = solution_older(idx);
1661  }
1662 
1663  for (unsigned int qp = 0; qp < nqp; ++qp)
1664  {
1665  phi_local = _phi_neighbor[i][qp];
1666  dphi_local = _grad_phi_neighbor[i][qp];
1667 
1669  d2phi_local = (*_second_phi_neighbor)[i][qp];
1670 
1671  _u_neighbor[qp] += phi_local * soln_local;
1672  _grad_u_neighbor[qp] += dphi_local * soln_local;
1673 
1675  _second_u_neighbor[qp] += d2phi_local * soln_local;
1676 
1677  if (is_transient)
1678  {
1680  _u_old_neighbor[qp] += phi_local * soln_old_local;
1681 
1683  _u_older_neighbor[qp] += phi_local * soln_older_local;
1684 
1686  _grad_u_old_neighbor[qp] += dphi_local * soln_old_local;
1687 
1689  _grad_u_older_neighbor[qp] += dphi_local * soln_older_local;
1690 
1692  _second_u_old_neighbor[qp] += d2phi_local * soln_old_local;
1693 
1695  _second_u_older_neighbor[qp] += d2phi_local * soln_older_local;
1696  }
1697  }
1698  }
1699 }
bool _need_grad_older_neighbor
RealVectorValue RealGradient
Definition: Assembly.h:43
bool _need_second_old_neighbor
bool _need_u_old_neighbor
bool _need_solution_dofs_older_neighbor
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
virtual NumericVector< Number > & solutionOld()=0
VariableGradient _grad_u_neighbor
VariableGradient _grad_u_old_neighbor
DenseVector< Number > _solution_dofs_neighbor
bool _need_grad_old_neighbor
virtual bool isTransient() const =0
const VariablePhiValue & _phi_neighbor
VariableValue _nodal_u_older_neighbor
RealTensorValue RealTensor
Definition: Assembly.h:46
VariableValue _u_old_neighbor
VariableValue _u_older_neighbor
bool _need_nodal_u_older_neighbor
VariableValue _nodal_u_neighbor
VariableSecond _second_u_old_neighbor
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
const VariablePhiGradient & _grad_phi_neighbor
SystemBase & _sys
System this variable is part of.
bool _need_nodal_u_old_neighbor
QBase *& _qrule_neighbor
Quadrature rule for the neighbor.
VariableValue _u_neighbor
bool _need_solution_dofs_neighbor
DenseVector< Number > _solution_dofs_old_neighbor
bool _need_nodal_u_dot_neighbor
bool _need_second_neighbor
DenseVector< Number > _solution_dofs_older_neighbor
VariableValue _nodal_u_old_neighbor
VariableSecond _second_u_older_neighbor
virtual NumericVector< Number > & solutionOlder()=0
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
bool _need_solution_dofs_old_neighbor
bool _need_second_older_neighbor
bool _need_u_older_neighbor
VariableSecond _second_u_neighbor
VariableGradient _grad_u_older_neighbor
VariableValue _nodal_u_dot_neighbor
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
bool _need_nodal_u_neighbor
void MooseVariable::computeNeighborValuesFace ( )
virtual

Compute values at facial quadrature points for the neighbor.

Reimplemented in MooseVariableConstMonomial.

Definition at line 1344 of file MooseVariable.C.

1345 {
1346  bool is_transient = _subproblem.isTransient();
1347  unsigned int nqp = _qrule_neighbor->n_points();
1348 
1349  _u_neighbor.resize(nqp);
1350  _grad_u_neighbor.resize(nqp);
1351 
1354 
1355  if (is_transient)
1356  {
1357  _u_dot_neighbor.resize(nqp);
1359 
1361  _u_old_neighbor.resize(nqp);
1362 
1365 
1368 
1371 
1374 
1377  }
1378 
1379  for (unsigned int i = 0; i < nqp; ++i)
1380  {
1381  _u_neighbor[i] = 0;
1382  _grad_u_neighbor[i] = 0;
1383 
1385  _second_u_neighbor[i] = 0;
1386 
1387  if (_subproblem.isTransient())
1388  {
1389  _u_dot_neighbor[i] = 0;
1390  _du_dot_du_neighbor[i] = 0;
1391 
1393  _u_old_neighbor[i] = 0;
1394 
1396  _u_older_neighbor[i] = 0;
1397 
1399  _grad_u_old_neighbor[i] = 0;
1400 
1402  _grad_u_older_neighbor[i] = 0;
1403 
1405  _second_u_old_neighbor[i] = 0;
1406 
1408  _second_u_older_neighbor[i] = 0;
1409  }
1410  }
1411 
1412  unsigned int num_dofs = _dof_indices_neighbor.size();
1413 
1415  _nodal_u_neighbor.resize(num_dofs);
1416  if (is_transient)
1417  {
1419  _nodal_u_old_neighbor.resize(num_dofs);
1421  _nodal_u_older_neighbor.resize(num_dofs);
1423  _nodal_u_dot_neighbor.resize(num_dofs);
1424  }
1425 
1427  _solution_dofs_neighbor.resize(num_dofs);
1428 
1430  _solution_dofs_old_neighbor.resize(num_dofs);
1431 
1433  _solution_dofs_older_neighbor.resize(num_dofs);
1434 
1435  const NumericVector<Real> & current_solution = *_sys.currentSolution();
1436  const NumericVector<Real> & solution_old = _sys.solutionOld();
1437  const NumericVector<Real> & solution_older = _sys.solutionOlder();
1438  const NumericVector<Real> & u_dot = _sys.solutionUDot();
1439  const Real & du_dot_du = _sys.duDotDu();
1440 
1441  dof_id_type idx;
1442  Real soln_local;
1443  Real soln_old_local = 0;
1444  Real soln_older_local = 0;
1445  Real u_dot_local = 0;
1446 
1447  Real phi_local;
1448  RealGradient dphi_local;
1449  RealTensor d2phi_local;
1450 
1451  for (unsigned int i = 0; i < num_dofs; ++i)
1452  {
1453  idx = _dof_indices_neighbor[i];
1454  soln_local = current_solution(idx);
1455 
1457  _nodal_u_neighbor[i] = soln_local;
1458 
1460  _solution_dofs_neighbor(i) = soln_local;
1461 
1462  if (is_transient)
1463  {
1465  soln_old_local = solution_old(idx);
1466 
1468  soln_older_local = solution_older(idx);
1469 
1471  _nodal_u_old_neighbor[i] = soln_old_local;
1473  _nodal_u_older_neighbor[i] = soln_older_local;
1474 
1475  u_dot_local = u_dot(idx);
1477  _nodal_u_dot_neighbor[i] = u_dot_local;
1478 
1480  _solution_dofs_old_neighbor(i) = solution_old(idx);
1481 
1483  _solution_dofs_older_neighbor(i) = solution_older(idx);
1484  }
1485 
1486  for (unsigned int qp = 0; qp < nqp; ++qp)
1487  {
1488  phi_local = _phi_face_neighbor[i][qp];
1489  dphi_local = _grad_phi_face_neighbor[i][qp];
1490 
1492  d2phi_local = (*_second_phi_face_neighbor)[i][qp];
1493 
1494  _u_neighbor[qp] += phi_local * soln_local;
1495  _grad_u_neighbor[qp] += dphi_local * soln_local;
1496 
1498  _second_u_neighbor[qp] += d2phi_local * soln_local;
1499 
1500  if (is_transient)
1501  {
1502  _u_dot_neighbor[qp] += phi_local * u_dot_local;
1503  _du_dot_du_neighbor[qp] = du_dot_du;
1504 
1506  _u_old_neighbor[qp] += phi_local * soln_old_local;
1507 
1509  _u_older_neighbor[qp] += phi_local * soln_older_local;
1510 
1512  _grad_u_old_neighbor[qp] += dphi_local * soln_old_local;
1513 
1515  _grad_u_older_neighbor[qp] += dphi_local * soln_older_local;
1516 
1518  _second_u_old_neighbor[qp] += d2phi_local * soln_old_local;
1519 
1521  _second_u_older_neighbor[qp] += d2phi_local * soln_older_local;
1522  }
1523  }
1524  }
1525 }
bool _need_grad_older_neighbor
RealVectorValue RealGradient
Definition: Assembly.h:43
bool _need_second_old_neighbor
bool _need_u_old_neighbor
bool _need_solution_dofs_older_neighbor
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
virtual NumericVector< Number > & solutionOld()=0
VariableGradient _grad_u_neighbor
VariableGradient _grad_u_old_neighbor
DenseVector< Number > _solution_dofs_neighbor
bool _need_grad_old_neighbor
virtual bool isTransient() const =0
VariableValue _nodal_u_older_neighbor
RealTensorValue RealTensor
Definition: Assembly.h:46
VariableValue _u_old_neighbor
VariableValue _u_older_neighbor
bool _need_nodal_u_older_neighbor
VariableValue _nodal_u_neighbor
virtual Number & duDotDu()
Definition: SystemBase.h:156
VariableSecond _second_u_old_neighbor
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
VariableValue _u_dot_neighbor
SystemBase & _sys
System this variable is part of.
bool _need_nodal_u_old_neighbor
const VariablePhiValue & _phi_face_neighbor
QBase *& _qrule_neighbor
Quadrature rule for the neighbor.
VariableValue _u_neighbor
bool _need_solution_dofs_neighbor
DenseVector< Number > _solution_dofs_old_neighbor
bool _need_nodal_u_dot_neighbor
bool _need_second_neighbor
DenseVector< Number > _solution_dofs_older_neighbor
VariableValue _nodal_u_old_neighbor
VariableSecond _second_u_older_neighbor
virtual NumericVector< Number > & solutionOlder()=0
const VariablePhiGradient & _grad_phi_face_neighbor
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
bool _need_solution_dofs_old_neighbor
bool _need_second_older_neighbor
bool _need_u_older_neighbor
VariableSecond _second_u_neighbor
VariableValue _du_dot_du_neighbor
VariableGradient _grad_u_older_neighbor
VariableValue _nodal_u_dot_neighbor
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
bool _need_nodal_u_neighbor
void MooseVariable::computeNodalNeighborValues ( )

Compute nodal values of this variable in the neighbor.

Definition at line 1749 of file MooseVariable.C.

1750 {
1752  {
1753  const unsigned int n = _dof_indices_neighbor.size();
1754  mooseAssert(n, "Defined but empty?");
1757 
1758  if (_subproblem.isTransient())
1759  {
1764 
1767  for (unsigned int i = 0; i < n; i++)
1768  {
1771  }
1772  }
1773  }
1774  else
1775  {
1777  if (_subproblem.isTransient())
1778  {
1783  }
1784  }
1785 }
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
virtual NumericVector< Number > & solutionOld()=0
bool _is_defined_neighbor
If the variable is defined at the neighbor node (used in compute nodal values)
virtual bool isTransient() const =0
VariableValue _nodal_u_older_neighbor
VariableValue _nodal_u_neighbor
virtual Number & duDotDu()
Definition: SystemBase.h:156
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
SystemBase & _sys
System this variable is part of.
VariableValue _nodal_du_dot_du_neighbor
PetscInt n
VariableValue _nodal_u_old_neighbor
virtual NumericVector< Number > & solutionOlder()=0
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
VariableValue _nodal_u_dot_neighbor
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void MooseVariable::computeNodalValues ( )

Compute nodal values of this variable.

Definition at line 1702 of file MooseVariable.C.

Referenced by ComputeBoundaryInitialConditionThread::onNode().

1703 {
1704  if (_is_defined)
1705  {
1706  const unsigned int n = _dof_indices.size();
1707  mooseAssert(n, "Defined but empty?");
1708  _nodal_u.resize(n);
1710 
1712  {
1715  }
1716 
1717  if (_subproblem.isTransient())
1718  {
1719  _nodal_u_old.resize(n);
1723 
1724  _nodal_u_dot.resize(n);
1726  for (unsigned int i = 0; i < n; i++)
1727  {
1729  _nodal_du_dot_du[i] = _sys.duDotDu();
1730  }
1731  }
1732  }
1733  else
1734  {
1735  _nodal_u.resize(0);
1738  if (_subproblem.isTransient())
1739  {
1740  _nodal_u_old.resize(0);
1742  _nodal_u_dot.resize(0);
1744  }
1745  }
1746 }
VariableValue _nodal_u_old
bool _need_nodal_u_previous_nl
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
virtual NumericVector< Number > & solutionOld()=0
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionPreviousNewton()=0
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
virtual Number & duDotDu()
Definition: SystemBase.h:156
VariableValue _nodal_du_dot_du
nodal values of derivative of u_dot wrt u
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
SystemBase & _sys
System this variable is part of.
VariableValue _nodal_u_previous_nl
VariableValue _nodal_u_dot
nodal values of u_dot
PetscInt n
virtual NumericVector< Number > & solutionOlder()=0
VariableValue _nodal_u_older
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void MooseVariable::computePerturbedElemValues ( unsigned  i,
Real  scale,
Real &  h 
)

Compute values at interior quadrature points when this variable's elem dof i is perturbed by h in the current solution.

Perturbation h is computed based on the current variable value at i, its size controlled by scale.

Definition at line 616 of file MooseVariable.C.

Referenced by FDKernel::perturbedResidual().

619 {
620 
621  bool is_transient = _subproblem.isTransient();
622  unsigned int nqp = _qrule->n_points();
623 
624  _u_bak = _u;
626  _u.resize(nqp);
627  _grad_u.resize(nqp);
628 
629  if (_need_second)
631  _second_u.resize(nqp);
632 
633  if (is_transient)
634  {
635  _u_dot_bak = _u_dot;
636  _u_dot.resize(nqp);
638  _du_dot_du.resize(nqp);
639 
640  if (_need_u_old)
641  _u_old_bak = _u_old;
642  _u_old.resize(nqp);
643 
644  if (_need_u_older)
646  _u_older.resize(nqp);
647 
648  if (_need_grad_old)
650  _grad_u_old.resize(nqp);
651 
652  if (_need_grad_older)
654  _grad_u_older.resize(nqp);
655 
656  if (_need_second_old)
658  _second_u_old.resize(nqp);
659 
660  if (_need_second_older)
662  _second_u_older.resize(nqp);
663  }
664 
665  for (unsigned int i = 0; i < nqp; ++i)
666  {
667  _u[i] = 0;
668  _grad_u[i] = 0;
669 
670  if (_need_second)
671  _second_u[i] = 0;
672 
673  if (is_transient)
674  {
675  _u_dot[i] = 0;
676  _du_dot_du[i] = 0;
677 
678  if (_need_u_old)
679  _u_old[i] = 0;
680 
681  if (_need_u_older)
682  _u_older[i] = 0;
683 
684  if (_need_grad_old)
685  _grad_u_old[i] = 0;
686 
687  if (_need_grad_older)
688  _grad_u_older[i] = 0;
689 
690  if (_need_second_old)
691  _second_u_old[i] = 0;
692 
693  if (_need_second_older)
694  _second_u_older[i] = 0;
695  }
696  }
697 
698  unsigned int num_dofs = _dof_indices.size();
699 
700  const NumericVector<Real> & current_solution = *_sys.currentSolution();
701  const NumericVector<Real> & solution_old = _sys.solutionOld();
702  const NumericVector<Real> & solution_older = _sys.solutionOlder();
703  const NumericVector<Real> & u_dot = _sys.solutionUDot();
704  const Real & du_dot_du = _sys.duDotDu();
705 
706  dof_id_type idx = 0;
707  Real soln_local = 0;
708  Real soln_old_local = 0;
709  Real soln_older_local = 0;
710  Real u_dot_local = 0;
711 
712  Real phi_local = 0;
713  const RealGradient * dphi_qp = NULL;
714  const RealTensor * d2phi_local = NULL;
715 
716  RealGradient * grad_u_qp = NULL;
717 
718  RealGradient * grad_u_old_qp = NULL;
719  RealGradient * grad_u_older_qp = NULL;
720 
721  RealTensor * second_u_qp = NULL;
722 
723  RealTensor * second_u_old_qp = NULL;
724  RealTensor * second_u_older_qp = NULL;
725 
726  for (unsigned int i = 0; i < num_dofs; i++)
727  {
728  idx = _dof_indices[i];
729  soln_local = current_solution(idx);
730  if (i == perturbation_idx)
731  {
732  // Compute the size of the perturbation.
733  // For the PETSc DS differencing method we use the magnitude of the variable at the "node"
734  // to determine the differencing parameters. The WP method could use the element L2 norm of
735  // the variable instead.
736  perturbation = soln_local;
737  // HACK: the use of fabs() and < assume Real is double or similar. Otherwise need to use
738  // PetscAbsScalar, PetscRealPart, etc.
739  if (fabs(perturbation) < 1.0e-16)
740  perturbation = (perturbation < 0. ? -1.0 : 1.0) * 0.1;
741  perturbation *= perturbation_scale;
742  soln_local += perturbation;
743  }
744  if (is_transient)
745  {
747  soln_old_local = solution_old(idx);
748 
750  soln_older_local = solution_older(idx);
751 
752  u_dot_local = u_dot(idx);
753  }
754 
755  for (unsigned int qp = 0; qp < nqp; qp++)
756  {
757  phi_local = _phi[i][qp];
758  dphi_qp = &_grad_phi[i][qp];
759 
760  grad_u_qp = &_grad_u[qp];
761 
762  if (is_transient)
763  {
764  if (_need_grad_old)
765  grad_u_old_qp = &_grad_u_old[qp];
766 
767  if (_need_grad_older)
768  grad_u_older_qp = &_grad_u_older[qp];
769  }
770 
772  {
773  d2phi_local = &(*_second_phi)[i][qp];
774 
775  if (_need_second)
776  {
777  second_u_qp = &_second_u[qp];
778  second_u_qp->add_scaled(*d2phi_local, soln_local);
779  }
780 
781  if (is_transient)
782  {
783  if (_need_second_old)
784  second_u_old_qp = &_second_u_old[qp];
785 
786  if (_need_second_older)
787  second_u_older_qp = &_second_u_older[qp];
788  }
789  }
790 
791  _u[qp] += phi_local * soln_local;
792 
793  grad_u_qp->add_scaled(*dphi_qp, soln_local);
794 
795  if (is_transient)
796  {
797  _u_dot[qp] += phi_local * u_dot_local;
798  _du_dot_du[qp] = du_dot_du;
799 
800  if (_need_u_old)
801  _u_old[qp] += phi_local * soln_old_local;
802 
803  if (_need_u_older)
804  _u_older[qp] += phi_local * soln_older_local;
805 
806  if (_need_grad_old)
807  grad_u_old_qp->add_scaled(*dphi_qp, soln_old_local);
808 
809  if (_need_grad_older)
810  grad_u_older_qp->add_scaled(*dphi_qp, soln_older_local);
811 
812  if (_need_second_old)
813  second_u_old_qp->add_scaled(*d2phi_local, soln_old_local);
814 
815  if (_need_second_older)
816  second_u_older_qp->add_scaled(*d2phi_local, soln_older_local);
817  }
818  }
819  }
820 }
const VariablePhiGradient & _grad_phi
RealVectorValue RealGradient
Definition: Assembly.h:43
bool _need_second_older
VariableValue _u_older_bak
VariableGradient _grad_u_old_bak
VariableSecond _second_u_older
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
VariableSecond _second_u_old
virtual NumericVector< Number > & solutionOld()=0
virtual bool isTransient() const =0
RealTensorValue RealTensor
Definition: Assembly.h:46
VariableValue _du_dot_du
derivative of u_dot wrt u
VariableGradient _grad_u_older
VariableGradient _grad_u_old
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableSecond _second_u
virtual Number & duDotDu()
Definition: SystemBase.h:156
VariableValue _u
QBase *& _qrule
Quadrature rule for interior.
VariableGradient _grad_u
SubProblem & _subproblem
Problem this variable is part of.
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
SystemBase & _sys
System this variable is part of.
VariableValue _u_old
VariableSecond _second_u_old_bak
VariableValue _u_bak
const VariablePhiValue & _phi
VariableValue _u_dot_bak
VariableSecond _second_u_older_bak
VariableGradient _grad_u_bak
VariableValue _du_dot_du_bak
virtual NumericVector< Number > & solutionOlder()=0
VariableSecond _second_u_bak
VariableValue _u_dot
u_dot (time derivative)
VariableGradient _grad_u_older_bak
VariableValue _u_old_bak
VariableValue _u_older
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
bool MooseVariable::computingSecond ( )
inline

Whether or not this variable is computing any second derivatives.

Definition at line 106 of file MooseVariable.h.

Referenced by Assembly::copyFaceShapes(), and Assembly::copyShapes().

107  {
109  }
bool _need_second_older
bool _need_second_previous_nl
const Elem*& MooseVariable::currentElem ( )
inline

Current element this variable is evaluated at.

Definition at line 91 of file MooseVariable.h.

91 { return _elem; }
const Elem *& _elem
current element
unsigned int& MooseVariable::currentSide ( )
inline

Current side this variable is being evaluated on.

Definition at line 96 of file MooseVariable.h.

96 { return _current_side; }
unsigned int & _current_side
the side of the current element (valid when doing face assembly)
std::vector<dof_id_type>& MooseVariableBase::dofIndices ( )
inlineinherited
const std::vector<dof_id_type>& MooseVariableBase::dofIndices ( ) const
inlineinherited

Definition at line 114 of file MooseVariableBase.h.

114 { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
DOF indices.
std::vector<dof_id_type>& MooseVariable::dofIndicesNeighbor ( )
inline

Get DOF indices for currently selected element.

Returns

Definition at line 397 of file MooseVariable.h.

Referenced by NodalConstraint::computeJacobian(), NodalConstraint::computeResidual(), and Assembly::prepareNeighbor().

397 { return _dof_indices_neighbor; }
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
const DofMap& MooseVariableBase::dofMap ( ) const
inlineinherited

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 VariableValue& MooseVariable::duDotDu ( )
inline

Definition at line 194 of file MooseVariable.h.

Referenced by Coupleable::coupledDotDu(), and MooseVariableInterface::dotDu().

194 { return _du_dot_du; }
VariableValue _du_dot_du
derivative of u_dot wrt u
const VariableValue& MooseVariable::duDotDuNeighbor ( )
inline

Definition at line 280 of file MooseVariable.h.

280 { return _du_dot_du_neighbor; }
VariableValue _du_dot_du_neighbor
const FEType& MooseVariableBase::feType ( ) const
inlineinherited
void MooseVariable::getDofIndices ( const Elem *  elem,
std::vector< dof_id_type > &  dof_indices 
)
protected

Get dof indices for the variable.

Parameters
elemElement whose DOFs we are requesting (input)
dof_indicesDOF indices for the given element (output)

Definition at line 372 of file MooseVariable.C.

Referenced by NodeFaceConstraint::getConnectedDofIndices().

373 {
374  _dof_map.dof_indices(elem, dof_indices, _var_num);
375 }
const DofMap & _dof_map
DOF map.
unsigned int _var_num
variable number (from libMesh)
Real MooseVariable::getElementalValue ( const Elem *  elem,
unsigned int  idx = 0 
) const

Retrieve the Elemental DOF.

Parameters
elemThe element we are computing on
Returns
The variable value

Definition at line 1980 of file MooseVariable.C.

1981 {
1982  std::vector<dof_id_type> dof_indices;
1983  _dof_map.dof_indices(elem, dof_indices, _var_num);
1984 
1985  return (*_sys.currentSolution())(dof_indices[idx]);
1986 }
const DofMap & _dof_map
DOF map.
SystemBase & _sys
System this variable is part of.
unsigned int _var_num
variable number (from libMesh)
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
RealGradient MooseVariable::getGradient ( const Elem *  elem,
const std::vector< std::vector< RealGradient >> &  phi 
) const

Definition at line 1955 of file MooseVariable.C.

Referenced by FaceFaceConstraint::reinit().

1957 {
1958  std::vector<dof_id_type> dof_indices;
1959  _dof_map.dof_indices(elem, dof_indices, _var_num);
1960 
1961  RealGradient value;
1962  if (isNodal())
1963  {
1964  for (unsigned int i = 0; i < dof_indices.size(); ++i)
1965  {
1966  // The zero index is because we only have one point that the phis are evaluated at
1967  value += grad_phi[i][0] * (*_sys.currentSolution())(dof_indices[i]);
1968  }
1969  }
1970  else
1971  {
1972  mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
1973  value = 0.0;
1974  }
1975 
1976  return value;
1977 }
RealVectorValue RealGradient
Definition: Assembly.h:43
const DofMap & _dof_map
DOF map.
virtual bool isNodal() const override
Is this variable nodal.
SystemBase & _sys
System this variable is part of.
unsigned int _var_num
variable number (from libMesh)
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
Number MooseVariable::getNodalValue ( const Node &  node)

Get the value of this variable at given node.

Definition at line 1876 of file MooseVariable.C.

Referenced by NodalVariableValue::getValue().

1877 {
1878  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
1879 
1880  // Make sure that the node has DOFs
1881  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
1882  * produce a
1883  * better error (see misc/check_error.node_value_off_block) */
1884  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
1885  "Node " << node.id() << " does not contain any dofs for the "
1886  << _sys.system().variable_name(_var_num)
1887  << " variable");
1888 
1889  dof_id_type dof = node.dof_number(_sys.number(), _var_num, 0);
1890 
1891  return (*_sys.currentSolution())(dof);
1892 }
virtual MooseMesh & mesh()=0
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
const Node *& node()
virtual System & system()=0
Get the reference to the libMesh system.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
bool isSemiLocal(Node *node)
Returns true if the node is semi-local.
Definition: MooseMesh.C:556
unsigned int _var_num
variable number (from libMesh)
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
Number MooseVariable::getNodalValueOld ( const Node &  node)

Get the old value of this variable at given node.

Definition at line 1895 of file MooseVariable.C.

1896 {
1897  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
1898 
1899  // Make sure that the node has DOFs
1900  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
1901  * produce a
1902  * better error (see misc/check_error.node_value_off_block) */
1903  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
1904  "Node " << node.id() << " does not contain any dofs for the "
1905  << _sys.system().variable_name(_var_num)
1906  << " variable");
1907 
1908  dof_id_type dof = node.dof_number(_sys.number(), _var_num, 0);
1909  return _sys.solutionOld()(dof);
1910 }
virtual MooseMesh & mesh()=0
virtual NumericVector< Number > & solutionOld()=0
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
const Node *& node()
virtual System & system()=0
Get the reference to the libMesh system.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
bool isSemiLocal(Node *node)
Returns true if the node is semi-local.
Definition: MooseMesh.C:556
unsigned int _var_num
variable number (from libMesh)
Number MooseVariable::getNodalValueOlder ( const Node &  node)

Get the t-2 value of this variable at given node.

Definition at line 1913 of file MooseVariable.C.

1914 {
1915  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
1916 
1917  // Make sure that the node has DOFs
1918  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
1919  * produce a
1920  * better error (see misc/check_error.node_value_off_block) */
1921  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
1922  "Node " << node.id() << " does not contain any dofs for the "
1923  << _sys.system().variable_name(_var_num)
1924  << " variable");
1925 
1926  dof_id_type dof = node.dof_number(_sys.number(), _var_num, 0);
1927  return _sys.solutionOlder()(dof);
1928 }
virtual MooseMesh & mesh()=0
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
const Node *& node()
virtual System & system()=0
Get the reference to the libMesh system.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
bool isSemiLocal(Node *node)
Returns true if the node is semi-local.
Definition: MooseMesh.C:556
unsigned int _var_num
variable number (from libMesh)
virtual NumericVector< Number > & solutionOlder()=0
Real MooseVariable::getValue ( const Elem *  elem,
const std::vector< std::vector< Real >> &  phi 
) const

Compute the variable value at a point on an element.

Parameters
elemThe element we are computing on
phiEvaluated shape functions at a point
Returns
The variable value

Definition at line 1931 of file MooseVariable.C.

Referenced by GapValueAux::computeValue(), FaceFaceConstraint::reinit(), and PenetrationThread::smoothNormal().

1932 {
1933  std::vector<dof_id_type> dof_indices;
1934  _dof_map.dof_indices(elem, dof_indices, _var_num);
1935 
1936  Real value = 0;
1937  if (isNodal())
1938  {
1939  for (unsigned int i = 0; i < dof_indices.size(); ++i)
1940  {
1941  // The zero index is because we only have one point that the phis are evaluated at
1942  value += phi[i][0] * (*_sys.currentSolution())(dof_indices[i]);
1943  }
1944  }
1945  else
1946  {
1947  mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
1948  value = (*_sys.currentSolution())(dof_indices[0]);
1949  }
1950 
1951  return value;
1952 }
const DofMap & _dof_map
DOF map.
virtual bool isNodal() const override
Is this variable nodal.
const VariablePhiValue & phi()
SystemBase & _sys
System this variable is part of.
unsigned int _var_num
variable number (from libMesh)
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
const VariablePhiGradient & MooseVariable::gradPhi ( )

Definition at line 404 of file MooseVariable.C.

Referenced by Assembly::copyShapes().

405 {
406  return _grad_phi;
407 }
const VariablePhiGradient & _grad_phi
const VariablePhiGradient & MooseVariable::gradPhiFace ( )

Definition at line 423 of file MooseVariable.C.

Referenced by Assembly::copyFaceShapes().

424 {
425  return _grad_phi_face;
426 }
const VariablePhiGradient & _grad_phi_face
const VariablePhiGradient & MooseVariable::gradPhiFaceNeighbor ( )

Definition at line 461 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes().

462 {
464 }
const VariablePhiGradient & _grad_phi_face_neighbor
const VariablePhiGradient & MooseVariable::gradPhiNeighbor ( )

Definition at line 442 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes().

443 {
444  return _grad_phi_neighbor;
445 }
const VariablePhiGradient & _grad_phi_neighbor
const VariableGradient& MooseVariable::gradSln ( )
inline

Definition at line 148 of file MooseVariable.h.

Referenced by Coupleable::coupledGradient(), and MooseVariableInterface::gradient().

148 { return _grad_u; }
VariableGradient _grad_u
const VariableGradient& MooseVariable::gradSlnNeighbor ( )
inline
const VariableGradient& MooseVariable::gradSlnOld ( )
inline

Definition at line 149 of file MooseVariable.h.

Referenced by Coupleable::coupledGradient(), Coupleable::coupledGradientOld(), and MooseVariableInterface::gradientOld().

150  {
151  _need_grad_old = true;
152  return _grad_u_old;
153  }
VariableGradient _grad_u_old
const VariableGradient& MooseVariable::gradSlnOlder ( )
inline

Definition at line 154 of file MooseVariable.h.

Referenced by Coupleable::coupledGradientOld(), Coupleable::coupledGradientOlder(), and MooseVariableInterface::gradientOlder().

155  {
156  _need_grad_older = true;
157  return _grad_u_older;
158  }
VariableGradient _grad_u_older
const VariableGradient& MooseVariable::gradSlnOlderNeighbor ( )
inline
const VariableGradient& MooseVariable::gradSlnOldNeighbor ( )
inline
const VariableGradient& MooseVariable::gradSlnPreviousNL ( )
inline

Definition at line 159 of file MooseVariable.h.

Referenced by Coupleable::coupledGradientPreviousNL().

160  {
161  _need_grad_previous_nl = true;
162  return _grad_u_previous_nl;
163  }
bool _need_grad_previous_nl
VariableGradient _grad_u_previous_nl
const VariableGradient& MooseVariable::gradSlnPreviousNLNeighbor ( )
inline

Definition at line 249 of file MooseVariable.h.

Referenced by Coupleable::coupledGradientPreviousNL().

250  {
253  }
bool _need_grad_previous_nl_neighbor
VariableGradient _grad_u_previous_nl_neighbor
VariableValue& MooseVariable::increment ( )
inline

Definition at line 130 of file MooseVariable.h.

130 { return _increment; }
VariableValue _increment
void MooseVariable::insert ( NumericVector< Number > &  residual)

Definition at line 378 of file MooseVariable.C.

Referenced by ComputeMarkerThread::onElement(), ComputeElemAuxVarsThread::onElement(), ComputeBoundaryInitialConditionThread::onNode(), ComputeNodalAuxBcsThread::onNode(), ComputeNodalAuxVarsThread::onNode(), ComputeElemAuxBcsThread::operator()(), and ConstraintWarehouse::subdomainsCovered().

379 {
380  if (_has_nodal_value)
381  residual.insert(&_nodal_u[0], _dof_indices);
382 
384  residual.insert(&_nodal_u_neighbor[0], _dof_indices_neighbor);
385 }
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
VariableValue _nodal_u_neighbor
bool _has_nodal_value_neighbor
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
bool MooseVariable::isNodal ( ) const
overridevirtual
bool MooseVariable::isNodalDefined ( )
inline

Definition at line 198 of file MooseVariable.h.

Referenced by AuxKernel::compute(), NodalBC::computeJacobian(), NodalKernel::computeJacobian(), TimeNodalKernel::computeResidual(), NodalBC::computeResidual(), and NodalKernel::computeResidual().

198 { return _is_defined; }
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
bool MooseVariable::isNodalNeighborDefined ( )
inline

Definition at line 284 of file MooseVariable.h.

284 { return _is_defined_neighbor; }
bool _is_defined_neighbor
If the variable is defined at the neighbor node (used in compute nodal values)
Moose::VarKindType MooseVariableBase::kind ( ) const
inlineinherited

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
inherited
const Elem*& MooseVariable::neighbor ( )
inline

Current neighboring element.

Definition at line 101 of file MooseVariable.h.

101 { return _neighbor; }
const Elem *& _neighbor
neighboring element
dof_id_type& MooseVariable::nodalDofIndex ( )
inline
dof_id_type& MooseVariable::nodalDofIndexNeighbor ( )
inline

Definition at line 283 of file MooseVariable.h.

Referenced by InternalSideIndicator::computeIndicator().

283 { return _nodal_dof_index_neighbor; }
dof_id_type _nodal_dof_index_neighbor
const VariableValue& MooseVariable::nodalSln ( )
inline
const VariableValue& MooseVariable::nodalSlnDot ( )
inline

Definition at line 207 of file MooseVariable.h.

Referenced by Coupleable::coupledDot(), and MooseVariableInterface::dot().

207 { return _nodal_u_dot; }
VariableValue _nodal_u_dot
nodal values of u_dot
const VariableValue& MooseVariable::nodalSlnDotNeighbor ( )
inline

Definition at line 293 of file MooseVariable.h.

Referenced by Coupleable::coupledDot().

293 { return _nodal_u_dot_neighbor; }
VariableValue _nodal_u_dot_neighbor
const VariableValue& MooseVariable::nodalSlnDuDotDu ( )
inline

Definition at line 208 of file MooseVariable.h.

Referenced by Coupleable::coupledDotDu(), and MooseVariableInterface::dotDu().

208 { return _nodal_du_dot_du; }
VariableValue _nodal_du_dot_du
nodal values of derivative of u_dot wrt u
const VariableValue& MooseVariable::nodalSlnDuDotDuNeighbor ( )
inline

Definition at line 294 of file MooseVariable.h.

294 { return _nodal_du_dot_du_neighbor; }
VariableValue _nodal_du_dot_du_neighbor
const VariableValue& MooseVariable::nodalSlnNeighbor ( )
inline
const VariableValue& MooseVariable::nodalSlnOld ( )
inline

Definition at line 200 of file MooseVariable.h.

Referenced by Coupleable::coupledValue(), Coupleable::coupledValueOld(), and MooseVariableInterface::valueOld().

200 { return _nodal_u_old; }
VariableValue _nodal_u_old
const VariableValue& MooseVariable::nodalSlnOlder ( )
inline
const VariableValue& MooseVariable::nodalSlnOlderNeighbor ( )
inline
const VariableValue& MooseVariable::nodalSlnOldNeighbor ( )
inline
const VariableValue& MooseVariable::nodalSlnPreviousNL ( )
inline

Definition at line 202 of file MooseVariable.h.

Referenced by Coupleable::coupledValuePreviousNL().

203  {
205  return _nodal_u_previous_nl;
206  }
bool _need_nodal_u_previous_nl
VariableValue _nodal_u_previous_nl
const VariableValue& MooseVariable::nodalSlnPreviousNLNeighbor ( )
inline

Definition at line 288 of file MooseVariable.h.

Referenced by Coupleable::coupledValuePreviousNL().

289  {
292  }
bool _need_nodal_u_previous_nl_neighbor
VariableValue _nodal_u_previous_nl_neighbor
const VariableValue & MooseVariable::nodalValue ( )

Definition at line 474 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValue().

475 {
476  if (isNodal())
477  {
478  _need_nodal_u = true;
479  return _nodal_u;
480  }
481  else
482  mooseError("Nodal values can be requested only on nodal variables, variable '",
483  name(),
484  "' is not nodal.");
485 }
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.
VariableValue _nodal_u
virtual bool isNodal() const override
Is this variable nodal.
const VariableValue & MooseVariable::nodalValueDot ( )

Definition at line 530 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalDot().

531 {
532  if (isNodal())
533  {
534  _need_nodal_u_dot = true;
535  return _nodal_u_dot;
536  }
537  else
538  mooseError("Nodal values can be requested only on nodal variables, variable '",
539  name(),
540  "' is not nodal.");
541 }
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.
virtual bool isNodal() const override
Is this variable nodal.
bool _need_nodal_u_dot
VariableValue _nodal_u_dot
nodal values of u_dot
const VariableValue & MooseVariable::nodalValueDotNeighbor ( )

Definition at line 600 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalDot().

601 {
602  if (isNodal())
603  {
605  return _nodal_u_dot_neighbor;
606  }
607  else
608  mooseError("Nodal values can be requested only on nodal variables, variable '",
609  name(),
610  "' is not nodal.");
611 }
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.
virtual bool isNodal() const override
Is this variable nodal.
bool _need_nodal_u_dot_neighbor
VariableValue _nodal_u_dot_neighbor
const VariableValue & MooseVariable::nodalValueNeighbor ( )

Definition at line 544 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValue().

545 {
546  if (isNodal())
547  {
548  _need_nodal_u_neighbor = true;
549  return _nodal_u_neighbor;
550  }
551  else
552  mooseError("Nodal values can be requested only on nodal variables, variable '",
553  name(),
554  "' is not nodal.");
555 }
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.
VariableValue _nodal_u_neighbor
virtual bool isNodal() const override
Is this variable nodal.
bool _need_nodal_u_neighbor
const VariableValue & MooseVariable::nodalValueOld ( )

Definition at line 488 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValue(), and Coupleable::coupledNodalValueOld().

489 {
490  if (isNodal())
491  {
492  _need_nodal_u_old = true;
493  return _nodal_u_old;
494  }
495  else
496  mooseError("Nodal values can be requested only on nodal variables, variable '",
497  name(),
498  "' is not nodal.");
499 }
VariableValue _nodal_u_old
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.
virtual bool isNodal() const override
Is this variable nodal.
bool _need_nodal_u_old
const VariableValue & MooseVariable::nodalValueOlder ( )

Definition at line 502 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValueOld(), and Coupleable::coupledNodalValueOlder().

503 {
504  if (isNodal())
505  {
506  _need_nodal_u_older = true;
507  return _nodal_u_older;
508  }
509  else
510  mooseError("Nodal values can be requested only on nodal variables, variable '",
511  name(),
512  "' is not nodal.");
513 }
bool _need_nodal_u_older
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.
virtual bool isNodal() const override
Is this variable nodal.
VariableValue _nodal_u_older
const VariableValue & MooseVariable::nodalValueOlderNeighbor ( )

Definition at line 572 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValueOld(), and Coupleable::coupledNodalValueOlder().

573 {
574  if (isNodal())
575  {
578  }
579  else
580  mooseError("Nodal values can be requested only on nodal variables, variable '",
581  name(),
582  "' is not nodal.");
583 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
VariableValue _nodal_u_older_neighbor
const std::string & name() const
Get the variable name.
bool _need_nodal_u_older_neighbor
virtual bool isNodal() const override
Is this variable nodal.
const VariableValue & MooseVariable::nodalValueOldNeighbor ( )

Definition at line 558 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValue(), and Coupleable::coupledNodalValueOld().

559 {
560  if (isNodal())
561  {
563  return _nodal_u_old_neighbor;
564  }
565  else
566  mooseError("Nodal values can be requested only on nodal variables, variable '",
567  name(),
568  "' is not nodal.");
569 }
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.
virtual bool isNodal() const override
Is this variable nodal.
bool _need_nodal_u_old_neighbor
VariableValue _nodal_u_old_neighbor
const VariableValue & MooseVariable::nodalValuePreviousNL ( )

Definition at line 516 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValuePreviousNL().

517 {
518  if (isNodal())
519  {
521  return _nodal_u_previous_nl;
522  }
523  else
524  mooseError("Nodal values can be requested only on nodal variables, variable '",
525  name(),
526  "' is not nodal.");
527 }
bool _need_nodal_u_previous_nl
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.
virtual bool isNodal() const override
Is this variable nodal.
VariableValue _nodal_u_previous_nl
const VariableValue & MooseVariable::nodalValuePreviousNLNeighbor ( )

Definition at line 586 of file MooseVariable.C.

Referenced by Coupleable::coupledNodalValuePreviousNL().

587 {
588  if (isNodal())
589  {
592  }
593  else
594  mooseError("Nodal values can be requested only on nodal variables, variable '",
595  name(),
596  "' is not nodal.");
597 }
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.
virtual bool isNodal() const override
Is this variable nodal.
bool _need_nodal_u_previous_nl_neighbor
VariableValue _nodal_u_previous_nl_neighbor
const Node*& MooseVariable::node ( )
inline

Definition at line 196 of file MooseVariable.h.

196 { return _node; }
const Node *& _node
const Node*& MooseVariable::nodeNeighbor ( )
inline

Definition at line 282 of file MooseVariable.h.

282 { return _node_neighbor; }
const Node *& _node_neighbor
const MooseArray<Point>& MooseVariable::normals ( )
inline

Definition at line 127 of file MooseVariable.h.

127 { return _normals; }
const MooseArray< Point > & _normals
Normals at QPs on faces.
unsigned int MooseVariableBase::number ( ) const
inlineinherited

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(), MassLumpedTimeDerivative::computeJacobian(), TimeDerivative::computeJacobian(), Kernel::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(), CoupledTiedValueConstraint::computeQpJacobian(), TiedValueConstraint::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(), NodalNormalsCorner::execute(), NodalNormalsEvaluator::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 ( )
inlineinherited

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.
unsigned int MooseVariable::numberOfDofsNeighbor ( )
inline

Definition at line 399 of file MooseVariable.h.

399 { return _dof_indices_neighbor.size(); }
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
Order MooseVariableBase::order ( ) const
inherited
const VariablePhiValue & MooseVariable::phi ( )

Definition at line 398 of file MooseVariable.C.

Referenced by Assembly::copyShapes(), and getValue().

399 {
400  return _phi;
401 }
const VariablePhiValue & _phi
const VariablePhiValue & MooseVariable::phiFace ( )

Definition at line 417 of file MooseVariable.C.

Referenced by Assembly::copyFaceShapes().

418 {
419  return _phi_face;
420 }
const VariablePhiValue & _phi_face
const VariablePhiValue & MooseVariable::phiFaceNeighbor ( )

Definition at line 455 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes().

456 {
457  return _phi_face_neighbor;
458 }
const VariablePhiValue & _phi_face_neighbor
const VariablePhiValue & MooseVariable::phiNeighbor ( )

Definition at line 436 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes().

437 {
438  return _phi_neighbor;
439 }
const VariablePhiValue & _phi_neighbor
void MooseVariable::prepare ( )

Definition at line 209 of file MooseVariable.C.

Referenced by FaceFaceConstraint::reinitSide().

210 {
211  _dof_map.dof_indices(_elem, _dof_indices, _var_num);
212  _has_nodal_value = false;
214 
215  // FIXME: remove this when the Richard's module is migrated to use the new NodalCoupleable
216  // interface.
217  if (_dof_indices.size() > 0)
218  _is_defined = true;
219  else
220  _is_defined = false;
221 }
const DofMap & _dof_map
DOF map.
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
std::vector< dof_id_type > _dof_indices
DOF indices.
bool _has_nodal_value_neighbor
const Elem *& _elem
current element
unsigned int _var_num
variable number (from libMesh)
void MooseVariable::prepareAux ( )
void MooseVariable::prepareIC ( )

Definition at line 239 of file MooseVariable.C.

Referenced by InitialCondition::compute().

240 {
241  _dof_map.dof_indices(_elem, _dof_indices, _var_num);
242  _nodal_u.resize(_dof_indices.size());
243 
244  unsigned int nqp = _qrule->n_points();
245  _u.resize(nqp);
246 }
const DofMap & _dof_map
DOF map.
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
VariableValue _u
QBase *& _qrule
Quadrature rule for interior.
const Elem *& _elem
current element
unsigned int _var_num
variable number (from libMesh)
void MooseVariable::prepareNeighbor ( )

Definition at line 224 of file MooseVariable.C.

225 {
227  _has_nodal_value = false;
229 }
const DofMap & _dof_map
DOF map.
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
bool _has_nodal_value_neighbor
unsigned int _var_num
variable number (from libMesh)
const Elem *& _neighbor
neighboring element
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
void MooseVariable::reinitAux ( )

Definition at line 283 of file MooseVariable.C.

Referenced by AuxiliarySystem::reinitElem(), and AuxiliarySystem::reinitElemFace().

284 {
285  /* FIXME: this method is only for elemental auxiliary variables, so
286  * we may want to rename it */
287  _dof_map.dof_indices(_elem, _dof_indices, _var_num);
288  if (_elem->n_dofs(_sys.number(), _var_num) > 0)
289  {
290  // FIXME: check if the following is equivalent with '_nodal_dof_index = _dof_indices[0];'?
291  _nodal_dof_index = _elem->dof_number(_sys.number(), _var_num, 0);
292  libmesh_assert(_dof_indices.size());
293  _nodal_u.resize(_dof_indices.size());
295 
296  _is_defined = true;
297  }
298  else
299  _is_defined = false;
300 }
const DofMap & _dof_map
DOF map.
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
std::vector< dof_id_type > _dof_indices
DOF indices.
VariableValue _nodal_u
SystemBase & _sys
System this variable is part of.
dof_id_type _nodal_dof_index
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
const Elem *& _elem
current element
unsigned int _var_num
variable number (from libMesh)
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void MooseVariable::reinitAuxNeighbor ( )

Definition at line 303 of file MooseVariable.C.

Referenced by AuxiliarySystem::reinitElemFace().

304 {
305  if (_neighbor)
306  {
308  if (_neighbor->n_dofs(_sys.number(), _var_num) > 0)
309  {
311 
312  libmesh_assert(_dof_indices_neighbor.size());
315 
316  _is_defined_neighbor = true;
317  }
318  else
319  _is_defined_neighbor = false;
320  }
321  else
322  _is_defined_neighbor = false;
323 }
dof_id_type _nodal_dof_index_neighbor
const DofMap & _dof_map
DOF map.
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
bool _is_defined_neighbor
If the variable is defined at the neighbor node (used in compute nodal values)
VariableValue _nodal_u_neighbor
SystemBase & _sys
System this variable is part of.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
unsigned int _var_num
variable number (from libMesh)
const Elem *& _neighbor
neighboring element
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void MooseVariable::reinitNode ( )

Definition at line 249 of file MooseVariable.C.

Referenced by ComputeBoundaryInitialConditionThread::onNode().

250 {
251  if (_node->n_dofs(_sys.number(), _var_num) > 0)
252  {
253  _nodal_dof_index = _node->dof_number(_sys.number(), _var_num, 0);
254  _dof_indices.resize(1);
256  _is_defined = true;
257  }
258  else
259  {
260  _dof_indices.clear(); // Clear these so Assembly doesn't think there's dofs here
261  _is_defined = false;
262  }
263 }
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
const Node *& _node
std::vector< dof_id_type > _dof_indices
DOF indices.
SystemBase & _sys
System this variable is part of.
dof_id_type _nodal_dof_index
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
unsigned int _var_num
variable number (from libMesh)
void MooseVariable::reinitNodeNeighbor ( )

Definition at line 266 of file MooseVariable.C.

267 {
268  if (_node_neighbor->n_dofs(_sys.number(), _var_num) > 0)
269  {
271  _dof_indices_neighbor.resize(1);
273  _is_defined_neighbor = true;
274  }
275  else
276  {
277  _dof_indices_neighbor.clear(); // Clear these so Assembly doesn't think there's dofs here
278  _is_defined_neighbor = false;
279  }
280 }
dof_id_type _nodal_dof_index_neighbor
bool _is_defined_neighbor
If the variable is defined at the neighbor node (used in compute nodal values)
const Node *& _node_neighbor
SystemBase & _sys
System this variable is part of.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
unsigned int _var_num
variable number (from libMesh)
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
void MooseVariable::reinitNodes ( const std::vector< dof_id_type > &  nodes)

Definition at line 326 of file MooseVariable.C.

327 {
328  _dof_indices.clear();
329  for (const auto & node_id : nodes)
330  {
331  Node * nd = _subproblem.mesh().getMesh().query_node_ptr(node_id);
332  if (nd && (_subproblem.mesh().isSemiLocal(nd)))
333  {
334  if (nd->n_dofs(_sys.number(), _var_num) > 0)
335  {
336  dof_id_type dof = nd->dof_number(_sys.number(), _var_num, 0);
337  _dof_indices.push_back(dof);
338  }
339  }
340  }
341 
342  if (_dof_indices.size() > 0)
343  _is_defined = true;
344  else
345  _is_defined = false;
346 }
virtual MooseMesh & mesh()=0
bool _is_defined
If the variable is defined at the node (used in compute nodal values)
std::vector< dof_id_type > _dof_indices
DOF indices.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
bool isSemiLocal(Node *node)
Returns true if the node is semi-local.
Definition: MooseMesh.C:556
unsigned int _var_num
variable number (from libMesh)
void MooseVariable::reinitNodesNeighbor ( const std::vector< dof_id_type > &  nodes)

Definition at line 349 of file MooseVariable.C.

350 {
351  _dof_indices_neighbor.clear();
352  for (const auto & node_id : nodes)
353  {
354  Node * nd = _subproblem.mesh().getMesh().query_node_ptr(node_id);
355  if (nd && (_subproblem.mesh().isSemiLocal(nd)))
356  {
357  if (nd->n_dofs(_sys.number(), _var_num) > 0)
358  {
359  dof_id_type dof = nd->dof_number(_sys.number(), _var_num, 0);
360  _dof_indices_neighbor.push_back(dof);
361  }
362  }
363  }
364 
365  if (_dof_indices_neighbor.size() > 0)
366  _is_defined_neighbor = true;
367  else
368  _is_defined_neighbor = false;
369 }
virtual MooseMesh & mesh()=0
bool _is_defined_neighbor
If the variable is defined at the neighbor node (used in compute nodal values)
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
SubProblem & _subproblem
Problem this variable is part of.
SystemBase & _sys
System this variable is part of.
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
bool isSemiLocal(Node *node)
Returns true if the node is semi-local.
Definition: MooseMesh.C:556
unsigned int _var_num
variable number (from libMesh)
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
void MooseVariable::restoreUnperturbedElemValues ( )

Restore the values the variable had before a call to computePerturbedElemValues().

Definition at line 823 of file MooseVariable.C.

Referenced by FDKernel::perturbedResidual().

824 {
825  _u = _u_bak;
827  if (_need_second)
829 
830  if (_subproblem.isTransient())
831  {
832  _u_dot = _u_dot_bak;
834 
835  if (_need_u_old)
836  _u_old = _u_old_bak;
837 
838  if (_need_u_older)
840 
841  if (_need_grad_old)
843 
844  if (_need_grad_older)
846 
847  if (_need_second_old)
849 
850  if (_need_second_older)
852  }
853 }
bool _need_second_older
VariableValue _u_older_bak
VariableGradient _grad_u_old_bak
VariableSecond _second_u_older
VariableSecond _second_u_old
virtual bool isTransient() const =0
VariableValue _du_dot_du
derivative of u_dot wrt u
VariableGradient _grad_u_older
VariableGradient _grad_u_old
VariableSecond _second_u
VariableValue _u
VariableGradient _grad_u
SubProblem & _subproblem
Problem this variable is part of.
VariableValue _u_old
VariableSecond _second_u_old_bak
VariableValue _u_bak
VariableValue _u_dot_bak
VariableSecond _second_u_older_bak
VariableGradient _grad_u_bak
VariableValue _du_dot_du_bak
VariableSecond _second_u_bak
VariableValue _u_dot
u_dot (time derivative)
VariableGradient _grad_u_older_bak
VariableValue _u_old_bak
VariableValue _u_older
void MooseVariableBase::scalingFactor ( Real  factor)
inlineinherited
Real MooseVariableBase::scalingFactor ( ) const
inlineinherited

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
const VariablePhiSecond & MooseVariable::secondPhi ( )

Definition at line 410 of file MooseVariable.C.

Referenced by Assembly::copyShapes(), and MooseVariableInterface::secondTest().

411 {
413  return *_second_phi;
414 }
FEType _fe_type
The FEType associated with this variable.
const VariablePhiSecond * _second_phi
const VariablePhiSecond & feSecondPhi(FEType type)
Definition: Assembly.C:279
Assembly & _assembly
Assembly data.
const VariablePhiSecond & MooseVariable::secondPhiFace ( )

Definition at line 429 of file MooseVariable.C.

Referenced by Assembly::copyFaceShapes(), and MooseVariableInterface::secondTestFace().

430 {
432  return *_second_phi_face;
433 }
const VariablePhiSecond & feSecondPhiFace(FEType type)
Definition: Assembly.C:301
FEType _fe_type
The FEType associated with this variable.
const VariablePhiSecond * _second_phi_face
Assembly & _assembly
Assembly data.
const VariablePhiSecond & MooseVariable::secondPhiFaceNeighbor ( )

Definition at line 467 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes(), and NeighborMooseVariableInterface::neighborSecondTest().

468 {
471 }
FEType _fe_type
The FEType associated with this variable.
const VariablePhiSecond & feSecondPhiFaceNeighbor(FEType type)
Definition: Assembly.C:345
const VariablePhiSecond * _second_phi_face_neighbor
Assembly & _assembly
Assembly data.
const VariablePhiSecond & MooseVariable::secondPhiNeighbor ( )

Definition at line 448 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes().

449 {
451  return *_second_phi_neighbor;
452 }
FEType _fe_type
The FEType associated with this variable.
const VariablePhiSecond * _second_phi_neighbor
Assembly & _assembly
Assembly data.
const VariablePhiSecond & feSecondPhiNeighbor(FEType type)
Definition: Assembly.C:323
const VariableSecond& MooseVariable::secondSln ( )
inline

Definition at line 164 of file MooseVariable.h.

Referenced by Coupleable::coupledSecond(), and MooseVariableInterface::second().

165  {
166  _need_second = true;
167  secondPhi();
168  secondPhiFace();
169  return _second_u;
170  }
const VariablePhiSecond & secondPhiFace()
VariableSecond _second_u
const VariablePhiSecond & secondPhi()
const VariableSecond& MooseVariable::secondSlnNeighbor ( )
inline

Definition at line 254 of file MooseVariable.h.

Referenced by NeighborCoupleable::coupledNeighborSecond(), Coupleable::coupledSecond(), and NeighborMooseVariableInterface::neighborSecond().

255  {
256  _need_second_neighbor = true;
258  return _second_u_neighbor;
259  }
const VariablePhiSecond & secondPhiFaceNeighbor()
bool _need_second_neighbor
VariableSecond _second_u_neighbor
const VariableSecond& MooseVariable::secondSlnOld ( )
inline

Definition at line 171 of file MooseVariable.h.

Referenced by Coupleable::coupledSecondOld(), and MooseVariableInterface::secondOld().

172  {
173  _need_second_old = true;
174  secondPhi();
175  secondPhiFace();
176  return _second_u_old;
177  }
const VariablePhiSecond & secondPhiFace()
VariableSecond _second_u_old
const VariablePhiSecond & secondPhi()
const VariableSecond& MooseVariable::secondSlnOlder ( )
inline

Definition at line 178 of file MooseVariable.h.

Referenced by Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), and MooseVariableInterface::secondOlder().

179  {
180  _need_second_older = true;
181  secondPhi();
182  secondPhiFace();
183  return _second_u_older;
184  }
const VariablePhiSecond & secondPhiFace()
bool _need_second_older
VariableSecond _second_u_older
const VariablePhiSecond & secondPhi()
const VariableSecond& MooseVariable::secondSlnOlderNeighbor ( )
inline

Definition at line 266 of file MooseVariable.h.

Referenced by Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), and NeighborMooseVariableInterface::neighborSecondOlder().

267  {
271  }
const VariablePhiSecond & secondPhiFaceNeighbor()
VariableSecond _second_u_older_neighbor
bool _need_second_older_neighbor
const VariableSecond& MooseVariable::secondSlnOldNeighbor ( )
inline

Definition at line 260 of file MooseVariable.h.

Referenced by NeighborCoupleable::coupledNeighborSecond(), Coupleable::coupledSecondOld(), and NeighborMooseVariableInterface::neighborSecondOld().

261  {
264  return _second_u_old_neighbor;
265  }
bool _need_second_old_neighbor
const VariablePhiSecond & secondPhiFaceNeighbor()
VariableSecond _second_u_old_neighbor
const VariableSecond& MooseVariable::secondSlnPreviousNL ( )
inline

Definition at line 185 of file MooseVariable.h.

Referenced by Coupleable::coupledSecondPreviousNL().

186  {
188  secondPhi();
189  secondPhiFace();
190  return _second_u_previous_nl;
191  }
const VariablePhiSecond & secondPhiFace()
bool _need_second_previous_nl
const VariablePhiSecond & secondPhi()
VariableSecond _second_u_previous_nl
const VariableSecond& MooseVariable::secondSlnPreviousNLNeighbor ( )
inline

Definition at line 272 of file MooseVariable.h.

Referenced by Coupleable::coupledSecondPreviousNL().

273  {
277  }
VariableSecond _second_u_previous_nl_neighbor
const VariablePhiSecond & secondPhiFaceNeighbor()
bool _need_second_previous_nl_neighbor
void MooseVariable::setNodalValue ( Number  value,
unsigned int  idx = 0 
)

Set the nodal value for this variable to keep everything up to date.

Definition at line 1824 of file MooseVariable.C.

Referenced by ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), InitialCondition::compute(), AuxKernel::compute(), ElementIntegralIndicator::computeIndicator(), Marker::computeMarker(), and ComputeBoundaryInitialConditionThread::onNode().

1825 {
1826  _nodal_u[idx] = value; // update variable nodal value
1827  _has_nodal_value = true;
1828 
1829  // Update the qp values as well
1830  for (unsigned int qp = 0; qp < _u.size(); qp++)
1831  _u[qp] = value;
1832 }
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
VariableValue _nodal_u
VariableValue _u
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
void MooseVariable::setNodalValue ( const DenseVector< Number > &  value)

Set values for this variable to keep everything up to date.

Definition at line 1788 of file MooseVariable.C.

1789 {
1790  for (unsigned int i = 0; i < values.size(); i++)
1791  _nodal_u[i] = values(i);
1792 
1793  _has_nodal_value = true;
1794 
1795  for (unsigned int qp = 0; qp < _u.size(); qp++)
1796  {
1797  _u[qp] = 0;
1798  for (unsigned int i = 0; i < _nodal_u.size(); i++)
1799  _u[qp] += _phi[i][qp] * _nodal_u[i];
1800  }
1801 }
bool _has_nodal_value
If true, the nodal value gets inserted on calling insert()
VariableValue _nodal_u
VariableValue _u
const VariablePhiValue & _phi
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
void MooseVariable::setNodalValueNeighbor ( Number  value)

Set the neighbor nodal value for this variable.

Definition at line 1835 of file MooseVariable.C.

1836 {
1837  _nodal_u_neighbor[0] = value; // update variable nodal value
1839 
1840  if (!isNodal()) // If this is an elemental variable, then update the qp values as well
1841  {
1842  for (unsigned int qp = 0; qp < _u_neighbor.size(); qp++)
1843  _u_neighbor[qp] = value;
1844  }
1845 }
VariableValue _nodal_u_neighbor
virtual bool isNodal() const override
Is this variable nodal.
bool _has_nodal_value_neighbor
VariableValue _u_neighbor
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
void MooseVariable::setNodalValueNeighbor ( const DenseVector< Number > &  value)

Set the neighbor values for this variable.

Definition at line 1804 of file MooseVariable.C.

1805 {
1806  for (unsigned int i = 0; i < values.size(); i++)
1807  _nodal_u_neighbor[i] = values(i);
1809 
1810  if (isNodal())
1811  mooseError("Variable " + name() + " has to be nodal!");
1812  else
1813  {
1814  for (unsigned int qp = 0; qp < _u_neighbor.size(); qp++)
1815  {
1816  _u_neighbor[qp] = 0;
1817  for (unsigned int i = 0; i < _nodal_u_neighbor.size(); i++)
1819  }
1820  }
1821 }
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.
VariableValue _nodal_u_neighbor
virtual bool isNodal() const override
Is this variable nodal.
const VariablePhiValue & _phi_face_neighbor
bool _has_nodal_value_neighbor
VariableValue _u_neighbor
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:250
const VariableValue& MooseVariable::sln ( )
inline
const VariableValue& MooseVariable::slnNeighbor ( )
inline
const VariableValue& MooseVariable::slnOld ( )
inline

Definition at line 133 of file MooseVariable.h.

Referenced by Coupleable::coupledValue(), Coupleable::coupledValueOld(), and MooseVariableInterface::valueOld().

134  {
135  _need_u_old = true;
136  return _u_old;
137  }
VariableValue _u_old
const VariableValue& MooseVariable::slnOlder ( )
inline

Definition at line 138 of file MooseVariable.h.

Referenced by Coupleable::coupledValueOld(), Coupleable::coupledValueOlder(), and MooseVariableInterface::valueOlder().

139  {
140  _need_u_older = true;
141  return _u_older;
142  }
VariableValue _u_older
const VariableValue& MooseVariable::slnOlderNeighbor ( )
inline
const VariableValue& MooseVariable::slnOldNeighbor ( )
inline
const VariableValue& MooseVariable::slnPreviousNL ( )
inline

Definition at line 143 of file MooseVariable.h.

Referenced by Coupleable::coupledValuePreviousNL().

144  {
145  _need_u_previous_nl = true;
146  return _u_previous_nl;
147  }
VariableValue _u_previous_nl
bool _need_u_previous_nl
const VariableValue& MooseVariable::slnPreviousNLNeighbor ( )
inline

Definition at line 233 of file MooseVariable.h.

Referenced by Coupleable::coupledValuePreviousNL().

234  {
237  }
bool _need_u_previous_nl_neighbor
VariableValue _u_previous_nl_neighbor
const DenseVector<Number>& MooseVariable::solutionDoFs ( )
inline

Definition at line 295 of file MooseVariable.h.

Referenced by Coupleable::coupledSolutionDoFs().

296  {
297  _need_solution_dofs = true;
298  return _solution_dofs;
299  }
bool _need_solution_dofs
DenseVector< Number > _solution_dofs
local elemental DoFs
const DenseVector<Number>& MooseVariable::solutionDoFsNeighbor ( )
inline

Definition at line 310 of file MooseVariable.h.

Referenced by NeighborCoupleable::coupledNeighborSolutionDoFs(), and Coupleable::coupledSolutionDoFs().

311  {
314  }
DenseVector< Number > _solution_dofs_neighbor
bool _need_solution_dofs_neighbor
const DenseVector<Number>& MooseVariable::solutionDoFsOld ( )
inline

Definition at line 300 of file MooseVariable.h.

Referenced by Coupleable::coupledSolutionDoFs(), and Coupleable::coupledSolutionDoFsOld().

301  {
303  return _solution_dofs_old;
304  }
bool _need_solution_dofs_old
DenseVector< Number > _solution_dofs_old
const DenseVector<Number>& MooseVariable::solutionDoFsOlder ( )
inline

Definition at line 305 of file MooseVariable.h.

Referenced by Coupleable::coupledSolutionDoFsOld(), and Coupleable::coupledSolutionDoFsOlder().

306  {
308  return _solution_dofs_older;
309  }
DenseVector< Number > _solution_dofs_older
bool _need_solution_dofs_older
const DenseVector<Number>& MooseVariable::solutionDoFsOlderNeighbor ( )
inline
const DenseVector<Number>& MooseVariable::solutionDoFsOldNeighbor ( )
inline
SystemBase& MooseVariableBase::sys ( )
inlineinherited
unsigned int MooseVariableBase::totalVarDofs ( )
inlineinherited

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.
const VariableValue& MooseVariable::uDot ( )
inline

Definition at line 193 of file MooseVariable.h.

Referenced by Coupleable::coupledDot(), and MooseVariableInterface::dot().

193 { return _u_dot; }
VariableValue _u_dot
u_dot (time derivative)
const VariableValue& MooseVariable::uDotNeighbor ( )
inline

Definition at line 279 of file MooseVariable.h.

Referenced by Coupleable::coupledDot().

279 { return _u_dot_neighbor; }
VariableValue _u_dot_neighbor
bool MooseVariable::usesGradPhi ( )
inline

Whether or not this variable is actually using the shape function gradient.

Currently hardcoded to true because we always compute the value.

Definition at line 446 of file MooseVariable.h.

Referenced by Assembly::copyNeighborShapes().

446 { return true; }
bool MooseVariable::usesPhi ( )
inline

Whether or not this variable is actually using the shape function value.

Currently hardcoded to true because we always compute the value.

Definition at line 439 of file MooseVariable.h.

Referenced by Assembly::copyNeighborShapes().

439 { return true; }
bool MooseVariable::usesSecondPhi ( )
inline

Whether or not this variable is actually using the shape function second derivative.

Definition at line 451 of file MooseVariable.h.

Referenced by Assembly::copyNeighborShapes().

Friends And Related Function Documentation

friend class NodeFaceConstraint
friend

Definition at line 631 of file MooseVariable.h.

friend class ValueRangeMarker
friend

Definition at line 633 of file MooseVariable.h.

friend class ValueThresholdMarker
friend

Definition at line 632 of file MooseVariable.h.

Member Data Documentation

Assembly& MooseVariableBase::_assembly
protectedinherited
unsigned int& MooseVariable::_current_side
protected

the side of the current element (valid when doing face assembly)

Definition at line 475 of file MooseVariable.h.

std::vector<dof_id_type> MooseVariableBase::_dof_indices
protectedinherited
std::vector<dof_id_type> MooseVariable::_dof_indices_neighbor
protected
const DofMap& MooseVariableBase::_dof_map
protectedinherited
VariableValue MooseVariable::_du_dot_du
protected
VariableValue MooseVariable::_du_dot_du_bak
protected
VariableValue MooseVariable::_du_dot_du_bak_neighbor
protected

Definition at line 585 of file MooseVariable.h.

Referenced by ~MooseVariable().

VariableValue MooseVariable::_du_dot_du_neighbor
protected

Definition at line 585 of file MooseVariable.h.

Referenced by computeNeighborValuesFace(), and ~MooseVariable().

const Elem*& MooseVariable::_elem
protected

current element

Definition at line 473 of file MooseVariable.h.

Referenced by prepare(), prepareIC(), and reinitAux().

FEType MooseVariableBase::_fe_type
protectedinherited

The FEType associated with this variable.

Definition at line 128 of file MooseVariableBase.h.

Referenced by MooseVariableBase::order(), secondPhi(), secondPhiFace(), secondPhiFaceNeighbor(), and secondPhiNeighbor().

const VariablePhiGradient& MooseVariable::_grad_phi
protected

Definition at line 530 of file MooseVariable.h.

Referenced by computeElemValues(), computePerturbedElemValues(), and gradPhi().

const VariablePhiGradient& MooseVariable::_grad_phi_face
protected

Definition at line 535 of file MooseVariable.h.

Referenced by computeElemValuesFace(), and gradPhiFace().

const VariablePhiGradient& MooseVariable::_grad_phi_face_neighbor
protected

Definition at line 545 of file MooseVariable.h.

Referenced by computeNeighborValuesFace(), and gradPhiFaceNeighbor().

const VariablePhiGradient& MooseVariable::_grad_phi_neighbor
protected

Definition at line 540 of file MooseVariable.h.

Referenced by computeNeighborValues(), and gradPhiNeighbor().

VariableGradient MooseVariable::_grad_u
protected
VariableGradient MooseVariable::_grad_u_bak
protected
VariableGradient MooseVariable::_grad_u_neighbor
protected
VariableGradient MooseVariable::_grad_u_old
protected
VariableGradient MooseVariable::_grad_u_old_bak
protected
VariableGradient MooseVariable::_grad_u_old_neighbor
protected
VariableGradient MooseVariable::_grad_u_older
protected
VariableGradient MooseVariable::_grad_u_older_bak
protected

Definition at line 557 of file MooseVariable.h.

Referenced by computePerturbedElemValues(), and restoreUnperturbedElemValues().

VariableGradient MooseVariable::_grad_u_older_neighbor
protected
VariableGradient MooseVariable::_grad_u_previous_nl
protected
VariableGradient MooseVariable::_grad_u_previous_nl_neighbor
protected

Definition at line 571 of file MooseVariable.h.

Referenced by ~MooseVariable().

bool MooseVariable::_has_nodal_value
protected

If true, the nodal value gets inserted on calling insert()

Definition at line 592 of file MooseVariable.h.

Referenced by add(), insert(), prepare(), prepareAux(), prepareNeighbor(), and setNodalValue().