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

#include <MooseVariableConstMonomial.h>

Inheritance diagram for MooseVariableConstMonomial:
[legend]

Public Member Functions

 MooseVariableConstMonomial (unsigned int var_num, const FEType &fe_type, SystemBase &sys, Assembly &assembly, Moose::VarKindType var_kind)
 
virtual void computeElemValues () override
 Compute values at interior quadrature points. More...
 
virtual void computeElemValuesFace () override
 Compute values at facial quadrature points. More...
 
virtual void computeNeighborValuesFace () override
 Compute values at facial quadrature points for the neighbor. More...
 
virtual void computeNeighborValues () override
 Compute values at quadrature points for the neighbor. More...
 
virtual void computeElemValuesHelper (const unsigned &nqp, const Real &phi)
 
virtual void computeNeighborValuesHelper (const unsigned &nqp, const Real &phi)
 
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...
 
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...
 

Detailed Description

Definition at line 21 of file MooseVariableConstMonomial.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file MooseVariableConstMonomial.C.

27  : MooseVariable(var_num, fe_type, sys, assembly, var_kind)
28 {
29 }
MooseVariable(unsigned int var_num, const FEType &fe_type, SystemBase &sys, Assembly &assembly, Moose::VarKindType var_kind)
Definition: MooseVariable.C:28

Member Function Documentation

bool MooseVariable::activeOnSubdomain ( SubdomainID  subdomain) const
inherited

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
inherited

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)
inherited

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 ( )
inherited

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 MooseVariableConstMonomial::computeElemValues ( )
overridevirtual

Compute values at interior quadrature points.

Reimplemented from MooseVariable.

Definition at line 302 of file MooseVariableConstMonomial.C.

303 {
304  if (_dof_indices.size() == 0)
305  return;
306 
307  computeElemValuesHelper(_qrule->n_points(), _phi[0][0]);
308 }
std::vector< dof_id_type > _dof_indices
DOF indices.
QBase *& _qrule
Quadrature rule for interior.
const VariablePhiValue & _phi
virtual void computeElemValuesHelper(const unsigned &nqp, const Real &phi)
void MooseVariableConstMonomial::computeElemValuesFace ( )
overridevirtual

Compute values at facial quadrature points.

Reimplemented from MooseVariable.

Definition at line 311 of file MooseVariableConstMonomial.C.

312 {
313  if (_dof_indices.size() == 0)
314  return;
315 
316  computeElemValuesHelper(_qrule_face->n_points(), _phi_face[0][0]);
317 }
QBase *& _qrule_face
Quadrature rule for the face.
std::vector< dof_id_type > _dof_indices
DOF indices.
const VariablePhiValue & _phi_face
virtual void computeElemValuesHelper(const unsigned &nqp, const Real &phi)
void MooseVariableConstMonomial::computeElemValuesHelper ( const unsigned &  nqp,
const Real &  phi 
)
virtual

Definition at line 32 of file MooseVariableConstMonomial.C.

Referenced by computeElemValues(), and computeElemValuesFace().

33 {
34  bool is_transient = _subproblem.isTransient();
35 
36  _u.resize(nqp);
37  _grad_u.resize(nqp);
38 
39  if (_need_second)
40  _second_u.resize(nqp);
41 
44 
47 
50 
51  if (is_transient)
52  {
53  _u_dot.resize(nqp);
54  _du_dot_du.resize(nqp);
55 
56  if (_need_u_old)
57  _u_old.resize(nqp);
58 
59  if (_need_u_older)
60  _u_older.resize(nqp);
61 
62  if (_need_grad_old)
63  _grad_u_old.resize(nqp);
64 
65  if (_need_grad_older)
66  _grad_u_older.resize(nqp);
67 
68  if (_need_second_old)
69  _second_u_old.resize(nqp);
70 
73  }
74 
75  if (_need_nodal_u)
76  _nodal_u.resize(1);
77 
80 
81  if (is_transient)
82  {
89  }
90 
92  _solution_dofs.resize(1);
93 
95  _solution_dofs_old.resize(1);
96 
98  _solution_dofs_older.resize(1);
99 
100  const dof_id_type & idx = _dof_indices[0];
101  const Real & soln = (*_sys.currentSolution())(idx);
102  Real soln_old;
103  Real soln_older;
104  Real soln_previous_nl;
105  Real u_dot;
106  const Real & du_dot_du = _sys.duDotDu();
107 
108  if (_need_nodal_u)
109  _nodal_u[0] = soln;
110 
113  soln_previous_nl = (*_sys.solutionPreviousNewton())(idx);
114 
116  _nodal_u_previous_nl[0] = soln_previous_nl;
117 
119  _solution_dofs(0) = soln;
120 
121  if (is_transient)
122  {
124  soln_old = _sys.solutionOld()(idx);
125 
127  soln_older = _sys.solutionOlder()(idx);
128 
129  if (_need_nodal_u_old)
130  _nodal_u_old[0] = soln_old;
131 
133  _nodal_u_older[0] = soln_older;
134 
135  u_dot = _sys.solutionUDot()(idx);
136 
137  if (_need_nodal_u_dot)
138  _nodal_u_dot[0] = u_dot;
139 
141  _solution_dofs_old(0) = soln_old;
142 
144  _solution_dofs_older(0) = soln_older;
145  }
146 
147  _u[0] = phi * soln;
148 
150  _u_previous_nl[0] = phi * soln_previous_nl;
151 
152  if (is_transient)
153  {
154  _u_dot[0] = phi * u_dot;
155  _du_dot_du[0] = du_dot_du;
156 
157  if (_need_u_old)
158  _u_old[0] = phi * soln_old;
159 
160  if (_need_u_older)
161  _u_older[0] = phi * soln_older;
162  }
163 
164  for (unsigned qp = 1; qp < nqp; ++qp)
165  {
166  _u[qp] = _u[0];
167 
170 
171  if (is_transient)
172  {
173  _u_dot[qp] = _u_dot[0];
174  _du_dot_du[qp] = _du_dot_du[0];
175 
176  if (_need_u_old)
177  _u_old[qp] = _u_old[0];
178 
179  if (_need_u_older)
180  _u_older[qp] = _u_older[qp];
181  }
182  }
183 }
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
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
const VariablePhiValue & phi()
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
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)
inherited

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)
inherited

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 MooseVariableConstMonomial::computeNeighborValues ( )
overridevirtual

Compute values at quadrature points for the neighbor.

Reimplemented from MooseVariable.

Definition at line 320 of file MooseVariableConstMonomial.C.

321 {
322  if (_dof_indices_neighbor.size() == 0)
323  return;
324 
326 }
const VariablePhiValue & _phi_neighbor
QBase *& _qrule_neighbor
Quadrature rule for the neighbor.
virtual void computeNeighborValuesHelper(const unsigned &nqp, const Real &phi)
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
void MooseVariableConstMonomial::computeNeighborValuesFace ( )
overridevirtual

Compute values at facial quadrature points for the neighbor.

Reimplemented from MooseVariable.

Definition at line 329 of file MooseVariableConstMonomial.C.

330 {
331  if (_dof_indices_neighbor.size() == 0)
332  return;
333 
335 }
const VariablePhiValue & _phi_face_neighbor
QBase *& _qrule_neighbor
Quadrature rule for the neighbor.
virtual void computeNeighborValuesHelper(const unsigned &nqp, const Real &phi)
std::vector< dof_id_type > _dof_indices_neighbor
DOF indices (neighbor)
void MooseVariableConstMonomial::computeNeighborValuesHelper ( const unsigned &  nqp,
const Real &  phi 
)
virtual

Definition at line 186 of file MooseVariableConstMonomial.C.

Referenced by computeNeighborValues(), and computeNeighborValuesFace().

187 {
188  bool is_transient = _subproblem.isTransient();
189 
190  _u_neighbor.resize(nqp);
192 
195 
196  if (is_transient)
197  {
199  _u_old_neighbor.resize(nqp);
200 
203 
206 
209 
212 
215  }
216 
219  if (is_transient)
220  {
227  }
228 
230  _solution_dofs_neighbor.resize(1);
231 
233  _solution_dofs_old_neighbor.resize(1);
234 
237 
238  const dof_id_type & idx = _dof_indices_neighbor[0];
239  const Real & soln = (*_sys.currentSolution())(idx);
240  Real soln_old;
241  Real soln_older;
242  Real u_dot;
243 
245  _nodal_u_neighbor[0] = soln;
246 
248  _solution_dofs_neighbor(0) = soln;
249 
250  if (is_transient)
251  {
253  soln_old = _sys.solutionOld()(idx);
254 
256  soln_older = _sys.solutionOlder()(idx);
257 
259  _nodal_u_old_neighbor[0] = soln_old;
261  _nodal_u_older_neighbor[0] = soln_older;
262 
263  u_dot = _sys.solutionUDot()(idx);
264 
266  _nodal_u_dot_neighbor[0] = u_dot;
267 
269  _solution_dofs_old_neighbor(0) = soln_old;
270 
272  _solution_dofs_older_neighbor(0) = soln_older;
273  }
274 
275  _u_neighbor[0] = phi * soln;
276 
277  if (is_transient)
278  {
280  _u_old_neighbor[0] = phi * soln_old;
281 
283  _u_older_neighbor[0] = phi * soln_older;
284  }
285 
286  for (unsigned qp = 1; qp < nqp; ++qp)
287  {
288  _u_neighbor[qp] = _u_neighbor[0];
289 
290  if (is_transient)
291  {
294 
297  }
298  }
299 }
bool _need_grad_older_neighbor
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
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 VariablePhiValue & phi()
SystemBase & _sys
System this variable is part of.
bool _need_nodal_u_old_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::computeNodalNeighborValues ( )
inherited

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 ( )
inherited

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 
)
inherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 
)
protectedinherited

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
inherited

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
inherited

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)
inherited

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)
inherited

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)
inherited

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
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

Definition at line 461 of file MooseVariable.C.

Referenced by Assembly::copyNeighborShapes().

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

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 ( )
inlineinherited

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 ( )
inlineinherited
const VariableGradient& MooseVariable::gradSlnOld ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited
const VariableGradient& MooseVariable::gradSlnOldNeighbor ( )
inlineinherited
const VariableGradient& MooseVariable::gradSlnPreviousNL ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

Definition at line 130 of file MooseVariable.h.

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

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
overridevirtualinherited
bool MooseVariable::isNodalDefined ( )
inlineinherited

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 ( )
inlineinherited

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

Get the variable name.

Definition at line 45 of file MooseVariableBase.C.

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

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

Current neighboring element.

Definition at line 101 of file MooseVariable.h.

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

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 ( )
inlineinherited
const VariableValue& MooseVariable::nodalSlnDot ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited
const VariableValue& MooseVariable::nodalSlnOld ( )
inlineinherited

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 ( )
inlineinherited
const VariableValue& MooseVariable::nodalSlnOlderNeighbor ( )
inlineinherited
const VariableValue& MooseVariable::nodalSlnOldNeighbor ( )
inlineinherited
const VariableValue& MooseVariable::nodalSlnPreviousNL ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inlineinherited

Definition at line 196 of file MooseVariable.h.

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

Definition at line 282 of file MooseVariable.h.

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

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(), TimeDerivative::computeJacobian(), Kernel::computeJacobian(), MassLumpedTimeDerivative::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 ( )
inlineinherited

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 ( )
inherited

Definition at line 398 of file MooseVariable.C.

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

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

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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)
inherited

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)
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 
)
inherited

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)
inherited

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)
inherited

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)
inherited

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 ( )
inlineinherited
const VariableValue& MooseVariable::slnNeighbor ( )
inlineinherited
const VariableValue& MooseVariable::slnOld ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited
const VariableValue& MooseVariable::slnOldNeighbor ( )
inlineinherited
const VariableValue& MooseVariable::slnPreviousNL ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited

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 ( )
inlineinherited
const DenseVector<Number>& MooseVariable::solutionDoFsOldNeighbor ( )
inlineinherited
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 ( )
inlineinherited

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 ( )
inlineinherited

Definition at line 279 of file MooseVariable.h.

Referenced by Coupleable::coupledDot().

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

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 ( )
inlineinherited

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 ( )
inlineinherited

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().

Member Data Documentation

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

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
protectedinherited
const DofMap& MooseVariableBase::_dof_map
protectedinherited
VariableValue MooseVariable::_du_dot_du
protectedinherited
VariableValue MooseVariable::_du_dot_du_bak
protectedinherited
VariableValue MooseVariable::_du_dot_du_bak_neighbor
protectedinherited

Definition at line 585 of file MooseVariable.h.

Referenced by MooseVariable::~MooseVariable().

VariableValue MooseVariable::_du_dot_du_neighbor
protectedinherited
const Elem*& MooseVariable::_elem
protectedinherited

current element

Definition at line 473 of file MooseVariable.h.

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

FEType MooseVariableBase::_fe_type
protectedinherited
const VariablePhiGradient& MooseVariable::_grad_phi
protectedinherited
const VariablePhiGradient& MooseVariable::_grad_phi_face
protectedinherited
const VariablePhiGradient& MooseVariable::_grad_phi_face_neighbor
protectedinherited
const VariablePhiGradient& MooseVariable::_grad_phi_neighbor
protectedinherited
VariableGradient MooseVariable::_grad_u
protectedinherited
VariableGradient MooseVariable::_grad_u_bak
protectedinherited
VariableGradient MooseVariable::_grad_u_neighbor
protectedinherited
VariableGradient MooseVariable::_grad_u_old
protectedinherited
VariableGradient MooseVariable::_grad_u_old_bak
protectedinherited
VariableGradient MooseVariable::_grad_u_old_neighbor
protectedinherited
VariableGradient MooseVariable::_grad_u_older
protectedinherited
VariableGradient MooseVariable::_grad_u_older_bak
protectedinherited
VariableGradient MooseVariable::_grad_u_older_neighbor
protectedinherited
VariableGradient MooseVariable::_grad_u_previous_nl
protectedinherited
VariableGradient MooseVariable::_grad_u_previous_nl_neighbor
protectedinherited

Definition at line 571 of file MooseVariable.h.

Referenced by MooseVariable::~MooseVariable().

bool MooseVariable::_has_nodal_value
protectedinherited
bool MooseVariable::_has_nodal_value_neighbor
protectedinherited
VariableValue MooseVariable::_increment
protectedinherited
unsigned int MooseVariableBase::_index
protectedinherited

variable number within MOOSE

Definition at line 130 of file MooseVariableBase.h.

bool MooseVariable::_is_defined
protectedinherited

If the variable is defined at the node (used in compute nodal values)

Definition at line 590 of file MooseVariable.h.

Referenced by MooseVariable::computeNodalValues(), MooseVariable::prepare(), MooseVariable::reinitAux(), MooseVariable::reinitNode(), and MooseVariable::reinitNodes().

bool MooseVariable::_is_defined_neighbor
protectedinherited

If the variable is defined at the neighbor node (used in compute nodal values)

Definition at line 607 of file MooseVariable.h.

Referenced by MooseVariable::computeNodalNeighborValues(), MooseVariable::reinitAuxNeighbor(), MooseVariable::reinitNodeNeighbor(), and MooseVariable::reinitNodesNeighbor().

bool MooseVariable::_is_nodal
protectedinherited

if variable is nodal

Definition at line 626 of file MooseVariable.h.

Referenced by MooseVariable::isNodal(), and MooseVariable::MooseVariable().

MooseMesh& MooseVariableBase::_mesh
protectedinherited

mesh the variable is active in

Definition at line 148 of file MooseVariableBase.h.

bool MooseVariable::_need_grad_old
protectedinherited
bool MooseVariable::_need_grad_old_neighbor
protectedinherited
bool MooseVariable::_need_grad_older
protectedinherited
bool MooseVariable::_need_grad_older_neighbor
protectedinherited
bool MooseVariable::_need_grad_previous_nl
protectedinherited
bool MooseVariable::_need_grad_previous_nl_neighbor
protectedinherited

Definition at line 502 of file MooseVariable.h.

bool MooseVariable::_need_nodal_u
protectedinherited
bool MooseVariable::_need_nodal_u_dot
protectedinherited
bool MooseVariable::_need_nodal_u_dot_neighbor
protectedinherited
bool MooseVariable::_need_nodal_u_neighbor
protectedinherited
bool MooseVariable::_need_nodal_u_old
protectedinherited
bool MooseVariable::_need_nodal_u_old_neighbor
protectedinherited
bool MooseVariable::_need_nodal_u_older
protectedinherited
bool MooseVariable::_need_nodal_u_older_neighbor
protectedinherited
bool MooseVariable::_need_nodal_u_previous_nl
protectedinherited
bool MooseVariable::_need_nodal_u_previous_nl_neighbor
protectedinherited

Definition at line 518 of file MooseVariable.h.

Referenced by MooseVariable::nodalValuePreviousNLNeighbor().

bool MooseVariable::_need_second
protectedinherited
bool MooseVariable::_need_second_neighbor
protectedinherited
bool MooseVariable::_need_second_old
protectedinherited
bool MooseVariable::_need_second_old_neighbor
protectedinherited
bool MooseVariable::_need_second_older
protectedinherited
bool MooseVariable::_need_second_older_neighbor
protectedinherited
bool MooseVariable::_need_second_previous_nl
protectedinherited
bool MooseVariable::_need_second_previous_nl_neighbor
protectedinherited

Definition at line 507 of file MooseVariable.h.

bool MooseVariable::_need_solution_dofs
protectedinherited
bool MooseVariable::_need_solution_dofs_neighbor
protectedinherited
bool MooseVariable::_need_solution_dofs_old
protectedinherited
bool MooseVariable::_need_solution_dofs_old_neighbor
protectedinherited
bool MooseVariable::_need_solution_dofs_older
protectedinherited
bool MooseVariable::_need_solution_dofs_older_neighbor
protectedinherited
bool MooseVariable::_need_u_old
protectedinherited
bool MooseVariable::_need_u_old_neighbor
protectedinherited
bool MooseVariable::_need_u_older
protectedinherited
bool MooseVariable::_need_u_older_neighbor
protectedinherited
bool MooseVariable::_need_u_previous_nl
protectedinherited
bool MooseVariable::_need_u_previous_nl_neighbor
protectedinherited

Definition at line 498 of file MooseVariable.h.

const Elem*& MooseVariable::_neighbor
protectedinherited

neighboring element

Definition at line 478 of file MooseVariable.h.

Referenced by MooseVariable::prepareNeighbor(), and MooseVariable::reinitAuxNeighbor().

dof_id_type MooseVariable::_nodal_dof_index
protectedinherited

Definition at line 595 of file MooseVariable.h.

Referenced by MooseVariable::reinitAux(), and MooseVariable::reinitNode().

dof_id_type MooseVariable::_nodal_dof_index_neighbor
protectedinherited
VariableValue MooseVariable::_nodal_du_dot_du
protectedinherited

nodal values of derivative of u_dot wrt u

Definition at line 604 of file MooseVariable.h.

Referenced by MooseVariable::computeNodalValues(), and MooseVariable::~MooseVariable().

VariableValue MooseVariable::_nodal_du_dot_du_neighbor
protectedinherited
VariableValue MooseVariable::_nodal_u
protectedinherited
VariableValue MooseVariable::_nodal_u_dot
protectedinherited
VariableValue MooseVariable::_nodal_u_dot_neighbor
protectedinherited
VariableValue MooseVariable::_nodal_u_neighbor
protectedinherited
VariableValue MooseVariable::_nodal_u_old
protectedinherited
VariableValue MooseVariable::_nodal_u_old_neighbor
protectedinherited
VariableValue MooseVariable::_nodal_u_older
protectedinherited
VariableValue MooseVariable::_nodal_u_older_neighbor
protectedinherited
VariableValue MooseVariable::_nodal_u_previous_nl
protectedinherited
VariableValue MooseVariable::_nodal_u_previous_nl_neighbor
protectedinherited
const Node*& MooseVariable::_node
protectedinherited

Definition at line 594 of file MooseVariable.h.

Referenced by MooseVariable::reinitNode().

const Node*& MooseVariable::_node_neighbor
protectedinherited

Definition at line 608 of file MooseVariable.h.

Referenced by MooseVariable::reinitNodeNeighbor().

const MooseArray<Point>& MooseVariable::_normals
protectedinherited

Normals at QPs on faces.

Definition at line 549 of file MooseVariable.h.

const VariablePhiValue& MooseVariable::_phi
protectedinherited
const VariablePhiValue& MooseVariable::_phi_face
protectedinherited
const VariablePhiValue& MooseVariable::_phi_face_neighbor
protectedinherited
const VariablePhiValue& MooseVariable::_phi_neighbor
protectedinherited
QBase*& MooseVariable::_qrule
protectedinherited
QBase*& MooseVariable::_qrule_face
protectedinherited

Quadrature rule for the face.

Definition at line 468 of file MooseVariable.h.

Referenced by computeElemValuesFace(), and MooseVariable::computeElemValuesFace().

QBase*& MooseVariable::_qrule_neighbor
protectedinherited
Real MooseVariableBase::_scaling_factor
protectedinherited

scaling factor for this variable

Definition at line 151 of file MooseVariableBase.h.

const VariablePhiSecond* MooseVariable::_second_phi
protectedinherited

Definition at line 531 of file MooseVariable.h.

Referenced by MooseVariable::secondPhi().

const VariablePhiSecond* MooseVariable::_second_phi_face
protectedinherited

Definition at line 536 of file MooseVariable.h.

Referenced by MooseVariable::secondPhiFace().

const VariablePhiSecond* MooseVariable::_second_phi_face_neighbor
protectedinherited

Definition at line 546 of file MooseVariable.h.

Referenced by MooseVariable::secondPhiFaceNeighbor().

const VariablePhiSecond* MooseVariable::_second_phi_neighbor
protectedinherited

Definition at line 541 of file MooseVariable.h.

Referenced by MooseVariable::secondPhiNeighbor().

VariableSecond MooseVariable::_second_u
protectedinherited
VariableSecond MooseVariable::_second_u_bak
protectedinherited
VariableSecond MooseVariable::_second_u_neighbor
protectedinherited
VariableSecond MooseVariable::_second_u_old
protectedinherited
VariableSecond MooseVariable::_second_u_old_bak
protectedinherited
VariableSecond MooseVariable::_second_u_old_neighbor
protectedinherited
VariableSecond MooseVariable::_second_u_older
protectedinherited
VariableSecond MooseVariable::_second_u_older_bak
protectedinherited
VariableSecond MooseVariable::_second_u_older_neighbor
protectedinherited
VariableSecond MooseVariable::_second_u_previous_nl
protectedinherited
VariableSecond MooseVariable::_second_u_previous_nl_neighbor
protectedinherited

Definition at line 575 of file MooseVariable.h.

Referenced by MooseVariable::~MooseVariable().

DenseVector<Number> MooseVariable::_solution_dofs
protectedinherited
DenseVector<Number> MooseVariable::_solution_dofs_neighbor
protectedinherited
DenseVector<Number> MooseVariable::_solution_dofs_old
protectedinherited
DenseVector<Number> MooseVariable::_solution_dofs_old_neighbor
protectedinherited
DenseVector<Number> MooseVariable::_solution_dofs_older
protectedinherited
DenseVector<Number> MooseVariable::_solution_dofs_older_neighbor
protectedinherited
SubProblem& MooseVariableBase::_subproblem
protectedinherited
SystemBase& MooseVariableBase::_sys
protectedinherited
THREAD_ID MooseVariable::_tid
protectedinherited

Thread ID.

Definition at line 463 of file MooseVariable.h.

VariableValue MooseVariable::_u
protectedinherited
VariableValue MooseVariable::_u_bak
protectedinherited
VariableValue MooseVariable::_u_dot
protectedinherited
VariableValue MooseVariable::_u_dot_bak
protectedinherited
VariableValue MooseVariable::_u_dot_bak_neighbor
protectedinherited

Definition at line 581 of file MooseVariable.h.

Referenced by MooseVariable::~MooseVariable().

VariableValue MooseVariable::_u_dot_neighbor
protectedinherited
VariableValue MooseVariable::_u_neighbor
protectedinherited
VariableValue MooseVariable::_u_old
protectedinherited
VariableValue MooseVariable::_u_old_bak
protectedinherited
VariableValue MooseVariable::_u_old_neighbor
protectedinherited
VariableValue MooseVariable::_u_older
protectedinherited
VariableValue MooseVariable::_u_older_bak
protectedinherited
VariableValue MooseVariable::_u_older_neighbor
protectedinherited
VariableValue MooseVariable::_u_previous_nl
protectedinherited
VariableValue MooseVariable::_u_previous_nl_neighbor
protectedinherited

Definition at line 567 of file MooseVariable.h.

Referenced by MooseVariable::~MooseVariable().

Moose::VarKindType MooseVariableBase::_var_kind
protectedinherited

Definition at line 131 of file MooseVariableBase.h.

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

libMesh variable object for this variable

Definition at line 138 of file MooseVariableBase.h.


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