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 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 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 Moose::DOFType< OutputType >::type OutputData
 
typedef MooseArray< OutputDataDoFValue
 

Public Member Functions

 MooseVariableData (const MooseVariableField< 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 computeMonomialValues ()
 compute the values for const monomial variables More...
 
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< OutputData > &values)
 Set local DOF values and evaluate the values on quadrature points. More...
 
void insertNodalValue (libMesh::NumericVector< libMesh::Number > &residual, const OutputData &v)
 Write a nodal value to the passed-in solution vector. More...
 
OutputData getNodalValue (const Node &node, Moose::SolutionState state) const
 
OutputData 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 DoFValuedofValuesDot () const
 
const DoFValuedofValuesDotOld () const
 
const DoFValuedofValuesDotDot () const
 
const DoFValuedofValuesDotDotOld () const
 
const MooseArray< libMesh::Number > & dofValuesDuDotDu () const
 
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu () const
 
const MooseArray< ADReal > & adDofValues () const
 Return the AD dof values. More...
 
const MooseArray< ADReal > & adDofValuesDot () 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 computeAD (const unsigned int, const unsigned int)
 
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, Moose::SolutionState state, unsigned int idx) const
 
template<>
void addSolution (NumericVector< Number > &sol, const DenseVector< Number > &v) 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 DoFValuedofValues () const
 
const DoFValuedofValuesOld () const
 
const DoFValuedofValuesOlder () const
 
const DoFValuedofValuesPreviousNL () 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 DoFValuenodalVectorTagValue (TagID tag) const
 
const DoFValuenodalMatrixTagValue (TagID tag) const
 
const DoFValuevectorTagDofValue (TagID tag) const
 
const DoFValuevectorTagDofValue (Moose::SolutionState state) const
 
void setActiveTags (const std::set< TagID > &vtags)
 Set the active vector tags. More...
 
void prepareAux ()
 Clear aux state. More...
 
void setDofValue (const OutputData &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< DoFValue_vector_tags_dof_u
 
std::vector< DoFValue_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
 
DoFValue _dof_values_dot
 time derivative of the solution values More...
 
DoFValue _dof_values_dotdot
 second time derivative of the solution values More...
 
DoFValue _dof_values_dot_old
 the previous time step's solution value time derivative More...
 
DoFValue _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 assignADNodalValue (const ADReal &value, const unsigned int &component)
 Helper methods for assigning nodal values from their corresponding solution values (dof values as they're referred to here in this class). More...
 
void fetchADNodalValues ()
 
template<bool monomial>
void computeValuesInternal ()
 Internal method for computeValues() and computeMonomialValues() More...
 
template<>
void fetchADNodalValues ()
 
template<>
void assignADNodalValue (const ADReal &value, const unsigned int &)
 
template<>
void assignADNodalValue (const ADReal &value, const unsigned int &component)
 

Private Attributes

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_ad_u_dot
 AD u dot flags. More...
 
bool _need_ad_u_dotdot
 
bool _need_second
 SolutionState second_u flags. More...
 
bool _need_second_old
 
bool _need_second_older
 
bool _need_second_previous_nl
 
bool _need_curl
 curl flags More...
 
bool _need_curl_old
 
bool _need_curl_older
 
bool _need_div
 divergence flags More...
 
bool _need_div_old
 
bool _need_div_older
 
bool _need_ad
 AD flags. More...
 
bool _need_ad_u
 
bool _need_ad_grad_u
 
bool _need_ad_grad_u_dot
 
bool _need_ad_second_u
 
bool _need_ad_curl_u
 
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
 
MooseArray< ADReal_ad_dof_values
 
MooseArray< ADReal_ad_dofs_dot
 
MooseArray< ADReal_ad_dofs_dotdot
 
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

◆ DoFValue

template<typename OutputType>
typedef MooseArray<OutputData> MooseVariableData< OutputType >::DoFValue

Definition at line 89 of file MooseVariableData.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> MooseVariableData< OutputType >::FieldVariableGradient

Definition at line 59 of file MooseVariableData.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> MooseVariableData< OutputType >::FieldVariableValue

Definition at line 58 of file MooseVariableData.h.

◆ OutputData

template<typename OutputType>
typedef Moose::DOFType<OutputType>::type MooseVariableData< OutputType >::OutputData

Definition at line 88 of file MooseVariableData.h.

◆ OutputDivergence

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

Definition at line 55 of file MooseVariableData.h.

◆ OutputGradient

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

Definition at line 53 of file MooseVariableData.h.

◆ OutputSecond

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

Definition at line 54 of file MooseVariableData.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 MooseVariableField< 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  _fe_type(var.feType()),
39  _var_num(var.number()),
40  _assembly(_subproblem.assembly(_tid, var.kind() == Moose::VAR_SOLVER ? sys.number() : 0)),
41  _element_type(element_type),
42  _ad_zero(0),
43  _need_ad_u_dot(false),
44  _need_ad_u_dotdot(false),
45  _need_second(false),
46  _need_second_old(false),
47  _need_second_older(false),
49  _need_curl(false),
50  _need_curl_old(false),
51  _need_curl_older(false),
52  _need_div(false),
53  _need_div_old(false),
54  _need_div_older(false),
55  _need_ad(false),
56  _need_ad_u(false),
57  _need_ad_grad_u(false),
58  _need_ad_grad_u_dot(false),
59  _need_ad_second_u(false),
60  _need_ad_curl_u(false),
61  _has_dof_indices(false),
62  _qrule(qrule_in),
63  _qrule_face(qrule_face_in),
64  _use_dual(var.useDual()),
69  _div_phi_assembly_method(nullptr),
73  _time_integrator(nullptr),
74  _node(node),
75  _elem(elem),
76  _displaced(dynamic_cast<const DisplacedSystem *>(&_sys) ? true : false),
78 {
79  _continuity = FEInterface::get_continuity(_fe_type);
80 
82 
84 
85  // Initialize AD zero with zero derivatives
86  const auto old_do = ADReal::do_derivatives;
87  ADReal::do_derivatives = true;
88  _ad_zero = 0.;
89  ADReal::do_derivatives = old_do;
90 
91  switch (_element_type)
92  {
94  {
95  _phi_assembly_method = &Assembly::fePhi<OutputShape>;
96  _phi_face_assembly_method = &Assembly::fePhiFace<OutputShape>;
97  _grad_phi_assembly_method = &Assembly::feGradPhi<OutputShape>;
98  _grad_phi_face_assembly_method = &Assembly::feGradPhiFace<OutputShape>;
99  _second_phi_assembly_method = &Assembly::feSecondPhi<OutputShape>;
100  _second_phi_face_assembly_method = &Assembly::feSecondPhiFace<OutputShape>;
101  _curl_phi_assembly_method = &Assembly::feCurlPhi<OutputShape>;
102  _curl_phi_face_assembly_method = &Assembly::feCurlPhiFace<OutputShape>;
103  _div_phi_assembly_method = &Assembly::feDivPhi<OutputShape>;
104  _div_phi_face_assembly_method = &Assembly::feDivPhiFace<OutputShape>;
105  _ad_grad_phi_assembly_method = &Assembly::feADGradPhi<OutputShape>;
106  _ad_grad_phi_face_assembly_method = &Assembly::feADGradPhiFace<OutputShape>;
107 
110  break;
111  }
113  {
114  _phi_assembly_method = &Assembly::fePhiNeighbor<OutputShape>;
115  _phi_face_assembly_method = &Assembly::fePhiFaceNeighbor<OutputShape>;
116  _grad_phi_assembly_method = &Assembly::feGradPhiNeighbor<OutputShape>;
117  _grad_phi_face_assembly_method = &Assembly::feGradPhiFaceNeighbor<OutputShape>;
118  _second_phi_assembly_method = &Assembly::feSecondPhiNeighbor<OutputShape>;
119  _second_phi_face_assembly_method = &Assembly::feSecondPhiFaceNeighbor<OutputShape>;
120  _curl_phi_assembly_method = &Assembly::feCurlPhiNeighbor<OutputShape>;
121  _curl_phi_face_assembly_method = &Assembly::feCurlPhiFaceNeighbor<OutputShape>;
122  _div_phi_assembly_method = &Assembly::feDivPhiNeighbor<OutputShape>;
123  _div_phi_face_assembly_method = &Assembly::feDivPhiFaceNeighbor<OutputShape>;
124 
125  _ad_grad_phi = nullptr;
126  _ad_grad_phi_face = nullptr;
127  break;
128  }
130  {
131  if (_use_dual)
132  {
133  _phi_assembly_method = &Assembly::feDualPhiLower<OutputType>;
134  _phi_face_assembly_method = &Assembly::feDualPhiLower<OutputType>; // Place holder
135  _grad_phi_assembly_method = &Assembly::feGradDualPhiLower<OutputType>;
136  _grad_phi_face_assembly_method = &Assembly::feGradDualPhiLower<OutputType>; // Place holder
137  }
138  else
139  {
140  _phi_assembly_method = &Assembly::fePhiLower<OutputType>;
141  _phi_face_assembly_method = &Assembly::fePhiLower<OutputType>; // Place holder
142  _grad_phi_assembly_method = &Assembly::feGradPhiLower<OutputType>;
143  _grad_phi_face_assembly_method = &Assembly::feGradPhiLower<OutputType>; // Place holder
144  }
145 
146  _ad_grad_phi = nullptr;
147  _ad_grad_phi_face = nullptr;
148  break;
149  }
150  }
155 }
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
bool _need_second
SolutionState second_u flags.
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
bool _need_ad_u_dot
AD u dot flags.
const QBase *const & _qrule_face
C_ZERO
bool _need_curl
curl flags
virtual const MooseVariableField< OutputType > & var() const
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_face_assembly_method
bool _need_div
divergence flags
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 Elem *const & _elem
The current elem.
bool _need_ad
AD flags.
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:1640
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:407
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 353 of file MooseVariableData.h.

354  {
355  _need_ad = _need_ad_curl_u = true;
356  curlPhi();
357  curlPhiFace();
358  return _ad_curl_u;
359  }
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 429 of file MooseVariableDataBase.C.

430 {
431  if (_has_dof_values)
432  {
433  auto & dof_values = _vector_tags_dof_u[_solution_tag];
434  residual.add_vector(&dof_values[0], _dof_indices);
435  }
436 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
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 440 of file MooseVariableDataBase.C.

441 {
442  if (_has_dof_values)
443  {
444  auto & dof_values = _vector_tags_dof_u[_solution_tag];
445  if (isNodal())
446  {
447  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
448  for (unsigned int j = 0; j < _count; ++j)
449  residual.add(_dof_indices[i] + j, dof_values[i](j));
450  }
451  else
452  {
453  unsigned int n = 0;
454  for (unsigned int j = 0; j < _count; ++j)
455  {
456  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
457  residual.add(_dof_indices[i] + n, dof_values[i](j));
458  n += _dof_indices.size();
459  }
460  }
461  }
462 }
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
virtual bool isNodal() const =0
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.

◆ adDofValues()

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

Return the AD dof values.

Definition at line 750 of file MooseVariableData.h.

751 {
752  _need_ad = true;
753  return _ad_dof_values;
754 }
bool _need_ad
AD flags.
MooseArray< ADReal > _ad_dof_values

◆ adDofValuesDot()

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

Return the AD time derivative values of degrees of freedom.

Definition at line 758 of file MooseVariableData.h.

759 {
760  _need_ad = _need_ad_u_dot = true;
761  if (!_time_integrator)
762  // See explanation in adUDot() body
763  _need_u_dot = true;
764  return _ad_dofs_dot;
765 }
MooseArray< ADReal > _ad_dofs_dot
bool _need_ad_u_dot
AD u dot flags.
const TimeIntegrator * _time_integrator
Pointer to time integrator.
bool _need_ad
AD flags.

◆ addSolution() [1/2]

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 1035 of file MooseVariableData.C.

1037 {
1038  sol.add_vector(v, _dof_indices);
1039 }
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.

◆ addSolution() [2/2]

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

Definition at line 1043 of file MooseVariableData.C.

1045 {
1046  unsigned int p = 0;
1047  const auto num_dofs = _dof_indices.size();
1048  for (const auto j : make_range(_count))
1049  {
1050  unsigned int inc = (isNodal() ? j : j * num_dofs);
1051  for (const auto i : make_range(num_dofs))
1052  sol.add(_dof_indices[i] + inc, v(p++));
1053  }
1054 }
IntRange< T > make_range(T beg, T end)
unsigned int _count
Number of components of the associated variable.
virtual void add(const numeric_index_type i, const T value)=0
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
bool isNodal() const override

◆ adGradPhi()

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

ad_grad_phi getter

Definition at line 809 of file MooseVariableData.h.

810 {
812  mooseError("Unsupported element type: ", Moose::stringify(_element_type));
813  mooseAssert(_ad_grad_phi, "this should be non-null");
814  return *_ad_grad_phi;
815 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 819 of file MooseVariableData.h.

820 {
822  mooseError("Unsupported element type: ", Moose::stringify(_element_type));
823  mooseAssert(_ad_grad_phi_face, "this should be non-null");
824  return *_ad_grad_phi_face;
825 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 301 of file MooseVariableData.h.

302  {
303  _need_ad = _need_ad_grad_u = true;
304  return _ad_grad_u;
305  }
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 307 of file MooseVariableData.h.

308  {
309  _need_ad = _need_ad_grad_u_dot = true;
310 
311  if (!_time_integrator)
312  // If we don't have a time integrator (this will be the case for variables that are a part of
313  // the AuxiliarySystem) then we have no way to calculate _ad_grad_u_dot and we are just going
314  // to copy the values from _grad_u_dot. Of course in order to be able to do that we need to
315  // calculate _grad_u_dot
316  _need_grad_dot = true;
317 
318  return _ad_grad_u_dot;
319  }
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 769 of file MooseVariableData.h.

770 {
771  _need_ad = true;
772  return _ad_nodal_value;
773 }
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 321 of file MooseVariableData.h.

322  {
323  _need_ad = _need_ad_second_u = true;
324  secondPhi();
325  secondPhiFace();
326  return _ad_second_u;
327  }
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 295 of file MooseVariableData.h.

296  {
297  _need_ad = _need_ad_u = true;
298  return _ad_u;
299  }
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 777 of file MooseVariableData.h.

778 {
779  _need_ad = _need_ad_u_dot = true;
780 
781  if (!_time_integrator)
782  // If we don't have a time integrator (this will be the case for variables that are a part of
783  // the AuxiliarySystem) then we have no way to calculate _ad_u_dot and we are just going to
784  // copy the values from _u_dot. Of course in order to be able to do that we need to calculate
785  // _u_dot
786  _need_u_dot = true;
787 
788  return _ad_u_dot;
789 }
ADTemplateVariableValue< OutputType > _ad_u_dot
bool _need_ad_u_dot
AD u dot flags.
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 793 of file MooseVariableData.h.

794 {
795  _need_ad = _need_ad_u_dotdot = true;
796 
797  if (!_time_integrator)
798  // If we don't have a time integrator (this will be the case for variables that are a part
799  // of the AuxiliarySystem) then we have no way to calculate _ad_u_dotdot and we are just
800  // going to copy the values from _u_dotdot. Of course in order to be able to do that we need
801  // to calculate _u_dotdot
802  _need_u_dotdot = true;
803 
804  return _ad_u_dotdot;
805 }
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 153 of file MooseVariableData.h.

154  {
155  mooseAssert(var().fieldType() == Moose::VarFieldType::VAR_FIELD_ARRAY, "Not an array variable");
156  return _mapped_grad_phi;
157  }
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 167 of file MooseVariableData.h.

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

◆ assignADNodalValue() [1/3]

template<typename OutputType>
void MooseVariableData< OutputType >::assignADNodalValue ( const ADReal value,
const unsigned int component 
)
private

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

These methods are only truly meaningful for nodal basis families

◆ assignADNodalValue() [2/3]

template<>
void MooseVariableData< Real >::assignADNodalValue ( const ADReal value,
const unsigned int  
)
private

Definition at line 1379 of file MooseVariableData.C.

1380 {
1382 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Moose::ADType< OutputType >::type _ad_nodal_value
AD nodal value.

◆ assignADNodalValue() [3/3]

template<>
void MooseVariableData< RealVectorValue >::assignADNodalValue ( const ADReal value,
const unsigned int component 
)
private

Definition at line 1386 of file MooseVariableData.C.

1388 {
1389  _ad_nodal_value(component) = value;
1390 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Moose::ADType< OutputType >::type _ad_nodal_value
AD nodal value.

◆ assignNodalValue() [1/3]

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

Definition at line 746 of file MooseVariableDataBase.C.

747 {
748  bool is_transient = _subproblem.isTransient();
749 
751 
752  auto & dof_values = _vector_tags_dof_u[_solution_tag];
753  _nodal_value = dof_values[0];
755 
756  if (is_transient)
757  {
758  if (oldestSolutionStateRequested() >= 1)
759  {
762  }
763  if (oldestSolutionStateRequested() >= 2)
764  {
767  }
776  }
779 }
DoFValue _dof_values_dotdot
second time derivative of the solution values
DoFValue _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.
DoFValue _dof_values_dot
time derivative of the solution values
OutputType _nodal_value
Nodal values.
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
MooseArray< OutputType > _nodal_value_array
Nodal values as MooseArrays for use with AuxKernels.
virtual bool isTransient() const =0
std::vector< DoFValue > _vector_tags_dof_u
libmesh_assert(ctx)
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
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
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
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 783 of file MooseVariableDataBase.C.

784 {
785  bool is_transient = _subproblem.isTransient();
786 
787  auto n = _dof_indices.size();
788  libmesh_assert(n);
789 
790  auto & dof_values = _vector_tags_dof_u[_solution_tag];
791  for (decltype(n) i = 0; i < n; ++i)
792  _nodal_value(i) = dof_values[i];
794 
795  if (is_transient)
796  {
797  if (oldestSolutionStateRequested() >= 1)
798  {
799  auto & dof_values_old = _vector_tags_dof_u[_old_solution_tag];
800  for (decltype(n) i = 0; i < n; ++i)
801  _nodal_value_old(i) = dof_values_old[i];
803  }
804  if (oldestSolutionStateRequested() >= 2)
805  {
806  auto & dof_values_older = _vector_tags_dof_u[_older_solution_tag];
807  for (decltype(n) i = 0; i < n; ++i)
808  _nodal_value_older(i) = dof_values_older[i];
810  }
812  for (decltype(n) i = 0; i < n; ++i)
815  for (decltype(n) i = 0; i < n; ++i)
818  for (decltype(n) i = 0; i < n; ++i)
821  for (decltype(n) i = 0; i < n; ++i)
823  }
825  {
826  auto & dof_values_previous_nl = _vector_tags_dof_u[_previous_nl_solution_tag];
827  for (decltype(n) i = 0; i < n; ++i)
828  _nodal_value_previous_nl(i) = dof_values_previous_nl[i];
829  }
830 }
DoFValue _dof_values_dotdot
second time derivative of the solution values
DoFValue _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.
DoFValue _dof_values_dot
time derivative of the solution values
OutputType _nodal_value
Nodal values.
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
MooseArray< OutputType > _nodal_value_array
Nodal values as MooseArrays for use with AuxKernels.
virtual bool isTransient() const =0
std::vector< DoFValue > _vector_tags_dof_u
libmesh_assert(ctx)
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
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
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
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 397 of file MooseVariableData.h.

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

◆ computeAD() [1/2]

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

compute AD things

Definition at line 681 of file MooseVariableData.C.

682 {
683  const bool do_derivatives = Moose::doDerivatives(_subproblem, _sys);
684 
685  _ad_dof_values.resize(num_dofs);
686  for (const auto i : make_range(num_dofs))
688  // NOTE! You have to do this AFTER setting the value!
689  if (do_derivatives)
690  for (const auto i : make_range(num_dofs))
691  Moose::derivInsert(_ad_dof_values[i].derivatives(), _dof_indices[i], 1.);
692 
693  if (_need_ad_u)
694  {
695  _ad_u.resize(nqp);
696  for (const auto qp : make_range(nqp))
697  _ad_u[qp] = _ad_zero;
698 
699  for (const auto i : make_range(num_dofs))
700  for (const auto qp : make_range(nqp))
701  _ad_u[qp] += _ad_dof_values[i] * (*_current_phi)[i][qp];
702  }
703 
704  if (_need_ad_grad_u)
705  {
706  _ad_grad_u.resize(nqp);
707  for (const auto qp : make_range(nqp))
708  _ad_grad_u[qp] = _ad_zero;
709 
710  // The latter check here is for handling the fact that we have not yet implemented
711  // calculation of ad_grad_phi for neighbor and neighbor-face, so if we are in that
712  // situation we need to default to using the non-ad grad_phi
714  for (const auto i : make_range(num_dofs))
715  for (const auto qp : make_range(nqp))
716  _ad_grad_u[qp] += _ad_dof_values[i] * (*_current_ad_grad_phi)[i][qp];
717  else
718  for (const auto i : make_range(num_dofs))
719  for (const auto qp : make_range(nqp))
720  _ad_grad_u[qp] += _ad_dof_values[i] * (*_current_grad_phi)[i][qp];
721  }
722 
723  if (_need_ad_second_u)
724  {
725  _ad_second_u.resize(nqp);
726  for (const auto qp : make_range(nqp))
727  _ad_second_u[qp] = _ad_zero;
728 
729  for (const auto i : make_range(num_dofs))
730  for (const auto qp : make_range(nqp))
731  // Note that this will not carry any derivatives with respect to displacements because
732  // those calculations have not yet been implemented in Assembly
733  _ad_second_u[qp] += _ad_dof_values[i] * (*_current_second_phi)[i][qp];
734  }
735 
736  if (_need_ad_curl_u)
737  {
738  _ad_curl_u.resize(nqp);
739  for (const auto qp : make_range(nqp))
740  _ad_curl_u[qp] = _ad_zero;
741 
742  for (const auto i : make_range(num_dofs))
743  for (const auto qp : make_range(nqp))
744  {
745  mooseAssert(_current_curl_phi,
746  "We're requiring a curl calculation but have not set a curl shape function!");
747 
748  // Note that the current version of _ad_curl_u is not yet implemented for mesh displacement
749  _ad_curl_u[qp] += _ad_dof_values[i] * (*_current_curl_phi)[i][qp];
750  }
751  }
752 
753  bool is_transient = _subproblem.isTransient();
754  if (is_transient)
755  {
756  if (_need_ad_u_dot)
757  {
758  _ad_dofs_dot.resize(num_dofs);
759  if (_need_ad_u_dotdot)
760  _ad_dofs_dotdot.resize(num_dofs);
761  _ad_u_dot.resize(nqp);
762  for (const auto qp : make_range(nqp))
763  _ad_u_dot[qp] = _ad_zero;
764 
766  {
767  for (const auto i : make_range(num_dofs))
769  for (const auto i : make_range(num_dofs))
771  _dof_indices[i],
773  : _ad_real_dummy);
774 
775  for (const auto i : make_range(num_dofs))
776  for (const auto qp : make_range(nqp))
777  _ad_u_dot[qp] += (*_current_phi)[i][qp] * _ad_dofs_dot[i];
778  }
779  else if (!_time_integrator)
780  {
781  for (const auto i : make_range(num_dofs))
783  for (const auto qp : make_range(nqp))
784  _ad_u_dot[qp] = _u_dot[qp];
785  }
786  }
787 
788  if (_need_ad_u_dotdot)
789  {
790  _ad_u_dotdot.resize(nqp);
791  for (const auto qp : make_range(nqp))
792  _ad_u_dotdot[qp] = _ad_zero;
793 
795  for (const auto i : make_range(num_dofs))
796  for (const auto qp : make_range(nqp))
797  _ad_u_dotdot[qp] += (*_current_phi)[i][qp] * _ad_dofs_dotdot[i];
798  else if (!_time_integrator)
799  for (const auto qp : make_range(nqp))
800  _ad_u_dotdot[qp] = _u_dotdot[qp];
801  }
802 
804  {
805  _ad_grad_u_dot.resize(nqp);
806  for (const auto qp : make_range(nqp))
807  _ad_grad_u_dot[qp] = _ad_zero;
808 
810  {
811  // The latter check here is for handling the fact that we have not yet implemented
812  // calculation of ad_grad_phi for neighbor and neighbor-face, so if we are in that
813  // situation we need to default to using the non-ad grad_phi
815  for (const auto i : make_range(num_dofs))
816  for (const auto qp : make_range(nqp))
817  _ad_grad_u_dot[qp] += _ad_dofs_dot[i] * (*_current_ad_grad_phi)[i][qp];
818  else
819  for (const auto i : make_range(num_dofs))
820  for (const auto qp : make_range(nqp))
821  _ad_grad_u_dot[qp] += _ad_dofs_dot[i] * (*_current_grad_phi)[i][qp];
822  }
823  else if (!_time_integrator)
824  for (const auto qp : make_range(nqp))
825  _ad_grad_u_dot[qp] = _grad_u_dot[qp];
826  }
827  }
828 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
ADTemplateVariableValue< OutputType > _ad_u
AD u.
MooseArray< ADReal > _ad_dofs_dot
ADTemplateVariableSecond< OutputType > _ad_second_u
const FieldVariablePhiGradient * _current_grad_phi
ADTemplateVariableGradient< OutputType > _ad_grad_u
const FieldVariablePhiCurl * _current_curl_phi
MooseArray< ADReal > _ad_dofs_dotdot
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.
ADTemplateVariableGradient< OutputType > _ad_grad_u_dot
DoFValue _dof_values_dot
time derivative of the solution values
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
Definition: ADUtils.C:83
FieldVariableValue _u_dot
u_dot (time derivative)
ADTemplateVariableValue< OutputType > _ad_u_dot
bool _need_ad_u_dot
AD u dot flags.
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.
ADReal _ad_zero
A zero AD variable.
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
FieldVariableGradient _grad_u_dot
grad_u dots
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
const bool _displaced
Whether this variable is being calculated on a displaced system.
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Definition: ADReal.h:21
const FieldVariablePhiValue * _current_phi
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
const ADTemplateVariablePhiGradient< OutputShape > * _current_ad_grad_phi
ADTemplateVariableValue< OutputType > _ad_u_dotdot
ADTemplateVariableCurl< OutputType > _ad_curl_u
MooseArray< ADReal > _ad_dof_values

◆ computeAD() [2/2]

template<>
void MooseVariableData< RealEigenVector >::computeAD ( const unsigned  int,
const unsigned  int 
)

Definition at line 832 of file MooseVariableData.C.

834 {
835  mooseError("AD for array variable has not been implemented");
836 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ 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 1184 of file MooseVariableData.C.

1185 {
1186  if (!isNodal())
1187  mooseError("computeIncrementAtNode can only be called for nodal variables");
1188 
1189  _increment.resize(1);
1190 
1191  // Compute the increment for the current DOF
1192  _increment[0] = increment_vec(_dof_indices[0]);
1193 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 1197 of file MooseVariableData.C.

1199 {
1200  if (!isNodal())
1201  mooseError("computeIncrementAtNode can only be called for nodal variables");
1202 
1203  _increment.resize(1);
1204 
1205  // Compute the increment for the current DOF
1206  if (isNodal())
1207  for (unsigned int j = 0; j < _count; j++)
1208  _increment[0](j) = increment_vec(_dof_indices[0] + j);
1209  else
1210  {
1211  unsigned int n = 0;
1212  const auto n_dof_indices = _dof_indices.size();
1213  for (const auto j : make_range(_count))
1214  {
1215  _increment[0](j) = increment_vec(_dof_indices[0] + n);
1216  n += n_dof_indices;
1217  }
1218  }
1219 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 1133 of file MooseVariableData.C.

1134 {
1135  unsigned int nqp = _qrule->n_points();
1136 
1137  _increment.resize(nqp);
1138  // Compute the increment at each quadrature point
1139  unsigned int num_dofs = _dof_indices.size();
1140  for (const auto qp : make_range(nqp))
1141  {
1142  _increment[qp] = 0.;
1143  for (const auto i : make_range(num_dofs))
1144  _increment[qp] += (*_phi)[i][qp] * increment_vec(_dof_indices[i]);
1145  }
1146 }
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 1150 of file MooseVariableData.C.

1152 {
1153  unsigned int nqp = _qrule->n_points();
1154 
1155  _increment.resize(nqp);
1156  // Compute the increment at each quadrature point
1157  unsigned int num_dofs = _dof_indices.size();
1158  if (isNodal())
1159  {
1160  for (const auto qp : make_range(nqp))
1161  {
1162  for (const auto i : make_range(num_dofs))
1163  for (const auto j : make_range(_count))
1164  _increment[qp](j) += (*_phi)[i][qp] * increment_vec(_dof_indices[i] + j);
1165  }
1166  }
1167  else
1168  {
1169  for (const auto qp : make_range(nqp))
1170  {
1171  unsigned int n = 0;
1172  for (const auto j : make_range(_count))
1173  for (const auto i : make_range(num_dofs))
1174  {
1175  _increment[qp](j) += (*_phi)[i][qp] * increment_vec(_dof_indices[i] + n);
1176  n += num_dofs;
1177  }
1178  }
1179  }
1180 }
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

◆ computeMonomialValues()

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

compute the values for const monomial variables

Definition at line 667 of file MooseVariableData.C.

668 {
669  if (_dof_indices.size() == 0)
670  return;
671 
672  // Monomial optimizations are not appropriate after p-refinement
673  if (_elem->p_level())
674  computeValues();
675  else
676  computeValuesInternal</* monomial = */ true>();
677 }
void computeValues()
compute the variable values
unsigned int p_level() const
void computeValuesInternal()
Internal method for computeValues() and computeMonomialValues()
const Elem *const & _elem
The current elem.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ computeNodalValues()

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

compute nodal things

Definition at line 1313 of file MooseVariableData.C.

1314 {
1315  if (_has_dof_indices)
1316  {
1317  fetchDoFValues();
1318  assignNodalValue();
1319 
1320  if (_need_ad)
1322  }
1323  else
1325 }
void fetchDoFValues()
Helper methods for assigning dof values from their corresponding solution values. ...
bool _need_ad
AD flags.

◆ computeValues()

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

compute the variable values

Definition at line 660 of file MooseVariableData.C.

661 {
662  computeValuesInternal</* monomial = */ false>();
663 }
void computeValuesInternal()
Internal method for computeValues() and computeMonomialValues()

◆ computeValuesInternal()

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

Internal method for computeValues() and computeMonomialValues()

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

Definition at line 428 of file MooseVariableData.C.

429 {
430  const auto num_dofs = _dof_indices.size();
431  if (num_dofs > 0)
432  fetchDoFValues();
433 
434  const bool is_transient = _subproblem.isTransient();
435  const auto nqp = _current_qrule->n_points();
436  auto && active_coupleable_matrix_tags = _subproblem.getActiveFEVariableCoupleableMatrixTags(_tid);
437 
438  // Map grad_phi using Eigen so that we can perform array operations easier
439  if constexpr (std::is_same_v<OutputType, RealEigenVector>)
440  {
441  if (_qrule == _current_qrule)
442  {
443  _mapped_grad_phi.resize(num_dofs);
444  for (const auto i : make_range(num_dofs))
445  {
446  _mapped_grad_phi[i].resize(nqp, Eigen::Map<RealDIMValue>(nullptr));
447  for (const auto qp : make_range(nqp))
448  // Note: this does NOT do any allocation. It is "reconstructing" the object in place
449  new (&_mapped_grad_phi[i][qp])
450  Eigen::Map<RealDIMValue>(const_cast<Real *>(&(*_current_grad_phi)[i][qp](0)));
451  }
452  }
453  else
454  {
455  _mapped_grad_phi_face.resize(num_dofs);
456  for (const auto i : make_range(num_dofs))
457  {
458  _mapped_grad_phi_face[i].resize(nqp, Eigen::Map<RealDIMValue>(nullptr));
459  for (const auto qp : make_range(nqp))
460  // Note: this does NOT do any allocation. It is "reconstructing" the object in place
461  new (&_mapped_grad_phi_face[i][qp])
462  Eigen::Map<RealDIMValue>(const_cast<Real *>(&(*_current_grad_phi)[i][qp](0)));
463  }
464  }
465  }
466 
467  mooseAssert(
470  "We're requiring a second calculation but have not set a second shape function!");
471  mooseAssert(!(_need_curl || _need_curl_old) || _current_curl_phi,
472  "We're requiring a curl calculation but have not set a curl shape function!");
473  mooseAssert(!(_need_div || _need_div_old) || _current_div_phi,
474  "We're requiring a divergence calculation but have not set a div shape function!");
475 
476  // Helper for filling values
477  const auto fill = [this, nqp, num_dofs](auto & dest, const auto & phi, const auto & dof_values)
478  {
479  if constexpr (monomial)
480  libmesh_ignore(num_dofs);
481 
482  // Deduce OutputType
483  constexpr bool is_real = std::is_same_v<OutputType, Real>;
484  constexpr bool is_real_vector = std::is_same_v<OutputType, RealVectorValue>;
485  constexpr bool is_eigen = std::is_same_v<OutputType, RealEigenVector>;
486  static_assert(is_real || is_real_vector || is_eigen, "Unsupported type");
487 
488  // this is only used in the RealEigenVector case to get this->_count
489  if constexpr (!is_eigen)
490  libmesh_ignore(this);
491 
492  // Deduce type of value within dest MooseArray
493  using dest_array_type = typename std::remove_reference_t<decltype(dest)>::value_type;
494  constexpr bool is_value = std::is_same_v<dest_array_type, OutputType>;
495  constexpr bool is_gradient = std::is_same_v<dest_array_type, OutputGradient>;
496  constexpr bool is_second = std::is_same_v<dest_array_type, OutputSecond>;
497  constexpr bool is_divergence = std::is_same_v<dest_array_type, OutputDivergence>;
498  static_assert(is_value || is_gradient || is_second || is_divergence,
499  "Unsupported destination array type");
500 
501  // Sets a value to zero at a quadrature point
502  const auto set_zero = [this, &dest](const auto qp)
503  {
504  if constexpr (!is_eigen)
505  libmesh_ignore(this);
506 
507  if constexpr (is_real || is_real_vector)
508  dest[qp] = 0;
509  else if constexpr (is_eigen)
510  {
511  if constexpr (is_value)
512  dest[qp].setZero(this->_count);
513  else if constexpr (is_gradient)
514  dest[qp].setZero(this->_count, LIBMESH_DIM);
515  else if constexpr (is_second)
516  dest[qp].setZero(this->_count, LIBMESH_DIM * LIBMESH_DIM);
517  else
518  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
519  }
520  else
521  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
522  };
523 
524  // Accumulates a value
525  const auto accumulate = [&dest, &phi, &dof_values](const auto i, const auto qp)
526  {
527  if constexpr (is_real || is_real_vector || (is_eigen && is_value))
528  {
529  if constexpr (is_value || is_divergence)
530  dest[qp] += phi[i][qp] * dof_values[i];
531  else if constexpr (is_gradient || is_second)
532  dest[qp].add_scaled(phi[i][qp], dof_values[i]);
533  else
534  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
535  }
536  else if constexpr (is_eigen)
537  {
538  if constexpr (is_gradient)
539  {
540  for (const auto d : make_range(Moose::dim))
541  dest[qp].col(d) += phi[i][qp](d) * dof_values[i];
542  }
543  else if constexpr (is_second)
544  {
545  for (unsigned int d = 0, d1 = 0; d1 < LIBMESH_DIM; ++d1)
546  for (const auto d2 : make_range(Moose::dim))
547  dest[qp].col(d++) += phi[i][qp](d1, d2) * dof_values[i];
548  }
549  else
550  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
551  }
552  else
553  static_assert(Moose::always_false<OutputType, dest_array_type>, "Unsupported type");
554  };
555 
556  dest.resize(nqp);
557 
558  // Monomial case, accumulate dest[0] and set dest[>0] to dest[0]
559  if constexpr (monomial)
560  {
561  mooseAssert(num_dofs == 1, "Should have only one dof");
562  set_zero(0);
563  accumulate(0, 0);
564  for (unsigned int qp = 1; qp < nqp; ++qp)
565  dest[qp] = dest[0];
566  }
567  // Non monomial case
568  else
569  {
570  for (const auto qp : make_range(nqp))
571  set_zero(qp);
572  for (const auto i : make_range(num_dofs))
573  for (const auto qp : make_range(nqp))
574  accumulate(i, qp);
575  }
576  };
577 
578  // Curl
579  if (_need_curl)
581  if (_need_curl_old)
583 
584  // Div
585  if (_need_div)
587  if (is_transient && _need_div_old)
589 
590  // Second
591  if (_need_second)
594  fill(
596 
597  // Vector tags
598  for (auto tag : _required_vector_tags)
599  {
600  if (_need_vector_tag_u[tag] && _sys.hasVector(tag) && _sys.getVector(tag).closed())
601  fill(_vector_tag_u[tag], *_current_phi, _vector_tags_dof_u[tag]);
602  if (_need_vector_tag_grad[tag] && _sys.hasVector(tag) && _sys.getVector(tag).closed())
604  }
605 
606  // Matrix tags
607  for (auto tag : active_coupleable_matrix_tags)
608  if (_need_matrix_tag_u[tag])
609  fill(_matrix_tag_u[tag], *_current_phi, _matrix_tags_dof_u[tag]);
610 
611  // Derivatives and old values
612  if (is_transient)
613  {
614  if (_need_second_old)
616  if (_need_second_older)
618  if (_need_u_dot)
620  if (_need_u_dotdot)
622  if (_need_u_dot_old)
624  if (_need_u_dotdot_old)
626 
627  if (_need_du_dot_du)
628  {
629  _du_dot_du.resize(nqp);
630  for (const auto qp : make_range(nqp))
631  _du_dot_du[qp] = 0.;
632  for (const auto i : make_range(num_dofs))
633  for (const auto qp : make_range(nqp))
634  _du_dot_du[qp] = _dof_du_dot_du[i];
635  }
636  if (_need_du_dotdot_du)
637  {
638  _du_dotdot_du.resize(nqp);
639  for (const auto qp : make_range(nqp))
640  _du_dotdot_du[qp] = 0.;
641  for (const auto i : make_range(num_dofs))
642  for (const auto qp : make_range(nqp))
644  }
645 
646  if (_need_grad_dot)
648  if (_need_grad_dotdot)
650  }
651 
652  // Automatic differentiation, not for eigen
653  if constexpr (!std::is_same_v<OutputType, RealEigenVector>)
654  if (_need_ad)
655  computeAD(num_dofs, nqp);
656 }
FieldVariableCurl _curl_u_old
std::vector< DoFValue > _matrix_tags_dof_u
bool _need_grad_dot
gradient dot flags
void computeAD(const unsigned int num_dofs, const unsigned int nqp)
compute AD things
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
DoFValue _dof_values_dotdot
second time derivative of the solution values
MappedArrayVariablePhiGradient _mapped_grad_phi
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:390
std::vector< FieldVariableValue > _matrix_tag_u
FieldVariableSecond _second_u_older
void fetchDoFValues()
Helper methods for assigning dof values from their corresponding solution values. ...
FieldVariableSecond _second_u_previous_nl
std::vector< bool > _need_vector_tag_u
bool _need_second
SolutionState second_u flags.
const FieldVariablePhiGradient * _current_grad_phi
MappedArrayVariablePhiGradient _mapped_grad_phi_face
DoFValue _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:153
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
DoFValue _dof_values_dot
time derivative of the solution values
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 ...
void libmesh_ignore(const Args &...)
FieldVariableValue _u_dot
u_dot (time derivative)
const FieldVariablePhiValue & phi() const
phi getter
FieldVariableSecond _second_u
second_u
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
bool _need_curl
curl flags
virtual bool isTransient() const =0
FieldVariableGradient _grad_u_dotdot
std::vector< DoFValue > _vector_tags_dof_u
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.
FieldVariableDivergence _div_u
divergence_u
bool _need_ad
AD flags.
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
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.
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.
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:916
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 234 of file MooseVariableData.h.

234 { 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 239 of file MooseVariableData.h.

239 { 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 395 of file MooseVariableData.C.

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

396 {
398  return *_curl_phi;
399 }
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 403 of file MooseVariableData.C.

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

404 {
406  return *_curl_phi_face;
407 }
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 317 of file MooseVariableData.C.

318 {
319  curlPhi();
320  curlPhiFace();
321  switch (state)
322  {
323  case Moose::Current:
324  {
325  _need_curl = true;
326  return _curl_u;
327  }
328 
329  case Moose::Old:
330  {
331  _need_curl_old = true;
332  return _curl_u_old;
333  }
334 
335  case Moose::Older:
336  {
337  _need_curl_older = true;
338  return _curl_u_older;
339  }
340 
341  default:
342  mooseError("We don't currently support curl from the previous non-linear iteration");
343  }
344 }
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:302
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 253 of file MooseVariableData.h.

253 { 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 258 of file MooseVariableData.h.

258 { 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 411 of file MooseVariableData.C.

412 {
414  return *_div_phi;
415 }
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 419 of file MooseVariableData.C.

420 {
422  return *_div_phi_face;
423 }
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 348 of file MooseVariableData.C.

349 {
350  divPhi();
351  divPhiFace();
352  switch (state)
353  {
354  case Moose::Current:
355  {
356  _need_div = true;
357  return _div_u;
358  }
359 
360  case Moose::Old:
361  {
362  _need_div_old = true;
363  return _div_u_old;
364  }
365 
366  case Moose::Older:
367  {
368  _need_div_older = true;
369  return _div_u_older;
370  }
371 
372  default:
373  mooseError("We don't currently support divergence from the previous non-linear iteration");
374  }
375 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 395 of file MooseVariableData.h.

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

◆ dofValues()

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

Definition at line 333 of file MooseVariableDataBase.C.

334 {
336 }
const DoFValue & vectorTagDofValue(TagID tag) const

◆ dofValuesDot()

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

Definition at line 1058 of file MooseVariableData.C.

1059 {
1060  if (_sys.solutionUDot())
1061  {
1062  _need_dof_values_dot = true;
1063  return _dof_values_dot;
1064  }
1065  else
1066  mooseError("MooseVariableData: Time derivative of solution (`u_dot`) is not stored. Please set "
1067  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
1068 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
DoFValue _dof_values_dot
time derivative of the solution values
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:252
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 >::DoFValue & MooseVariableData< OutputType >::dofValuesDotDot ( ) const

Definition at line 1072 of file MooseVariableData.C.

1073 {
1074  if (_sys.solutionUDotDot())
1075  {
1076  _need_dof_values_dotdot = true;
1077  return _dof_values_dotdot;
1078  }
1079  else
1080  mooseError("MooseVariableData: Second time derivative of solution (`u_dotdot`) is not stored. "
1081  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
1082  "`u_dotdot`.");
1083 }
DoFValue _dof_values_dotdot
second time derivative of the solution values
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:253

◆ dofValuesDotDotOld()

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

Definition at line 1102 of file MooseVariableData.C.

1103 {
1104  if (_sys.solutionUDotDotOld())
1105  {
1107  return _dof_values_dotdot_old;
1108  }
1109  else
1110  mooseError("MooseVariableData: Old second time derivative of solution (`u_dotdot_old`) is not "
1111  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
1112  "requesting `u_dotdot_old`.");
1113 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
DoFValue _dof_values_dotdot_old
the previous time step&#39;s solution value second time derivative
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:255
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ dofValuesDotOld()

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

Definition at line 1087 of file MooseVariableData.C.

1088 {
1089  if (_sys.solutionUDotOld())
1090  {
1091  _need_dof_values_dot_old = true;
1092  return _dof_values_dot_old;
1093  }
1094  else
1095  mooseError("MooseVariableData: Old time derivative of solution (`u_dot_old`) is not stored. "
1096  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
1097  "`u_dot_old`.");
1098 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:254
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...

◆ dofValuesDuDotDotDu()

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

Definition at line 1125 of file MooseVariableData.C.

1126 {
1127  _need_dof_du_dotdot_du = true;
1128  return _dof_du_dotdot_du;
1129 }
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 1117 of file MooseVariableData.C.

1118 {
1119  _need_dof_du_dot_du = true;
1120  return _dof_du_dot_du;
1121 }
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 >::DoFValue & MooseVariableDataBase< OutputType >::dofValuesOld ( ) const
inherited

Definition at line 340 of file MooseVariableDataBase.C.

341 {
343 }
const DoFValue & vectorTagDofValue(TagID tag) const

◆ dofValuesOlder()

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

Definition at line 347 of file MooseVariableDataBase.C.

348 {
350 }
const DoFValue & vectorTagDofValue(TagID tag) const

◆ dofValuesPreviousNL()

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

Definition at line 354 of file MooseVariableDataBase.C.

355 {
357 }
const DoFValue & vectorTagDofValue(TagID tag) const

◆ duDotDotDu()

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

Definition at line 347 of file MooseVariableData.h.

348  {
349  _need_du_dotdot_du = true;
350  return _du_dotdot_du;
351  }
VariableValue _du_dotdot_du
derivative of u_dotdot wrt u

◆ duDotDu()

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

Definition at line 341 of file MooseVariableData.h.

342  {
343  _need_du_dot_du = true;
344  return _du_dot_du;
345  }
VariableValue _du_dot_du
derivative of u_dot wrt u

◆ fetchADNodalValues() [1/2]

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

Definition at line 1329 of file MooseVariableData.C.

1330 {
1331  auto n = _dof_indices.size();
1332  libmesh_assert(n);
1334 
1335  if (_need_ad_u_dot)
1336  _ad_dofs_dot.resize(n);
1337  if (_need_ad_u_dotdot)
1339 
1340  const bool do_derivatives =
1341  ADReal::do_derivatives && _sys.number() == _subproblem.currentNlSysNum();
1342 
1343  for (decltype(n) i = 0; i < n; ++i)
1344  {
1346  if (do_derivatives)
1347  Moose::derivInsert(_ad_dof_values[i].derivatives(), _dof_indices[i], 1.);
1349 
1350  if (_need_ad_u_dot)
1351  {
1353  {
1354  _ad_dofs_dot[i] = _ad_dof_values[i];
1356  _dof_indices[i],
1358  : _ad_real_dummy);
1359  }
1360  // Executing something with a time derivative at initial should not put a NaN
1361  else if (_time_integrator && !_time_integrator->dt())
1362  _ad_dofs_dot[i] = 0.;
1363  else
1364  mooseError("AD nodal time derivatives not implemented for variables without a time "
1365  "integrator (auxiliary variables)");
1366  }
1367  }
1368 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual unsigned int currentNlSysNum() const =0
MooseArray< ADReal > _ad_dofs_dot
MooseArray< ADReal > _ad_dofs_dotdot
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.
void assignADNodalValue(const ADReal &value, const unsigned int &component)
Helper methods for assigning nodal values from their corresponding solution values (dof values as the...
bool _need_ad_u_dot
AD u dot flags.
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.
std::vector< DoFValue > _vector_tags_dof_u
libmesh_assert(ctx)
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1159
const TimeIntegrator * _time_integrator
Pointer to time integrator.
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
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
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.
MooseArray< ADReal > _ad_dof_values

◆ fetchADNodalValues() [2/2]

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

Definition at line 1372 of file MooseVariableData.C.

1373 {
1374  mooseError("I do not know how to support AD with array variables");
1375 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ 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 529 of file MooseVariableDataBase.C.

530 {
531  bool is_transient = _subproblem.isTransient();
532 
533  auto n = _dof_indices.size();
534  libmesh_assert(n);
535 
536  if (is_transient)
537  {
539  {
543  }
545  {
549  }
551  {
555  }
557  {
561  }
562  }
563 
564  for (auto tag : _required_vector_tags)
569  {
570  // tag is defined on problem but may not be used by a system
571  // the grain tracker requires being able to read from solution vectors that we are also in
572  // the process of writing :-/
573  if (_sys.hasVector(tag) /* && _sys.getVector(tag).closed()*/)
574  {
575  auto & vec = _sys.getVector(tag);
576  _vector_tags_dof_u[tag].resize(n);
577  vec.get(_dof_indices, &_vector_tags_dof_u[tag][0]);
578  }
579  }
580 
582  {
583  auto & active_coupleable_matrix_tags =
585 
586  for (auto tag : active_coupleable_matrix_tags)
587  {
588  _matrix_tags_dof_u[tag].resize(n);
590  if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag) && _sys.getMatrix(tag).closed())
591  {
592  auto & mat = _sys.getMatrix(tag);
593  for (unsigned i = 0; i < n; i++)
594  {
595  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
596  _matrix_tags_dof_u[tag][i] = mat(_dof_indices[i], _dof_indices[i]);
597  }
598  }
599  }
600  }
601 
603  {
605  for (decltype(n) i = 0; i < n; ++i)
606  _dof_du_dot_du[i] = _sys.duDotDu(_var.number());
607  }
609  {
611  for (decltype(n) i = 0; i < n; ++i)
613  }
614 }
std::vector< DoFValue > _matrix_tags_dof_u
bool _need_grad_dot
gradient dot flags
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
DoFValue _dof_values_dotdot
second time derivative of the solution values
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:390
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
DoFValue _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:351
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:255
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
DoFValue _dof_values_dot
time derivative of the solution values
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:248
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
virtual const Number & duDotDu(unsigned int var_num=0) const
Definition: SystemBase.C:1668
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:252
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:254
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C:231
std::vector< DoFValue > _vector_tags_dof_u
libmesh_assert(ctx)
virtual bool matrixTagActive(TagID tag) const
If or not a matrix tag is active.
Definition: SystemBase.C:1151
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
virtual bool closed() const=0
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:1007
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.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:253
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:916
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 650 of file MooseVariableDataBase.C.

651 {
652  bool is_transient = _subproblem.isTransient();
653 
654  auto n = _dof_indices.size();
655  libmesh_assert(n);
656 
657  if (is_transient)
658  {
660  {
663  }
665  {
668  }
670  {
673  }
675  {
678  }
679  }
680 
681  for (auto tag : _required_vector_tags)
685  // tag is defined on problem but may not be used by a system
686  if (_sys.hasVector(tag) && _sys.getVector(tag).closed())
688 
690  {
691  auto & active_coupleable_matrix_tags =
693  for (auto tag : active_coupleable_matrix_tags)
694  {
695  _matrix_tags_dof_u[tag].resize(n);
697  if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag) && _sys.getMatrix(tag).closed())
698  {
699  auto & mat = _sys.getMatrix(tag);
700  for (unsigned i = 0; i < n; i++)
701  {
702  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
703  for (unsigned j = 0; j < _count; j++)
704  _matrix_tags_dof_u[tag][i](j) = mat(_dof_indices[i] + j, _dof_indices[i] + j);
705  }
706  }
707  }
708  }
709 
711  {
713  for (decltype(n) i = 0; i < n; ++i)
714  _dof_du_dot_du[i] = _sys.duDotDu(_var.number());
715  }
717  {
719  for (decltype(n) i = 0; i < n; ++i)
721  }
722 }
std::vector< DoFValue > _matrix_tags_dof_u
bool _need_grad_dot
gradient dot flags
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
DoFValue _dof_values_dotdot
second time derivative of the solution values
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:390
virtual bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
Definition: SubProblem.h:734
void getArrayDoFValues(const libMesh::NumericVector< libMesh::Number > &sol, unsigned int n, MooseArray< RealEigenVector > &dof_values) const
DoFValue _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:351
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:255
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
DoFValue _dof_values_dot
time derivative of the solution values
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:248
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
virtual const Number & duDotDu(unsigned int var_num=0) const
Definition: SystemBase.C:1668
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:252
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:254
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C:231
std::vector< DoFValue > _vector_tags_dof_u
libmesh_assert(ctx)
virtual bool matrixTagActive(TagID tag) const
If or not a matrix tag is active.
Definition: SystemBase.C:1151
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
virtual bool closed() const=0
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:1007
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.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:253
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:916
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ 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 618 of file MooseVariableDataBase.C.

621 {
622  dof_values.resize(n);
623  if (isNodal())
624  {
625  for (unsigned int i = 0; i < n; ++i)
626  {
627  dof_values[i].resize(_count);
628  auto dof = _dof_indices[i];
629  for (unsigned int j = 0; j < _count; ++j)
630  dof_values[i](j) = sol(dof++);
631  }
632  }
633  else
634  {
635  for (unsigned int i = 0; i < n; ++i)
636  {
637  dof_values[i].resize(_count);
638  auto dof = _dof_indices[i];
639  for (unsigned int j = 0; j < _count; ++j)
640  {
641  dof_values[i](j) = sol(dof);
642  dof += n;
643  }
644  }
645  }
646 }
virtual bool isNodal() const =0
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 245 of file MooseVariableData.h.

245 { 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 1027 of file MooseVariableData.C.

1029 {
1030  _dof_map.dof_indices(elem, dof_indices, _var_num);
1031 }
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

◆ getElementalValue() [1/2]

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

Definition at line 966 of file MooseVariableData.C.

969 {
970  std::vector<dof_id_type> dof_indices;
971  _dof_map.dof_indices(elem, dof_indices, _var_num);
972 
973  switch (state)
974  {
975  case Moose::Current:
976  return (*_sys.currentSolution())(dof_indices[idx]);
977 
978  case Moose::Old:
979  return _sys.solutionOld()(dof_indices[idx]);
980 
981  case Moose::Older:
982  return _sys.solutionOlder()(dof_indices[idx]);
983 
984  default:
985  mooseError("PreviousNL not currently supported for getElementalValue");
986  }
987 }
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:302
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:197
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:196
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,
Moose::SolutionState  state,
unsigned int  idx 
) const

Definition at line 991 of file MooseVariableData.C.

994 {
995  std::vector<dof_id_type> dof_indices;
996  _dof_map.dof_indices(elem, dof_indices, _var_num);
997 
998  dof_id_type dof = dof_indices[idx];
999 
1001 
1002  switch (state)
1003  {
1004  case Moose::Current:
1005  for (unsigned int i = 0; i < _count; ++i)
1006  v(i) = (*_sys.currentSolution())(dof++);
1007  break;
1008 
1009  case Moose::Old:
1010  for (unsigned int i = 0; i < _count; ++i)
1011  v(i) = _sys.solutionOld()(dof++);
1012  break;
1013 
1014  case Moose::Older:
1015  for (unsigned int i = 0; i < _count; ++i)
1016  v(i) = _sys.solutionOlder()(dof++);
1017  break;
1018 
1019  default:
1020  mooseError("PreviousNL not currently supported for getElementalValue");
1021  }
1022  return v;
1023 }
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:302
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:197
const unsigned int _var_num
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:146
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:196
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
uint8_t dof_id_type

◆ getNodalValue() [1/2]

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

Definition at line 895 of file MooseVariableData.C.

896 {
897  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
898 
899  // Make sure that the node has DOFs
900  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
901  * produce a better error (see misc/check_error.node_value_off_block) */
902  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
903  "Node " << node.id() << " does not contain any dofs for the "
904  << _sys.system().variable_name(_var_num) << " variable");
905 
907 
908  switch (state)
909  {
910  case Moose::Current:
911  return (*_sys.currentSolution())(dof);
912 
913  case Moose::Old:
914  return _sys.solutionOld()(dof);
915 
916  case Moose::Older:
917  return _sys.solutionOlder()(dof);
918 
919  default:
920  mooseError("PreviousNL not currently supported for getNodalValue");
921  }
922 }
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:302
bool isSemiLocal(Node *const node) const
Returns true if the node is semi-local.
Definition: MooseMesh.C:989
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:197
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:1159
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:196
uint8_t dof_id_type

◆ getNodalValue() [2/2]

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

Definition at line 926 of file MooseVariableData.C.

928 {
929  mooseAssert(_subproblem.mesh().isSemiLocal(const_cast<Node *>(&node)), "Node is not Semilocal");
930 
931  // Make sure that the node has DOFs
932  /* Note, this is a reproduction of an assert within libMesh::Node::dof_number, this is done to
933  * produce a better error (see misc/check_error.node_value_off_block) */
934  mooseAssert(node.n_dofs(_sys.number(), _var_num) > 0,
935  "Node " << node.id() << " does not contain any dofs for the "
936  << _sys.system().variable_name(_var_num) << " variable");
937 
939 
941  switch (state)
942  {
943  case Moose::Current:
944  for (unsigned int i = 0; i < _count; ++i)
945  v(i) = (*_sys.currentSolution())(dof++);
946  break;
947 
948  case Moose::Old:
949  for (unsigned int i = 0; i < _count; ++i)
950  v(i) = _sys.solutionOld()(dof++);
951  break;
952 
953  case Moose::Older:
954  for (unsigned int i = 0; i < _count; ++i)
955  v(i) = _sys.solutionOlder()(dof++);
956  break;
957 
958  default:
959  mooseError("PreviousNL not currently supported for getNodalValue");
960  }
961  return v;
962 }
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:302
bool isSemiLocal(Node *const node) const
Returns true if the node is semi-local.
Definition: MooseMesh.C:989
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:197
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:1159
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:146
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:196
uint8_t dof_id_type

◆ gradPhi()

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

grad_phi getter

Definition at line 148 of file MooseVariableData.h.

148 { 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 162 of file MooseVariableData.h.

162 { 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 312 of file MooseVariableDataBase.C.

313 {
314  auto functor = [this](TagID tag_id) -> const FieldVariableGradient &
315  { return vectorTagGradient(tag_id); };
316 
317  return const_cast<MooseVariableDataBase<OutputType> *>(this)
318  ->stateToTagHelper<FieldVariableGradient>(state, functor);
319 }
unsigned int TagID
Definition: MooseTypes.h:210
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 249 of file MooseVariableData.C.

250 {
251  if (_sys.solutionUDot())
252  {
253  _need_grad_dot = true;
254  return _grad_u_dot;
255  }
256  else
257  mooseError("MooseVariableFE: Time derivative of solution (`u_dot`) is not stored. Please set "
258  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
259 }
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:302
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:252
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 263 of file MooseVariableData.C.

264 {
265  if (_sys.solutionUDotDot())
266  {
267  _need_grad_dotdot = true;
268  return _grad_u_dotdot;
269  }
270  else
271  mooseError("MooseVariableFE: Second time derivative of solution (`u_dotdot`) is not stored. "
272  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
273  "`u_dotdot`.");
274 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:253

◆ 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 244 of file MooseVariableData.h.

244 { 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 451 of file MooseVariableData.h.

451 { 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 390 of file MooseVariableDataBase.C.

391 {
392  if (_has_dof_values)
393  {
394  auto & dof_values = _vector_tags_dof_u[_solution_tag];
395  mooseAssert(dof_values.size() == _dof_indices.size(),
396  "Degree of freedom values size and degree of freedom indices sizes must match.");
397  residual.insert(&dof_values[0], _dof_indices);
398  }
399 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
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 403 of file MooseVariableDataBase.C.

404 {
405  if (_has_dof_values)
406  {
407  auto & dof_values = _vector_tags_dof_u[_solution_tag];
408  if (isNodal())
409  {
410  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
411  for (unsigned int j = 0; j < _count; ++j)
412  residual.set(_dof_indices[i] + j, dof_values[i](j));
413  }
414  else
415  {
416  unsigned int n = 0;
417  for (unsigned int j = 0; j < _count; ++j)
418  {
419  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
420  residual.set(_dof_indices[i] + n, dof_values[i](j));
421  n += _dof_indices.size();
422  }
423  }
424  }
425 }
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
virtual bool isNodal() const =0
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.

◆ insertNodalValue() [1/2]

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

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

Definition at line 878 of file MooseVariableData.C.

880 {
881  residual.set(_nodal_dof_index, v);
882 }
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 886 of file MooseVariableData.C.

888 {
889  for (const auto j : make_range(_count))
890  residual.set(_nodal_dof_index + j, v(j));
891 }
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 323 of file MooseVariableDataBase.h.

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

324 {
325  _solution_tags.insert(tag_id);
326  _required_vector_tags.insert(tag_id);
327 }
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 243 of file MooseVariableData.h.

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

◆ isNodalDefined()

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

Definition at line 248 of file MooseVariableData.h.

248 { return _has_dof_indices; }

◆ matrixTagValue()

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

Definition at line 219 of file MooseVariableDataBase.C.

220 {
221  if (tag >= _matrix_tag_u.size())
222  {
223  _need_matrix_tag_u.resize(tag + 1, false);
224  const_cast<MooseVariableDataBase<OutputType> *>(this)->_matrix_tag_u.resize(tag + 1);
225  }
226 
227  _need_matrix_tag_u[tag] = true;
228 
229  if (_sys.hasMatrix(tag))
230  return _matrix_tag_u[tag];
231  else
232  mooseError("Tag ", tag, " is not associated with any matrix for variable ", _var.name());
233 }
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:302
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:351
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 103 of file MooseVariableData.h.

103 { 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 244 of file MooseVariableDataBase.C.

245 {
246  if (state > _max_state)
247  {
248  _sys.needSolutionState(state);
249  _max_state = state;
250  }
251 }
virtual void needSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Registers that the solution state state is needed.
Definition: SystemBase.C:1428
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 247 of file MooseVariableData.h.

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

◆ nodalMatrixTagValue()

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

Definition at line 116 of file MooseVariableDataBase.C.

117 {
118  if (isNodal())
119  {
120  if (tag >= _matrix_tags_dof_u.size())
121  {
122  _need_matrix_tag_dof_u.resize(tag + 1, false);
123  const_cast<MooseVariableDataBase<OutputType> *>(this)->_matrix_tags_dof_u.resize(tag + 1);
124  }
125 
126  _need_matrix_tag_dof_u[tag] = true;
127 
128  if (_sys.hasMatrix(tag))
129  return _matrix_tags_dof_u[tag];
130  else
131  mooseError(
132  "Tag ", tag, " is not associated with any matrix for nodal variable ", _var.name());
133  }
134  else
135  mooseError("Nodal values can be requested only on nodal variables, variable '",
136  _var.name(),
137  "' is not nodal.");
138 }
std::vector< DoFValue > _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:302
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:351
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 466 of file MooseVariableDataBase.C.

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

◆ nodalValueArray()

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

Definition at line 500 of file MooseVariableDataBase.C.

501 {
502  if (isNodal())
503  {
504  // Request the correct solution states and data members
505  vectorTagDofValue(state);
506  switch (state)
507  {
508  case Moose::Current:
509  return _nodal_value_array;
510 
511  case Moose::Old:
512  return _nodal_value_old_array;
513 
514  case Moose::Older:
516 
517  default:
518  mooseError("No current support for PreviousNL for nodal value array");
519  }
520  }
521  else
522  mooseError("Nodal values can be requested only on nodal variables, variable '",
523  _var.name(),
524  "' is not nodal.");
525 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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.
const DoFValue & vectorTagDofValue(TagID tag) const

◆ nodalValueDot()

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

Definition at line 1223 of file MooseVariableData.C.

1224 {
1225  if (isNodal())
1226  {
1227  if (_sys.solutionUDot())
1228  {
1229  _need_dof_values_dot = true;
1230  return _nodal_value_dot;
1231  }
1232  else
1233  mooseError(
1234  "MooseVariableData: Time derivative of solution (`u_dot`) is not stored. Please set "
1235  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
1236  }
1237  else
1238  mooseError("Nodal values can be requested only on nodal variables, variable '",
1239  var().name(),
1240  "' is not nodal.");
1241 }
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:302
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:252
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 1245 of file MooseVariableData.C.

1246 {
1247  if (isNodal())
1248  {
1249  if (_sys.solutionUDotDot())
1250  {
1251  _need_dof_values_dotdot = true;
1252  return _nodal_value_dotdot;
1253  }
1254  else
1255  mooseError(
1256  "MooseVariableData: Second time derivative of solution (`u_dotdot`) is not stored. "
1257  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
1258  "`u_dotdot`.");
1259  }
1260  else
1261  mooseError("Nodal values can be requested only on nodal variables, variable '",
1262  var().name(),
1263  "' is not nodal.");
1264 }
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:302
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:253
bool isNodal() const override

◆ nodalValueDotDotOld()

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

Definition at line 1290 of file MooseVariableData.C.

1291 {
1292  if (isNodal())
1293  {
1294  if (_sys.solutionUDotDotOld())
1295  {
1297  return _nodal_value_dotdot_old;
1298  }
1299  else
1300  mooseError(
1301  "MooseVariableData: Old second time derivative of solution (`u_dotdot_old`) is not "
1302  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
1303  "requesting `u_dotdot_old`.");
1304  }
1305  else
1306  mooseError("Nodal values can be requested only on nodal variables, variable '",
1307  var().name(),
1308  "' is not nodal.");
1309 }
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:302
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:255
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 1268 of file MooseVariableData.C.

1269 {
1270  if (isNodal())
1271  {
1272  if (_sys.solutionUDotOld())
1273  {
1274  _need_dof_values_dot_old = true;
1275  return _nodal_value_dot_old;
1276  }
1277  else
1278  mooseError("MooseVariableData: Old time derivative of solution (`u_dot_old`) is not stored. "
1279  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
1280  "`u_dot_old`.");
1281  }
1282  else
1283  mooseError("Nodal values can be requested only on nodal variables, variable '",
1284  var().name(),
1285  "' is not nodal.");
1286 }
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:302
virtual const MooseVariableField< OutputType > & var() const
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:254
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 >::DoFValue & MooseVariableDataBase< OutputType >::nodalVectorTagValue ( TagID  tag) const
inherited

Definition at line 93 of file MooseVariableDataBase.C.

94 {
95  if (isNodal())
96  {
97  if (tag >= _need_vector_tag_dof_u.size())
99 
100  _need_vector_tag_dof_u[tag] = true;
101 
102  if (_sys.hasVector(tag))
103  return _vector_tags_dof_u[tag];
104  else
105  mooseError(
106  "Tag ", tag, " is not associated with any vector for nodal variable ", _var.name());
107  }
108  else
109  mooseError("Nodal values can be requested only on nodal variables, variable '",
110  _var.name(),
111  "' is not nodal.");
112 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
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:302
std::vector< bool > _need_vector_tag_dof_u
std::vector< DoFValue > _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 246 of file MooseVariableData.h.

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

◆ numberOfDofs()

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

Definition at line 396 of file MooseVariableData.h.

396 { 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 237 of file MooseVariableDataBase.C.

238 {
239  return _max_state;
240 }
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 138 of file MooseVariableData.h.

138 { return *_phi; }
const FieldVariablePhiValue * _phi

◆ phiFace()

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

phi_face getter

Definition at line 143 of file MooseVariableData.h.

143 { 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 221 of file MooseVariableData.h.

221 { 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 216 of file MooseVariableData.h.

216 { 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 1405 of file MooseVariableData.C.

1406 {
1408  _has_dof_values = false;
1409 
1410  // FIXME: remove this when the Richard's module is migrated to use the new NodalCoupleable
1411  // interface.
1412  _has_dof_indices = _dof_indices.size();
1413 }
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.
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 140 of file MooseVariableDataBase.h.

140 { _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 1394 of file MooseVariableData.C.

1395 {
1398 
1399  unsigned int nqp = _qrule->n_points();
1400  _vector_tag_u[_solution_tag].resize(nqp);
1401 }
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
std::vector< DoFValue > _vector_tags_dof_u
unsigned int n_points() const
const QBase *const & _qrule
The current qrule.
const Elem *const & _elem
The current elem.
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
std::vector< FieldVariableValue > _vector_tag_u
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 1438 of file MooseVariableData.C.

1439 {
1440  /* FIXME: this method is only for elemental auxiliary variables, so
1441  * we may want to rename it */
1442  if (_elem)
1443  {
1445  if (_elem->n_dofs(_sys.number(), _var_num) > 0)
1446  {
1447  // FIXME: check if the following is equivalent with '_nodal_dof_index = _dof_indices[0];'?
1449 
1450  fetchDoFValues();
1451 
1452  const auto num_dofs = _dof_indices.size();
1453  for (auto & dof_u : _vector_tags_dof_u)
1454  dof_u.resize(num_dofs);
1455 
1456  for (auto & dof_u : _matrix_tags_dof_u)
1457  dof_u.resize(num_dofs);
1458 
1459  _has_dof_indices = true;
1460  }
1461  else
1462  _has_dof_indices = false;
1463  }
1464  else
1465  _has_dof_indices = false;
1466 }
std::vector< DoFValue > _matrix_tags_dof_u
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void fetchDoFValues()
Helper methods for assigning dof values from their corresponding solution values. ...
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
std::vector< DoFValue > _vector_tags_dof_u
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1159
const Elem *const & _elem
The current elem.
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.

◆ reinitNode()

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

Prepare degrees of freedom for the current node.

Definition at line 1417 of file MooseVariableData.C.

1418 {
1419  if (std::size_t n_dofs = _node->n_dofs(_sys.number(), _var_num))
1420  {
1421  _dof_indices.resize(n_dofs);
1422  for (std::size_t i = 0; i < n_dofs; ++i)
1424  // For standard variables. _nodal_dof_index is retrieved by nodalDofIndex() which is used in
1425  // NodalBC for example
1427  _has_dof_indices = true;
1428  }
1429  else
1430  {
1431  _dof_indices.clear(); // Clear these so Assembly doesn't think there's dofs here
1432  _has_dof_indices = false;
1433  }
1434 }
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) 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
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:1159
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.

◆ 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 1470 of file MooseVariableData.C.

1471 {
1472  _dof_indices.clear();
1473  for (const auto & node_id : nodes)
1474  {
1475  auto && nd = _subproblem.mesh().getMesh().query_node_ptr(node_id);
1476  if (nd && (_subproblem.mesh().isSemiLocal(const_cast<Node *>(nd))))
1477  {
1478  if (nd->n_dofs(_sys.number(), _var_num) > 0)
1479  {
1480  dof_id_type dof = nd->dof_number(_sys.number(), _var_num, 0);
1481  _dof_indices.push_back(dof);
1482  }
1483  }
1484  }
1485 
1486  if (!_dof_indices.empty())
1487  _has_dof_indices = true;
1488  else
1489  _has_dof_indices = false;
1490 }
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:989
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:3443
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:1159
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 142 of file MooseVariableDataBase.C.

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

143 {
144  mooseAssert(_need_vector_tag_dof_u.size() == _need_vector_tag_u.size() &&
146  _need_vector_tag_dof_u.size() == _vector_tags_dof_u.size() &&
147  _need_vector_tag_dof_u.size() == _vector_tag_u.size() &&
148  _need_vector_tag_dof_u.size() == _vector_tag_grad.size(),
149  "These sizes should be in sync.");
150 
151  auto check_capacity = [tag](const auto & vector_to_check)
152  {
153  if (tag + 1 > vector_to_check.capacity())
154  mooseError("New size greater than tag capacity. This will cause reallocation which will "
155  "invalidate any stored references.");
156  };
157  check_capacity(_need_vector_tag_dof_u);
158  check_capacity(_need_vector_tag_u);
159  check_capacity(_need_vector_tag_grad);
160  check_capacity(_vector_tags_dof_u);
161  check_capacity(_vector_tag_u);
162  check_capacity(_vector_tag_grad);
163 
164  _need_vector_tag_dof_u.resize(tag + 1, false);
165  _need_vector_tag_u.resize(tag + 1, false);
166  _need_vector_tag_grad.resize(tag + 1, false);
167  _vector_tags_dof_u.resize(tag + 1);
168  _vector_tag_u.resize(tag + 1);
169  _vector_tag_grad.resize(tag + 1);
170 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::vector< bool > _need_vector_tag_u
std::vector< bool > _need_vector_tag_grad
std::vector< bool > _need_vector_tag_dof_u
std::vector< DoFValue > _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 379 of file MooseVariableData.C.

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

380 {
382  return *_second_phi;
383 }
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 387 of file MooseVariableData.C.

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

388 {
390  return *_second_phi_face;
391 }
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 278 of file MooseVariableData.C.

279 {
280  secondPhi();
281  secondPhiFace();
282  switch (state)
283  {
284  case Moose::Current:
285  {
286  _need_second = true;
287  return _second_u;
288  }
289 
290  case Moose::Old:
291  {
292  _need_second_old = true;
293  return _second_u_old;
294  }
295 
296  case Moose::Older:
297  {
298  _need_second_older = true;
299  return _second_u_older;
300  }
301 
302  case Moose::PreviousNL:
303  {
305  return _second_u_previous_nl;
306  }
307 
308  default:
309  // We should never get here but gcc requires that we have a default. See
310  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
311  mooseError("Unknown SolutionState!");
312  }
313 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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 307 of file MooseVariableDataBase.h.

308 {
310  for (const auto tag : vtags)
311  _required_vector_tags.insert(tag);
312 
313  if (!_required_vector_tags.empty())
314  {
315  const auto largest_tag_id = *_required_vector_tags.rbegin();
316  if (largest_tag_id >= _need_vector_tag_dof_u.size())
317  resizeVectorTagData(largest_tag_id);
318  }
319 }
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 OutputData value,
unsigned int  index 
)

dof value setters

Definition at line 840 of file MooseVariableData.C.

841 {
842  auto & dof_values = _vector_tags_dof_u[_solution_tag];
843  dof_values[index] = value;
844  _has_dof_values = true;
845 
846  auto & u = _vector_tag_u[_solution_tag];
847  const auto nqps = u.size();
848  const auto ndofs = dof_values.size();
849  for (const auto qp : make_range(nqps))
850  u[qp] *= 0.;
851  for (const auto qp : make_range(nqps))
852  for (const auto i : make_range(ndofs))
853  u[qp] += (*_phi)[i][qp] * dof_values[i];
854 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
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< OutputData > &  values)

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

Definition at line 858 of file MooseVariableData.C.

859 {
860  auto & dof_values = _vector_tags_dof_u[_solution_tag];
861  for (unsigned int i = 0; i < values.size(); i++)
862  dof_values[i] = values(i);
863 
864  _has_dof_values = true;
865 
866  auto & u = _vector_tag_u[_solution_tag];
867  const auto nqps = u.size();
868  const auto ndofs = dof_values.size();
869  for (const auto qp : make_range(nqps))
870  u[qp] *= 0.;
871  for (const auto qp : make_range(nqps))
872  for (const auto i : make_range(ndofs))
873  u[qp] += (*_phi)[i][qp] * dof_values[i];
874 }
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
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 159 of file MooseVariableData.C.

160 {
161  switch (gm_type)
162  {
163  case Moose::Volume:
164  {
166  _current_phi = _phi;
172  break;
173  }
174  case Moose::Face:
175  {
183  break;
184  }
185  }
186 }
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 361 of file MooseVariableDataBase.C.

362 {
363  auto & dof_values = _vector_tags_dof_u[_solution_tag];
364  mooseAssert(idx < dof_values.size(), "idx is out of the bounds of degree of freedom values");
365  dof_values[idx] = value; // update variable nodal value
366  _has_dof_values = true;
368 
369  // Update the qp values as well
370  auto & u = _vector_tag_u[_solution_tag];
371  for (unsigned int qp = 0; qp < u.size(); qp++)
372  u[qp] = value;
373 }
OutputType _nodal_value
Nodal values.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
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 377 of file MooseVariableDataBase.C.

379 {
380  auto & dof_values = _vector_tags_dof_u[_solution_tag];
381  for (decltype(idx) i = 0; i < dof_values.size(); ++i, ++idx)
382  dof_values[idx] = value(i);
383 
384  _has_dof_values = true;
386 }
OutputType _nodal_value
Nodal values.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
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)

◆ 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 301 of file MooseVariableDataBase.C.

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

302 {
303  auto functor = [this](TagID tag_id) -> const FieldVariableValue &
304  { return vectorTagValue(tag_id); };
305 
306  return const_cast<MooseVariableDataBase<OutputType> *>(this)
307  ->stateToTagHelper<FieldVariableValue>(state, functor);
308 }
unsigned int TagID
Definition: MooseTypes.h:210
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 256 of file MooseVariableDataBase.C.

258 {
259  if (state > 0)
260  {
261  // We need to request all states that are between current and the requested state
262  stateToTagHelper<ReturnType>(Moose::SolutionState(static_cast<int>(state) - 1), functor);
263  needSolutionState(cast_int<unsigned int>(state));
264  }
265 
266  switch (state)
267  {
268  case Moose::Current:
270 
271  case Moose::Old:
272  {
275  return functor(_old_solution_tag);
276  }
277 
278  case Moose::Older:
279  {
282  return functor(_older_solution_tag);
283  }
284 
285  case Moose::PreviousNL:
286  {
289  return functor(_previous_nl_solution_tag);
290  }
291 
292  default:
293  // We should never get here but gcc requires that we have a default. See
294  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
295  mooseError("Unknown SolutionState!");
296  }
297 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:233
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 190 of file MooseVariableData.C.

191 {
192  if (_sys.solutionUDot())
193  {
194  _need_u_dot = true;
195  return _u_dot;
196  }
197  else
198  mooseError("MooseVariableFE: Time derivative of solution (`u_dot`) is not stored. Please set "
199  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
200 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
FieldVariableValue _u_dot
u_dot (time derivative)
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:252
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 204 of file MooseVariableData.C.

205 {
206  if (_sys.solutionUDotDot())
207  {
208  _need_u_dotdot = true;
209  return _u_dotdot;
210  }
211  else
212  mooseError("MooseVariableFE: Second time derivative of solution (`u_dotdot`) is not stored. "
213  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
214  "`u_dotdot`.");
215 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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:253

◆ uDotDotOld()

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

Definition at line 234 of file MooseVariableData.C.

235 {
236  if (_sys.solutionUDotDotOld())
237  {
238  _need_u_dotdot_old = true;
239  return _u_dotdot_old;
240  }
241  else
242  mooseError("MooseVariableFE: Old second time derivative of solution (`u_dotdot_old`) is not "
243  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
244  "requesting `u_dotdot_old`");
245 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:255
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 219 of file MooseVariableData.C.

220 {
221  if (_sys.solutionUDotOld())
222  {
223  _need_u_dot_old = true;
224  return _u_dot_old;
225  }
226  else
227  mooseError("MooseVariableFE: Old time derivative of solution (`u_dot_old`) is not stored. "
228  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
229  "`u_dot_old`.");
230 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
FieldVariableValue _u_dot_old
u_dot_old (time derivative)
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:254
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 226 of file MooseVariableData.h.

227  {
229  }
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 146 of file MooseVariableDataBase.h.

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

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

◆ vectorTagDofValue() [1/2]

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

Definition at line 189 of file MooseVariableDataBase.C.

190 {
191  if (tag >= _need_vector_tag_dof_u.size())
192  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
193 
194  _need_vector_tag_dof_u[tag] = true;
195 
196  if (_sys.hasVector(tag))
197  return _vector_tags_dof_u[tag];
198  else
199  mooseError("Tag ", tag, " is not associated with any vector for variable ", _var.name());
200 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
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:302
std::vector< bool > _need_vector_tag_dof_u
std::vector< DoFValue > _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 >::DoFValue & MooseVariableDataBase< OutputType >::vectorTagDofValue ( Moose::SolutionState  state) const
inherited

Definition at line 323 of file MooseVariableDataBase.C.

324 {
325  auto functor = [this](TagID tag_id) -> const DoFValue & { return vectorTagDofValue(tag_id); };
326 
327  return const_cast<MooseVariableDataBase<OutputType> *>(this)->stateToTagHelper<DoFValue>(state,
328  functor);
329 }
unsigned int TagID
Definition: MooseTypes.h:210
MooseArray< OutputData > DoFValue
const DoFValue & vectorTagDofValue(TagID tag) const

◆ vectorTagGradient()

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

Definition at line 204 of file MooseVariableDataBase.C.

205 {
206  if (tag >= _need_vector_tag_grad.size())
207  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
208 
209  _need_vector_tag_grad[tag] = true;
210 
211  if (_sys.hasVector(tag))
212  return _vector_tag_grad[tag];
213  else
214  mooseError("Tag ", tag, " is not associated with any vector for variable ", _var.name());
215 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
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:302
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 174 of file MooseVariableDataBase.C.

175 {
176  if (tag >= _need_vector_tag_u.size())
177  const_cast<MooseVariableDataBase<OutputType> *>(this)->resizeVectorTagData(tag);
178 
179  _need_vector_tag_u[tag] = true;
180 
181  if (_sys.hasVector(tag))
182  return _vector_tag_u[tag];
183  else
184  mooseError("Tag ", tag, " is not associated with any vector for variable ", _var.name());
185 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:907
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:302
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 726 of file MooseVariableDataBase.C.

727 {
728  if (_subproblem.isTransient())
729  {
736  }
737 
738  for (auto & dof_values : _vector_tags_dof_u)
739  dof_values.resize(0);
740 
741  _has_dof_values = false;
742 }
DoFValue _dof_values_dotdot
second time derivative of the solution values
DoFValue _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.
DoFValue _dof_values_dot
time derivative of the solution values
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 ...
DoFValue _dof_values_dot_old
the previous time step&#39;s solution value time derivative
virtual bool isTransient() const =0
std::vector< DoFValue > _vector_tags_dof_u
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216

Member Data Documentation

◆ _ad_curl_u

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

Definition at line 568 of file MooseVariableData.h.

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

◆ _ad_dof_values

template<typename OutputType>
MooseArray<ADReal> MooseVariableData< OutputType >::_ad_dof_values
private

Definition at line 562 of file MooseVariableData.h.

◆ _ad_dofs_dot

template<typename OutputType>
MooseArray<ADReal> MooseVariableData< OutputType >::_ad_dofs_dot
private

Definition at line 563 of file MooseVariableData.h.

◆ _ad_dofs_dotdot

template<typename OutputType>
MooseArray<ADReal> MooseVariableData< OutputType >::_ad_dofs_dotdot
private

Definition at line 564 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 560 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 567 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 503 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 693 of file MooseVariableData.h.

◆ _ad_second_u

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

Definition at line 561 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 559 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 565 of file MooseVariableData.h.

◆ _ad_u_dotdot

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

Definition at line 566 of file MooseVariableData.h.

◆ _ad_zero

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

A zero AD variable.

Definition at line 506 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 195 of file MooseVariableDataBase.h.

◆ _curl_phi

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

Definition at line 600 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 613 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 549 of file MooseVariableData.h.

◆ _curl_u_old

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

Definition at line 550 of file MooseVariableData.h.

◆ _curl_u_older

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

Definition at line 551 of file MooseVariableData.h.

◆ _current_ad_grad_phi

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

Definition at line 625 of file MooseVariableData.h.

◆ _current_curl_phi

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

Definition at line 623 of file MooseVariableData.h.

◆ _current_div_phi

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

Definition at line 624 of file MooseVariableData.h.

◆ _current_grad_phi

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

Definition at line 621 of file MooseVariableData.h.

◆ _current_phi

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

Definition at line 620 of file MooseVariableData.h.

◆ _current_qrule

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

Definition at line 619 of file MooseVariableData.h.

◆ _current_second_phi

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

Definition at line 622 of file MooseVariableData.h.

◆ _current_side

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

The current element side.

Definition at line 690 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 687 of file MooseVariableData.h.

◆ _div_phi

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

Definition at line 601 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 614 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 554 of file MooseVariableData.h.

◆ _div_u_old

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

Definition at line 555 of file MooseVariableData.h.

◆ _div_u_older

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

Definition at line 556 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 274 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 277 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 192 of file MooseVariableDataBase.h.

◆ _dof_values_dot

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

time derivative of the solution values

Definition at line 266 of file MooseVariableDataBase.h.

◆ _dof_values_dot_old

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

the previous time step's solution value time derivative

Definition at line 270 of file MooseVariableDataBase.h.

◆ _dof_values_dotdot

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

second time derivative of the solution values

Definition at line 268 of file MooseVariableDataBase.h.

◆ _dof_values_dotdot_old

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

the previous time step's solution value second time derivative

Definition at line 272 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 585 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 588 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 684 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 488 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 539 of file MooseVariableData.h.

◆ _grad_u_dotdot

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

Definition at line 540 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 199 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 500 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 604 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 607 of file MooseVariableData.h.

◆ _mapped_grad_phi_neighbor

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

Definition at line 606 of file MooseVariableData.h.

◆ _matrix_tag_u

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

◆ _matrix_tags_dof_u

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

◆ _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 202 of file MooseVariableDataBase.h.

◆ _need_ad

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

◆ _need_ad_curl_u

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

Definition at line 534 of file MooseVariableData.h.

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

◆ _need_ad_grad_u

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

Definition at line 531 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
mutableprivate

Definition at line 532 of file MooseVariableData.h.

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

◆ _need_ad_second_u

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

Definition at line 533 of file MooseVariableData.h.

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

◆ _need_ad_u

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

Definition at line 530 of file MooseVariableData.h.

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

◆ _need_ad_u_dot

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

AD u dot flags.

Definition at line 509 of file MooseVariableData.h.

◆ _need_ad_u_dotdot

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

Definition at line 510 of file MooseVariableData.h.

◆ _need_curl

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

curl flags

Definition at line 519 of file MooseVariableData.h.

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

◆ _need_curl_old

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

Definition at line 520 of file MooseVariableData.h.

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

◆ _need_curl_older

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

Definition at line 521 of file MooseVariableData.h.

◆ _need_div

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

divergence flags

Definition at line 524 of file MooseVariableData.h.

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

◆ _need_div_old

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

Definition at line 525 of file MooseVariableData.h.

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

◆ _need_div_older

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

Definition at line 526 of file MooseVariableData.h.

◆ _need_dof_du_dot_du

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

Definition at line 262 of file MooseVariableDataBase.h.

◆ _need_dof_du_dotdot_du

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

Definition at line 263 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 258 of file MooseVariableDataBase.h.

◆ _need_dof_values_dot_old

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

Definition at line 260 of file MooseVariableDataBase.h.

◆ _need_dof_values_dotdot

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

Definition at line 259 of file MooseVariableDataBase.h.

◆ _need_dof_values_dotdot_old

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

Definition at line 261 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 254 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 255 of file MooseVariableDataBase.h.

◆ _need_matrix_tag_dof_u

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

◆ _need_matrix_tag_u

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

◆ _need_second

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

SolutionState second_u flags.

Definition at line 513 of file MooseVariableData.h.

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

◆ _need_second_old

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

Definition at line 514 of file MooseVariableData.h.

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

◆ _need_second_older

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

Definition at line 515 of file MooseVariableData.h.

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

◆ _need_second_previous_nl

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

Definition at line 516 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 246 of file MooseVariableDataBase.h.

◆ _need_u_dot_old

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

Definition at line 248 of file MooseVariableDataBase.h.

◆ _need_u_dotdot

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

Definition at line 247 of file MooseVariableDataBase.h.

◆ _need_u_dotdot_old

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

Definition at line 249 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 494 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 235 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 241 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 280 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 284 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 282 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 286 of file MooseVariableDataBase.h.

◆ _nodal_value_old

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

Definition at line 236 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 237 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 238 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 679 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 208 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 211 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 214 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 593 of file MooseVariableData.h.

◆ _qrule_face

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

Definition at line 594 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 289 of file MooseVariableDataBase.h.

◆ _second_phi

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

Definition at line 599 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 612 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 543 of file MooseVariableData.h.

◆ _second_u_old

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

Definition at line 544 of file MooseVariableData.h.

◆ _second_u_older

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

Definition at line 545 of file MooseVariableData.h.

◆ _second_u_previous_nl

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

Definition at line 546 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 205 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 292 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 186 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 183 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 189 of file MooseVariableDataBase.h.

◆ _time_integrator

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

Pointer to time integrator.

Definition at line 674 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 573 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 579 of file MooseVariableData.h.

◆ _u_dotdot

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

u_dotdot (second time derivative)

Definition at line 576 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 582 of file MooseVariableData.h.

◆ _use_dual

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

◆ _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<DoFValue> MooseVariableDataBase< OutputType >::_vector_tags_dof_u
protectedinherited

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