https://mooseframework.inl.gov
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
MooseVariableData< OutputType > Class Template Reference

#include <MooseVariableData.h>

Inheritance diagram for MooseVariableData< OutputType >:
[legend]

Public Types

typedef MooseArray< OutputSecondFieldVariableSecond
 
typedef MooseArray< OutputType > FieldVariableCurl
 
typedef MooseArray< OutputDivergenceFieldVariableDivergence
 
typedef Moose::ShapeType< OutputType >::type OutputShape
 
typedef libMesh::TensorTools::IncrementRank< OutputShape >::type OutputShapeGradient
 
typedef libMesh::TensorTools::IncrementRank< OutputShapeGradient >::type OutputShapeSecond
 
typedef libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
 
typedef MooseArray< std::vector< OutputShape > > FieldVariablePhiValue
 
typedef MooseArray< std::vector< OutputShapeGradient > > FieldVariablePhiGradient
 
typedef MooseArray< std::vector< OutputShapeSecond > > FieldVariablePhiSecond
 
typedef MooseArray< std::vector< OutputShape > > FieldVariablePhiCurl
 
typedef MooseArray< std::vector< OutputShapeDivergence > > FieldVariablePhiDivergence
 
typedef MooseArray< std::vector< OutputShape > > FieldVariableTestValue
 
typedef MooseArray< std::vector< OutputShapeGradient > > FieldVariableTestGradient
 
typedef MooseArray< std::vector< OutputShapeSecond > > FieldVariableTestSecond
 
typedef MooseArray< std::vector< OutputShape > > FieldVariableTestCurl
 
typedef MooseArray< std::vector< OutputShapeDivergence > > FieldVariableTestDivergence
 
typedef libMesh::TensorTools::IncrementRank< OutputType >::type OutputGradient
 
typedef libMesh::TensorTools::IncrementRank< OutputGradient >::type OutputSecond
 
typedef libMesh::TensorTools::DecrementRank< OutputType >::type OutputDivergence
 
typedef MooseArray< OutputType > FieldVariableValue
 
typedef MooseArray< OutputGradientFieldVariableGradient
 
typedef Moose::DOFType< OutputType >::type DofValue
 
typedef Moose::ADType< DofValue >::type ADDofValue
 
typedef MooseArray< DofValueDofValues
 
typedef MooseArray< ADDofValueADDofValues
 

Public Member Functions

 MooseVariableData (const MooseVariableFE< OutputType > &var, SystemBase &sys, THREAD_ID tid, Moose::ElementType element_type, const QBase *const &qrule_in, const QBase *const &qrule_face_in, const Node *const &node, const Elem *const &elem)
 
bool needsAD () const
 Returns whether this data structure needs automatic differentiation calculations. More...
 
void setGeometry (Moose::GeometryType gm_type)
 Set the geometry type before calculating variables values. More...
 
void computeValues ()
 compute the variable values More...
 
void computeConstantMonomialValues ()
 compute the values for const monomial variables More...
 
template<bool constant_monomial>
void computeAD (const unsigned int num_dofs, const unsigned int nqp)
 compute AD things More...
 
void computeNodalValues ()
 compute nodal things More...
 
const FieldVariablePhiValuephi () const
 phi getter More...
 
const FieldVariablePhiValuephiFace () const
 phi_face getter More...
 
const FieldVariablePhiGradientgradPhi () const
 grad_phi getter More...
 
const MappedArrayVariablePhiGradientarrayGradPhi () const
 mapped_grad_phi getter More...
 
const FieldVariablePhiGradientgradPhiFace () const
 grad_phi_face getter More...
 
const MappedArrayVariablePhiGradientarrayGradPhiFace () const
 mapped_grad_phi_face getter More...
 
const FieldVariablePhiSecondsecondPhi () const
 second_phi getter More...
 
const FieldVariablePhiSecondsecondPhiFace () const
 second_phi_face getter More...
 
const FieldVariablePhiCurlcurlPhi () const
 curl_phi getter More...
 
const FieldVariablePhiCurlcurlPhiFace () const
 curl_phi_face getter More...
 
const FieldVariablePhiDivergencedivPhi () const
 divergence_phi getter More...
 
const FieldVariablePhiDivergencedivPhiFace () const
 divergence_phi_face getter More...
 
const ADTemplateVariablePhiGradient< OutputShape > & adGradPhi () const
 ad_grad_phi getter More...
 
const ADTemplateVariablePhiGradient< OutputShape > & adGradPhiFace () const
 ad_grad_phi_face getter More...
 
std::size_t phiSize () const
 Return phi size. More...
 
std::size_t phiFaceSize () const
 Return phiFace size. More...
 
bool usesSecondPhi () const
 Whether or not this variable is computing any second derivatives. More...
 
bool computingCurl () const
 Whether or not this variable is computing the curl. More...
 
bool computingDiv () const
 Whether or not this variable is computing the divergence. More...
 
bool isNodal () const override
 
bool hasDoFsOnNodes () const override
 Whether this data is associated with a variable that has DoFs on nodes. More...
 
libMesh::FEContinuity getContinuity () const override
 Return the variable continuity. More...
 
const Node *const & node () const
 
const dof_id_typenodalDofIndex () const
 
bool isNodalDefined () const
 
const Elem *const & currentElem () const
 The current element. More...
 
const unsigned intcurrentSide () const
 The current side. More...
 
void prepareIC ()
 prepare the initial condition More...
 
const FieldVariableGradientgradSlnDot () const
 Local time derivative of solution gradient getter. More...
 
const FieldVariableGradientgradSlnDotDot () const
 Local second time derivative of solution gradient getter. More...
 
const FieldVariableSecondsecondSln (Moose::SolutionState state) const
 Local solution second spatial derivative getter. More...
 
const FieldVariableCurlcurlSln (Moose::SolutionState state) const
 Local solution curl getter. More...
 
const FieldVariableDivergencedivSln (Moose::SolutionState state) const
 Local solution divergence getter. More...
 
const ADTemplateVariableValue< OutputType > & adSln () const
 
const ADTemplateVariableGradient< OutputType > & adGradSln () const
 
const ADTemplateVariableGradient< OutputType > & adGradSlnDot () const
 
const ADTemplateVariableSecond< OutputType > & adSecondSln () const
 
const ADTemplateVariableValue< OutputType > & adUDot () const
 
const ADTemplateVariableValue< OutputType > & adUDotDot () const
 
const FieldVariableValueuDot () const
 
const FieldVariableValueuDotDot () const
 
const FieldVariableValueuDotOld () const
 
const FieldVariableValueuDotDotOld () const
 
const VariableValueduDotDu () const
 
const VariableValueduDotDotDu () const
 
const ADTemplateVariableCurl< OutputType > & adCurlSln () const
 
const OutputType & nodalValueDot () const
 
const OutputType & nodalValueDotDot () const
 
const OutputType & nodalValueDotOld () const
 
const OutputType & nodalValueDotDotOld () const
 
const OutputType & nodalValueDuDotDu () const
 
const OutputType & nodalValueDuDotDotDu () const
 
const Moose::ADType< OutputType >::type & adNodalValue () const
 
void setDofValues (const DenseVector< DofValue > &values)
 Set local DOF values and evaluate the values on quadrature points. More...
 
void insertNodalValue (libMesh::NumericVector< libMesh::Number > &residual, const DofValue &v)
 Write a nodal value to the passed-in solution vector. More...
 
DofValue getNodalValue (const Node &node, Moose::SolutionState state) const
 
DofValue getElementalValue (const Elem *elem, Moose::SolutionState state, unsigned int idx=0) const
 
void getDofIndices (const Elem *elem, std::vector< dof_id_type > &dof_indices) const
 
const std::vector< dof_id_type > & dofIndices () const
 
unsigned int numberOfDofs () const
 
void clearDofIndices ()
 
void prepare ()
 Get the dof indices corresponding to the current element. More...
 
void reinitNode ()
 Prepare degrees of freedom for the current node. More...
 
void reinitAux ()
 Prepare dof indices and solution values for elemental auxiliary variables. More...
 
void reinitNodes (const std::vector< dof_id_type > &nodes)
 Set _dof_indices to the degrees of freedom existing on the passed-in nodes. More...
 
void addSolution (libMesh::NumericVector< libMesh::Number > &sol, const DenseVector< libMesh::Number > &v) const
 Add passed in local DOF values to a solution vector. More...
 
const DofValuesdofValuesDot () const
 
const DofValuesdofValuesDotOld () const
 
const DofValuesdofValuesDotDot () const
 
const DofValuesdofValuesDotDotOld () const
 
const MooseArray< libMesh::Number > & dofValuesDuDotDu () const
 
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu () const
 
const ADDofValuesadDofValues () const
 Return the AD dof values. More...
 
const ADDofValuesadDofValuesDot () const
 Return the AD time derivative values of degrees of freedom. More...
 
const FieldVariableValueincrement () const
 Increment getter. More...
 
void computeIncrementAtQps (const libMesh::NumericVector< libMesh::Number > &increment_vec)
 Compute and store incremental change in solution at QPs based on increment_vec. More...
 
void computeIncrementAtNode (const libMesh::NumericVector< libMesh::Number > &increment_vec)
 Compute and store incremental change at the current node based on increment_vec. More...
 
template<>
void insertNodalValue (NumericVector< Number > &residual, const RealEigenVector &v)
 
template<>
RealEigenVector getNodalValue (const Node &node, Moose::SolutionState state) const
 
template<>
RealEigenVector getElementalValue (const Elem *elem, const Moose::SolutionState state, const unsigned int idx) const
 
template<>
void computeIncrementAtQps (const NumericVector< Number > &increment_vec)
 
template<>
void computeIncrementAtNode (const NumericVector< Number > &increment_vec)
 
const FieldVariableValuesln (Moose::SolutionState state) const
 Local solution getter. More...
 
const FieldVariableGradientgradSln (Moose::SolutionState state) const
 Local solution gradient getter. More...
 
unsigned int oldestSolutionStateRequested () const
 The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc). More...
 
void setNodalValue (const OutputType &value, unsigned int idx=0)
 Set nodal value. More...
 
template<>
void setNodalValue (const RealVectorValue &value, unsigned int idx)
 
void insert (libMesh::NumericVector< libMesh::Number > &residual)
 Set the current local DOF values to the input vector. More...
 
template<>
void insert (NumericVector< Number > &residual)
 
void add (libMesh::NumericVector< libMesh::Number > &residual)
 Add the current local DOF values to the input vector. More...
 
template<>
void add (NumericVector< Number > &residual)
 
const DofValuesdofValues () const
 
const DofValuesdofValuesOld () const
 
const DofValuesdofValuesOlder () const
 
const DofValuesdofValuesPreviousNL () const
 
const OutputType & nodalValue (Moose::SolutionState state) const
 
const MooseArray< OutputType > & nodalValueArray (Moose::SolutionState state) const
 
const FieldVariableValuevectorTagValue (TagID tag) const
 
const FieldVariableGradientvectorTagGradient (TagID tag) const
 
const FieldVariableValuematrixTagValue (TagID tag) const
 
const DofValuesnodalVectorTagValue (TagID tag) const
 
const DofValuesnodalMatrixTagValue (TagID tag) const
 
const DofValuesvectorTagDofValue (TagID tag) const
 
const DofValuesvectorTagDofValue (Moose::SolutionState state) const
 
void setActiveTags (const std::set< TagID > &vtags)
 Set the active vector tags. More...
 
void prepareAux ()
 Clear aux state. More...
 
void sizeMatrixTagData ()
 size matrix tag data More...
 
void setDofValue (const DofValue &value, unsigned int index)
 dof value setters More...
 

Protected Member Functions

virtual const MooseVariableField< OutputType > & var () const
 
void insertSolutionTag (TagID tag_id)
 insert a solution tag into our tag containers More...
 
void needSolutionState (unsigned int state)
 Request that we have at least state number of older solution states/vectors. More...
 
void fetchDofValues ()
 Helper methods for assigning dof values from their corresponding solution values. More...
 
template<>
void fetchDofValues ()
 
template<>
void fetchDofValues ()
 
void zeroSizeDofValues ()
 
void getArrayDofValues (const libMesh::NumericVector< libMesh::Number > &sol, unsigned int n, MooseArray< RealEigenVector > &dof_values) const
 
void assignNodalValue ()
 
template<>
void assignNodalValue ()
 
template<>
void assignNodalValue ()
 
template<typename ReturnType , typename Functor >
const ReturnType & stateToTagHelper (Moose::SolutionState state, Functor functor)
 Helper method that converts a SolutionState argument into a corresponding tag ID, potentially requesting necessary additional solution states and assigning tag id data members, and then calls the provided functor with the tag ID. More...
 
void resizeVectorTagData (TagID tag)
 resize the vector tag need flags and data containers to accomodate this tag index More...
 

Protected Attributes

SystemBase_sys
 The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data. More...
 
const SubProblem_subproblem
 The subproblem which we can query for information related to tagged vectors and matrices. More...
 
const THREAD_ID _tid
 The thread ID that this object is on. More...
 
const libMesh::DofMap_dof_map
 The degree of freedom map from libMesh. More...
 
unsigned int _count
 Number of components of the associated variable. More...
 
bool _has_dof_values
 Whether we currently have degree of freedom values stored in our local containers (corresponding to the current element) More...
 
unsigned int _max_state
 The maximum number of older solution states our variable needs. More...
 
TagID _solution_tag
 The vector tag ID corresponding to the solution vector. More...
 
TagID _old_solution_tag
 The vector tag ID corresponding to the old solution vector. More...
 
TagID _older_solution_tag
 The vector tag ID corresponding to the older solution vector. More...
 
TagID _previous_nl_solution_tag
 The vector tag ID corresponding to the previous nonlinear iteration's solution vector. More...
 
std::vector< dof_id_type_dof_indices
 The dof indices for the current element. More...
 
std::vector< bool > _need_vector_tag_dof_u
 
std::vector< bool > _need_matrix_tag_dof_u
 
std::vector< DofValues_vector_tags_dof_u
 
std::vector< DofValues_matrix_tags_dof_u
 
std::vector< FieldVariableValue_vector_tag_u
 
std::vector< bool > _need_vector_tag_u
 
std::vector< FieldVariableGradient_vector_tag_grad
 
std::vector< bool > _need_vector_tag_grad
 
std::vector< FieldVariableValue_matrix_tag_u
 
std::vector< bool > _need_matrix_tag_u
 
OutputType _nodal_value
 Nodal values. More...
 
OutputType _nodal_value_old
 
OutputType _nodal_value_older
 
OutputType _nodal_value_previous_nl
 
MooseArray< OutputType > _nodal_value_array
 Nodal values as MooseArrays for use with AuxKernels. More...
 
MooseArray< OutputType > _nodal_value_old_array
 
MooseArray< OutputType > _nodal_value_older_array
 
bool _need_u_dot
 u dot flags More...
 
bool _need_u_dotdot
 
bool _need_u_dot_old
 
bool _need_u_dotdot_old
 
bool _need_du_dot_du
 
bool _need_du_dotdot_du
 
bool _need_grad_dot
 gradient dot flags More...
 
bool _need_grad_dotdot
 
bool _need_dof_values_dot
 local solution flags More...
 
bool _need_dof_values_dotdot
 
bool _need_dof_values_dot_old
 
bool _need_dof_values_dotdot_old
 
bool _need_dof_du_dot_du
 
bool _need_dof_du_dotdot_du
 
DofValues _dof_values_dot
 time derivative of the solution values More...
 
DofValues _dof_values_dotdot
 second time derivative of the solution values More...
 
DofValues _dof_values_dot_old
 the previous time step's solution value time derivative More...
 
DofValues _dof_values_dotdot_old
 the previous time step's solution value second time derivative More...
 
MooseArray< libMesh::Number_dof_du_dot_du
 derivatives of the solution value time derivative with respect to the degrees of freedom More...
 
MooseArray< libMesh::Number_dof_du_dotdot_du
 derivatives of the solution value second time derivative with respect to the degrees of freedom More...
 
OutputType _nodal_value_dot
 nodal values of u_dot More...
 
OutputType _nodal_value_dotdot
 nodal values of u_dotdot More...
 
OutputType _nodal_value_dot_old
 nodal values of u_dot_old More...
 
OutputType _nodal_value_dotdot_old
 nodal values of u_dotdot_old More...
 
std::set< TagID_required_vector_tags
 The set of vector tags (residual + solution) we need to evaluate. More...
 
std::set< TagID_solution_tags
 The set of solution tags we need to evaluate. More...
 

Private Member Functions

void fetchADDofValues ()
 Helper method for assigning the ad_dof* arrays. More...
 
void assignADNodalValue ()
 Helper method for assigning nodal values from their corresponding solution values (dof values as they're referred to here in this class). More...
 
template<bool constant_monomial>
void computeValuesInternal ()
 Internal method for computeValues() and computeConstantMonomialValues() More...
 
template<bool constant_monomial, typename DestinationType , typename ShapeType , typename DofValuesType >
void fill (DestinationType &dest, const ShapeType &phi, const DofValuesType &dof_values, unsigned int nqp, std::size_t num_shapes)
 
template<>
void fetchADDofValues ()
 
template<>
void assignADNodalValue ()
 

Private Attributes

const MooseVariableFE< OutputType > & _var
 A const reference to the owning MooseVariableFE object. More...
 
const libMesh::FEType_fe_type
 
const unsigned int _var_num
 
const Assembly_assembly
 
Moose::ElementType _element_type
 The element type this object is storing data for. This is either Element, Neighbor, or Lower. More...
 
bool _is_nodal
 if variable is nodal More...
 
dof_id_type _nodal_dof_index
 The dof index for the current node. More...
 
libMesh::FEContinuity _continuity
 Continuity type of the variable. More...
 
FieldVariableValue _increment
 Increment in the variable used in dampers. More...
 
Moose::ADType< OutputType >::type _ad_nodal_value
 AD nodal value. More...
 
ADReal _ad_zero
 A zero AD variable. More...
 
bool _need_second = false
 SolutionState second_u flags. More...
 
bool _need_second_old = false
 
bool _need_second_older = false
 
bool _need_second_previous_nl = false
 
bool _need_curl = false
 curl flags More...
 
bool _need_curl_old = false
 
bool _need_curl_older = false
 
bool _need_div = false
 divergence flags More...
 
bool _need_div_old = false
 
bool _need_div_older = false
 
bool _need_ad = false
 AD flags. More...
 
bool _need_ad_u = false
 
bool _need_ad_grad_u = false
 
bool _need_ad_grad_u_dot = false
 
bool _need_ad_second_u = false
 
bool _need_ad_curl_u = false
 
bool _need_ad_div_u = false
 
bool _need_ad_u_dot = false
 
bool _need_ad_u_dotdot = false
 
bool _has_dof_indices
 
FieldVariableGradient _grad_u_dot
 grad_u dots More...
 
FieldVariableGradient _grad_u_dotdot
 
FieldVariableSecond _second_u
 second_u More...
 
FieldVariableSecond _second_u_old
 
FieldVariableSecond _second_u_older
 
FieldVariableSecond _second_u_previous_nl
 
FieldVariableCurl _curl_u
 curl_u More...
 
FieldVariableCurl _curl_u_old
 
FieldVariableCurl _curl_u_older
 
FieldVariableDivergence _div_u
 divergence_u More...
 
FieldVariableDivergence _div_u_old
 
FieldVariableDivergence _div_u_older
 
ADTemplateVariableValue< OutputType > _ad_u
 AD u. More...
 
ADTemplateVariableGradient< OutputType > _ad_grad_u
 
ADTemplateVariableSecond< OutputType > _ad_second_u
 
ADDofValues _ad_dof_values
 
ADDofValues _ad_dofs_dot
 
MooseArray< ADRealEigenVector > _ad_dofs_dot_eigen
 
ADDofValues _ad_dofs_dotdot
 
MooseArray< ADRealEigenVector > _ad_dofs_dotdot_eigen
 
ADTemplateVariableValue< OutputType > _ad_u_dot
 
ADTemplateVariableValue< OutputType > _ad_u_dotdot
 
ADTemplateVariableGradient< OutputType > _ad_grad_u_dot
 
ADTemplateVariableCurl< OutputType > _ad_curl_u
 
FieldVariableValue _u_dot
 u_dot (time derivative) More...
 
FieldVariableValue _u_dotdot
 u_dotdot (second time derivative) More...
 
FieldVariableValue _u_dot_old
 u_dot_old (time derivative) More...
 
FieldVariableValue _u_dotdot_old
 u_dotdot_old (second time derivative) More...
 
VariableValue _du_dot_du
 derivative of u_dot wrt u More...
 
VariableValue _du_dotdot_du
 derivative of u_dotdot wrt u More...
 
const QBase *const & _qrule
 The current qrule. More...
 
const QBase *const & _qrule_face
 
const FieldVariablePhiValue_phi
 
const FieldVariablePhiGradient_grad_phi
 
const FieldVariablePhiSecond_second_phi
 
const FieldVariablePhiCurl_curl_phi
 
const FieldVariablePhiDivergence_div_phi
 
MappedArrayVariablePhiGradient _mapped_grad_phi
 
MappedArrayVariablePhiGradient _mapped_grad_phi_face
 
MappedArrayVariablePhiGradient _mapped_grad_phi_neighbor
 
MappedArrayVariablePhiGradient _mapped_grad_phi_face_neighbor
 
const FieldVariablePhiValue_phi_face
 
const FieldVariablePhiGradient_grad_phi_face
 
const FieldVariablePhiSecond_second_phi_face
 
const FieldVariablePhiCurl_curl_phi_face
 
const FieldVariablePhiDivergence_div_phi_face
 
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi
 
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi_face
 
const QBase_current_qrule
 
const FieldVariablePhiValue_current_phi
 
const FieldVariablePhiGradient_current_grad_phi
 
const FieldVariablePhiSecond_current_second_phi
 
const FieldVariablePhiCurl_current_curl_phi
 
const FieldVariablePhiDivergence_current_div_phi
 
const ADTemplateVariablePhiGradient< OutputShape > * _current_ad_grad_phi
 
const bool _use_dual
 
std::function< const typename OutputTools< OutputType >::VariablePhiValue &(const Assembly &, libMesh::FEType)> _phi_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiValue &(const Assembly &, libMesh::FEType)> _phi_face_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiGradient &(const Assembly &, libMesh::FEType)> _grad_phi_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiGradient &(const Assembly &, libMesh::FEType)> _grad_phi_face_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_face_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_face_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_assembly_method
 
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_face_assembly_method
 
std::function< const ADTemplateVariablePhiGradient< OutputShape > &(const Assembly &, libMesh::FEType)> _ad_grad_phi_assembly_method
 
std::function< const ADTemplateVariablePhiGradient< OutputShape > &(const Assembly &, libMesh::FEType)> _ad_grad_phi_face_assembly_method
 
const TimeIntegrator_time_integrator
 Pointer to time integrator. More...
 
const Node *const & _node
 The current node. More...
 
const Elem *const & _elem
 The current elem. More...
 
const bool _displaced
 Whether this variable is being calculated on a displaced system. More...
 
const unsigned int_current_side
 The current element side. More...
 
ADReal _ad_real_dummy = 0
 A dummy ADReal variable. More...
 

Detailed Description

template<typename OutputType>
class MooseVariableData< OutputType >

Definition at line 49 of file MooseVariableData.h.

Member Typedef Documentation

◆ ADDofValue

template<typename OutputType>
typedef Moose::ADType<DofValue>::type MooseVariableDataBase< OutputType >::ADDofValue
inherited

Definition at line 47 of file MooseVariableDataBase.h.

◆ ADDofValues

template<typename OutputType>
typedef MooseArray<ADDofValue> MooseVariableDataBase< OutputType >::ADDofValues
inherited

Definition at line 49 of file MooseVariableDataBase.h.

◆ DofValue

template<typename OutputType>
typedef Moose::DOFType<OutputType>::type MooseVariableDataBase< OutputType >::DofValue
inherited

Definition at line 46 of file MooseVariableDataBase.h.

◆ DofValues

template<typename OutputType>
typedef MooseArray<DofValue> MooseVariableDataBase< OutputType >::DofValues
inherited

Definition at line 48 of file MooseVariableDataBase.h.

◆ FieldVariableCurl

template<typename OutputType >
typedef MooseArray<OutputType> MooseVariableData< OutputType >::FieldVariableCurl

Definition at line 61 of file MooseVariableData.h.

◆ FieldVariableDivergence

template<typename OutputType >
typedef MooseArray<OutputDivergence> MooseVariableData< OutputType >::FieldVariableDivergence

Definition at line 62 of file MooseVariableData.h.

◆ FieldVariableGradient

template<typename OutputType>
typedef MooseArray<OutputGradient> MooseVariableDataBase< OutputType >::FieldVariableGradient
inherited

Definition at line 43 of file MooseVariableDataBase.h.

◆ FieldVariablePhiCurl

template<typename OutputType >
typedef MooseArray<std::vector<OutputShape> > MooseVariableData< OutputType >::FieldVariablePhiCurl

Definition at line 76 of file MooseVariableData.h.

◆ FieldVariablePhiDivergence

template<typename OutputType >
typedef MooseArray<std::vector<OutputShapeDivergence> > MooseVariableData< OutputType >::FieldVariablePhiDivergence

Definition at line 77 of file MooseVariableData.h.

◆ FieldVariablePhiGradient

template<typename OutputType >
typedef MooseArray<std::vector<OutputShapeGradient> > MooseVariableData< OutputType >::FieldVariablePhiGradient

Definition at line 74 of file MooseVariableData.h.

◆ FieldVariablePhiSecond

template<typename OutputType >
typedef MooseArray<std::vector<OutputShapeSecond> > MooseVariableData< OutputType >::FieldVariablePhiSecond

Definition at line 75 of file MooseVariableData.h.

◆ FieldVariablePhiValue

template<typename OutputType >
typedef MooseArray<std::vector<OutputShape> > MooseVariableData< OutputType >::FieldVariablePhiValue

Definition at line 73 of file MooseVariableData.h.

◆ FieldVariableSecond

template<typename OutputType >
typedef MooseArray<OutputSecond> MooseVariableData< OutputType >::FieldVariableSecond

Definition at line 60 of file MooseVariableData.h.

◆ FieldVariableTestCurl

template<typename OutputType >
typedef MooseArray<std::vector<OutputShape> > MooseVariableData< OutputType >::FieldVariableTestCurl

Definition at line 84 of file MooseVariableData.h.

◆ FieldVariableTestDivergence

template<typename OutputType >
typedef MooseArray<std::vector<OutputShapeDivergence> > MooseVariableData< OutputType >::FieldVariableTestDivergence

Definition at line 85 of file MooseVariableData.h.

◆ FieldVariableTestGradient

template<typename OutputType >
typedef MooseArray<std::vector<OutputShapeGradient> > MooseVariableData< OutputType >::FieldVariableTestGradient

Definition at line 82 of file MooseVariableData.h.

◆ FieldVariableTestSecond

template<typename OutputType >
typedef MooseArray<std::vector<OutputShapeSecond> > MooseVariableData< OutputType >::FieldVariableTestSecond

Definition at line 83 of file MooseVariableData.h.

◆ FieldVariableTestValue

template<typename OutputType >
typedef MooseArray<std::vector<OutputShape> > MooseVariableData< OutputType >::FieldVariableTestValue

Definition at line 81 of file MooseVariableData.h.

◆ FieldVariableValue

template<typename OutputType>
typedef MooseArray<OutputType> MooseVariableDataBase< OutputType >::FieldVariableValue
inherited

Definition at line 42 of file MooseVariableDataBase.h.

◆ OutputDivergence

template<typename OutputType>
typedef libMesh::TensorTools::DecrementRank<OutputType>::type MooseVariableDataBase< OutputType >::OutputDivergence
inherited

Definition at line 39 of file MooseVariableDataBase.h.

◆ OutputGradient

template<typename OutputType>
typedef libMesh::TensorTools::IncrementRank<OutputType>::type MooseVariableDataBase< OutputType >::OutputGradient
inherited

Definition at line 37 of file MooseVariableDataBase.h.

◆ OutputSecond

template<typename OutputType>
typedef libMesh::TensorTools::IncrementRank<OutputGradient>::type MooseVariableDataBase< OutputType >::OutputSecond
inherited

Definition at line 38 of file MooseVariableDataBase.h.

◆ OutputShape

template<typename OutputType >
typedef Moose::ShapeType<OutputType>::type MooseVariableData< OutputType >::OutputShape

Definition at line 65 of file MooseVariableData.h.

◆ OutputShapeDivergence

template<typename OutputType >
typedef libMesh::TensorTools::DecrementRank<OutputShape>::type MooseVariableData< OutputType >::OutputShapeDivergence

Definition at line 70 of file MooseVariableData.h.

◆ OutputShapeGradient

template<typename OutputType >
typedef libMesh::TensorTools::IncrementRank<OutputShape>::type MooseVariableData< OutputType >::OutputShapeGradient

Definition at line 68 of file MooseVariableData.h.

◆ OutputShapeSecond

template<typename OutputType >
typedef libMesh::TensorTools::IncrementRank<OutputShapeGradient>::type MooseVariableData< OutputType >::OutputShapeSecond

Definition at line 69 of file MooseVariableData.h.

Constructor & Destructor Documentation

◆ MooseVariableData()

template<typename OutputType >
MooseVariableData< OutputType >::MooseVariableData ( const MooseVariableFE< OutputType > &  var,
SystemBase sys,
THREAD_ID  tid,
Moose::ElementType  element_type,
const QBase *const &  qrule_in,
const QBase *const &  qrule_face_in,
const Node *const &  node,
const Elem *const &  elem 
)

Definition at line 28 of file MooseVariableData.C.

38  _var(var),
39  _fe_type(var.feType()),
40  _var_num(var.number()),
41  _assembly(_subproblem.assembly(_tid, var.kind() == Moose::VAR_SOLVER ? sys.number() : 0)),
42  _element_type(element_type),
43  _ad_zero(0),
44  _has_dof_indices(false),
45  _qrule(qrule_in),
46  _qrule_face(qrule_face_in),
47  _use_dual(var.useDual()),
52  _div_phi_assembly_method(nullptr),
56  _time_integrator(nullptr),
57  _node(node),
58  _elem(elem),
59  _displaced(dynamic_cast<const DisplacedSystem *>(&_sys) ? true : false),
61 {
62  _continuity = FEInterface::get_continuity(_fe_type);
63 
65 
67 
68  // Initialize AD zero with zero derivatives
69  const auto old_do = ADReal::do_derivatives;
70  ADReal::do_derivatives = true;
71  _ad_zero = 0.;
72  ADReal::do_derivatives = old_do;
73 
74  switch (_element_type)
75  {
77  {
78  _phi_assembly_method = &Assembly::fePhi<OutputShape>;
79  _phi_face_assembly_method = &Assembly::fePhiFace<OutputShape>;
80  _grad_phi_assembly_method = &Assembly::feGradPhi<OutputShape>;
81  _grad_phi_face_assembly_method = &Assembly::feGradPhiFace<OutputShape>;
82  _second_phi_assembly_method = &Assembly::feSecondPhi<OutputShape>;
83  _second_phi_face_assembly_method = &Assembly::feSecondPhiFace<OutputShape>;
84  _curl_phi_assembly_method = &Assembly::feCurlPhi<OutputShape>;
85  _curl_phi_face_assembly_method = &Assembly::feCurlPhiFace<OutputShape>;
86  _div_phi_assembly_method = &Assembly::feDivPhi<OutputShape>;
87  _div_phi_face_assembly_method = &Assembly::feDivPhiFace<OutputShape>;
88  _ad_grad_phi_assembly_method = &Assembly::feADGradPhi<OutputShape>;
89  _ad_grad_phi_face_assembly_method = &Assembly::feADGradPhiFace<OutputShape>;
90 
93  break;
94  }
96  {
97  _phi_assembly_method = &Assembly::fePhiNeighbor<OutputShape>;
98  _phi_face_assembly_method = &Assembly::fePhiFaceNeighbor<OutputShape>;
99  _grad_phi_assembly_method = &Assembly::feGradPhiNeighbor<OutputShape>;
100  _grad_phi_face_assembly_method = &Assembly::feGradPhiFaceNeighbor<OutputShape>;
101  _second_phi_assembly_method = &Assembly::feSecondPhiNeighbor<OutputShape>;
102  _second_phi_face_assembly_method = &Assembly::feSecondPhiFaceNeighbor<OutputShape>;
103  _curl_phi_assembly_method = &Assembly::feCurlPhiNeighbor<OutputShape>;
104  _curl_phi_face_assembly_method = &Assembly::feCurlPhiFaceNeighbor<OutputShape>;
105  _div_phi_assembly_method = &Assembly::feDivPhiNeighbor<OutputShape>;
106  _div_phi_face_assembly_method = &Assembly::feDivPhiFaceNeighbor<OutputShape>;
107 
108  _ad_grad_phi = nullptr;
109  _ad_grad_phi_face = nullptr;
110  break;
111  }
113  {
114  if (_use_dual)
115  {
116  _phi_assembly_method = &Assembly::feDualPhiLower<OutputType>;
117  _phi_face_assembly_method = &Assembly::feDualPhiLower<OutputType>; // Place holder
118  _grad_phi_assembly_method = &Assembly::feGradDualPhiLower<OutputType>;
119  _grad_phi_face_assembly_method = &Assembly::feGradDualPhiLower<OutputType>; // Place holder
120  }
121  else
122  {
123  _phi_assembly_method = &Assembly::fePhiLower<OutputType>;
124  _phi_face_assembly_method = &Assembly::fePhiLower<OutputType>; // Place holder
125  _grad_phi_assembly_method = &Assembly::feGradPhiLower<OutputType>;
126  _grad_phi_face_assembly_method = &Assembly::feGradPhiLower<OutputType>; // Place holder
127  }
128 
129  _ad_grad_phi = nullptr;
130  _ad_grad_phi_face = nullptr;
131  break;
132  }
133  }
138 }
const Assembly & _assembly
const Node *const & _node
The current node.
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_assembly_method
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_face_assembly_method
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
std::function< const ADTemplateVariablePhiGradient< OutputShape > &(const Assembly &, libMesh::FEType)> _ad_grad_phi_assembly_method
const unsigned int _var_num
std::function< const typename OutputTools< OutputShape >::VariablePhiValue &(const Assembly &, libMesh::FEType)> _phi_face_assembly_method
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_face_assembly_method
const QBase *const & _qrule_face
C_ZERO
virtual const MooseVariableField< OutputType > & var() const
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_face_assembly_method
const QBase *const & _qrule
The current qrule.
std::function< const ADTemplateVariablePhiGradient< OutputShape > &(const Assembly &, libMesh::FEType)> _ad_grad_phi_face_assembly_method
const TimeIntegrator * _time_integrator
Pointer to time integrator.
const MooseVariableFE< OutputType > & _var
A const reference to the owning MooseVariableFE object.
const Elem *const & _elem
The current elem.
libMesh::FEContinuity _continuity
Continuity type of the variable.
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor, or Lower.
ADReal _ad_zero
A zero AD variable.
std::function< const typename OutputTools< OutputShape >::VariablePhiGradient &(const Assembly &, libMesh::FEType)> _grad_phi_assembly_method
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi
std::function< const typename OutputTools< OutputShape >::VariablePhiGradient &(const Assembly &, libMesh::FEType)> _grad_phi_face_assembly_method
const FieldVariablePhiValue * _phi_face
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_assembly_method
const Node *const & node() const
C_ONE
const libMesh::FEType & _fe_type
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi_face
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
const bool _displaced
Whether this variable is being calculated on a displaced system.
const unsigned int & _current_side
The current element side.
const TimeIntegrator * queryTimeIntegrator(const unsigned int var_num) const
Retrieve the time integrator that integrates the given variable&#39;s equation.
Definition: SystemBase.C:1673
const FieldVariablePhiGradient * _grad_phi_face
const THREAD_ID _tid
The thread ID that this object is on.
const unsigned int & side() const
Returns the current side.
Definition: Assembly.h:446
std::function< const typename OutputTools< OutputType >::VariablePhiValue &(const Assembly &, libMesh::FEType)> _phi_assembly_method
bool _is_nodal
if variable is nodal
const FieldVariablePhiGradient * _grad_phi
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_assembly_method
const FieldVariablePhiValue * _phi

Member Function Documentation

◆ adCurlSln()

template<typename OutputType >
const ADTemplateVariableCurl<OutputType>& MooseVariableData< OutputType >::adCurlSln ( ) const
inline

Definition at line 356 of file MooseVariableData.h.

357  {
358  _need_ad = _need_ad_curl_u = true;
359  curlPhi();
360  curlPhiFace();
361  return _ad_curl_u;
362  }
const FieldVariablePhiCurl & curlPhi() const
curl_phi getter
bool _need_ad
AD flags.
const FieldVariablePhiCurl & curlPhiFace() const
curl_phi_face getter
ADTemplateVariableCurl< OutputType > _ad_curl_u

◆ add() [1/2]

template<typename OutputType>
void MooseVariableDataBase< OutputType >::add ( libMesh::NumericVector< libMesh::Number > &  residual)
inherited

Add the current local DOF values to the input vector.

Definition at line 427 of file MooseVariableDataBase.C.

428 {
429  if (_has_dof_values)
430  {
431  const auto & dof_values = _vector_tags_dof_u[_solution_tag];
432  residual.add_vector(&dof_values[0], _dof_indices);
433  }
434 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ add() [2/2]

template<>
void MooseVariableDataBase< RealEigenVector >::add ( NumericVector< Number > &  residual)
inherited

Definition at line 438 of file MooseVariableDataBase.C.

439 {
440  if (_has_dof_values)
441  {
442  const auto & dof_values = _vector_tags_dof_u[_solution_tag];
443  mooseAssert(_dof_indices.size() % _count == 0,
444  "Dof indices should be cleanly divisible by the variable count");
445  const auto n_shapes = _dof_indices.size() / _count;
446  for (const auto indx : index_range(_dof_indices))
447  {
448  const auto i = indx % n_shapes;
449  const auto j = indx / n_shapes;
450  residual.add(_dof_indices[indx], dof_values[i](j));
451  }
452  }
453 }
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
unsigned int _count
Number of components of the associated variable.
virtual void add(const numeric_index_type i, const Number value)=0
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
auto index_range(const T &sizable)

◆ adDofValues()

template<typename OutputType >
const MooseVariableData< OutputType >::ADDofValues & MooseVariableData< OutputType >::adDofValues ( ) const

Return the AD dof values.

Definition at line 772 of file MooseVariableData.h.

773 {
774  _need_ad = true;
775  return _ad_dof_values;
776 }
bool _need_ad
AD flags.
ADDofValues _ad_dof_values

◆ adDofValuesDot()

template<typename OutputType >
const MooseVariableData< OutputType >::ADDofValues & MooseVariableData< OutputType >::adDofValuesDot ( ) const

Return the AD time derivative values of degrees of freedom.

Definition at line 780 of file MooseVariableData.h.

781 {
782  _need_ad = _need_ad_u_dot = true;
783  if (!_time_integrator)
784  // See explanation in adUDot() body
785  _need_u_dot = true;
786  return _ad_dofs_dot;
787 }
ADDofValues _ad_dofs_dot
const TimeIntegrator * _time_integrator
Pointer to time integrator.
bool _need_ad
AD flags.

◆ addSolution()

template<typename OutputType >
void MooseVariableData< OutputType >::addSolution ( libMesh::NumericVector< libMesh::Number > &  sol,
const DenseVector< libMesh::Number > &  v 
) const

Add passed in local DOF values to a solution vector.

Definition at line 1075 of file MooseVariableData.C.

1077 {
1078  sol.add_vector(v, _dof_indices);
1079 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ adGradPhi()

template<typename OutputType >
const ADTemplateVariablePhiGradient< typename MooseVariableData< OutputType >::OutputShape > & MooseVariableData< OutputType >::adGradPhi ( ) const

ad_grad_phi getter

Definition at line 831 of file MooseVariableData.h.

832 {
834  mooseError("Unsupported element type: ", Moose::stringify(_element_type));
835  mooseAssert(_ad_grad_phi, "this should be non-null");
836  return *_ad_grad_phi;
837 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor, or Lower.
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi

◆ adGradPhiFace()

template<typename OutputType >
const ADTemplateVariablePhiGradient< typename MooseVariableData< OutputType >::OutputShape > & MooseVariableData< OutputType >::adGradPhiFace ( ) const

ad_grad_phi_face getter

Definition at line 841 of file MooseVariableData.h.

842 {
844  mooseError("Unsupported element type: ", Moose::stringify(_element_type));
845  mooseAssert(_ad_grad_phi_face, "this should be non-null");
846  return *_ad_grad_phi_face;
847 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor, or Lower.
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi_face

◆ adGradSln()

template<typename OutputType >
const ADTemplateVariableGradient<OutputType>& MooseVariableData< OutputType >::adGradSln ( ) const
inline

Definition at line 304 of file MooseVariableData.h.

305  {
306  _need_ad = _need_ad_grad_u = true;
307  return _ad_grad_u;
308  }
ADTemplateVariableGradient< OutputType > _ad_grad_u
bool _need_ad
AD flags.

◆ adGradSlnDot()

template<typename OutputType >
const ADTemplateVariableGradient<OutputType>& MooseVariableData< OutputType >::adGradSlnDot ( ) const
inline

Definition at line 310 of file MooseVariableData.h.

311  {
312  _need_ad = _need_ad_grad_u_dot = true;
313 
314  if (!_time_integrator)
315  // If we don't have a time integrator (this will be the case for variables that are a part of
316  // the AuxiliarySystem) then we have no way to calculate _ad_grad_u_dot and we are just going
317  // to copy the values from _grad_u_dot. Of course in order to be able to do that we need to
318  // calculate _grad_u_dot
319  _need_grad_dot = true;
320 
321  return _ad_grad_u_dot;
322  }
bool _need_grad_dot
gradient dot flags
ADTemplateVariableGradient< OutputType > _ad_grad_u_dot
const TimeIntegrator * _time_integrator
Pointer to time integrator.
bool _need_ad
AD flags.

◆ adNodalValue()

template<typename OutputType >
const Moose::ADType< OutputType >::type & MooseVariableData< OutputType >::adNodalValue ( ) const

Definition at line 791 of file MooseVariableData.h.

792 {
793  _need_ad = true;
794  return _ad_nodal_value;
795 }
bool _need_ad
AD flags.
Moose::ADType< OutputType >::type _ad_nodal_value
AD nodal value.

◆ adSecondSln()

template<typename OutputType >
const ADTemplateVariableSecond<OutputType>& MooseVariableData< OutputType >::adSecondSln ( ) const
inline

Definition at line 324 of file MooseVariableData.h.

325  {
326  _need_ad = _need_ad_second_u = true;
327  secondPhi();
328  secondPhiFace();
329  return _ad_second_u;
330  }
ADTemplateVariableSecond< OutputType > _ad_second_u
const FieldVariablePhiSecond & secondPhiFace() const
second_phi_face getter
bool _need_ad
AD flags.
const FieldVariablePhiSecond & secondPhi() const
second_phi getter

◆ adSln()

template<typename OutputType >
const ADTemplateVariableValue<OutputType>& MooseVariableData< OutputType >::adSln ( ) const
inline

Definition at line 298 of file MooseVariableData.h.

299  {
300  _need_ad = _need_ad_u = true;
301  return _ad_u;
302  }
ADTemplateVariableValue< OutputType > _ad_u
AD u.
bool _need_ad
AD flags.

◆ adUDot()

template<typename OutputType >
const ADTemplateVariableValue< OutputType > & MooseVariableData< OutputType >::adUDot ( ) const

Definition at line 799 of file MooseVariableData.h.

800 {
801  _need_ad = _need_ad_u_dot = true;
802 
803  if (!_time_integrator)
804  // If we don't have a time integrator (this will be the case for variables that are a part of
805  // the AuxiliarySystem) then we have no way to calculate _ad_u_dot and we are just going to
806  // copy the values from _u_dot. Of course in order to be able to do that we need to calculate
807  // _u_dot
808  _need_u_dot = true;
809 
810  return _ad_u_dot;
811 }
ADTemplateVariableValue< OutputType > _ad_u_dot
const TimeIntegrator * _time_integrator
Pointer to time integrator.
bool _need_ad
AD flags.

◆ adUDotDot()

template<typename OutputType >
const ADTemplateVariableValue< OutputType > & MooseVariableData< OutputType >::adUDotDot ( ) const

Definition at line 815 of file MooseVariableData.h.

816 {
817  _need_ad = _need_ad_u_dotdot = true;
818 
819  if (!_time_integrator)
820  // If we don't have a time integrator (this will be the case for variables that are a part
821  // of the AuxiliarySystem) then we have no way to calculate _ad_u_dotdot and we are just
822  // going to copy the values from _u_dotdot. Of course in order to be able to do that we need
823  // to calculate _u_dotdot
824  _need_u_dotdot = true;
825 
826  return _ad_u_dotdot;
827 }
const TimeIntegrator * _time_integrator
Pointer to time integrator.
bool _need_ad
AD flags.
ADTemplateVariableValue< OutputType > _ad_u_dotdot

◆ arrayGradPhi()

template<typename OutputType >
const MappedArrayVariablePhiGradient& MooseVariableData< OutputType >::arrayGradPhi ( ) const
inline

mapped_grad_phi getter

Definition at line 156 of file MooseVariableData.h.

157  {
158  mooseAssert(var().fieldType() == Moose::VarFieldType::VAR_FIELD_ARRAY, "Not an array variable");
159  return _mapped_grad_phi;
160  }
MappedArrayVariablePhiGradient _mapped_grad_phi
virtual const MooseVariableField< OutputType > & var() const

◆ arrayGradPhiFace()

template<typename OutputType >
const MappedArrayVariablePhiGradient& MooseVariableData< OutputType >::arrayGradPhiFace ( ) const
inline

mapped_grad_phi_face getter

Definition at line 170 of file MooseVariableData.h.

171  {
172  mooseAssert(var().fieldType() == Moose::VarFieldType::VAR_FIELD_ARRAY, "Not an array variable");
173  return _mapped_grad_phi_face;
174  }
MappedArrayVariablePhiGradient _mapped_grad_phi_face
virtual const MooseVariableField< OutputType > & var() const

◆ assignADNodalValue() [1/2]

template<typename OutputType >
void MooseVariableData< OutputType >::assignADNodalValue ( )
private

Helper method for assigning nodal values from their corresponding solution values (dof values as they're referred to here in this class).

This method is only truly meaningful for nodal basis families

Definition at line 1357 of file MooseVariableData.C.

1358 {
1359  mooseAssert(_ad_dof_values.size(), "The AD dof values container must have size greater than 0");
1361 }
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:259
Moose::ADType< OutputType >::type _ad_nodal_value
AD nodal value.
ADDofValues _ad_dof_values

◆ assignADNodalValue() [2/2]

template<>
void MooseVariableData< RealVectorValue >::assignADNodalValue ( )
private

Definition at line 1365 of file MooseVariableData.C.

1366 {
1367  const auto num_dofs = _dof_indices.size();
1368  mooseAssert(_ad_dof_values.size() == num_dofs,
1369  "Our dof values container size should match the dof indices container size");
1370  for (const auto i : make_range(num_dofs))
1372 }
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:259
Moose::ADType< OutputType >::type _ad_nodal_value
AD nodal value.
ADDofValues _ad_dof_values
IntRange< T > make_range(T beg, T end)
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ assignNodalValue() [1/3]

template<typename OutputType >
void MooseVariableDataBase< OutputType >::assignNodalValue ( )
protectedinherited

Definition at line 723 of file MooseVariableDataBase.C.

724 {
725  bool is_transient = _subproblem.isTransient();
727 
728  auto & dof_values = _vector_tags_dof_u[_solution_tag];
729  _nodal_value = dof_values[0];
731 
732  if (is_transient)
733  {
734  if (oldestSolutionStateRequested() >= 1)
735  {
738  }
739  if (oldestSolutionStateRequested() >= 2)
740  {
743  }
752  }
755 }
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
OutputType _nodal_value
Nodal values.
DofValues _dof_values_dotdot
second time derivative of the solution values
MooseArray< OutputType > _nodal_value_array
Nodal values as MooseArrays for use with AuxKernels.
virtual bool isTransient() const =0
libmesh_assert(ctx)
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
std::vector< DofValues > _vector_tags_dof_u
OutputType _nodal_value_dotdot
nodal values of u_dotdot
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
OutputType _nodal_value_dot_old
nodal values of u_dot_old
DofValues _dof_values_dot
time derivative of the solution values
MooseArray< OutputType > _nodal_value_old_array
OutputType _nodal_value_dotdot_old
nodal values of u_dotdot_old
TagID _old_solution_tag
The vector tag ID corresponding to the old solution vector.
const TagID INVALID_TAG_ID
Definition: MooseTypes.C:23
OutputType _nodal_value_dot
nodal values of u_dot
TagID _previous_nl_solution_tag
The vector tag ID corresponding to the previous nonlinear iteration&#39;s solution vector.
bool _need_dof_values_dot
local solution flags
MooseArray< OutputType > _nodal_value_older_array
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
unsigned int oldestSolutionStateRequested() const
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).

◆ assignNodalValue() [2/3]

template<>
void MooseVariableDataBase< RealVectorValue >::assignNodalValue ( )
protectedinherited

◆ assignNodalValue() [3/3]

template<>
void MooseVariableDataBase< RealVectorValue >::assignNodalValue ( )
protectedinherited

Definition at line 759 of file MooseVariableDataBase.C.

760 {
761  bool is_transient = _subproblem.isTransient();
762 
763  auto n = _dof_indices.size();
764  libmesh_assert(n);
765 
766  auto & dof_values = _vector_tags_dof_u[_solution_tag];
767  for (decltype(n) i = 0; i < n; ++i)
768  _nodal_value(i) = dof_values[i];
770 
771  if (is_transient)
772  {
773  if (oldestSolutionStateRequested() >= 1)
774  {
775  auto & dof_values_old = _vector_tags_dof_u[_old_solution_tag];
776  for (decltype(n) i = 0; i < n; ++i)
777  _nodal_value_old(i) = dof_values_old[i];
779  }
780  if (oldestSolutionStateRequested() >= 2)
781  {
782  auto & dof_values_older = _vector_tags_dof_u[_older_solution_tag];
783  for (decltype(n) i = 0; i < n; ++i)
784  _nodal_value_older(i) = dof_values_older[i];
786  }
788  for (decltype(n) i = 0; i < n; ++i)
791  for (decltype(n) i = 0; i < n; ++i)
794  for (decltype(n) i = 0; i < n; ++i)
797  for (decltype(n) i = 0; i < n; ++i)
799  }
801  {
802  auto & dof_values_previous_nl = _vector_tags_dof_u[_previous_nl_solution_tag];
803  for (decltype(n) i = 0; i < n; ++i)
804  _nodal_value_previous_nl(i) = dof_values_previous_nl[i];
805  }
806 }
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
OutputType _nodal_value
Nodal values.
DofValues _dof_values_dotdot
second time derivative of the solution values
MooseArray< OutputType > _nodal_value_array
Nodal values as MooseArrays for use with AuxKernels.
virtual bool isTransient() const =0
libmesh_assert(ctx)
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
std::vector< DofValues > _vector_tags_dof_u
OutputType _nodal_value_dotdot
nodal values of u_dotdot
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
OutputType _nodal_value_dot_old
nodal values of u_dot_old
DofValues _dof_values_dot
time derivative of the solution values
MooseArray< OutputType > _nodal_value_old_array
OutputType _nodal_value_dotdot_old
nodal values of u_dotdot_old
TagID _old_solution_tag
The vector tag ID corresponding to the old solution vector.
const TagID INVALID_TAG_ID
Definition: MooseTypes.C:23
OutputType _nodal_value_dot
nodal values of u_dot
TagID _previous_nl_solution_tag
The vector tag ID corresponding to the previous nonlinear iteration&#39;s solution vector.
bool _need_dof_values_dot
local solution flags
MooseArray< OutputType > _nodal_value_older_array
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
unsigned int oldestSolutionStateRequested() const
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).

◆ clearDofIndices()

template<typename OutputType >
void MooseVariableData< OutputType >::clearDofIndices ( )
inline

Definition at line 400 of file MooseVariableData.h.

400 { _dof_indices.clear(); }
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ computeAD()

template<typename OutputType >
template<bool constant_monomial>
void MooseVariableData< OutputType >::computeAD ( const unsigned int  num_dofs,
const unsigned int  nqp 
)

compute AD things

Definition at line 790 of file MooseVariableData.C.

791 {
793  const auto n_test = num_dofs / _count;
794 
795  // Values
796  if (_need_ad_u)
797  fill<constant_monomial>(_ad_u, *_current_phi, _ad_dof_values, nqp, n_test);
798  // Grad
799  if (_need_ad_grad_u)
800  {
801  // The latter check here is for handling the fact that we have not yet implemented
802  // calculation of ad_grad_phi for neighbor and neighbor-face, so if we are in that
803  // situation we need to default to using the non-ad grad_phi
805  fill<constant_monomial>(_ad_grad_u, *_current_ad_grad_phi, _ad_dof_values, nqp, n_test);
806  else
807  fill<constant_monomial>(_ad_grad_u, *_current_grad_phi, _ad_dof_values, nqp, n_test);
808  }
809  // Second
810  if constexpr (std::is_same_v<OutputType, Real>)
811  if (_need_ad_second_u)
812  fill<constant_monomial>(_ad_second_u, *_current_second_phi, _ad_dof_values, nqp, n_test);
813  // Curl
814  if (_need_ad_curl_u)
815  fill<constant_monomial>(_ad_curl_u, *_current_curl_phi, _ad_dof_values, nqp, n_test);
816 
817  const bool is_transient = _subproblem.isTransient();
818  if (is_transient)
819  {
820  if (_need_ad_u_dot)
821  {
822  if (_time_integrator)
823  fill<constant_monomial>(_ad_u_dot, *_current_phi, _ad_dofs_dot, nqp, n_test);
824  // We are too early in the setup to have a time integrator, so we are not really using the
825  // AD-derivatives. We set the AD value of the derivatives to the nonAD value
826  else
827  {
828  _ad_u_dot.resize(nqp);
829  for (const auto qp : make_range(nqp))
830  _ad_u_dot[qp] = _u_dot[qp];
831  }
832  }
833 
834  if (_need_ad_u_dotdot)
835  {
836  if (_time_integrator)
837  fill<constant_monomial>(_ad_u_dotdot, *_current_phi, _ad_dofs_dotdot, nqp, n_test);
838  else
839  {
840  _ad_u_dotdot.resize(nqp);
841  for (const auto qp : make_range(nqp))
842  _ad_u_dotdot[qp] = _u_dotdot[qp];
843  }
844  }
845 
847  {
848  if (_time_integrator)
849  {
850  // The latter check here is for handling the fact that we have not yet implemented
851  // calculation of ad_grad_phi for neighbor and neighbor-face, so if we are in that
852  // situation we need to default to using the non-ad grad_phi
854  fill<constant_monomial>(_ad_grad_u_dot, *_current_ad_grad_phi, _ad_dofs_dot, nqp, n_test);
855  else
856  fill<constant_monomial>(_ad_grad_u_dot, *_current_grad_phi, _ad_dofs_dot, nqp, n_test);
857  }
858  else
859  {
860  _ad_grad_u_dot.resize(nqp);
861  for (const auto qp : make_range(nqp))
862  _ad_grad_u_dot[qp] = _grad_u_dot[qp];
863  }
864  }
865  }
866 }
ADTemplateVariableValue< OutputType > _ad_u
AD u.
ADTemplateVariableSecond< OutputType > _ad_second_u
const FieldVariablePhiGradient * _current_grad_phi
ADTemplateVariableGradient< OutputType > _ad_grad_u
const FieldVariablePhiCurl * _current_curl_phi
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
ADTemplateVariableGradient< OutputType > _ad_grad_u_dot
FieldVariableValue _u_dot
u_dot (time derivative)
ADTemplateVariableValue< OutputType > _ad_u_dot
ADDofValues _ad_dofs_dot
virtual bool isTransient() const =0
const TimeIntegrator * _time_integrator
Pointer to time integrator.
ADDofValues _ad_dofs_dotdot
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
FieldVariableGradient _grad_u_dot
grad_u dots
void fetchADDofValues()
Helper method for assigning the ad_dof* arrays.
ADDofValues _ad_dof_values
IntRange< T > make_range(T beg, T end)
const bool _displaced
Whether this variable is being calculated on a displaced system.
const FieldVariablePhiSecond * _current_second_phi
unsigned int _count
Number of components of the associated variable.
const FieldVariablePhiValue * _current_phi
const ADTemplateVariablePhiGradient< OutputShape > * _current_ad_grad_phi
ADTemplateVariableValue< OutputType > _ad_u_dotdot
ADTemplateVariableCurl< OutputType > _ad_curl_u

◆ computeConstantMonomialValues()

template<typename OutputType >
void MooseVariableData< OutputType >::computeConstantMonomialValues ( )

compute the values for const monomial variables

Definition at line 691 of file MooseVariableData.C.

692 {
693  if (_dof_indices.size() == 0)
694  return;
695 
696  // Monomial optimizations are not appropriate after p-refinement
697  if (_elem->p_level())
698  computeValues();
699  else
700  computeValuesInternal</* constant_monomial = */ true>();
701 }
void computeValues()
compute the variable values
unsigned int p_level() const
void computeValuesInternal()
Internal method for computeValues() and computeConstantMonomialValues()
const Elem *const & _elem
The current elem.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ computeIncrementAtNode() [1/2]

template<typename OutputType >
void MooseVariableData< OutputType >::computeIncrementAtNode ( const libMesh::NumericVector< libMesh::Number > &  increment_vec)

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

Definition at line 1209 of file MooseVariableData.C.

1210 {
1211  if (!isNodal())
1212  mooseError("computeIncrementAtNode can only be called for nodal variables");
1213 
1214  _increment.resize(1);
1215 
1216  // Compute the increment for the current DOF
1217  _increment[0] = increment_vec(_dof_indices[0]);
1218 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableValue _increment
Increment in the variable used in dampers.
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
bool isNodal() const override

◆ computeIncrementAtNode() [2/2]

template<>
void MooseVariableData< RealEigenVector >::computeIncrementAtNode ( const NumericVector< Number > &  increment_vec)

Definition at line 1222 of file MooseVariableData.C.

1224 {
1225  if (!isNodal())
1226  mooseError("computeIncrementAtNode can only be called for nodal variables");
1227 
1228  _increment.resize(1);
1229 
1230  // Compute the increment for the current DOF
1231  if (isNodal())
1232  for (unsigned int j = 0; j < _count; j++)
1233  _increment[0](j) = increment_vec(_dof_indices[0] + j);
1234  else
1235  {
1236  unsigned int n = 0;
1237  const auto n_dof_indices = _dof_indices.size();
1238  for (const auto j : make_range(_count))
1239  {
1240  _increment[0](j) = increment_vec(_dof_indices[0] + n);
1241  n += n_dof_indices;
1242  }
1243  }
1244 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableValue _increment
Increment in the variable used in dampers.
IntRange< T > make_range(T beg, T end)
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _count
Number of components of the associated variable.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
bool isNodal() const override

◆ computeIncrementAtQps() [1/2]

template<typename OutputType >
void MooseVariableData< OutputType >::computeIncrementAtQps ( const libMesh::NumericVector< libMesh::Number > &  increment_vec)

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

Definition at line 1158 of file MooseVariableData.C.

1159 {
1160  unsigned int nqp = _qrule->n_points();
1161 
1162  _increment.resize(nqp);
1163  // Compute the increment at each quadrature point
1164  unsigned int num_dofs = _dof_indices.size();
1165  for (const auto qp : make_range(nqp))
1166  {
1167  _increment[qp] = 0.;
1168  for (const auto i : make_range(num_dofs))
1169  _increment[qp] += (*_phi)[i][qp] * increment_vec(_dof_indices[i]);
1170  }
1171 }
unsigned int n_points() const
const QBase *const & _qrule
The current qrule.
FieldVariableValue _increment
Increment in the variable used in dampers.
IntRange< T > make_range(T beg, T end)
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ computeIncrementAtQps() [2/2]

template<>
void MooseVariableData< RealEigenVector >::computeIncrementAtQps ( const NumericVector< Number > &  increment_vec)

Definition at line 1175 of file MooseVariableData.C.

1177 {
1178  unsigned int nqp = _qrule->n_points();
1179 
1180  _increment.resize(nqp);
1181  // Compute the increment at each quadrature point
1182  unsigned int num_dofs = _dof_indices.size();
1183  if (isNodal())
1184  {
1185  for (const auto qp : make_range(nqp))
1186  {
1187  for (const auto i : make_range(num_dofs))
1188  for (const auto j : make_range(_count))
1189  _increment[qp](j) += (*_phi)[i][qp] * increment_vec(_dof_indices[i] + j);
1190  }
1191  }
1192  else
1193  {
1194  for (const auto qp : make_range(nqp))
1195  {
1196  unsigned int n = 0;
1197  for (const auto j : make_range(_count))
1198  for (const auto i : make_range(num_dofs))
1199  {
1200  _increment[qp](j) += (*_phi)[i][qp] * increment_vec(_dof_indices[i] + n);
1201  n += num_dofs;
1202  }
1203  }
1204  }
1205 }
unsigned int n_points() const
const QBase *const & _qrule
The current qrule.
FieldVariableValue _increment
Increment in the variable used in dampers.
IntRange< T > make_range(T beg, T end)
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _count
Number of components of the associated variable.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
bool isNodal() const override
const FieldVariablePhiValue * _phi

◆ computeNodalValues()

template<typename OutputType >
void MooseVariableData< OutputType >::computeNodalValues ( )

compute nodal things

Definition at line 1338 of file MooseVariableData.C.

1339 {
1340  if (_has_dof_indices)
1341  {
1342  fetchDofValues();
1343  assignNodalValue();
1344 
1345  if (_need_ad)
1346  {
1347  fetchADDofValues();
1349  }
1350  }
1351  else
1353 }
void assignADNodalValue()
Helper method for assigning nodal values from their corresponding solution values (dof values as they...
bool _need_ad
AD flags.
void fetchADDofValues()
Helper method for assigning the ad_dof* arrays.
void fetchDofValues()
Helper methods for assigning dof values from their corresponding solution values. ...

◆ computeValues()

template<typename OutputType >
void MooseVariableData< OutputType >::computeValues ( )

compute the variable values

Definition at line 684 of file MooseVariableData.C.

685 {
686  computeValuesInternal</* constant_monomial = */ false>();
687 }
void computeValuesInternal()
Internal method for computeValues() and computeConstantMonomialValues()

◆ computeValuesInternal()

template<typename OutputType >
template<bool constant_monomial>
void MooseVariableData< OutputType >::computeValuesInternal ( )
private

Internal method for computeValues() and computeConstantMonomialValues()

Monomial is a template parameter so that we get compile time optimization for constant monomial vs non-constant monomial

Definition at line 530 of file MooseVariableData.C.

531 {
532  const auto num_dofs = _dof_indices.size();
533  const auto num_shapes = num_dofs / _count;
534 
535  if (num_dofs > 0)
536  fetchDofValues();
537 
538  const bool is_transient = _subproblem.isTransient();
539  const auto nqp = _current_qrule->n_points();
540  const auto & active_coupleable_matrix_tags =
542 
543  // Map grad_phi using Eigen so that we can perform array operations easier
544  if constexpr (std::is_same_v<OutputType, RealEigenVector>)
545  {
546  if (_qrule == _current_qrule)
547  {
548  _mapped_grad_phi.resize(num_shapes);
549  for (const auto i : make_range(num_shapes))
550  {
551  _mapped_grad_phi[i].resize(nqp, Eigen::Map<RealDIMValue>(nullptr));
552  for (const auto qp : make_range(nqp))
553  // Note: this does NOT do any allocation. It is "reconstructing" the object in place
554  new (&_mapped_grad_phi[i][qp])
555  Eigen::Map<RealDIMValue>(const_cast<Real *>(&(*_current_grad_phi)[i][qp](0)));
556  }
557  }
558  else
559  {
560  _mapped_grad_phi_face.resize(num_shapes);
561  for (const auto i : make_range(num_shapes))
562  {
563  _mapped_grad_phi_face[i].resize(nqp, Eigen::Map<RealDIMValue>(nullptr));
564  for (const auto qp : make_range(nqp))
565  // Note: this does NOT do any allocation. It is "reconstructing" the object in place
566  new (&_mapped_grad_phi_face[i][qp])
567  Eigen::Map<RealDIMValue>(const_cast<Real *>(&(*_current_grad_phi)[i][qp](0)));
568  }
569  }
570  }
571 
572  mooseAssert(
575  "We're requiring a second calculation but have not set a second shape function!");
576  mooseAssert(!(_need_curl || _need_curl_old) || _current_curl_phi,
577  "We're requiring a curl calculation but have not set a curl shape function!");
578  mooseAssert(!(_need_div || _need_div_old) || _current_div_phi,
579  "We're requiring a divergence calculation but have not set a div shape function!");
580 
581  // Curl
582  if (_need_curl)
583  fill<constant_monomial>(
585  if (is_transient && _need_curl_old)
586  fill<constant_monomial>(
588 
589  // Div
590  if (_need_div)
591  fill<constant_monomial>(
593  if (is_transient && _need_div_old)
594  fill<constant_monomial>(
596 
597  // Second
598  if (_need_second)
599  fill<constant_monomial>(
602  fill<constant_monomial>(_second_u_previous_nl,
605  nqp,
606  num_shapes);
607 
608  // Vector tags
609  for (auto tag : _required_vector_tags)
610  {
611  if (_need_vector_tag_u[tag] && _sys.hasVector(tag))
612  {
613  mooseAssert(_sys.getVector(tag).closed(), "Vector should be closed");
614  fill<constant_monomial>(
615  _vector_tag_u[tag], *_current_phi, _vector_tags_dof_u[tag], nqp, num_shapes);
616  }
617  if (_need_vector_tag_grad[tag] && _sys.hasVector(tag))
618  {
619  mooseAssert(_sys.getVector(tag).closed(), "Vector should be closed");
620  fill<constant_monomial>(
621  _vector_tag_grad[tag], *_current_grad_phi, _vector_tags_dof_u[tag], nqp, num_shapes);
622  }
623  }
624 
625  // Matrix tags
626  for (auto tag : active_coupleable_matrix_tags)
627  if (_need_matrix_tag_u[tag])
628  fill<constant_monomial>(
629  _matrix_tag_u[tag], *_current_phi, _matrix_tags_dof_u[tag], nqp, num_shapes);
630 
631  // Derivatives and old values
632  if (is_transient)
633  {
634  if (_need_second_old)
635  fill<constant_monomial>(_second_u_old,
638  nqp,
639  num_shapes);
640  if (_need_second_older)
641  fill<constant_monomial>(_second_u_older,
644  nqp,
645  num_shapes);
646  if (_need_u_dot)
647  fill<constant_monomial>(_u_dot, *_current_phi, _dof_values_dot, nqp, num_shapes);
648  if (_need_u_dotdot)
649  fill<constant_monomial>(_u_dotdot, *_current_phi, _dof_values_dotdot, nqp, num_shapes);
650  if (_need_u_dot_old)
651  fill<constant_monomial>(_u_dot_old, *_current_phi, _dof_values_dot_old, nqp, num_shapes);
652  if (_need_u_dotdot_old)
653  fill<constant_monomial>(
655 
656  if (_need_du_dot_du)
657  {
658  _du_dot_du.resize(nqp);
659  for (const auto i : make_range(num_shapes))
660  for (const auto qp : make_range(nqp))
661  _du_dot_du[qp] = _dof_du_dot_du[i];
662  }
663  if (_need_du_dotdot_du)
664  {
665  _du_dotdot_du.resize(nqp);
666  for (const auto i : make_range(num_shapes))
667  for (const auto qp : make_range(nqp))
669  }
670 
671  if (_need_grad_dot)
672  fill<constant_monomial>(_grad_u_dot, *_current_grad_phi, _dof_values_dot, nqp, num_shapes);
673  if (_need_grad_dotdot)
674  fill<constant_monomial>(
676  }
677 
678  if (_need_ad)
679  computeAD<constant_monomial>(num_dofs, nqp);
680 }
FieldVariableCurl _curl_u_old
bool _need_grad_dot
gradient dot flags
std::vector< DofValues > _matrix_tags_dof_u
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
MappedArrayVariablePhiGradient _mapped_grad_phi
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:391
std::vector< FieldVariableValue > _matrix_tag_u
FieldVariableSecond _second_u_older
FieldVariableSecond _second_u_previous_nl
std::vector< bool > _need_vector_tag_u
bool _need_second
SolutionState second_u flags.
const FieldVariablePhiGradient * _current_grad_phi
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
MappedArrayVariablePhiGradient _mapped_grad_phi_face
const FieldVariablePhiCurl * _current_curl_phi
const FieldVariablePhiDivergence * _current_div_phi
const QBase * _current_qrule
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
FieldVariableValue _u_dot_old
u_dot_old (time derivative)
std::vector< bool > _need_vector_tag_grad
FieldVariableDivergence _div_u_old
MooseArray< libMesh::Number > _dof_du_dot_du
derivatives of the solution value time derivative with respect to the degrees of freedom ...
VariableValue _du_dot_du
derivative of u_dot wrt u
MooseArray< libMesh::Number > _dof_du_dotdot_du
derivatives of the solution value second time derivative with respect to the degrees of freedom ...
FieldVariableValue _u_dot
u_dot (time derivative)
FieldVariableSecond _second_u
second_u
DofValues _dof_values_dotdot
second time derivative of the solution values
bool _need_curl
curl flags
virtual bool isTransient() const =0
FieldVariableGradient _grad_u_dotdot
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
bool _need_div
divergence flags
unsigned int n_points() const
const QBase *const & _qrule
The current qrule.
std::vector< DofValues > _vector_tags_dof_u
FieldVariableDivergence _div_u
divergence_u
bool _need_ad
AD flags.
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
DofValues _dof_values_dot
time derivative of the solution values
virtual bool closed() const
std::vector< bool > _need_matrix_tag_u
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
FieldVariableGradient _grad_u_dot
grad_u dots
TagID _old_solution_tag
The vector tag ID corresponding to the old solution vector.
void fetchDofValues()
Helper methods for assigning dof values from their corresponding solution values. ...
FieldVariableValue _u_dotdot_old
u_dotdot_old (second time derivative)
FieldVariableSecond _second_u_old
std::vector< FieldVariableGradient > _vector_tag_grad
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
IntRange< T > make_range(T beg, T end)
const FieldVariablePhiSecond * _current_second_phi
unsigned int _count
Number of components of the associated variable.
TagID _previous_nl_solution_tag
The vector tag ID corresponding to the previous nonlinear iteration&#39;s solution vector.
const THREAD_ID _tid
The thread ID that this object is on.
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative
std::vector< FieldVariableValue > _vector_tag_u
VariableValue _du_dotdot_du
derivative of u_dotdot wrt u
const FieldVariablePhiValue * _current_phi
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:933
FieldVariableCurl _curl_u
curl_u

◆ computingCurl()

template<typename OutputType >
bool MooseVariableData< OutputType >::computingCurl ( ) const
inline

Whether or not this variable is computing the curl.

Definition at line 237 of file MooseVariableData.h.

237 { return _need_curl || _need_curl_old; }
bool _need_curl
curl flags

◆ computingDiv()

template<typename OutputType >
bool MooseVariableData< OutputType >::computingDiv ( ) const
inline

Whether or not this variable is computing the divergence.

Definition at line 242 of file MooseVariableData.h.

242 { return _need_div || _need_div_old; }
bool _need_div
divergence flags

◆ curlPhi()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariablePhiCurl & MooseVariableData< OutputType >::curlPhi ( ) const

curl_phi getter

Definition at line 378 of file MooseVariableData.C.

Referenced by MooseVariableData< OutputType >::adCurlSln().

379 {
381  return *_curl_phi;
382 }
const Assembly & _assembly
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_assembly_method
const FieldVariablePhiCurl * _curl_phi
const libMesh::FEType & _fe_type

◆ curlPhiFace()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariablePhiCurl & MooseVariableData< OutputType >::curlPhiFace ( ) const

curl_phi_face getter

Definition at line 386 of file MooseVariableData.C.

Referenced by MooseVariableData< OutputType >::adCurlSln().

387 {
389  return *_curl_phi_face;
390 }
const Assembly & _assembly
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_face_assembly_method
const FieldVariablePhiCurl * _curl_phi_face
const libMesh::FEType & _fe_type

◆ curlSln()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableCurl & MooseVariableData< OutputType >::curlSln ( Moose::SolutionState  state) const

Local solution curl getter.

Parameters
stateThe state of the simulation: current, old, older

Definition at line 300 of file MooseVariableData.C.

301 {
302  curlPhi();
303  curlPhiFace();
304  switch (state)
305  {
306  case Moose::Current:
307  {
308  _need_curl = true;
309  return _curl_u;
310  }
311 
312  case Moose::Old:
313  {
314  _need_curl_old = true;
315  return _curl_u_old;
316  }
317 
318  case Moose::Older:
319  {
320  _need_curl_older = true;
321  return _curl_u_older;
322  }
323 
324  default:
325  mooseError("We don't currently support curl from the previous non-linear iteration");
326  }
327 }
FieldVariableCurl _curl_u_old
const FieldVariablePhiCurl & curlPhi() const
curl_phi getter
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _need_curl
curl flags
const FieldVariablePhiCurl & curlPhiFace() const
curl_phi_face getter
FieldVariableCurl _curl_u_older
FieldVariableCurl _curl_u
curl_u

◆ currentElem()

template<typename OutputType >
const Elem* const& MooseVariableData< OutputType >::currentElem ( ) const
inline

The current element.

Definition at line 256 of file MooseVariableData.h.

256 { return _elem; }
const Elem *const & _elem
The current elem.

◆ currentSide()

template<typename OutputType >
const unsigned int& MooseVariableData< OutputType >::currentSide ( ) const
inline

The current side.

Definition at line 261 of file MooseVariableData.h.

261 { return _current_side; }
const unsigned int & _current_side
The current element side.

◆ divPhi()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariablePhiDivergence & MooseVariableData< OutputType >::divPhi ( ) const

divergence_phi getter

Definition at line 394 of file MooseVariableData.C.

395 {
397  return *_div_phi;
398 }
const Assembly & _assembly
const FieldVariablePhiDivergence * _div_phi
const libMesh::FEType & _fe_type
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_assembly_method

◆ divPhiFace()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariablePhiDivergence & MooseVariableData< OutputType >::divPhiFace ( ) const

divergence_phi_face getter

Definition at line 402 of file MooseVariableData.C.

403 {
405  return *_div_phi_face;
406 }
const Assembly & _assembly
const FieldVariablePhiDivergence * _div_phi_face
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_face_assembly_method
const libMesh::FEType & _fe_type

◆ divSln()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableDivergence & MooseVariableData< OutputType >::divSln ( Moose::SolutionState  state) const

Local solution divergence getter.

Parameters
stateThe state of the simulation: current, old, older

Definition at line 331 of file MooseVariableData.C.

332 {
333  divPhi();
334  divPhiFace();
335  switch (state)
336  {
337  case Moose::Current:
338  {
339  _need_div = true;
340  return _div_u;
341  }
342 
343  case Moose::Old:
344  {
345  _need_div_old = true;
346  return _div_u_old;
347  }
348 
349  case Moose::Older:
350  {
351  _need_div_older = true;
352  return _div_u_older;
353  }
354 
355  default:
356  mooseError("We don't currently support divergence from the previous non-linear iteration");
357  }
358 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableDivergence _div_u_old
FieldVariableDivergence _div_u_older
const FieldVariablePhiDivergence & divPhi() const
divergence_phi getter
bool _need_div
divergence flags
FieldVariableDivergence _div_u
divergence_u
const FieldVariablePhiDivergence & divPhiFace() const
divergence_phi_face getter

◆ dofIndices()

template<typename OutputType >
const std::vector<dof_id_type>& MooseVariableData< OutputType >::dofIndices ( ) const
inline

Definition at line 398 of file MooseVariableData.h.

398 { return _dof_indices; }
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ dofValues()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::dofValues ( ) const
inherited

Definition at line 338 of file MooseVariableDataBase.C.

339 {
341 }
const DofValues & vectorTagDofValue(TagID tag) const

◆ dofValuesDot()

template<typename OutputType >
const MooseVariableData< OutputType >::DofValues & MooseVariableData< OutputType >::dofValuesDot ( ) const

Definition at line 1083 of file MooseVariableData.C.

1084 {
1085  if (_sys.solutionUDot())
1086  {
1087  _need_dof_values_dot = true;
1088  return _dof_values_dot;
1089  }
1090  else
1091  mooseError("MooseVariableData: Time derivative of solution (`u_dot`) is not stored. Please set "
1092  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
1093 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
DofValues _dof_values_dot
time derivative of the solution values
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
bool _need_dof_values_dot
local solution flags

◆ dofValuesDotDot()

template<typename OutputType >
const MooseVariableData< OutputType >::DofValues & MooseVariableData< OutputType >::dofValuesDotDot ( ) const

Definition at line 1097 of file MooseVariableData.C.

1098 {
1099  if (_sys.solutionUDotDot())
1100  {
1101  _need_dof_values_dotdot = true;
1102  return _dof_values_dotdot;
1103  }
1104  else
1105  mooseError("MooseVariableData: Second time derivative of solution (`u_dotdot`) is not stored. "
1106  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
1107  "`u_dotdot`.");
1108 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
DofValues _dof_values_dotdot
second time derivative of the solution values
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262

◆ dofValuesDotDotOld()

template<typename OutputType >
const MooseVariableData< OutputType >::DofValues & MooseVariableData< OutputType >::dofValuesDotDotOld ( ) const

Definition at line 1127 of file MooseVariableData.C.

1128 {
1129  if (_sys.solutionUDotDotOld())
1130  {
1132  return _dof_values_dotdot_old;
1133  }
1134  else
1135  mooseError("MooseVariableData: Old second time derivative of solution (`u_dotdot_old`) is not "
1136  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
1137  "requesting `u_dotdot_old`.");
1138 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ dofValuesDotOld()

template<typename OutputType >
const MooseVariableData< OutputType >::DofValues & MooseVariableData< OutputType >::dofValuesDotOld ( ) const

Definition at line 1112 of file MooseVariableData.C.

1113 {
1114  if (_sys.solutionUDotOld())
1115  {
1116  _need_dof_values_dot_old = true;
1117  return _dof_values_dot_old;
1118  }
1119  else
1120  mooseError("MooseVariableData: Old time derivative of solution (`u_dot_old`) is not stored. "
1121  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
1122  "`u_dot_old`.");
1123 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative

◆ dofValuesDuDotDotDu()

template<typename OutputType >
const MooseArray< Number > & MooseVariableData< OutputType >::dofValuesDuDotDotDu ( ) const

Definition at line 1150 of file MooseVariableData.C.

1151 {
1152  _need_dof_du_dotdot_du = true;
1153  return _dof_du_dotdot_du;
1154 }
MooseArray< libMesh::Number > _dof_du_dotdot_du
derivatives of the solution value second time derivative with respect to the degrees of freedom ...

◆ dofValuesDuDotDu()

template<typename OutputType >
const MooseArray< Number > & MooseVariableData< OutputType >::dofValuesDuDotDu ( ) const

Definition at line 1142 of file MooseVariableData.C.

1143 {
1144  _need_dof_du_dot_du = true;
1145  return _dof_du_dot_du;
1146 }
MooseArray< libMesh::Number > _dof_du_dot_du
derivatives of the solution value time derivative with respect to the degrees of freedom ...

◆ dofValuesOld()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::dofValuesOld ( ) const
inherited

Definition at line 345 of file MooseVariableDataBase.C.

346 {
348 }
const DofValues & vectorTagDofValue(TagID tag) const

◆ dofValuesOlder()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::dofValuesOlder ( ) const
inherited

Definition at line 352 of file MooseVariableDataBase.C.

353 {
355 }
const DofValues & vectorTagDofValue(TagID tag) const

◆ dofValuesPreviousNL()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::dofValuesPreviousNL ( ) const
inherited

Definition at line 359 of file MooseVariableDataBase.C.

360 {
362 }
const DofValues & vectorTagDofValue(TagID tag) const

◆ duDotDotDu()

template<typename OutputType >
const VariableValue& MooseVariableData< OutputType >::duDotDotDu ( ) const
inline

Definition at line 350 of file MooseVariableData.h.

351  {
352  _need_du_dotdot_du = true;
353  return _du_dotdot_du;
354  }
VariableValue _du_dotdot_du
derivative of u_dotdot wrt u

◆ duDotDu()

template<typename OutputType >
const VariableValue& MooseVariableData< OutputType >::duDotDu ( ) const
inline

Definition at line 344 of file MooseVariableData.h.

345  {
346  _need_du_dot_du = true;
347  return _du_dot_du;
348  }
VariableValue _du_dot_du
derivative of u_dot wrt u

◆ fetchADDofValues() [1/2]

template<typename OutputType >
void MooseVariableData< OutputType >::fetchADDofValues ( )
private

Helper method for assigning the ad_dof* arrays.

Definition at line 705 of file MooseVariableData.C.

706 {
707  const auto num_dofs = _dof_indices.size();
708 
709  const bool do_derivatives = Moose::doDerivatives(_subproblem, _sys);
710 
711  _ad_dof_values.resize(num_dofs);
712  for (const auto i : make_range(num_dofs))
714  // NOTE! You have to do this AFTER setting the value!
715  if (do_derivatives)
716  for (const auto i : make_range(num_dofs))
717  Moose::derivInsert(_ad_dof_values[i].derivatives(), _dof_indices[i], 1.);
718 
719  const bool is_transient = _subproblem.isTransient();
720  if (is_transient && _need_ad_u_dot)
721  {
722  _ad_dofs_dot.resize(num_dofs);
723  if (_need_ad_u_dotdot)
724  _ad_dofs_dotdot.resize(num_dofs);
725 
726  if (_time_integrator)
727  {
728  if (_time_integrator->dt())
729  {
730  for (const auto i : make_range(num_dofs))
732  for (const auto i : make_range(num_dofs))
734  _dof_indices[i],
736  : _ad_real_dummy);
737  }
738  else
739  // Executing something with a time derivative at initial should not put a NaN
740  for (const auto i : make_range(num_dofs))
741  {
742  _ad_dofs_dot[i] = 0.;
743  if (_need_ad_u_dotdot)
744  _ad_dofs_dotdot[i] = 0;
745  }
746  }
747  // We are too early in the setup to have a time integrator, so we are not really using the
748  // AD-derivatives. We set the AD value of the derivatives to the nonAD value
749  else
750  for (const auto i : make_range(num_dofs))
751  {
753  if (_need_ad_u_dotdot)
755  }
756  }
757 }
ADReal _ad_real_dummy
A dummy ADReal variable.
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
Definition: ADUtils.C:83
DofValues _dof_values_dotdot
second time derivative of the solution values
ADDofValues _ad_dofs_dot
virtual void computeADTimeDerivatives(ADReal &ad_u_dot, const dof_id_type &dof, ADReal &ad_u_dot_dot) const =0
method for computing local automatic differentiation time derivatives
const Real & dt() const
Returns the time step size.
virtual bool isTransient() const =0
const TimeIntegrator * _time_integrator
Pointer to time integrator.
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
ADDofValues _ad_dofs_dotdot
DofValues _dof_values_dot
time derivative of the solution values
ADDofValues _ad_dof_values
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
IntRange< T > make_range(T beg, T end)
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Definition: ADReal.h:21
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ fetchADDofValues() [2/2]

template<>
void MooseVariableData< RealEigenVector >::fetchADDofValues ( )
private

Definition at line 761 of file MooseVariableData.C.

762 {
763  const auto num_dofs = _dof_indices.size();
764 
765  const bool do_derivatives = Moose::doDerivatives(_subproblem, _sys);
766  const auto n_test = num_dofs / _count;
767  mooseAssert(num_dofs == _count * n_test,
768  "Our assertions around number of dofs, test functions, and count are incorrect");
769 
770  _ad_dof_values.resize(n_test);
771  // Test is outer, count is inner
772  for (const auto i : make_range(n_test))
773  {
775  for (const auto j : make_range(_count))
776  {
777  auto & dual_number = _ad_dof_values[i](j);
778  const auto global_dof_index = _dof_indices[j * n_test + i];
779  dual_number = (*_sys.currentSolution())(global_dof_index);
780  // NOTE! You have to do this AFTER setting the value!
781  if (do_derivatives)
782  Moose::derivInsert(dual_number.derivatives(), global_dof_index, 1.);
783  }
784  }
785 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
Definition: ADUtils.C:83
ADDofValues _ad_dof_values
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
IntRange< T > make_range(T beg, T end)
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _count
Number of components of the associated variable.
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Definition: ADReal.h:21
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ fetchDofValues() [1/3]

template<typename OutputType >
void MooseVariableDataBase< OutputType >::fetchDofValues ( )
protectedinherited

Helper methods for assigning dof values from their corresponding solution values.

Definition at line 520 of file MooseVariableDataBase.C.

521 {
522  bool is_transient = _subproblem.isTransient();
523 
524  auto n = _dof_indices.size();
525  libmesh_assert(n);
526 
527  if (is_transient)
528  {
530  {
534  }
536  {
540  }
542  {
546  }
548  {
552  }
553  }
554 
555  for (auto tag : _required_vector_tags)
560  {
561  // tag is defined on problem but may not be used by a system
562  // the grain tracker requires being able to read from solution vectors that we are also in
563  // the process of writing :-/
564  // Note: the extra vector tags are also still not closed when a TagVectorAux uses them
565  if (_sys.hasVector(tag) /* && _sys.getVector(tag).closed()*/)
566  {
567  auto & vec = _sys.getVector(tag);
568  _vector_tags_dof_u[tag].resize(n);
569  vec.get(_dof_indices, &_vector_tags_dof_u[tag][0]);
570  }
571  }
572 
574  {
575  auto & active_coupleable_matrix_tags =
577 
578  for (auto tag : active_coupleable_matrix_tags)
579  {
580  _matrix_tags_dof_u[tag].resize(n);
582  if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag))
583  {
584  mooseAssert(_sys.getMatrix(tag).closed(),
585  "Matrix with tag '" + std::to_string(tag) + "' should be closed");
586  auto & mat = _sys.getMatrix(tag);
587  for (unsigned i = 0; i < n; i++)
588  _matrix_tags_dof_u[tag][i] = mat(_dof_indices[i], _dof_indices[i]);
589  }
590  }
591  }
592 
594  {
596  for (decltype(n) i = 0; i < n; ++i)
597  _dof_du_dot_du[i] = _sys.duDotDu(_var.number());
598  }
600  {
602  for (decltype(n) i = 0; i < n; ++i)
604  }
605 }
bool _need_grad_dot
gradient dot flags
std::vector< DofValues > _matrix_tags_dof_u
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:391
virtual void get(const std::vector< numeric_index_type > &index, Number *values) const
virtual bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
Definition: SubProblem.h:734
std::vector< bool > _need_vector_tag_u
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:360
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
std::vector< bool > _need_vector_tag_grad
std::vector< bool > _need_vector_tag_dof_u
MooseArray< libMesh::Number > _dof_du_dot_du
derivatives of the solution value time derivative with respect to the degrees of freedom ...
MooseArray< libMesh::Number > _dof_du_dotdot_du
derivatives of the solution value second time derivative with respect to the degrees of freedom ...
virtual Number & duDotDotDu()
Definition: SystemBase.h:257
virtual const Number & duDotDu(unsigned int var_num=0) const
Definition: SystemBase.C:1701
DofValues _dof_values_dotdot
second time derivative of the solution values
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C:232
libmesh_assert(ctx)
virtual bool matrixTagActive(TagID tag) const
If or not a matrix tag is active.
Definition: SystemBase.C:1149
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
std::vector< DofValues > _vector_tags_dof_u
virtual bool closed() const=0
DofValues _dof_values_dot
time derivative of the solution values
std::vector< bool > _need_matrix_tag_u
std::vector< bool > _need_matrix_tag_dof_u
virtual libMesh::SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:1024
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
bool _need_dof_values_dot
local solution flags
const THREAD_ID _tid
The thread ID that this object is on.
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:933
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ fetchDofValues() [2/3]

template<>
void MooseVariableDataBase< RealEigenVector >::fetchDofValues ( )
protectedinherited

◆ fetchDofValues() [3/3]

template<>
void MooseVariableDataBase< RealEigenVector >::fetchDofValues ( )
protectedinherited

Definition at line 624 of file MooseVariableDataBase.C.

625 {
626  bool is_transient = _subproblem.isTransient();
627 
628  auto n = _dof_indices.size() / _count;
629  libmesh_assert(n);
630 
631  if (is_transient)
632  {
634  {
637  }
639  {
642  }
644  {
647  }
649  {
652  }
653  }
654 
655  for (auto tag : _required_vector_tags)
659  // tag is defined on problem but may not be used by a system
660  if (_sys.hasVector(tag))
661  {
662  mooseAssert(_sys.getVector(tag).closed(),
663  "Vector with tag '" + std::to_string(tag) + "' should be closed");
665  }
666 
668  {
669  auto & active_coupleable_matrix_tags =
671  for (auto tag : active_coupleable_matrix_tags)
672  {
673  _matrix_tags_dof_u[tag].resize(n);
675  if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag))
676  {
677  mooseAssert(_sys.getMatrix(tag).closed(),
678  "Matrix with tag '" + std::to_string(tag) + "' should be closed");
679  auto & mat = _sys.getMatrix(tag);
680  for (unsigned i = 0; i < n; i++)
681  for (unsigned j = 0; j < _count; j++)
682  _matrix_tags_dof_u[tag][i](j) = mat(_dof_indices[i] + j, _dof_indices[i] + j);
683  }
684  }
685  }
686 
688  {
690  for (decltype(n) i = 0; i < n; ++i)
691  _dof_du_dot_du[i] = _sys.duDotDu(_var.number());
692  }
694  {
696  for (decltype(n) i = 0; i < n; ++i)
698  }
699 }
bool _need_grad_dot
gradient dot flags
std::vector< DofValues > _matrix_tags_dof_u
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:391
virtual bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
Definition: SubProblem.h:734
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
void getArrayDofValues(const libMesh::NumericVector< libMesh::Number > &sol, unsigned int n, MooseArray< RealEigenVector > &dof_values) const
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:360
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
MooseArray< libMesh::Number > _dof_du_dot_du
derivatives of the solution value time derivative with respect to the degrees of freedom ...
MooseArray< libMesh::Number > _dof_du_dotdot_du
derivatives of the solution value second time derivative with respect to the degrees of freedom ...
virtual Number & duDotDotDu()
Definition: SystemBase.h:257
virtual const Number & duDotDu(unsigned int var_num=0) const
Definition: SystemBase.C:1701
DofValues _dof_values_dotdot
second time derivative of the solution values
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C:232
libmesh_assert(ctx)
virtual bool matrixTagActive(TagID tag) const
If or not a matrix tag is active.
Definition: SystemBase.C:1149
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
std::vector< DofValues > _vector_tags_dof_u
virtual bool closed() const=0
DofValues _dof_values_dot
time derivative of the solution values
virtual bool closed() const
std::vector< bool > _need_matrix_tag_u
std::vector< bool > _need_matrix_tag_dof_u
virtual libMesh::SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:1024
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _count
Number of components of the associated variable.
bool _need_dof_values_dot
local solution flags
const THREAD_ID _tid
The thread ID that this object is on.
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:933
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ fill()

template<typename OutputType >
template<bool constant_monomial, typename DestinationType , typename ShapeType , typename DofValuesType >
void MooseVariableData< OutputType >::fill ( DestinationType &  dest,
const ShapeType phi,
const DofValuesType &  dof_values,
unsigned int  nqp,
std::size_t  num_shapes 
)
private

Definition at line 414 of file MooseVariableData.C.

419 {
420  if constexpr (constant_monomial)
421  libmesh_ignore(num_shapes);
422 
423  // Deduce OutputType
424  constexpr bool is_real = std::is_same_v<OutputType, Real>;
425  constexpr bool is_real_vector = std::is_same_v<OutputType, RealVectorValue>;
426  constexpr bool is_eigen = std::is_same_v<OutputType, RealEigenVector>;
427  static_assert(is_real || is_real_vector || is_eigen, "Unsupported type");
428 
429  // this is only used in the RealEigenVector case to get this->_count
430  if constexpr (!is_eigen)
431  libmesh_ignore(this);
432 
433  // Deduce type of value within dest MooseArray
434  using dest_array_type = typename std::remove_reference_t<decltype(dest)>::value_type;
435  constexpr bool is_value =
436  std::is_same_v<dest_array_type, OutputType> ||
437  std::is_same_v<dest_array_type, typename Moose::ADType<OutputType>::type>;
438  constexpr bool is_gradient =
439  std::is_same_v<dest_array_type, OutputGradient> ||
440  std::is_same_v<dest_array_type, typename Moose::ADType<OutputGradient>::type>;
441  constexpr bool is_second =
442  std::is_same_v<dest_array_type, OutputSecond> ||
443  std::is_same_v<dest_array_type, typename Moose::ADType<OutputSecond>::type>;
444  constexpr bool is_divergence =
445  std::is_same_v<dest_array_type, OutputDivergence> ||
446  std::is_same_v<dest_array_type, typename Moose::ADType<OutputDivergence>::type>;
447  static_assert(is_value || is_gradient || is_second || is_divergence,
448  "Unsupported destination array type");
449 
450  // Sets a value to zero at a quadrature point
451  const auto set_zero = [this, &dest](const auto qp)
452  {
453  if constexpr (!is_eigen)
454  libmesh_ignore(this);
455 
456  if constexpr (is_real || is_real_vector)
457  dest[qp] = 0;
458  else if constexpr (is_eigen)
459  {
460  if constexpr (is_value)
461  dest[qp].setZero(this->_count);
462  else if constexpr (is_gradient)
463  dest[qp].setZero(this->_count, LIBMESH_DIM);
464  else if constexpr (is_second)
465  dest[qp].setZero(this->_count, LIBMESH_DIM * LIBMESH_DIM);
466  else
467  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
468  }
469  else
470  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
471  };
472 
473  // Accumulates a value
474  const auto accumulate = [&dest, &phi, &dof_values](const auto i, const auto qp)
475  {
476  if constexpr (is_real || is_real_vector || (is_eigen && is_value))
477  {
478  if constexpr (is_value || is_divergence)
479  dest[qp] += phi[i][qp] * dof_values[i];
480  else if constexpr (is_gradient || is_second)
481  dest[qp].add_scaled(phi[i][qp], dof_values[i]);
482  else
483  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
484  }
485  else if constexpr (is_eigen)
486  {
487  if constexpr (is_gradient)
488  {
489  for (const auto d : make_range(Moose::dim))
490  dest[qp].col(d) += phi[i][qp](d) * dof_values[i];
491  }
492  else if constexpr (is_second)
493  {
494  for (unsigned int d = 0, d1 = 0; d1 < LIBMESH_DIM; ++d1)
495  for (const auto d2 : make_range(Moose::dim))
496  dest[qp].col(d++) += phi[i][qp](d1, d2) * dof_values[i];
497  }
498  else
499  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
500  }
501  else
502  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
503  };
504 
505  dest.resize(nqp);
506 
507  // Monomial case, accumulate dest[0] and set dest[>0] to dest[0]
508  if constexpr (constant_monomial)
509  {
510  mooseAssert(num_shapes == 1, "Should have only one shape function for a constant monomial");
511  set_zero(0);
512  accumulate(0, 0);
513  for (unsigned int qp = 1; qp < nqp; ++qp)
514  dest[qp] = dest[0];
515  }
516  // Non constant monomial case
517  else
518  {
519  for (const auto qp : make_range(nqp))
520  set_zero(qp);
521  for (const auto i : make_range(num_shapes))
522  for (const auto qp : make_range(nqp))
523  accumulate(i, qp);
524  }
525 }
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:162
void libmesh_ignore(const Args &...)
const FieldVariablePhiValue & phi() const
phi getter
IntRange< T > make_range(T beg, T end)
unsigned int _count
Number of components of the associated variable.

◆ getArrayDofValues()

template<typename OutputType>
void MooseVariableDataBase< OutputType >::getArrayDofValues ( const libMesh::NumericVector< libMesh::Number > &  sol,
unsigned int  n,
MooseArray< RealEigenVector > &  dof_values 
) const
protectedinherited

Definition at line 609 of file MooseVariableDataBase.C.

612 {
613  dof_values.resize(nshapes);
614  for (const auto i : make_range(nshapes))
615  {
616  dof_values[i].resize(_count);
617  for (const auto j : make_range(_count))
618  dof_values[i](j) = sol(_dof_indices[j * nshapes + i]);
619  }
620 }
IntRange< T > make_range(T beg, T end)
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _count
Number of components of the associated variable.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ getContinuity()

template<typename OutputType >
libMesh::FEContinuity MooseVariableData< OutputType >::getContinuity ( ) const
inlineoverridevirtual

Return the variable continuity.

Implements MooseVariableDataBase< OutputType >.

Definition at line 248 of file MooseVariableData.h.

248 { return _continuity; };
libMesh::FEContinuity _continuity
Continuity type of the variable.

◆ getDofIndices()

template<typename OutputType >
void MooseVariableData< OutputType >::getDofIndices ( const Elem elem,
std::vector< dof_id_type > &  dof_indices 
) const

Definition at line 1064 of file MooseVariableData.C.

1066 {
1067  if constexpr (std::is_same<OutputType, RealEigenVector>::value)
1068  _dof_map.array_dof_indices(elem, dof_indices, _var_num);
1069  else
1070  _dof_map.dof_indices(elem, dof_indices, _var_num);
1071 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
const unsigned int _var_num
void array_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const

◆ getElementalValue() [1/2]

template<typename OutputType >
MooseVariableData< OutputType >::DofValue MooseVariableData< OutputType >::getElementalValue ( const Elem elem,
Moose::SolutionState  state,
unsigned int  idx = 0 
) const

Definition at line 996 of file MooseVariableData.C.

999 {
1000  static thread_local std::vector<dof_id_type> dof_indices;
1001  _dof_map.dof_indices(elem, dof_indices, _var_num);
1002 
1003  switch (state)
1004  {
1005  case Moose::Current:
1006  return (*_sys.currentSolution())(dof_indices[idx]);
1007 
1008  case Moose::Old:
1009  return _sys.solutionOld()(dof_indices[idx]);
1010 
1011  case Moose::Older:
1012  return _sys.solutionOlder()(dof_indices[idx]);
1013 
1014  default:
1015  mooseError("PreviousNL not currently supported for getElementalValue");
1016  }
1017 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:198
const unsigned int _var_num
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:197
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)

◆ getElementalValue() [2/2]

template<>
RealEigenVector MooseVariableData< RealEigenVector >::getElementalValue ( const Elem elem,
const Moose::SolutionState  state,
const unsigned int  idx 
) const

Definition at line 1021 of file MooseVariableData.C.

1024 {
1026  "getElementalValue has a really bad API name. It is retrieving a value from the solution "
1027  "vector for a particular dof index. Generally speaking it has absolutely no equivalence to "
1028  "an 'elemental' value, which most people would consider to be something like an element "
1029  "average value");
1030 
1031  static thread_local std::vector<dof_id_type> dof_indices;
1032  _dof_map.array_dof_indices(elem, dof_indices, _var_num);
1033  mooseAssert(dof_indices.size() % _count == 0,
1034  "The number of array dof indices should divide cleanly by the variable count");
1035  const auto num_shapes = dof_indices.size() / _count;
1036 
1038 
1039  switch (state)
1040  {
1041  case Moose::Current:
1042  for (unsigned int i = 0; i < _count; ++i)
1043  v(i) = (*_sys.currentSolution())(dof_indices[i * num_shapes + idx]);
1044  break;
1045 
1046  case Moose::Old:
1047  for (unsigned int i = 0; i < _count; ++i)
1048  v(i) = _sys.solutionOld()(dof_indices[i * num_shapes + idx]);
1049  break;
1050 
1051  case Moose::Older:
1052  for (unsigned int i = 0; i < _count; ++i)
1053  v(i) = _sys.solutionOlder()(dof_indices[i * num_shapes + idx]);
1054  break;
1055 
1056  default:
1057  mooseError("PreviousNL not currently supported for getElementalValue");
1058  }
1059  return v;
1060 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:198
const unsigned int _var_num
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:374
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
unsigned int _count
Number of components of the associated variable.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:147
void array_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:197
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)

◆ getNodalValue() [1/2]

template<typename OutputType >
MooseVariableData< OutputType >::DofValue MooseVariableData< OutputType >::getNodalValue ( const Node node,
Moose::SolutionState  state 
) const

Definition at line 925 of file MooseVariableData.C.

926 {
927  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
928 
929  // Make sure that the node has DOFs
930  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
931  * produce a better error (see misc/check_error.node_value_off_block) */
932  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
933  "Node " << node.id() << " does not contain any dofs for the "
934  << _sys.system().variable_name(_var_num) << " variable");
935 
937 
938  switch (state)
939  {
940  case Moose::Current:
941  return (*_sys.currentSolution())(dof);
942 
943  case Moose::Old:
944  return _sys.solutionOld()(dof);
945 
946  case Moose::Older:
947  return _sys.solutionOlder()(dof);
948 
949  default:
950  mooseError("PreviousNL not currently supported for getNodalValue");
951  }
952 }
virtual MooseMesh & mesh()=0
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool isSemiLocal(Node *const node) const
Returns true if the node is semi-local.
Definition: MooseMesh.C:1019
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:198
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
const unsigned int _var_num
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
dof_id_type id() const
const std::string & variable_name(const unsigned int i) const
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1157
const Node *const & node() const
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:197
uint8_t dof_id_type

◆ getNodalValue() [2/2]

template<>
RealEigenVector MooseVariableData< RealEigenVector >::getNodalValue ( const Node node,
Moose::SolutionState  state 
) const

Definition at line 956 of file MooseVariableData.C.

958 {
959  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
960 
961  // Make sure that the node has DOFs
962  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
963  * produce a better error (see misc/check_error.node_value_off_block) */
964  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
965  "Node " << node.id() << " does not contain any dofs for the "
966  << _sys.system().variable_name(_var_num) << " variable");
967 
969 
971  switch (state)
972  {
973  case Moose::Current:
974  for (unsigned int i = 0; i < _count; ++i)
975  v(i) = (*_sys.currentSolution())(dof++);
976  break;
977 
978  case Moose::Old:
979  for (unsigned int i = 0; i < _count; ++i)
980  v(i) = _sys.solutionOld()(dof++);
981  break;
982 
983  case Moose::Older:
984  for (unsigned int i = 0; i < _count; ++i)
985  v(i) = _sys.solutionOlder()(dof++);
986  break;
987 
988  default:
989  mooseError("PreviousNL not currently supported for getNodalValue");
990  }
991  return v;
992 }
virtual MooseMesh & mesh()=0
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool isSemiLocal(Node *const node) const
Returns true if the node is semi-local.
Definition: MooseMesh.C:1019
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:198
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
const unsigned int _var_num
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
dof_id_type id() const
const std::string & variable_name(const unsigned int i) const
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1157
const Node *const & node() const
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
unsigned int _count
Number of components of the associated variable.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:147
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:197
uint8_t dof_id_type

◆ gradPhi()

template<typename OutputType >
const FieldVariablePhiGradient& MooseVariableData< OutputType >::gradPhi ( ) const
inline

grad_phi getter

Definition at line 151 of file MooseVariableData.h.

151 { return *_grad_phi; }
const FieldVariablePhiGradient * _grad_phi

◆ gradPhiFace()

template<typename OutputType >
const FieldVariablePhiGradient& MooseVariableData< OutputType >::gradPhiFace ( ) const
inline

grad_phi_face getter

Definition at line 165 of file MooseVariableData.h.

165 { return *_grad_phi_face; }
const FieldVariablePhiGradient * _grad_phi_face

◆ gradSln()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::FieldVariableGradient & MooseVariableDataBase< OutputType >::gradSln ( Moose::SolutionState  state) const
inherited

Local solution gradient getter.

Parameters
stateThe state of the simulation: current, old, older, previous nl

Definition at line 317 of file MooseVariableDataBase.C.

318 {
319  auto functor = [this](TagID tag_id) -> const FieldVariableGradient &
320  { return vectorTagGradient(tag_id); };
321 
322  return const_cast<MooseVariableDataBase<OutputType> *>(this)
323  ->stateToTagHelper<FieldVariableGradient>(state, functor);
324 }
unsigned int TagID
Definition: MooseTypes.h:238
const FieldVariableGradient & vectorTagGradient(TagID tag) const
MooseArray< OutputGradient > FieldVariableGradient

◆ gradSlnDot()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableGradient & MooseVariableData< OutputType >::gradSlnDot ( ) const

Local time derivative of solution gradient getter.

Definition at line 232 of file MooseVariableData.C.

233 {
234  if (_sys.solutionUDot())
235  {
236  _need_grad_dot = true;
237  return _grad_u_dot;
238  }
239  else
240  mooseError("MooseVariableFE: Time derivative of solution (`u_dot`) is not stored. Please set "
241  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
242 }
bool _need_grad_dot
gradient dot flags
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
FieldVariableGradient _grad_u_dot
grad_u dots
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ gradSlnDotDot()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableGradient & MooseVariableData< OutputType >::gradSlnDotDot ( ) const

Local second time derivative of solution gradient getter.

Definition at line 246 of file MooseVariableData.C.

247 {
248  if (_sys.solutionUDotDot())
249  {
250  _need_grad_dotdot = true;
251  return _grad_u_dotdot;
252  }
253  else
254  mooseError("MooseVariableFE: Second time derivative of solution (`u_dotdot`) is not stored. "
255  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
256  "`u_dotdot`.");
257 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableGradient _grad_u_dotdot
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262

◆ hasDoFsOnNodes()

template<typename OutputType >
bool MooseVariableData< OutputType >::hasDoFsOnNodes ( ) const
inlineoverridevirtual

Whether this data is associated with a variable that has DoFs on nodes.

Implements MooseVariableDataBase< OutputType >.

Definition at line 247 of file MooseVariableData.h.

247 { return _continuity != libMesh::DISCONTINUOUS; }
libMesh::FEContinuity _continuity
Continuity type of the variable.

◆ increment()

template<typename OutputType >
const FieldVariableValue& MooseVariableData< OutputType >::increment ( ) const
inline

Increment getter.

Returns
The increment

Definition at line 454 of file MooseVariableData.h.

454 { return _increment; }
FieldVariableValue _increment
Increment in the variable used in dampers.

◆ insert() [1/2]

template<typename OutputType>
void MooseVariableDataBase< OutputType >::insert ( libMesh::NumericVector< libMesh::Number > &  residual)
inherited

Set the current local DOF values to the input vector.

Definition at line 395 of file MooseVariableDataBase.C.

396 {
397  if (_has_dof_values)
398  {
399  const auto & dof_values = _vector_tags_dof_u[_solution_tag];
400  mooseAssert(dof_values.size() == _dof_indices.size(),
401  "Degree of freedom values size and degree of freedom indices sizes must match.");
402  residual.insert(&dof_values[0], _dof_indices);
403  }
404 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ insert() [2/2]

template<>
void MooseVariableDataBase< RealEigenVector >::insert ( NumericVector< Number > &  residual)
inherited

Definition at line 408 of file MooseVariableDataBase.C.

409 {
410  if (_has_dof_values)
411  {
412  const auto & dof_values = _vector_tags_dof_u[_solution_tag];
413  mooseAssert(_dof_indices.size() % _count == 0,
414  "Dof indices should be cleanly divisible by the variable count");
415  const auto n_shapes = _dof_indices.size() / _count;
416  for (const auto indx : index_range(_dof_indices))
417  {
418  const auto i = indx % n_shapes;
419  const auto j = indx / n_shapes;
420  residual.set(_dof_indices[indx], dof_values[i](j));
421  }
422  }
423 }
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
unsigned int _count
Number of components of the associated variable.
virtual void set(const numeric_index_type i, const Number value)=0
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
auto index_range(const T &sizable)

◆ insertNodalValue() [1/2]

template<typename OutputType >
void MooseVariableData< OutputType >::insertNodalValue ( libMesh::NumericVector< libMesh::Number > &  residual,
const DofValue v 
)

Write a nodal value to the passed-in solution vector.

Definition at line 908 of file MooseVariableData.C.

910 {
911  residual.set(_nodal_dof_index, v);
912 }
dof_id_type _nodal_dof_index
The dof index for the current node.
virtual void set(const numeric_index_type i, const T value)=0

◆ insertNodalValue() [2/2]

template<>
void MooseVariableData< RealEigenVector >::insertNodalValue ( NumericVector< Number > &  residual,
const RealEigenVector v 
)

Definition at line 916 of file MooseVariableData.C.

918 {
919  for (const auto j : make_range(_count))
920  residual.set(_nodal_dof_index + j, v(j));
921 }
dof_id_type _nodal_dof_index
The dof index for the current node.
IntRange< T > make_range(T beg, T end)
unsigned int _count
Number of components of the associated variable.
virtual void set(const numeric_index_type i, const T value)=0

◆ insertSolutionTag()

template<typename OutputType >
void MooseVariableDataBase< OutputType >::insertSolutionTag ( TagID  tag_id)
protectedinherited

insert a solution tag into our tag containers

Definition at line 330 of file MooseVariableDataBase.h.

Referenced by MooseVariableDataBase< OutputType >::MooseVariableDataBase().

331 {
332  _solution_tags.insert(tag_id);
333  _required_vector_tags.insert(tag_id);
334 }
std::set< TagID > _solution_tags
The set of solution tags we need to evaluate.
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.

◆ isNodal()

template<typename OutputType >
bool MooseVariableData< OutputType >::isNodal ( ) const
inlineoverridevirtual
Returns
Whether this data is associated with a nodal variable

Implements MooseVariableDataBase< OutputType >.

Definition at line 246 of file MooseVariableData.h.

246 { return _is_nodal; }
bool _is_nodal
if variable is nodal

◆ isNodalDefined()

template<typename OutputType >
bool MooseVariableData< OutputType >::isNodalDefined ( ) const
inline

Definition at line 251 of file MooseVariableData.h.

251 { return _has_dof_indices; }

◆ matrixTagValue()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::FieldVariableValue & MooseVariableDataBase< OutputType >::matrixTagValue ( TagID  tag) const
inherited

Definition at line 224 of file MooseVariableDataBase.C.

225 {
226  if (tag >= _matrix_tag_u.size())
227  {
228  _need_matrix_tag_u.resize(tag + 1, false);
229  const_cast<MooseVariableDataBase<OutputType> *>(this)->_matrix_tag_u.resize(tag + 1);
230  }
231 
232  _need_matrix_tag_u[tag] = true;
233 
234  if (_sys.hasMatrix(tag))
235  return _matrix_tag_u[tag];
236  else
237  mooseError("Tag ", tag, " is not associated with any matrix for variable ", _var.name());
238 }
std::vector< FieldVariableValue > _matrix_tag_u
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:360
std::vector< bool > _need_matrix_tag_u
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ needsAD()

template<typename OutputType >
bool MooseVariableData< OutputType >::needsAD ( ) const
inline

Returns whether this data structure needs automatic differentiation calculations.

Definition at line 105 of file MooseVariableData.h.

105 { return _need_ad; }
bool _need_ad
AD flags.

◆ needSolutionState()

template<typename OutputType >
void MooseVariableDataBase< OutputType >::needSolutionState ( unsigned int  state)
protectedinherited

Request that we have at least state number of older solution states/vectors.

Definition at line 249 of file MooseVariableDataBase.C.

250 {
251  if (state > _max_state)
252  {
253  _sys.needSolutionState(state);
254  _max_state = state;
255  }
256 }
virtual void needSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time, libMesh::ParallelType parallel_type=GHOSTED)
Registers that the solution state state is needed.
Definition: SystemBase.C:1450
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
unsigned int _max_state
The maximum number of older solution states our variable needs.

◆ nodalDofIndex()

template<typename OutputType >
const dof_id_type& MooseVariableData< OutputType >::nodalDofIndex ( ) const
inline

Definition at line 250 of file MooseVariableData.h.

250 { return _nodal_dof_index; }
dof_id_type _nodal_dof_index
The dof index for the current node.

◆ nodalMatrixTagValue()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::nodalMatrixTagValue ( TagID  tag) const
inherited

Definition at line 121 of file MooseVariableDataBase.C.

122 {
123  if (isNodal())
124  {
125  if (tag >= _matrix_tags_dof_u.size())
126  {
127  _need_matrix_tag_dof_u.resize(tag + 1, false);
128  const_cast<MooseVariableDataBase<OutputType> *>(this)->_matrix_tags_dof_u.resize(tag + 1);
129  }
130 
131  _need_matrix_tag_dof_u[tag] = true;
132 
133  if (_sys.hasMatrix(tag))
134  return _matrix_tags_dof_u[tag];
135  else
136  mooseError(
137  "Tag ", tag, " is not associated with any matrix for nodal variable ", _var.name());
138  }
139  else
140  mooseError("Nodal values can be requested only on nodal variables, variable '",
141  _var.name(),
142  "' is not nodal.");
143 }
std::vector< DofValues > _matrix_tags_dof_u
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:360
virtual bool isNodal() const =0
std::vector< bool > _need_matrix_tag_dof_u
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ nodalValue()

template<typename OutputType >
const OutputType & MooseVariableDataBase< OutputType >::nodalValue ( Moose::SolutionState  state) const
inherited

Definition at line 457 of file MooseVariableDataBase.C.

458 {
459  if (isNodal())
460  {
461  // Request the correct solution states and data members
462  vectorTagDofValue(state);
463  switch (state)
464  {
465  case Moose::Current:
466  return _nodal_value;
467 
468  case Moose::Old:
469  return _nodal_value_old;
470 
471  case Moose::Older:
472  return _nodal_value_older;
473 
474  case Moose::PreviousNL:
476 
477  default:
478  // We should never get here but gcc requires that we have a default. See
479  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
480  mooseError("Unknown SolutionState!");
481  }
482  }
483  else
484  mooseError("Nodal values can be requested only on nodal variables, variable '",
485  _var.name(),
486  "' is not nodal.");
487 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const DofValues & vectorTagDofValue(TagID tag) const
OutputType _nodal_value
Nodal values.
virtual bool isNodal() const =0
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ nodalValueArray()

template<typename OutputType >
const MooseArray< OutputType > & MooseVariableDataBase< OutputType >::nodalValueArray ( Moose::SolutionState  state) const
inherited

Definition at line 491 of file MooseVariableDataBase.C.

492 {
493  if (isNodal())
494  {
495  // Request the correct solution states and data members
496  vectorTagDofValue(state);
497  switch (state)
498  {
499  case Moose::Current:
500  return _nodal_value_array;
501 
502  case Moose::Old:
503  return _nodal_value_old_array;
504 
505  case Moose::Older:
507 
508  default:
509  mooseError("No current support for PreviousNL for nodal value array");
510  }
511  }
512  else
513  mooseError("Nodal values can be requested only on nodal variables, variable '",
514  _var.name(),
515  "' is not nodal.");
516 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const DofValues & vectorTagDofValue(TagID tag) const
MooseArray< OutputType > _nodal_value_array
Nodal values as MooseArrays for use with AuxKernels.
MooseArray< OutputType > _nodal_value_old_array
virtual bool isNodal() const =0
MooseArray< OutputType > _nodal_value_older_array
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ nodalValueDot()

template<typename OutputType >
const OutputType & MooseVariableData< OutputType >::nodalValueDot ( ) const

Definition at line 1248 of file MooseVariableData.C.

1249 {
1250  if (isNodal())
1251  {
1252  if (_sys.solutionUDot())
1253  {
1254  _need_dof_values_dot = true;
1255  return _nodal_value_dot;
1256  }
1257  else
1258  mooseError(
1259  "MooseVariableData: Time derivative of solution (`u_dot`) is not stored. Please set "
1260  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
1261  }
1262  else
1263  mooseError("Nodal values can be requested only on nodal variables, variable '",
1264  var().name(),
1265  "' is not nodal.");
1266 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
virtual const MooseVariableField< OutputType > & var() const
OutputType _nodal_value_dot
nodal values of u_dot
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
bool _need_dof_values_dot
local solution flags
bool isNodal() const override

◆ nodalValueDotDot()

template<typename OutputType >
const OutputType & MooseVariableData< OutputType >::nodalValueDotDot ( ) const

Definition at line 1270 of file MooseVariableData.C.

1271 {
1272  if (isNodal())
1273  {
1274  if (_sys.solutionUDotDot())
1275  {
1276  _need_dof_values_dotdot = true;
1277  return _nodal_value_dotdot;
1278  }
1279  else
1280  mooseError(
1281  "MooseVariableData: Second time derivative of solution (`u_dotdot`) is not stored. "
1282  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
1283  "`u_dotdot`.");
1284  }
1285  else
1286  mooseError("Nodal values can be requested only on nodal variables, variable '",
1287  var().name(),
1288  "' is not nodal.");
1289 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual const MooseVariableField< OutputType > & var() const
OutputType _nodal_value_dotdot
nodal values of u_dotdot
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262
bool isNodal() const override

◆ nodalValueDotDotOld()

template<typename OutputType >
const OutputType & MooseVariableData< OutputType >::nodalValueDotDotOld ( ) const

Definition at line 1315 of file MooseVariableData.C.

1316 {
1317  if (isNodal())
1318  {
1319  if (_sys.solutionUDotDotOld())
1320  {
1322  return _nodal_value_dotdot_old;
1323  }
1324  else
1325  mooseError(
1326  "MooseVariableData: Old second time derivative of solution (`u_dotdot_old`) is not "
1327  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
1328  "requesting `u_dotdot_old`.");
1329  }
1330  else
1331  mooseError("Nodal values can be requested only on nodal variables, variable '",
1332  var().name(),
1333  "' is not nodal.");
1334 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
virtual const MooseVariableField< OutputType > & var() const
OutputType _nodal_value_dotdot_old
nodal values of u_dotdot_old
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
bool isNodal() const override

◆ nodalValueDotOld()

template<typename OutputType >
const OutputType & MooseVariableData< OutputType >::nodalValueDotOld ( ) const

Definition at line 1293 of file MooseVariableData.C.

1294 {
1295  if (isNodal())
1296  {
1297  if (_sys.solutionUDotOld())
1298  {
1299  _need_dof_values_dot_old = true;
1300  return _nodal_value_dot_old;
1301  }
1302  else
1303  mooseError("MooseVariableData: Old time derivative of solution (`u_dot_old`) is not stored. "
1304  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
1305  "`u_dot_old`.");
1306  }
1307  else
1308  mooseError("Nodal values can be requested only on nodal variables, variable '",
1309  var().name(),
1310  "' is not nodal.");
1311 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual const MooseVariableField< OutputType > & var() const
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
OutputType _nodal_value_dot_old
nodal values of u_dot_old
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
bool isNodal() const override

◆ nodalValueDuDotDotDu()

template<typename OutputType >
const OutputType& MooseVariableData< OutputType >::nodalValueDuDotDotDu ( ) const

◆ nodalValueDuDotDu()

template<typename OutputType >
const OutputType& MooseVariableData< OutputType >::nodalValueDuDotDu ( ) const

◆ nodalVectorTagValue()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::nodalVectorTagValue ( TagID  tag) const
inherited

Definition at line 98 of file MooseVariableDataBase.C.

99 {
100  if (isNodal())
101  {
102  if (tag >= _need_vector_tag_dof_u.size())
103  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
104 
105  _need_vector_tag_dof_u[tag] = true;
106 
107  if (_sys.hasVector(tag))
108  return _vector_tags_dof_u[tag];
109  else
110  mooseError(
111  "Tag ", tag, " is not associated with any vector for nodal variable ", _var.name());
112  }
113  else
114  mooseError("Nodal values can be requested only on nodal variables, variable '",
115  _var.name(),
116  "' is not nodal.");
117 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
void resizeVectorTagData(TagID tag)
resize the vector tag need flags and data containers to accomodate this tag index ...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::vector< bool > _need_vector_tag_dof_u
std::vector< DofValues > _vector_tags_dof_u
virtual bool isNodal() const =0
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ node()

template<typename OutputType >
const Node* const& MooseVariableData< OutputType >::node ( ) const
inline

Definition at line 249 of file MooseVariableData.h.

249 { return _node; }
const Node *const & _node
The current node.

◆ numberOfDofs()

template<typename OutputType >
unsigned int MooseVariableData< OutputType >::numberOfDofs ( ) const
inline

Definition at line 399 of file MooseVariableData.h.

399 { return _dof_indices.size(); }
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ oldestSolutionStateRequested()

template<typename OutputType >
unsigned int MooseVariableDataBase< OutputType >::oldestSolutionStateRequested ( ) const
inherited

The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).

Definition at line 242 of file MooseVariableDataBase.C.

243 {
244  return _max_state;
245 }
unsigned int _max_state
The maximum number of older solution states our variable needs.

◆ phi()

template<typename OutputType >
const FieldVariablePhiValue& MooseVariableData< OutputType >::phi ( ) const
inline

phi getter

Definition at line 141 of file MooseVariableData.h.

141 { return *_phi; }
const FieldVariablePhiValue * _phi

◆ phiFace()

template<typename OutputType >
const FieldVariablePhiValue& MooseVariableData< OutputType >::phiFace ( ) const
inline

phi_face getter

Definition at line 146 of file MooseVariableData.h.

146 { return *_phi_face; }
const FieldVariablePhiValue * _phi_face

◆ phiFaceSize()

template<typename OutputType >
std::size_t MooseVariableData< OutputType >::phiFaceSize ( ) const
inline

Return phiFace size.

Definition at line 224 of file MooseVariableData.h.

224 { return _phi_face->size(); }
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:259
const FieldVariablePhiValue * _phi_face

◆ phiSize()

template<typename OutputType >
std::size_t MooseVariableData< OutputType >::phiSize ( ) const
inline

Return phi size.

Definition at line 219 of file MooseVariableData.h.

219 { return _phi->size(); }
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition: MooseArray.h:259
const FieldVariablePhiValue * _phi

◆ prepare()

template<typename OutputType >
void MooseVariableData< OutputType >::prepare ( )

Get the dof indices corresponding to the current element.

Definition at line 1394 of file MooseVariableData.C.

1395 {
1396  if constexpr (std::is_same<OutputType, RealEigenVector>::value)
1398  else
1400 
1401  _has_dof_values = false;
1402 
1403  // FIXME: remove this when the Richard's module is migrated to use the new NodalCoupleable
1404  // interface.
1405  _has_dof_indices = _dof_indices.size();
1406 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
const unsigned int _var_num
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
const Elem *const & _elem
The current elem.
void array_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ prepareAux()

template<typename OutputType>
void MooseVariableDataBase< OutputType >::prepareAux ( )
inlineinherited

Clear aux state.

Definition at line 142 of file MooseVariableDataBase.h.

142 { _has_dof_values = false; }
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...

◆ prepareIC()

template<typename OutputType >
void MooseVariableData< OutputType >::prepareIC ( )

prepare the initial condition

Definition at line 1376 of file MooseVariableData.C.

1377 {
1378  if constexpr (std::is_same<RealEigenVector, OutputType>::value)
1380  else
1382 
1383  mooseAssert(_dof_indices.size() % _count == 0,
1384  "The number of dof indices should divide cleanly by the variable count");
1385  const auto num_shapes = _dof_indices.size() / _count;
1386  _vector_tags_dof_u[_solution_tag].resize(num_shapes);
1387 
1388  unsigned int nqp = _qrule->n_points();
1389  _vector_tag_u[_solution_tag].resize(nqp);
1390 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
const unsigned int _var_num
unsigned int n_points() const
const QBase *const & _qrule
The current qrule.
std::vector< DofValues > _vector_tags_dof_u
const Elem *const & _elem
The current elem.
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
unsigned int _count
Number of components of the associated variable.
std::vector< FieldVariableValue > _vector_tag_u
void array_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ reinitAux()

template<typename OutputType >
void MooseVariableData< OutputType >::reinitAux ( )

Prepare dof indices and solution values for elemental auxiliary variables.

Definition at line 1431 of file MooseVariableData.C.

1432 {
1433  /* FIXME: this method is only for elemental auxiliary variables, so
1434  * we may want to rename it */
1435  if (_elem)
1436  {
1437  if constexpr (std::is_same<RealEigenVector, OutputType>::value)
1439  else
1441  if (_elem->n_dofs(_sys.number(), _var_num) > 0)
1442  {
1443  // FIXME: Setting _nodal_dof_index inside of a method that apparently is only for "elemental"
1444  // aux variables seems absolutely absurd
1446 
1447  fetchDofValues();
1448 
1449  mooseAssert(_dof_indices.size() % _count == 0,
1450  "The number of dof indices should be cleanly divisible by the variable count");
1451  const auto num_shapes = _dof_indices.size() / _count;
1452  for (auto & dof_u : _vector_tags_dof_u)
1453  dof_u.resize(num_shapes);
1454 
1455  for (auto & dof_u : _matrix_tags_dof_u)
1456  dof_u.resize(num_shapes);
1457 
1458  _has_dof_indices = true;
1459  }
1460  else
1461  _has_dof_indices = false;
1462  }
1463  else
1464  _has_dof_indices = false;
1465 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
std::vector< DofValues > _matrix_tags_dof_u
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
dof_id_type _nodal_dof_index
The dof index for the current node.
const unsigned int _var_num
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1157
std::vector< DofValues > _vector_tags_dof_u
const Elem *const & _elem
The current elem.
void fetchDofValues()
Helper methods for assigning dof values from their corresponding solution values. ...
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
unsigned int _count
Number of components of the associated variable.
void array_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ reinitNode()

template<typename OutputType >
void MooseVariableData< OutputType >::reinitNode ( )

Prepare degrees of freedom for the current node.

Definition at line 1410 of file MooseVariableData.C.

1411 {
1412  if constexpr (std::is_same<OutputType, RealEigenVector>::value)
1414  else
1416 
1417  const auto n_dofs = _dof_indices.size();
1418  if (n_dofs)
1419  {
1420  // For standard variables. _nodal_dof_index is retrieved by nodalDofIndex() which is used in
1421  // NodalBC for example
1423  _has_dof_indices = true;
1424  }
1425  else
1426  _has_dof_indices = false;
1427 }
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
const Node *const & _node
The current node.
dof_id_type _nodal_dof_index
The dof index for the current node.
const unsigned int _var_num
void array_dof_indices(const Elem *const elem, std::vector< dof_id_type > &di, const unsigned int vn, int p_level=-12345) const
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ reinitNodes()

template<typename OutputType >
void MooseVariableData< OutputType >::reinitNodes ( const std::vector< dof_id_type > &  nodes)

Set _dof_indices to the degrees of freedom existing on the passed-in nodes.

Parameters
nodesThe nodes to grab the degrees of freedom for

Definition at line 1469 of file MooseVariableData.C.

1470 {
1471  _dof_indices.clear();
1472  for (const auto & node_id : nodes)
1473  {
1474  auto && nd = _subproblem.mesh().getMesh().query_node_ptr(node_id);
1475  if (nd && (_subproblem.mesh().isSemiLocal(const_cast<Node *>(nd))))
1476  {
1477  if (nd->n_dofs(_sys.number(), _var_num) > 0)
1478  {
1479  dof_id_type dof = nd->dof_number(_sys.number(), _var_num, 0);
1480  _dof_indices.push_back(dof);
1481  }
1482  }
1483  }
1484 
1485  if (!_dof_indices.empty())
1486  _has_dof_indices = true;
1487  else
1488  _has_dof_indices = false;
1489 }
virtual MooseMesh & mesh()=0
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
bool isSemiLocal(Node *const node) const
Returns true if the node is semi-local.
Definition: MooseMesh.C:1019
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
const unsigned int _var_num
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3528
virtual const Node * query_node_ptr(const dof_id_type i) const=0
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1157
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
uint8_t dof_id_type

◆ resizeVectorTagData()

template<typename OutputType >
void MooseVariableDataBase< OutputType >::resizeVectorTagData ( TagID  tag)
protectedinherited

resize the vector tag need flags and data containers to accomodate this tag index

Definition at line 147 of file MooseVariableDataBase.C.

Referenced by MooseVariableDataBase< OutputType >::nodalVectorTagValue(), MooseVariableDataBase< OutputType >::vectorTagDofValue(), MooseVariableDataBase< OutputType >::vectorTagGradient(), and MooseVariableDataBase< OutputType >::vectorTagValue().

148 {
149  mooseAssert(_need_vector_tag_dof_u.size() == _need_vector_tag_u.size() &&
151  _need_vector_tag_dof_u.size() == _vector_tags_dof_u.size() &&
152  _need_vector_tag_dof_u.size() == _vector_tag_u.size() &&
153  _need_vector_tag_dof_u.size() == _vector_tag_grad.size(),
154  "These sizes should be in sync.");
155 
156  auto check_capacity = [tag](const auto & vector_to_check)
157  {
158  if (tag + 1 > vector_to_check.capacity())
159  mooseError("New size greater than tag capacity. This will cause reallocation which will "
160  "invalidate any stored references.");
161  };
162  check_capacity(_need_vector_tag_dof_u);
163  check_capacity(_need_vector_tag_u);
164  check_capacity(_need_vector_tag_grad);
165  check_capacity(_vector_tags_dof_u);
166  check_capacity(_vector_tag_u);
167  check_capacity(_vector_tag_grad);
168 
169  _need_vector_tag_dof_u.resize(tag + 1, false);
170  _need_vector_tag_u.resize(tag + 1, false);
171  _need_vector_tag_grad.resize(tag + 1, false);
172  _vector_tags_dof_u.resize(tag + 1);
173  _vector_tag_u.resize(tag + 1);
174  _vector_tag_grad.resize(tag + 1);
175 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::vector< bool > _need_vector_tag_u
std::vector< bool > _need_vector_tag_grad
std::vector< bool > _need_vector_tag_dof_u
std::vector< DofValues > _vector_tags_dof_u
std::vector< FieldVariableGradient > _vector_tag_grad
std::vector< FieldVariableValue > _vector_tag_u

◆ secondPhi()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariablePhiSecond & MooseVariableData< OutputType >::secondPhi ( ) const

second_phi getter

Definition at line 362 of file MooseVariableData.C.

Referenced by MooseVariableData< OutputType >::adSecondSln().

363 {
365  return *_second_phi;
366 }
const Assembly & _assembly
const FieldVariablePhiSecond * _second_phi
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_assembly_method
const libMesh::FEType & _fe_type

◆ secondPhiFace()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariablePhiSecond & MooseVariableData< OutputType >::secondPhiFace ( ) const

second_phi_face getter

Definition at line 370 of file MooseVariableData.C.

Referenced by MooseVariableData< OutputType >::adSecondSln().

371 {
373  return *_second_phi_face;
374 }
const Assembly & _assembly
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_face_assembly_method
const FieldVariablePhiSecond * _second_phi_face
const libMesh::FEType & _fe_type

◆ secondSln()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableSecond & MooseVariableData< OutputType >::secondSln ( Moose::SolutionState  state) const

Local solution second spatial derivative getter.

Parameters
stateThe state of the simulation: current, old, older, previous nl

Definition at line 261 of file MooseVariableData.C.

262 {
263  secondPhi();
264  secondPhiFace();
265  switch (state)
266  {
267  case Moose::Current:
268  {
269  _need_second = true;
270  return _second_u;
271  }
272 
273  case Moose::Old:
274  {
275  _need_second_old = true;
276  return _second_u_old;
277  }
278 
279  case Moose::Older:
280  {
281  _need_second_older = true;
282  return _second_u_older;
283  }
284 
285  case Moose::PreviousNL:
286  {
288  return _second_u_previous_nl;
289  }
290 
291  default:
292  // We should never get here but gcc requires that we have a default. See
293  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
294  mooseError("Unknown SolutionState!");
295  }
296 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableSecond _second_u_older
FieldVariableSecond _second_u_previous_nl
bool _need_second
SolutionState second_u flags.
FieldVariableSecond _second_u
second_u
const FieldVariablePhiSecond & secondPhiFace() const
second_phi_face getter
FieldVariableSecond _second_u_old
const FieldVariablePhiSecond & secondPhi() const
second_phi getter

◆ setActiveTags()

template<typename OutputType >
void MooseVariableDataBase< OutputType >::setActiveTags ( const std::set< TagID > &  vtags)
inherited

Set the active vector tags.

Parameters
vtagsAdditional vector tags that this variable will need to query at dof indices for, in addition to our own required solution tags

Definition at line 314 of file MooseVariableDataBase.h.

315 {
317  for (const auto tag : vtags)
318  _required_vector_tags.insert(tag);
319 
320  if (!_required_vector_tags.empty())
321  {
322  const auto largest_tag_id = *_required_vector_tags.rbegin();
323  if (largest_tag_id >= _need_vector_tag_dof_u.size())
324  resizeVectorTagData(largest_tag_id);
325  }
326 }
void resizeVectorTagData(TagID tag)
resize the vector tag need flags and data containers to accomodate this tag index ...
std::vector< bool > _need_vector_tag_dof_u
std::set< TagID > _solution_tags
The set of solution tags we need to evaluate.
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.

◆ setDofValue()

template<typename OutputType >
void MooseVariableData< OutputType >::setDofValue ( const DofValue value,
unsigned int  index 
)

dof value setters

Definition at line 870 of file MooseVariableData.C.

871 {
872  auto & dof_values = _vector_tags_dof_u[_solution_tag];
873  dof_values[index] = value;
874  _has_dof_values = true;
875 
876  auto & u = _vector_tag_u[_solution_tag];
877  const auto nqps = u.size();
878  const auto ndofs = dof_values.size();
879  for (const auto qp : make_range(nqps))
880  u[qp] *= 0.;
881  for (const auto qp : make_range(nqps))
882  for (const auto i : make_range(ndofs))
883  u[qp] += (*_phi)[i][qp] * dof_values[i];
884 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
IntRange< T > make_range(T beg, T end)
std::vector< FieldVariableValue > _vector_tag_u

◆ setDofValues()

template<typename OutputType >
void MooseVariableData< OutputType >::setDofValues ( const DenseVector< DofValue > &  values)

Set local DOF values and evaluate the values on quadrature points.

Definition at line 888 of file MooseVariableData.C.

889 {
890  auto & dof_values = _vector_tags_dof_u[_solution_tag];
891  for (unsigned int i = 0; i < values.size(); i++)
892  dof_values[i] = values(i);
893 
894  _has_dof_values = true;
895 
896  auto & u = _vector_tag_u[_solution_tag];
897  const auto nqps = u.size();
898  const auto ndofs = dof_values.size();
899  for (const auto qp : make_range(nqps))
900  u[qp] *= 0.;
901  for (const auto qp : make_range(nqps))
902  for (const auto i : make_range(ndofs))
903  u[qp] += (*_phi)[i][qp] * dof_values[i];
904 }
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
IntRange< T > make_range(T beg, T end)
virtual unsigned int size() const override final
std::vector< FieldVariableValue > _vector_tag_u

◆ setGeometry()

template<typename OutputType >
void MooseVariableData< OutputType >::setGeometry ( Moose::GeometryType  gm_type)

Set the geometry type before calculating variables values.

Parameters
gm_typeThe type type of geometry; either Volume or Face

Definition at line 142 of file MooseVariableData.C.

143 {
144  switch (gm_type)
145  {
146  case Moose::Volume:
147  {
149  _current_phi = _phi;
155  break;
156  }
157  case Moose::Face:
158  {
166  break;
167  }
168  }
169 }
const FieldVariablePhiDivergence * _div_phi_face
const FieldVariablePhiSecond * _second_phi
const FieldVariablePhiGradient * _current_grad_phi
const FieldVariablePhiDivergence * _div_phi
const FieldVariablePhiCurl * _current_curl_phi
const FieldVariablePhiDivergence * _current_div_phi
const FieldVariablePhiCurl * _curl_phi_face
const QBase * _current_qrule
const FieldVariablePhiCurl * _curl_phi
const FieldVariablePhiSecond * _second_phi_face
const QBase *const & _qrule_face
const QBase *const & _qrule
The current qrule.
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi
const FieldVariablePhiValue * _phi_face
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi_face
const FieldVariablePhiSecond * _current_second_phi
const FieldVariablePhiGradient * _grad_phi_face
const FieldVariablePhiValue * _current_phi
const ADTemplateVariablePhiGradient< OutputShape > * _current_ad_grad_phi
const FieldVariablePhiGradient * _grad_phi
const FieldVariablePhiValue * _phi

◆ setNodalValue() [1/2]

template<typename OutputType >
void MooseVariableDataBase< OutputType >::setNodalValue ( const OutputType &  value,
unsigned int  idx = 0 
)
inherited

Set nodal value.

Definition at line 366 of file MooseVariableDataBase.C.

367 {
368  auto & dof_values = _vector_tags_dof_u[_solution_tag];
369  mooseAssert(idx < dof_values.size(), "idx is out of the bounds of degree of freedom values");
370  dof_values[idx] = value; // update variable nodal value
371  _has_dof_values = true;
373 
374  // Update the qp values as well
375  auto & u = _vector_tag_u[_solution_tag];
376  for (unsigned int qp = 0; qp < u.size(); qp++)
377  u[qp] = value;
378 }
OutputType _nodal_value
Nodal values.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
std::vector< FieldVariableValue > _vector_tag_u
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)

◆ setNodalValue() [2/2]

template<>
void MooseVariableDataBase< RealVectorValue >::setNodalValue ( const RealVectorValue value,
unsigned int  idx 
)
inherited

Definition at line 382 of file MooseVariableDataBase.C.

384 {
385  auto & dof_values = _vector_tags_dof_u[_solution_tag];
386  for (decltype(idx) i = 0; i < dof_values.size(); ++i, ++idx)
387  dof_values[idx] = value(i);
388 
389  _has_dof_values = true;
391 }
OutputType _nodal_value
Nodal values.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)

◆ sizeMatrixTagData()

template<typename OutputType >
void MooseVariableDataBase< OutputType >::sizeMatrixTagData ( )
inherited

size matrix tag data

Definition at line 85 of file MooseVariableDataBase.C.

86 {
87  auto num_matrix_tags = _subproblem.numMatrixTags();
88 
89  _matrix_tags_dof_u.resize(num_matrix_tags);
90  _need_matrix_tag_dof_u.resize(num_matrix_tags, false);
91 
92  _need_matrix_tag_u.resize(num_matrix_tags, false);
93  _matrix_tag_u.resize(num_matrix_tags);
94 }
std::vector< DofValues > _matrix_tags_dof_u
std::vector< FieldVariableValue > _matrix_tag_u
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
std::vector< bool > _need_matrix_tag_u
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:248
std::vector< bool > _need_matrix_tag_dof_u

◆ sln()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::FieldVariableValue & MooseVariableDataBase< OutputType >::sln ( Moose::SolutionState  state) const
inherited

Local solution getter.

Parameters
stateThe state of the simulation: current, old, older, previous nl

Definition at line 306 of file MooseVariableDataBase.C.

Referenced by MooseVariableDataFV< OutputType >::sln().

307 {
308  auto functor = [this](TagID tag_id) -> const FieldVariableValue &
309  { return vectorTagValue(tag_id); };
310 
311  return const_cast<MooseVariableDataBase<OutputType> *>(this)
312  ->stateToTagHelper<FieldVariableValue>(state, functor);
313 }
unsigned int TagID
Definition: MooseTypes.h:238
MooseArray< OutputType > FieldVariableValue
const FieldVariableValue & vectorTagValue(TagID tag) const

◆ stateToTagHelper()

template<typename OutputType >
template<typename ReturnType , typename Functor >
const ReturnType & MooseVariableDataBase< OutputType >::stateToTagHelper ( Moose::SolutionState  state,
Functor  functor 
)
protectedinherited

Helper method that converts a SolutionState argument into a corresponding tag ID, potentially requesting necessary additional solution states and assigning tag id data members, and then calls the provided functor with the tag ID.

Definition at line 261 of file MooseVariableDataBase.C.

263 {
264  if (state > 0)
265  {
266  // We need to request all states that are between current and the requested state
267  stateToTagHelper<ReturnType>(Moose::SolutionState(static_cast<int>(state) - 1), functor);
268  needSolutionState(cast_int<unsigned int>(state));
269  }
270 
271  switch (state)
272  {
273  case Moose::Current:
275 
276  case Moose::Old:
277  {
280  return functor(_old_solution_tag);
281  }
282 
283  case Moose::Older:
284  {
287  return functor(_older_solution_tag);
288  }
289 
290  case Moose::PreviousNL:
291  {
294  return functor(_previous_nl_solution_tag);
295  }
296 
297  default:
298  // We should never get here but gcc requires that we have a default. See
299  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
300  mooseError("Unknown SolutionState!");
301  }
302 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const TagName OLDER_SOLUTION_TAG
Definition: MooseTypes.C:27
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
const TagName OLD_SOLUTION_TAG
Definition: MooseTypes.C:26
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
void insertSolutionTag(TagID tag_id)
insert a solution tag into our tag containers
TagID _old_solution_tag
The vector tag ID corresponding to the old solution vector.
SolutionState
Definition: MooseTypes.h:261
TagID _previous_nl_solution_tag
The vector tag ID corresponding to the previous nonlinear iteration&#39;s solution vector.
const TagName SOLUTION_TAG
Definition: MooseTypes.C:25
void needSolutionState(unsigned int state)
Request that we have at least state number of older solution states/vectors.
const TagName PREVIOUS_NL_SOLUTION_TAG
Definition: MooseTypes.C:28

◆ uDot()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableValue & MooseVariableData< OutputType >::uDot ( ) const

Definition at line 173 of file MooseVariableData.C.

174 {
175  if (_sys.solutionUDot())
176  {
177  _need_u_dot = true;
178  return _u_dot;
179  }
180  else
181  mooseError("MooseVariableFE: Time derivative of solution (`u_dot`) is not stored. Please set "
182  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
183 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableValue _u_dot
u_dot (time derivative)
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ uDotDot()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableValue & MooseVariableData< OutputType >::uDotDot ( ) const

Definition at line 187 of file MooseVariableData.C.

188 {
189  if (_sys.solutionUDotDot())
190  {
191  _need_u_dotdot = true;
192  return _u_dotdot;
193  }
194  else
195  mooseError("MooseVariableFE: Second time derivative of solution (`u_dotdot`) is not stored. "
196  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
197  "`u_dotdot`.");
198 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262

◆ uDotDotOld()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableValue & MooseVariableData< OutputType >::uDotDotOld ( ) const

Definition at line 217 of file MooseVariableData.C.

218 {
219  if (_sys.solutionUDotDotOld())
220  {
221  _need_u_dotdot_old = true;
222  return _u_dotdot_old;
223  }
224  else
225  mooseError("MooseVariableFE: Old second time derivative of solution (`u_dotdot_old`) is not "
226  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
227  "requesting `u_dotdot_old`");
228 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
FieldVariableValue _u_dotdot_old
u_dotdot_old (second time derivative)
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ uDotOld()

template<typename OutputType >
const MooseVariableData< OutputType >::FieldVariableValue & MooseVariableData< OutputType >::uDotOld ( ) const

Definition at line 202 of file MooseVariableData.C.

203 {
204  if (_sys.solutionUDotOld())
205  {
206  _need_u_dot_old = true;
207  return _u_dot_old;
208  }
209  else
210  mooseError("MooseVariableFE: Old time derivative of solution (`u_dot_old`) is not stored. "
211  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
212  "`u_dot_old`.");
213 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FieldVariableValue _u_dot_old
u_dot_old (time derivative)
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ usesSecondPhi()

template<typename OutputType >
bool MooseVariableData< OutputType >::usesSecondPhi ( ) const
inline

Whether or not this variable is computing any second derivatives.

Definition at line 229 of file MooseVariableData.h.

230  {
232  }
bool _need_second
SolutionState second_u flags.

◆ var()

template<typename OutputType>
virtual const MooseVariableField<OutputType>& MooseVariableDataBase< OutputType >::var ( ) const
inlineprotectedvirtualinherited
Returns
The variable to which the data in this class belongs to

Reimplemented in MooseVariableDataFV< OutputType >, and MooseVariableDataLinearFV< OutputType >.

Definition at line 153 of file MooseVariableDataBase.h.

Referenced by MooseVariableData< OutputType >::arrayGradPhi(), and MooseVariableData< OutputType >::arrayGradPhiFace().

153 { return _var; }
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ vectorTagDofValue() [1/2]

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::vectorTagDofValue ( TagID  tag) const
inherited

Definition at line 194 of file MooseVariableDataBase.C.

195 {
196  if (tag >= _need_vector_tag_dof_u.size())
197  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
198 
199  _need_vector_tag_dof_u[tag] = true;
200 
201  if (_sys.hasVector(tag))
202  return _vector_tags_dof_u[tag];
203  else
204  mooseError("Tag ", tag, " is not associated with any vector for variable ", _var.name());
205 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
void resizeVectorTagData(TagID tag)
resize the vector tag need flags and data containers to accomodate this tag index ...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::vector< bool > _need_vector_tag_dof_u
std::vector< DofValues > _vector_tags_dof_u
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ vectorTagDofValue() [2/2]

template<typename OutputType >
const MooseVariableDataBase< OutputType >::DofValues & MooseVariableDataBase< OutputType >::vectorTagDofValue ( Moose::SolutionState  state) const
inherited

Definition at line 328 of file MooseVariableDataBase.C.

329 {
330  auto functor = [this](TagID tag_id) -> const DofValues & { return vectorTagDofValue(tag_id); };
331 
332  return const_cast<MooseVariableDataBase<OutputType> *>(this)->stateToTagHelper<DofValues>(
333  state, functor);
334 }
MooseArray< DofValue > DofValues
unsigned int TagID
Definition: MooseTypes.h:238
const DofValues & vectorTagDofValue(TagID tag) const

◆ vectorTagGradient()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::FieldVariableGradient & MooseVariableDataBase< OutputType >::vectorTagGradient ( TagID  tag) const
inherited

Definition at line 209 of file MooseVariableDataBase.C.

210 {
211  if (tag >= _need_vector_tag_grad.size())
212  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
213 
214  _need_vector_tag_grad[tag] = true;
215 
216  if (_sys.hasVector(tag))
217  return _vector_tag_grad[tag];
218  else
219  mooseError("Tag ", tag, " is not associated with any vector for variable ", _var.name());
220 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
void resizeVectorTagData(TagID tag)
resize the vector tag need flags and data containers to accomodate this tag index ...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::vector< bool > _need_vector_tag_grad
std::vector< FieldVariableGradient > _vector_tag_grad
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ vectorTagValue()

template<typename OutputType >
const MooseVariableDataBase< OutputType >::FieldVariableValue & MooseVariableDataBase< OutputType >::vectorTagValue ( TagID  tag) const
inherited

Definition at line 179 of file MooseVariableDataBase.C.

180 {
181  if (tag >= _need_vector_tag_u.size())
182  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
183 
184  _need_vector_tag_u[tag] = true;
185 
186  if (_sys.hasVector(tag))
187  return _vector_tag_u[tag];
188  else
189  mooseError("Tag ", tag, " is not associated with any vector for variable ", _var.name());
190 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
void resizeVectorTagData(TagID tag)
resize the vector tag need flags and data containers to accomodate this tag index ...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::vector< bool > _need_vector_tag_u
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
std::vector< FieldVariableValue > _vector_tag_u
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ zeroSizeDofValues()

template<typename OutputType >
void MooseVariableDataBase< OutputType >::zeroSizeDofValues ( )
protectedinherited

Definition at line 703 of file MooseVariableDataBase.C.

704 {
705  if (_subproblem.isTransient())
706  {
713  }
714 
715  for (auto & dof_values : _vector_tags_dof_u)
716  dof_values.resize(0);
717 
718  _has_dof_values = false;
719 }
DofValues _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
MooseArray< libMesh::Number > _dof_du_dot_du
derivatives of the solution value time derivative with respect to the degrees of freedom ...
MooseArray< libMesh::Number > _dof_du_dotdot_du
derivatives of the solution value second time derivative with respect to the degrees of freedom ...
DofValues _dof_values_dotdot
second time derivative of the solution values
virtual bool isTransient() const =0
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
std::vector< DofValues > _vector_tags_dof_u
DofValues _dof_values_dot
time derivative of the solution values
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
DofValues _dof_values_dot_old
the previous time step&#39;s solution value time derivative

Member Data Documentation

◆ _ad_curl_u

template<typename OutputType >
ADTemplateVariableCurl<OutputType> MooseVariableData< OutputType >::_ad_curl_u
private

Definition at line 589 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adCurlSln().

◆ _ad_dof_values

template<typename OutputType >
ADDofValues MooseVariableData< OutputType >::_ad_dof_values
private

Definition at line 581 of file MooseVariableData.h.

◆ _ad_dofs_dot

template<typename OutputType >
ADDofValues MooseVariableData< OutputType >::_ad_dofs_dot
private

Definition at line 582 of file MooseVariableData.h.

◆ _ad_dofs_dot_eigen

template<typename OutputType >
MooseArray<ADRealEigenVector> MooseVariableData< OutputType >::_ad_dofs_dot_eigen
private

Definition at line 583 of file MooseVariableData.h.

◆ _ad_dofs_dotdot

template<typename OutputType >
ADDofValues MooseVariableData< OutputType >::_ad_dofs_dotdot
private

Definition at line 584 of file MooseVariableData.h.

◆ _ad_dofs_dotdot_eigen

template<typename OutputType >
MooseArray<ADRealEigenVector> MooseVariableData< OutputType >::_ad_dofs_dotdot_eigen
private

Definition at line 585 of file MooseVariableData.h.

◆ _ad_grad_phi

template<typename OutputType >
const ADTemplateVariablePhiGradient<OutputShape>* MooseVariableData< OutputType >::_ad_grad_phi
private

◆ _ad_grad_phi_assembly_method

template<typename OutputType >
std::function<const ADTemplateVariablePhiGradient<OutputShape> &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_ad_grad_phi_assembly_method
private

◆ _ad_grad_phi_face

template<typename OutputType >
const ADTemplateVariablePhiGradient<OutputShape>* MooseVariableData< OutputType >::_ad_grad_phi_face
private

◆ _ad_grad_phi_face_assembly_method

template<typename OutputType >
std::function<const ADTemplateVariablePhiGradient<OutputShape> &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_ad_grad_phi_face_assembly_method
private

◆ _ad_grad_u

template<typename OutputType >
ADTemplateVariableGradient<OutputType> MooseVariableData< OutputType >::_ad_grad_u
private

Definition at line 579 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adGradSln().

◆ _ad_grad_u_dot

template<typename OutputType >
ADTemplateVariableGradient<OutputType> MooseVariableData< OutputType >::_ad_grad_u_dot
private

Definition at line 588 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adGradSlnDot().

◆ _ad_nodal_value

template<typename OutputType >
Moose::ADType<OutputType>::type MooseVariableData< OutputType >::_ad_nodal_value
private

AD nodal value.

Definition at line 523 of file MooseVariableData.h.

◆ _ad_real_dummy

template<typename OutputType >
ADReal MooseVariableData< OutputType >::_ad_real_dummy = 0
private

A dummy ADReal variable.

Definition at line 714 of file MooseVariableData.h.

◆ _ad_second_u

template<typename OutputType >
ADTemplateVariableSecond<OutputType> MooseVariableData< OutputType >::_ad_second_u
private

Definition at line 580 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adSecondSln().

◆ _ad_u

template<typename OutputType >
ADTemplateVariableValue<OutputType> MooseVariableData< OutputType >::_ad_u
private

AD u.

Definition at line 578 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adSln().

◆ _ad_u_dot

template<typename OutputType >
ADTemplateVariableValue<OutputType> MooseVariableData< OutputType >::_ad_u_dot
private

Definition at line 586 of file MooseVariableData.h.

◆ _ad_u_dotdot

template<typename OutputType >
ADTemplateVariableValue<OutputType> MooseVariableData< OutputType >::_ad_u_dotdot
private

Definition at line 587 of file MooseVariableData.h.

◆ _ad_zero

template<typename OutputType >
ADReal MooseVariableData< OutputType >::_ad_zero
private

A zero AD variable.

Definition at line 526 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::MooseVariableData().

◆ _assembly

template<typename OutputType >
const Assembly& MooseVariableData< OutputType >::_assembly
private

◆ _continuity

template<typename OutputType >
libMesh::FEContinuity MooseVariableData< OutputType >::_continuity
private

◆ _count

template<typename OutputType>
unsigned int MooseVariableDataBase< OutputType >::_count
protectedinherited

Number of components of the associated variable.

Definition at line 202 of file MooseVariableDataBase.h.

◆ _curl_phi

template<typename OutputType >
const FieldVariablePhiCurl* MooseVariableData< OutputType >::_curl_phi
mutableprivate

Definition at line 621 of file MooseVariableData.h.

◆ _curl_phi_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiCurl &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_curl_phi_assembly_method
private

◆ _curl_phi_face

template<typename OutputType >
const FieldVariablePhiCurl* MooseVariableData< OutputType >::_curl_phi_face
mutableprivate

Definition at line 634 of file MooseVariableData.h.

◆ _curl_phi_face_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiCurl &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_curl_phi_face_assembly_method
private

◆ _curl_u

template<typename OutputType >
FieldVariableCurl MooseVariableData< OutputType >::_curl_u
private

curl_u

Definition at line 568 of file MooseVariableData.h.

◆ _curl_u_old

template<typename OutputType >
FieldVariableCurl MooseVariableData< OutputType >::_curl_u_old
private

Definition at line 569 of file MooseVariableData.h.

◆ _curl_u_older

template<typename OutputType >
FieldVariableCurl MooseVariableData< OutputType >::_curl_u_older
private

Definition at line 570 of file MooseVariableData.h.

◆ _current_ad_grad_phi

template<typename OutputType >
const ADTemplateVariablePhiGradient<OutputShape>* MooseVariableData< OutputType >::_current_ad_grad_phi
private

Definition at line 646 of file MooseVariableData.h.

◆ _current_curl_phi

template<typename OutputType >
const FieldVariablePhiCurl* MooseVariableData< OutputType >::_current_curl_phi
private

Definition at line 644 of file MooseVariableData.h.

◆ _current_div_phi

template<typename OutputType >
const FieldVariablePhiDivergence* MooseVariableData< OutputType >::_current_div_phi
private

Definition at line 645 of file MooseVariableData.h.

◆ _current_grad_phi

template<typename OutputType >
const FieldVariablePhiGradient* MooseVariableData< OutputType >::_current_grad_phi
private

Definition at line 642 of file MooseVariableData.h.

◆ _current_phi

template<typename OutputType >
const FieldVariablePhiValue* MooseVariableData< OutputType >::_current_phi
private

Definition at line 641 of file MooseVariableData.h.

◆ _current_qrule

template<typename OutputType >
const QBase* MooseVariableData< OutputType >::_current_qrule
private

Definition at line 640 of file MooseVariableData.h.

◆ _current_second_phi

template<typename OutputType >
const FieldVariablePhiSecond* MooseVariableData< OutputType >::_current_second_phi
private

Definition at line 643 of file MooseVariableData.h.

◆ _current_side

template<typename OutputType >
const unsigned int& MooseVariableData< OutputType >::_current_side
private

The current element side.

Definition at line 711 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::currentSide().

◆ _displaced

template<typename OutputType >
const bool MooseVariableData< OutputType >::_displaced
private

Whether this variable is being calculated on a displaced system.

Definition at line 708 of file MooseVariableData.h.

◆ _div_phi

template<typename OutputType >
const FieldVariablePhiDivergence* MooseVariableData< OutputType >::_div_phi
mutableprivate

Definition at line 622 of file MooseVariableData.h.

◆ _div_phi_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_div_phi_assembly_method
private

◆ _div_phi_face

template<typename OutputType >
const FieldVariablePhiDivergence* MooseVariableData< OutputType >::_div_phi_face
mutableprivate

Definition at line 635 of file MooseVariableData.h.

◆ _div_phi_face_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_div_phi_face_assembly_method
private

◆ _div_u

template<typename OutputType >
FieldVariableDivergence MooseVariableData< OutputType >::_div_u
private

divergence_u

Definition at line 573 of file MooseVariableData.h.

◆ _div_u_old

template<typename OutputType >
FieldVariableDivergence MooseVariableData< OutputType >::_div_u_old
private

Definition at line 574 of file MooseVariableData.h.

◆ _div_u_older

template<typename OutputType >
FieldVariableDivergence MooseVariableData< OutputType >::_div_u_older
private

Definition at line 575 of file MooseVariableData.h.

◆ _dof_du_dot_du

template<typename OutputType>
MooseArray<libMesh::Number> MooseVariableDataBase< OutputType >::_dof_du_dot_du
protectedinherited

derivatives of the solution value time derivative with respect to the degrees of freedom

Definition at line 281 of file MooseVariableDataBase.h.

◆ _dof_du_dotdot_du

template<typename OutputType>
MooseArray<libMesh::Number> MooseVariableDataBase< OutputType >::_dof_du_dotdot_du
protectedinherited

derivatives of the solution value second time derivative with respect to the degrees of freedom

Definition at line 284 of file MooseVariableDataBase.h.

◆ _dof_indices

template<typename OutputType>
std::vector<dof_id_type> MooseVariableDataBase< OutputType >::_dof_indices
protectedinherited

◆ _dof_map

template<typename OutputType>
const libMesh::DofMap& MooseVariableDataBase< OutputType >::_dof_map
protectedinherited

The degree of freedom map from libMesh.

Definition at line 199 of file MooseVariableDataBase.h.

◆ _dof_values_dot

template<typename OutputType>
DofValues MooseVariableDataBase< OutputType >::_dof_values_dot
protectedinherited

time derivative of the solution values

Definition at line 273 of file MooseVariableDataBase.h.

◆ _dof_values_dot_old

template<typename OutputType>
DofValues MooseVariableDataBase< OutputType >::_dof_values_dot_old
protectedinherited

the previous time step's solution value time derivative

Definition at line 277 of file MooseVariableDataBase.h.

◆ _dof_values_dotdot

template<typename OutputType>
DofValues MooseVariableDataBase< OutputType >::_dof_values_dotdot
protectedinherited

second time derivative of the solution values

Definition at line 275 of file MooseVariableDataBase.h.

◆ _dof_values_dotdot_old

template<typename OutputType>
DofValues MooseVariableDataBase< OutputType >::_dof_values_dotdot_old
protectedinherited

the previous time step's solution value second time derivative

Definition at line 279 of file MooseVariableDataBase.h.

◆ _du_dot_du

template<typename OutputType >
VariableValue MooseVariableData< OutputType >::_du_dot_du
private

derivative of u_dot wrt u

Definition at line 606 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::duDotDu().

◆ _du_dotdot_du

template<typename OutputType >
VariableValue MooseVariableData< OutputType >::_du_dotdot_du
private

derivative of u_dotdot wrt u

Definition at line 609 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::duDotDotDu().

◆ _elem

template<typename OutputType >
const Elem* const& MooseVariableData< OutputType >::_elem
private

The current elem.

This has to be a reference because the current elem will be constantly changing. If we initialized this to point to one elem, then in the next calculation we would be pointing to the wrong place!

Definition at line 705 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::currentElem().

◆ _element_type

template<typename OutputType >
Moose::ElementType MooseVariableData< OutputType >::_element_type
private

The element type this object is storing data for. This is either Element, Neighbor, or Lower.

Definition at line 508 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::MooseVariableData().

◆ _fe_type

template<typename OutputType >
const libMesh::FEType& MooseVariableData< OutputType >::_fe_type
private

◆ _grad_phi

template<typename OutputType >
const FieldVariablePhiGradient* MooseVariableData< OutputType >::_grad_phi
private

◆ _grad_phi_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiGradient &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_grad_phi_assembly_method
private

◆ _grad_phi_face

template<typename OutputType >
const FieldVariablePhiGradient* MooseVariableData< OutputType >::_grad_phi_face
private

◆ _grad_phi_face_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiGradient &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_grad_phi_face_assembly_method
private

◆ _grad_u_dot

template<typename OutputType >
FieldVariableGradient MooseVariableData< OutputType >::_grad_u_dot
private

grad_u dots

Definition at line 558 of file MooseVariableData.h.

◆ _grad_u_dotdot

template<typename OutputType >
FieldVariableGradient MooseVariableData< OutputType >::_grad_u_dotdot
private

Definition at line 559 of file MooseVariableData.h.

◆ _has_dof_indices

template<typename OutputType >
bool MooseVariableData< OutputType >::_has_dof_indices
private

◆ _has_dof_values

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_has_dof_values
protectedinherited

Whether we currently have degree of freedom values stored in our local containers (corresponding to the current element)

Definition at line 206 of file MooseVariableDataBase.h.

Referenced by MooseVariableDataBase< OutputType >::prepareAux().

◆ _increment

template<typename OutputType >
FieldVariableValue MooseVariableData< OutputType >::_increment
private

Increment in the variable used in dampers.

Definition at line 520 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::increment().

◆ _is_nodal

template<typename OutputType >
bool MooseVariableData< OutputType >::_is_nodal
private

◆ _mapped_grad_phi

template<typename OutputType >
MappedArrayVariablePhiGradient MooseVariableData< OutputType >::_mapped_grad_phi
private

Definition at line 625 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::arrayGradPhi().

◆ _mapped_grad_phi_face

template<typename OutputType >
MappedArrayVariablePhiGradient MooseVariableData< OutputType >::_mapped_grad_phi_face
private

◆ _mapped_grad_phi_face_neighbor

template<typename OutputType >
MappedArrayVariablePhiGradient MooseVariableData< OutputType >::_mapped_grad_phi_face_neighbor
private

Definition at line 628 of file MooseVariableData.h.

◆ _mapped_grad_phi_neighbor

template<typename OutputType >
MappedArrayVariablePhiGradient MooseVariableData< OutputType >::_mapped_grad_phi_neighbor
private

Definition at line 627 of file MooseVariableData.h.

◆ _matrix_tag_u

template<typename OutputType>
std::vector<FieldVariableValue> MooseVariableDataBase< OutputType >::_matrix_tag_u
protectedinherited

Definition at line 238 of file MooseVariableDataBase.h.

◆ _matrix_tags_dof_u

template<typename OutputType>
std::vector<DofValues> MooseVariableDataBase< OutputType >::_matrix_tags_dof_u
protectedinherited

Definition at line 232 of file MooseVariableDataBase.h.

◆ _max_state

template<typename OutputType>
unsigned int MooseVariableDataBase< OutputType >::_max_state
protectedinherited

The maximum number of older solution states our variable needs.

Definition at line 209 of file MooseVariableDataBase.h.

◆ _need_ad

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad = false
mutableprivate

◆ _need_ad_curl_u

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_curl_u = false
mutableprivate

Definition at line 550 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adCurlSln().

◆ _need_ad_div_u

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_div_u = false
mutableprivate

Definition at line 551 of file MooseVariableData.h.

◆ _need_ad_grad_u

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_grad_u = false
mutableprivate

Definition at line 547 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adGradSln().

◆ _need_ad_grad_u_dot

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_grad_u_dot = false
mutableprivate

Definition at line 548 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adGradSlnDot().

◆ _need_ad_second_u

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_second_u = false
mutableprivate

Definition at line 549 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adSecondSln().

◆ _need_ad_u

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_u = false
mutableprivate

Definition at line 546 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adSln().

◆ _need_ad_u_dot

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_u_dot = false
mutableprivate

Definition at line 552 of file MooseVariableData.h.

◆ _need_ad_u_dotdot

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_ad_u_dotdot = false
mutableprivate

Definition at line 553 of file MooseVariableData.h.

◆ _need_curl

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_curl = false
mutableprivate

curl flags

Definition at line 535 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::computingCurl().

◆ _need_curl_old

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_curl_old = false
mutableprivate

Definition at line 536 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::computingCurl().

◆ _need_curl_older

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_curl_older = false
mutableprivate

Definition at line 537 of file MooseVariableData.h.

◆ _need_div

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_div = false
mutableprivate

divergence flags

Definition at line 540 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::computingDiv().

◆ _need_div_old

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_div_old = false
mutableprivate

Definition at line 541 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::computingDiv().

◆ _need_div_older

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_div_older = false
mutableprivate

Definition at line 542 of file MooseVariableData.h.

◆ _need_dof_du_dot_du

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_dof_du_dot_du
mutableprotectedinherited

Definition at line 269 of file MooseVariableDataBase.h.

◆ _need_dof_du_dotdot_du

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_dof_du_dotdot_du
mutableprotectedinherited

Definition at line 270 of file MooseVariableDataBase.h.

◆ _need_dof_values_dot

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_dof_values_dot
mutableprotectedinherited

local solution flags

Definition at line 265 of file MooseVariableDataBase.h.

◆ _need_dof_values_dot_old

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_dof_values_dot_old
mutableprotectedinherited

Definition at line 267 of file MooseVariableDataBase.h.

◆ _need_dof_values_dotdot

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_dof_values_dotdot
mutableprotectedinherited

Definition at line 266 of file MooseVariableDataBase.h.

◆ _need_dof_values_dotdot_old

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_dof_values_dotdot_old
mutableprotectedinherited

Definition at line 268 of file MooseVariableDataBase.h.

◆ _need_du_dot_du

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_du_dot_du
mutableprotectedinherited

◆ _need_du_dotdot_du

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_du_dotdot_du
mutableprotectedinherited

◆ _need_grad_dot

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_grad_dot
mutableprotectedinherited

gradient dot flags

Definition at line 261 of file MooseVariableDataBase.h.

Referenced by MooseVariableData< OutputType >::adGradSlnDot().

◆ _need_grad_dotdot

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_grad_dotdot
mutableprotectedinherited

Definition at line 262 of file MooseVariableDataBase.h.

◆ _need_matrix_tag_dof_u

template<typename OutputType>
std::vector<bool> MooseVariableDataBase< OutputType >::_need_matrix_tag_dof_u
mutableprotectedinherited

Definition at line 227 of file MooseVariableDataBase.h.

◆ _need_matrix_tag_u

template<typename OutputType>
std::vector<bool> MooseVariableDataBase< OutputType >::_need_matrix_tag_u
mutableprotectedinherited

Definition at line 239 of file MooseVariableDataBase.h.

◆ _need_second

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_second = false
mutableprivate

SolutionState second_u flags.

Definition at line 529 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::usesSecondPhi().

◆ _need_second_old

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_second_old = false
mutableprivate

Definition at line 530 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::usesSecondPhi().

◆ _need_second_older

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_second_older = false
mutableprivate

Definition at line 531 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::usesSecondPhi().

◆ _need_second_previous_nl

template<typename OutputType >
bool MooseVariableData< OutputType >::_need_second_previous_nl = false
mutableprivate

Definition at line 532 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::usesSecondPhi().

◆ _need_u_dot

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_u_dot
mutableprotectedinherited

u dot flags

Definition at line 253 of file MooseVariableDataBase.h.

◆ _need_u_dot_old

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_u_dot_old
mutableprotectedinherited

Definition at line 255 of file MooseVariableDataBase.h.

◆ _need_u_dotdot

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_u_dotdot
mutableprotectedinherited

Definition at line 254 of file MooseVariableDataBase.h.

◆ _need_u_dotdot_old

template<typename OutputType>
bool MooseVariableDataBase< OutputType >::_need_u_dotdot_old
mutableprotectedinherited

Definition at line 256 of file MooseVariableDataBase.h.

◆ _need_vector_tag_dof_u

template<typename OutputType>
std::vector<bool> MooseVariableDataBase< OutputType >::_need_vector_tag_dof_u
mutableprotectedinherited

◆ _need_vector_tag_grad

template<typename OutputType>
std::vector<bool> MooseVariableDataBase< OutputType >::_need_vector_tag_grad
mutableprotectedinherited

◆ _need_vector_tag_u

template<typename OutputType>
std::vector<bool> MooseVariableDataBase< OutputType >::_need_vector_tag_u
mutableprotectedinherited

◆ _nodal_dof_index

template<typename OutputType >
dof_id_type MooseVariableData< OutputType >::_nodal_dof_index
private

The dof index for the current node.

Definition at line 514 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::nodalDofIndex().

◆ _nodal_value

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value
protectedinherited

Nodal values.

Definition at line 242 of file MooseVariableDataBase.h.

◆ _nodal_value_array

template<typename OutputType>
MooseArray<OutputType> MooseVariableDataBase< OutputType >::_nodal_value_array
protectedinherited

Nodal values as MooseArrays for use with AuxKernels.

Definition at line 248 of file MooseVariableDataBase.h.

Referenced by MooseVariableDataBase< OutputType >::MooseVariableDataBase().

◆ _nodal_value_dot

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_dot
protectedinherited

nodal values of u_dot

Definition at line 287 of file MooseVariableDataBase.h.

◆ _nodal_value_dot_old

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_dot_old
protectedinherited

nodal values of u_dot_old

Definition at line 291 of file MooseVariableDataBase.h.

◆ _nodal_value_dotdot

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_dotdot
protectedinherited

nodal values of u_dotdot

Definition at line 289 of file MooseVariableDataBase.h.

◆ _nodal_value_dotdot_old

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_dotdot_old
protectedinherited

nodal values of u_dotdot_old

Definition at line 293 of file MooseVariableDataBase.h.

◆ _nodal_value_old

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_old
protectedinherited

Definition at line 243 of file MooseVariableDataBase.h.

◆ _nodal_value_old_array

template<typename OutputType>
MooseArray<OutputType> MooseVariableDataBase< OutputType >::_nodal_value_old_array
protectedinherited

◆ _nodal_value_older

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_older
protectedinherited

Definition at line 244 of file MooseVariableDataBase.h.

◆ _nodal_value_older_array

template<typename OutputType>
MooseArray<OutputType> MooseVariableDataBase< OutputType >::_nodal_value_older_array
protectedinherited

◆ _nodal_value_previous_nl

template<typename OutputType>
OutputType MooseVariableDataBase< OutputType >::_nodal_value_previous_nl
protectedinherited

Definition at line 245 of file MooseVariableDataBase.h.

◆ _node

template<typename OutputType >
const Node* const& MooseVariableData< OutputType >::_node
private

The current node.

This has to be a reference because the current node will be constantly changing. If we initialized this to point to one node, then in the next calculation we would be pointing to the wrong place!

Definition at line 700 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::node().

◆ _old_solution_tag

template<typename OutputType>
TagID MooseVariableDataBase< OutputType >::_old_solution_tag
protectedinherited

The vector tag ID corresponding to the old solution vector.

Definition at line 215 of file MooseVariableDataBase.h.

◆ _older_solution_tag

template<typename OutputType>
TagID MooseVariableDataBase< OutputType >::_older_solution_tag
protectedinherited

The vector tag ID corresponding to the older solution vector.

Definition at line 218 of file MooseVariableDataBase.h.

◆ _phi

template<typename OutputType >
const FieldVariablePhiValue* MooseVariableData< OutputType >::_phi
private

◆ _phi_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputType>::VariablePhiValue &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_phi_assembly_method
private

◆ _phi_face

template<typename OutputType >
const FieldVariablePhiValue* MooseVariableData< OutputType >::_phi_face
private

◆ _phi_face_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiValue &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_phi_face_assembly_method
private

◆ _previous_nl_solution_tag

template<typename OutputType>
TagID MooseVariableDataBase< OutputType >::_previous_nl_solution_tag
protectedinherited

The vector tag ID corresponding to the previous nonlinear iteration's solution vector.

Definition at line 221 of file MooseVariableDataBase.h.

◆ _qrule

template<typename OutputType >
const QBase* const& MooseVariableData< OutputType >::_qrule
private

The current qrule.

This has to be a reference because the current qrule will be constantly changing. If we initialized this to point to one qrule, then in the next calculation we would be pointing to the wrong place!

Definition at line 614 of file MooseVariableData.h.

◆ _qrule_face

template<typename OutputType >
const QBase* const& MooseVariableData< OutputType >::_qrule_face
private

Definition at line 615 of file MooseVariableData.h.

◆ _required_vector_tags

template<typename OutputType>
std::set<TagID> MooseVariableDataBase< OutputType >::_required_vector_tags
protectedinherited

The set of vector tags (residual + solution) we need to evaluate.

Definition at line 296 of file MooseVariableDataBase.h.

◆ _second_phi

template<typename OutputType >
const FieldVariablePhiSecond* MooseVariableData< OutputType >::_second_phi
mutableprivate

Definition at line 620 of file MooseVariableData.h.

◆ _second_phi_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiSecond &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_second_phi_assembly_method
private

◆ _second_phi_face

template<typename OutputType >
const FieldVariablePhiSecond* MooseVariableData< OutputType >::_second_phi_face
mutableprivate

Definition at line 633 of file MooseVariableData.h.

◆ _second_phi_face_assembly_method

template<typename OutputType >
std::function<const typename OutputTools<OutputShape>::VariablePhiSecond &(const Assembly &, libMesh::FEType)> MooseVariableData< OutputType >::_second_phi_face_assembly_method
private

◆ _second_u

template<typename OutputType >
FieldVariableSecond MooseVariableData< OutputType >::_second_u
private

second_u

Definition at line 562 of file MooseVariableData.h.

◆ _second_u_old

template<typename OutputType >
FieldVariableSecond MooseVariableData< OutputType >::_second_u_old
private

Definition at line 563 of file MooseVariableData.h.

◆ _second_u_older

template<typename OutputType >
FieldVariableSecond MooseVariableData< OutputType >::_second_u_older
private

Definition at line 564 of file MooseVariableData.h.

◆ _second_u_previous_nl

template<typename OutputType >
FieldVariableSecond MooseVariableData< OutputType >::_second_u_previous_nl
private

Definition at line 565 of file MooseVariableData.h.

◆ _solution_tag

template<typename OutputType>
TagID MooseVariableDataBase< OutputType >::_solution_tag
protectedinherited

The vector tag ID corresponding to the solution vector.

Definition at line 212 of file MooseVariableDataBase.h.

◆ _solution_tags

template<typename OutputType>
std::set<TagID> MooseVariableDataBase< OutputType >::_solution_tags
protectedinherited

The set of solution tags we need to evaluate.

Definition at line 299 of file MooseVariableDataBase.h.

◆ _subproblem

template<typename OutputType>
const SubProblem& MooseVariableDataBase< OutputType >::_subproblem
protectedinherited

The subproblem which we can query for information related to tagged vectors and matrices.

Definition at line 193 of file MooseVariableDataBase.h.

Referenced by MooseVariableDataBase< OutputType >::MooseVariableDataBase(), and MooseVariableDataFV< OutputType >::MooseVariableDataFV().

◆ _sys

template<typename OutputType>
SystemBase& MooseVariableDataBase< OutputType >::_sys
protectedinherited

The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data.

Definition at line 190 of file MooseVariableDataBase.h.

Referenced by MooseVariableData< OutputType >::MooseVariableData().

◆ _tid

template<typename OutputType>
const THREAD_ID MooseVariableDataBase< OutputType >::_tid
protectedinherited

The thread ID that this object is on.

Definition at line 196 of file MooseVariableDataBase.h.

◆ _time_integrator

template<typename OutputType >
const TimeIntegrator* MooseVariableData< OutputType >::_time_integrator
private

Pointer to time integrator.

Definition at line 695 of file MooseVariableData.h.

Referenced by MooseVariableData< OutputType >::adGradSlnDot(), and MooseVariableData< OutputType >::MooseVariableData().

◆ _u_dot

template<typename OutputType >
FieldVariableValue MooseVariableData< OutputType >::_u_dot
private

u_dot (time derivative)

Definition at line 594 of file MooseVariableData.h.

◆ _u_dot_old

template<typename OutputType >
FieldVariableValue MooseVariableData< OutputType >::_u_dot_old
private

u_dot_old (time derivative)

Definition at line 600 of file MooseVariableData.h.

◆ _u_dotdot

template<typename OutputType >
FieldVariableValue MooseVariableData< OutputType >::_u_dotdot
private

u_dotdot (second time derivative)

Definition at line 597 of file MooseVariableData.h.

◆ _u_dotdot_old

template<typename OutputType >
FieldVariableValue MooseVariableData< OutputType >::_u_dotdot_old
private

u_dotdot_old (second time derivative)

Definition at line 603 of file MooseVariableData.h.

◆ _use_dual

template<typename OutputType >
const bool MooseVariableData< OutputType >::_use_dual
private

◆ _var

template<typename OutputType >
const MooseVariableFE<OutputType>& MooseVariableData< OutputType >::_var
private

A const reference to the owning MooseVariableFE object.

Definition at line 499 of file MooseVariableData.h.

◆ _var_num

template<typename OutputType >
const unsigned int MooseVariableData< OutputType >::_var_num
private

◆ _vector_tag_grad

template<typename OutputType>
std::vector<FieldVariableGradient> MooseVariableDataBase< OutputType >::_vector_tag_grad
protectedinherited

◆ _vector_tag_u

template<typename OutputType>
std::vector<FieldVariableValue> MooseVariableDataBase< OutputType >::_vector_tag_u
protectedinherited

◆ _vector_tags_dof_u

template<typename OutputType>
std::vector<DofValues> MooseVariableDataBase< OutputType >::_vector_tags_dof_u
protectedinherited

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