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

Class holding the data members for linear finite volume variables. More...

#include <MooseVariableDataLinearFV.h>

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

Public Member Functions

 MooseVariableDataLinearFV (const MooseLinearVariableFV< OutputType > &var, SystemBase &sys, THREAD_ID tid, Moose::ElementType element_type, const Elem *const &elem)
 
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...
 
void setGeometry (Moose::GeometryType gm_type)
 Set the geometry type before calculating variables values. More...
 
void computeValues ()
 Compute the variable values. More...
 
void setDofValues (const DenseVector< OutputData > &values)
 Set local DOF values to the entries of values . More...
 
void setDofValue (const OutputData &value, unsigned int index)
 Set local DOF value at index to value . More...
 
void getDofIndices (const Elem *elem, std::vector< dof_id_type > &dof_indices) const
 Get the dof indices for an element. More...
 
const std::vector< dof_id_type > & dofIndices () const
 Get the dof indices of the current element. More...
 
unsigned int numberOfDofs () const
 Get the number of dofs on the current element. More...
 
void clearDofIndices ()
 Clear the dof indices in the cache. More...
 
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)
 
void prepareIC ()
 prepare the initial condition More...
 
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 sizeMatrixTagData ()
 size matrix tag data More...
 

Protected Member Functions

virtual const MooseLinearVariableFV< OutputType > & var () const override
 Get the corresponding variable. More...
 
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 initializeSolnVars ()
 
const std::vector< dof_id_type > & initDofIndices ()
 Fetch and return the dof indices of this variable on the current element. More...
 

Private Attributes

const MooseLinearVariableFV< OutputType > & _var
 A const reference to the owning MooseLinearVariableFV object. More...
 
const libMesh::FEType_fe_type
 Reference to the variable's finite element type. More...
 
const unsigned int _var_num
 The index of the variable in the system. More...
 
const Assembly_assembly
 Reference to the system assembly of the variable. More...
 
Moose::ElementType _element_type
 The element type this object is storing data for. This is either Element, Neighbor, or Lower. More...
 
const TimeIntegrator *const _time_integrator
 Pointer to time integrator. More...
 
const Elem *const & _elem
 The current elem. More...
 
const Elem * _prev_elem = nullptr
 used to keep track of when dof indices are out of date More...
 
const bool _displaced
 Whether this variable is being calculated on a displaced system. More...
 
const libMesh::QBase_qrule
 Pointer to the quadrature rule. More...
 

Friends

void Moose::initDofIndices (MooseVariableDataLinearFV< OutputType > &, const Elem &)
 

Detailed Description

template<typename OutputType>
class MooseVariableDataLinearFV< OutputType >

Class holding the data members for linear finite volume variables.

At the moment, this is only used when the user wants to use linear finite volume variables in the postprocessor/userobject and auxiliary systems. The solver-related functionalities rely on a different machinery.

Definition at line 51 of file MooseVariableDataLinearFV.h.

Member Typedef Documentation

◆ DoFValue

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

Definition at line 76 of file MooseVariableDataLinearFV.h.

◆ FieldVariableCurl

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

Definition at line 63 of file MooseVariableDataLinearFV.h.

◆ FieldVariableDivergence

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

Definition at line 64 of file MooseVariableDataLinearFV.h.

◆ FieldVariableGradient

template<typename OutputType >
typedef MooseArray<OutputGradient> MooseVariableDataLinearFV< OutputType >::FieldVariableGradient

Definition at line 61 of file MooseVariableDataLinearFV.h.

◆ FieldVariableSecond

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

Definition at line 62 of file MooseVariableDataLinearFV.h.

◆ FieldVariableValue

template<typename OutputType >
typedef MooseArray<OutputType> MooseVariableDataLinearFV< OutputType >::FieldVariableValue

Definition at line 60 of file MooseVariableDataLinearFV.h.

◆ OutputData

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

Definition at line 75 of file MooseVariableDataLinearFV.h.

◆ OutputDivergence

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

Definition at line 57 of file MooseVariableDataLinearFV.h.

◆ OutputGradient

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

Definition at line 55 of file MooseVariableDataLinearFV.h.

◆ OutputSecond

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

Definition at line 56 of file MooseVariableDataLinearFV.h.

◆ OutputShape

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

Definition at line 67 of file MooseVariableDataLinearFV.h.

◆ OutputShapeDivergence

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

Definition at line 72 of file MooseVariableDataLinearFV.h.

◆ OutputShapeGradient

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

Definition at line 70 of file MooseVariableDataLinearFV.h.

◆ OutputShapeSecond

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

Definition at line 71 of file MooseVariableDataLinearFV.h.

Constructor & Destructor Documentation

◆ MooseVariableDataLinearFV()

template<typename OutputType >
MooseVariableDataLinearFV< OutputType >::MooseVariableDataLinearFV ( const MooseLinearVariableFV< OutputType > &  var,
SystemBase sys,
THREAD_ID  tid,
Moose::ElementType  element_type,
const Elem *const &  elem 
)

Definition at line 33 of file MooseVariableDataLinearFV.C.

40  _var(var),
41  _fe_type(_var.feType()),
42  _var_num(_var.number()),
43  _assembly(_subproblem.assembly(_tid, var.kind() == Moose::VAR_SOLVER ? sys.number() : 0)),
44  _element_type(element_type),
46  _elem(elem),
47  _displaced(dynamic_cast<const DisplacedSystem *>(&_sys) ? true : false),
48  _qrule(nullptr)
49 {
50 }
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor, or Lower.
const bool _displaced
Whether this variable is being calculated on a displaced system.
const Elem *const & _elem
The current elem.
const libMesh::FEType & _fe_type
Reference to the variable&#39;s finite element type.
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
const MooseLinearVariableFV< OutputType > & _var
A const reference to the owning MooseLinearVariableFV object.
const unsigned int _var_num
The index of the variable in the system.
const libMesh::QBase * _qrule
Pointer to the quadrature rule.
const TimeIntegrator *const _time_integrator
Pointer to time integrator.
const Assembly & _assembly
Reference to the system assembly of the variable.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
virtual const MooseLinearVariableFV< OutputType > & var() const override
Get the corresponding variable.
const TimeIntegrator * queryTimeIntegrator(const unsigned int var_num) const
Retrieve the time integrator that integrates the given variable&#39;s equation.
Definition: SystemBase.C:1673
const THREAD_ID _tid
The thread ID that this object is on.

Member Function Documentation

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

435 {
436  if (_has_dof_values)
437  {
438  auto & dof_values = _vector_tags_dof_u[_solution_tag];
439  residual.add_vector(&dof_values[0], _dof_indices);
440  }
441 }
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 445 of file MooseVariableDataBase.C.

446 {
447  if (_has_dof_values)
448  {
449  auto & dof_values = _vector_tags_dof_u[_solution_tag];
450  if (isNodal())
451  {
452  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
453  for (unsigned int j = 0; j < _count; ++j)
454  residual.add(_dof_indices[i] + j, dof_values[i](j));
455  }
456  else
457  {
458  unsigned int n = 0;
459  for (unsigned int j = 0; j < _count; ++j)
460  {
461  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
462  residual.add(_dof_indices[i] + n, dof_values[i](j));
463  n += _dof_indices.size();
464  }
465  }
466  }
467 }
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.

◆ assignNodalValue() [1/3]

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

Definition at line 751 of file MooseVariableDataBase.C.

752 {
753  bool is_transient = _subproblem.isTransient();
754 
756 
757  auto & dof_values = _vector_tags_dof_u[_solution_tag];
758  _nodal_value = dof_values[0];
760 
761  if (is_transient)
762  {
763  if (oldestSolutionStateRequested() >= 1)
764  {
767  }
768  if (oldestSolutionStateRequested() >= 2)
769  {
772  }
781  }
784 }
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 788 of file MooseVariableDataBase.C.

789 {
790  bool is_transient = _subproblem.isTransient();
791 
792  auto n = _dof_indices.size();
793  libmesh_assert(n);
794 
795  auto & dof_values = _vector_tags_dof_u[_solution_tag];
796  for (decltype(n) i = 0; i < n; ++i)
797  _nodal_value(i) = dof_values[i];
799 
800  if (is_transient)
801  {
802  if (oldestSolutionStateRequested() >= 1)
803  {
804  auto & dof_values_old = _vector_tags_dof_u[_old_solution_tag];
805  for (decltype(n) i = 0; i < n; ++i)
806  _nodal_value_old(i) = dof_values_old[i];
808  }
809  if (oldestSolutionStateRequested() >= 2)
810  {
811  auto & dof_values_older = _vector_tags_dof_u[_older_solution_tag];
812  for (decltype(n) i = 0; i < n; ++i)
813  _nodal_value_older(i) = dof_values_older[i];
815  }
817  for (decltype(n) i = 0; i < n; ++i)
820  for (decltype(n) i = 0; i < n; ++i)
823  for (decltype(n) i = 0; i < n; ++i)
826  for (decltype(n) i = 0; i < n; ++i)
828  }
830  {
831  auto & dof_values_previous_nl = _vector_tags_dof_u[_previous_nl_solution_tag];
832  for (decltype(n) i = 0; i < n; ++i)
833  _nodal_value_previous_nl(i) = dof_values_previous_nl[i];
834  }
835 }
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 MooseVariableDataLinearFV< OutputType >::clearDofIndices ( )
inline

Clear the dof indices in the cache.

Definition at line 129 of file MooseVariableDataLinearFV.h.

130  {
131  _dof_indices.clear();
132  _prev_elem = nullptr;
133  }
const Elem * _prev_elem
used to keep track of when dof indices are out of date
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ computeValues()

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

Compute the variable values.

Definition at line 107 of file MooseVariableDataLinearFV.C.

108 {
109  initDofIndices();
111 
112  unsigned int num_dofs = _dof_indices.size();
113 
114  if (num_dofs > 0)
115  fetchDoFValues();
116  else
117  // We don't have any dofs. There's nothing to do
118  return;
119 
120  mooseAssert(num_dofs == 1 && _vector_tags_dof_u[_solution_tag].size() == 1,
121  "There should only be one dof per elem for FV variables");
122 
123  const auto nqp = _qrule->n_points();
124  auto && active_coupleable_matrix_tags =
126 
127  for (const auto qp : make_range(nqp))
128  {
129  for (auto tag : _required_vector_tags)
130  if (_need_vector_tag_u[tag])
131  _vector_tag_u[tag][qp] = _vector_tags_dof_u[tag][0];
132 
133  for (auto tag : active_coupleable_matrix_tags)
134  if (_need_matrix_tag_u[tag])
135  _matrix_tag_u[tag][qp] = _matrix_tags_dof_u[tag][0];
136  }
137 }
std::vector< DoFValue > _matrix_tags_dof_u
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:390
std::vector< FieldVariableValue > _matrix_tag_u
void fetchDoFValues()
Helper methods for assigning dof values from their corresponding solution values. ...
std::vector< bool > _need_vector_tag_u
SubProblem & subproblem()
Definition: SystemBase.h:101
std::vector< DoFValue > _vector_tags_dof_u
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
unsigned int n_points() const
const libMesh::QBase * _qrule
Pointer to the quadrature rule.
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
std::vector< bool > _need_matrix_tag_u
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 THREAD_ID _tid
The thread ID that this object is on.
std::vector< FieldVariableValue > _vector_tag_u
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
const std::vector< dof_id_type > & initDofIndices()
Fetch and return the dof indices of this variable on the current element.

◆ dofIndices()

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

Get the dof indices of the current element.

Definition at line 237 of file MooseVariableDataLinearFV.h.

238 {
239  return const_cast<MooseVariableDataLinearFV<OutputType> *>(this)->initDofIndices();
240 }
Class holding the data members for linear finite volume variables.
const std::vector< dof_id_type > & initDofIndices()
Fetch and return the dof indices of this variable on the current element.

◆ dofValues()

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

Definition at line 338 of file MooseVariableDataBase.C.

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

◆ dofValuesOld()

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

Definition at line 345 of file MooseVariableDataBase.C.

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

◆ dofValuesOlder()

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

Definition at line 352 of file MooseVariableDataBase.C.

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

◆ dofValuesPreviousNL()

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

Definition at line 359 of file MooseVariableDataBase.C.

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

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

535 {
536  bool is_transient = _subproblem.isTransient();
537 
538  auto n = _dof_indices.size();
539  libmesh_assert(n);
540 
541  if (is_transient)
542  {
544  {
548  }
550  {
554  }
556  {
560  }
562  {
566  }
567  }
568 
569  for (auto tag : _required_vector_tags)
574  {
575  // tag is defined on problem but may not be used by a system
576  // the grain tracker requires being able to read from solution vectors that we are also in
577  // the process of writing :-/
578  if (_sys.hasVector(tag) /* && _sys.getVector(tag).closed()*/)
579  {
580  auto & vec = _sys.getVector(tag);
581  _vector_tags_dof_u[tag].resize(n);
582  vec.get(_dof_indices, &_vector_tags_dof_u[tag][0]);
583  }
584  }
585 
587  {
588  auto & active_coupleable_matrix_tags =
590 
591  for (auto tag : active_coupleable_matrix_tags)
592  {
593  _matrix_tags_dof_u[tag].resize(n);
595  if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag) && _sys.getMatrix(tag).closed())
596  {
597  auto & mat = _sys.getMatrix(tag);
598  for (unsigned i = 0; i < n; i++)
599  {
600  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
601  _matrix_tags_dof_u[tag][i] = mat(_dof_indices[i], _dof_indices[i]);
602  }
603  }
604  }
605  }
606 
608  {
610  for (decltype(n) i = 0; i < n; ++i)
611  _dof_du_dot_du[i] = _sys.duDotDu(_var.number());
612  }
614  {
616  for (decltype(n) i = 0; i < n; ++i)
618  }
619 }
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:924
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:360
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
std::vector< bool > _need_vector_tag_grad
std::vector< bool > _need_vector_tag_dof_u
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:257
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:1701
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C: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:1149
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:1024
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
bool _need_dof_values_dot
local solution flags
const THREAD_ID _tid
The thread ID that this object is on.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:933
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

◆ fetchDoFValues() [2/3]

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

◆ fetchDoFValues() [3/3]

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

Definition at line 655 of file MooseVariableDataBase.C.

656 {
657  bool is_transient = _subproblem.isTransient();
658 
659  auto n = _dof_indices.size();
660  libmesh_assert(n);
661 
662  if (is_transient)
663  {
665  {
668  }
670  {
673  }
675  {
678  }
680  {
683  }
684  }
685 
686  for (auto tag : _required_vector_tags)
690  // tag is defined on problem but may not be used by a system
691  if (_sys.hasVector(tag) && _sys.getVector(tag).closed())
693 
695  {
696  auto & active_coupleable_matrix_tags =
698  for (auto tag : active_coupleable_matrix_tags)
699  {
700  _matrix_tags_dof_u[tag].resize(n);
702  if (_sys.hasMatrix(tag) && _sys.matrixTagActive(tag) && _sys.getMatrix(tag).closed())
703  {
704  auto & mat = _sys.getMatrix(tag);
705  for (unsigned i = 0; i < n; i++)
706  {
707  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
708  for (unsigned j = 0; j < _count; j++)
709  _matrix_tags_dof_u[tag][i](j) = mat(_dof_indices[i] + j, _dof_indices[i] + j);
710  }
711  }
712  }
713  }
714 
716  {
718  for (decltype(n) i = 0; i < n; ++i)
719  _dof_du_dot_du[i] = _sys.duDotDu(_var.number());
720  }
722  {
724  for (decltype(n) i = 0; i < n; ++i)
726  }
727 }
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:924
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:360
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
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:257
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:1701
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
virtual bool isTransient() const =0
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C: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:1149
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:1024
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data...
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _count
Number of components of the associated variable.
bool _need_dof_values_dot
local solution flags
const THREAD_ID _tid
The thread ID that this object is on.
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:933
const MooseVariableField< OutputType > & _var
A const reference to the owning MooseVariableField object.

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

626 {
627  dof_values.resize(n);
628  if (isNodal())
629  {
630  for (unsigned int i = 0; i < n; ++i)
631  {
632  dof_values[i].resize(_count);
633  auto dof = _dof_indices[i];
634  for (unsigned int j = 0; j < _count; ++j)
635  dof_values[i](j) = sol(dof++);
636  }
637  }
638  else
639  {
640  for (unsigned int i = 0; i < n; ++i)
641  {
642  dof_values[i].resize(_count);
643  auto dof = _dof_indices[i];
644  for (unsigned int j = 0; j < _count; ++j)
645  {
646  dof_values[i](j) = sol(dof);
647  dof += n;
648  }
649  }
650  }
651 }
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 MooseVariableDataLinearFV< OutputType >::getContinuity ( ) const
inlineoverridevirtual

Return the variable continuity.

Implements MooseVariableDataBase< OutputType >.

Definition at line 86 of file MooseVariableDataLinearFV.h.

86 { return libMesh::DISCONTINUOUS; }

◆ getDofIndices()

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

Get the dof indices for an element.

Parameters
elemThe element on which the dof indices shall be queried
dof_indicesThe container in which the dof indices will be copied

Definition at line 165 of file MooseVariableDataLinearFV.C.

167 {
168  _dof_map.dof_indices(elem, dof_indices, _var_num);
169 }
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
The index of the variable in the system.

◆ gradSln()

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

Local solution gradient getter.

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

Definition at line 317 of file MooseVariableDataBase.C.

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

◆ hasDoFsOnNodes()

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

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

Implements MooseVariableDataBase< OutputType >.

Definition at line 85 of file MooseVariableDataLinearFV.h.

85 { return false; }

◆ initDofIndices()

template<typename OutputType >
const std::vector< dof_id_type > & MooseVariableDataLinearFV< OutputType >::initDofIndices ( )
private

Fetch and return the dof indices of this variable on the current element.

Definition at line 99 of file MooseVariableDataLinearFV.C.

100 {
101  Moose::initDofIndices(*this, *_elem);
102  return _dof_indices;
103 }
void initDofIndices(T &data, const Elem &elem)
const Elem *const & _elem
The current elem.
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.

◆ initializeSolnVars()

template<typename OutputType >
void MooseVariableDataLinearFV< OutputType >::initializeSolnVars ( )
private

Definition at line 75 of file MooseVariableDataLinearFV.C.

76 {
77  auto && active_coupleable_matrix_tags =
79  mooseAssert(_qrule, "We should have a non-null qrule");
80  const auto nqp = _qrule->n_points();
81 
82  for (auto tag : _required_vector_tags)
83  if (_need_vector_tag_u[tag])
84  {
85  _vector_tag_u[tag].resize(nqp);
86  assignForAllQps(0, _vector_tag_u[tag], nqp);
87  }
88 
89  for (auto tag : active_coupleable_matrix_tags)
90  if (_need_matrix_tag_u[tag])
91  {
92  _matrix_tag_u[tag].resize(nqp);
93  assignForAllQps(0, _matrix_tag_u[tag], nqp);
94  }
95 }
const std::set< TagID > & getActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:390
std::vector< FieldVariableValue > _matrix_tag_u
std::vector< bool > _need_vector_tag_u
SubProblem & subproblem()
Definition: SystemBase.h:101
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
unsigned int n_points() const
const libMesh::QBase * _qrule
Pointer to the quadrature rule.
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 THREAD_ID _tid
The thread ID that this object is on.
std::vector< FieldVariableValue > _vector_tag_u

◆ insert() [1/2]

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

Set the current local DOF values to the input vector.

Definition at line 395 of file MooseVariableDataBase.C.

396 {
397  if (_has_dof_values)
398  {
399  auto & dof_values = _vector_tags_dof_u[_solution_tag];
400  mooseAssert(dof_values.size() == _dof_indices.size(),
401  "Degree of freedom values size and degree of freedom indices sizes must match.");
402  residual.insert(&dof_values[0], _dof_indices);
403  }
404 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
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 408 of file MooseVariableDataBase.C.

409 {
410  if (_has_dof_values)
411  {
412  auto & dof_values = _vector_tags_dof_u[_solution_tag];
413  if (isNodal())
414  {
415  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
416  for (unsigned int j = 0; j < _count; ++j)
417  residual.set(_dof_indices[i] + j, dof_values[i](j));
418  }
419  else
420  {
421  unsigned int n = 0;
422  for (unsigned int j = 0; j < _count; ++j)
423  {
424  for (unsigned int i = 0; i < _dof_indices.size(); ++i)
425  residual.set(_dof_indices[i] + n, dof_values[i](j));
426  n += _dof_indices.size();
427  }
428  }
429  }
430 }
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.

◆ insertSolutionTag()

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

insert a solution tag into our tag containers

Definition at line 328 of file MooseVariableDataBase.h.

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

329 {
330  _solution_tags.insert(tag_id);
331  _required_vector_tags.insert(tag_id);
332 }
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 MooseVariableDataLinearFV< OutputType >::isNodal ( ) const
inlineoverridevirtual
Returns
Whether this data is associated with a nodal variable

Implements MooseVariableDataBase< OutputType >.

Definition at line 84 of file MooseVariableDataLinearFV.h.

84 { return false; }

◆ matrixTagValue()

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

Definition at line 224 of file MooseVariableDataBase.C.

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

◆ needSolutionState()

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

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

Definition at line 249 of file MooseVariableDataBase.C.

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

◆ nodalMatrixTagValue()

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

Definition at line 121 of file MooseVariableDataBase.C.

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

◆ nodalValue()

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

Definition at line 471 of file MooseVariableDataBase.C.

472 {
473  if (isNodal())
474  {
475  // Request the correct solution states and data members
476  vectorTagDofValue(state);
477  switch (state)
478  {
479  case Moose::Current:
480  return _nodal_value;
481 
482  case Moose::Old:
483  return _nodal_value_old;
484 
485  case Moose::Older:
486  return _nodal_value_older;
487 
488  case Moose::PreviousNL:
490 
491  default:
492  // We should never get here but gcc requires that we have a default. See
493  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
494  mooseError("Unknown SolutionState!");
495  }
496  }
497  else
498  mooseError("Nodal values can be requested only on nodal variables, variable '",
499  _var.name(),
500  "' is not nodal.");
501 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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 505 of file MooseVariableDataBase.C.

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

◆ nodalVectorTagValue()

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

Definition at line 98 of file MooseVariableDataBase.C.

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

◆ numberOfDofs()

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

Get the number of dofs on the current element.

Definition at line 244 of file MooseVariableDataLinearFV.h.

245 {
246  return dofIndices().size();
247 }
const std::vector< dof_id_type > & dofIndices() const
Get the dof indices of the current element.

◆ oldestSolutionStateRequested()

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

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

Definition at line 242 of file MooseVariableDataBase.C.

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

◆ 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 MooseVariableDataBase< OutputType >::prepareIC ( )
inherited

prepare the initial condition

◆ resizeVectorTagData()

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

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

Definition at line 147 of file MooseVariableDataBase.C.

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

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

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

313 {
315  for (const auto tag : vtags)
316  _required_vector_tags.insert(tag);
317 
318  if (!_required_vector_tags.empty())
319  {
320  const auto largest_tag_id = *_required_vector_tags.rbegin();
321  if (largest_tag_id >= _need_vector_tag_dof_u.size())
322  resizeVectorTagData(largest_tag_id);
323  }
324 }
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 MooseVariableDataLinearFV< OutputType >::setDofValue ( const OutputData value,
unsigned int  index 
)

Set local DOF value at index to value .

Definition at line 141 of file MooseVariableDataLinearFV.C.

142 {
143  mooseAssert(index == 0, "We only ever have one dof value locally");
145  _has_dof_values = true;
146 
147  auto & u = _vector_tag_u[_solution_tag];
148  // Update the qp values as well
149  for (const auto qp : index_range(u))
150  u[qp] = value;
151 }
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
auto index_range(const T &sizable)

◆ setDofValues()

template<typename OutputType >
void MooseVariableDataLinearFV< OutputType >::setDofValues ( const DenseVector< OutputData > &  values)

Set local DOF values to the entries of values .

Definition at line 155 of file MooseVariableDataLinearFV.C.

156 {
157  auto & dof_values = _vector_tags_dof_u[_solution_tag];
158  for (unsigned int i = 0; i < values.size(); i++)
159  dof_values[i] = values(i);
160  _has_dof_values = true;
161 }
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.

◆ setGeometry()

template<typename OutputType >
void MooseVariableDataLinearFV< 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 54 of file MooseVariableDataLinearFV.C.

55 {
56  switch (gm_type)
57  {
58  case Moose::Volume:
59  {
61  // TODO: set integration multiplier to cell volume
62  break;
63  }
64  case Moose::Face:
65  {
67  // TODO: set integration multiplier to face area
68  break;
69  }
70  }
71 }
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:294
const libMesh::QBase * _qrule
Pointer to the quadrature rule.
const Assembly & _assembly
Reference to the system assembly of the variable.
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:218

◆ setNodalValue() [1/2]

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

Set nodal value.

Definition at line 366 of file MooseVariableDataBase.C.

367 {
368  auto & dof_values = _vector_tags_dof_u[_solution_tag];
369  mooseAssert(idx < dof_values.size(), "idx is out of the bounds of degree of freedom values");
370  dof_values[idx] = value; // update variable nodal value
371  _has_dof_values = true;
373 
374  // Update the qp values as well
375  auto & u = _vector_tag_u[_solution_tag];
376  for (unsigned int qp = 0; qp < u.size(); qp++)
377  u[qp] = value;
378 }
OutputType _nodal_value
Nodal values.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
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 382 of file MooseVariableDataBase.C.

384 {
385  auto & dof_values = _vector_tags_dof_u[_solution_tag];
386  for (decltype(idx) i = 0; i < dof_values.size(); ++i, ++idx)
387  dof_values[idx] = value(i);
388 
389  _has_dof_values = true;
391 }
OutputType _nodal_value
Nodal values.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
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)

◆ sizeMatrixTagData()

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

size matrix tag data

Definition at line 85 of file MooseVariableDataBase.C.

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

◆ sln()

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

Local solution getter.

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

Definition at line 306 of file MooseVariableDataBase.C.

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

307 {
308  auto functor = [this](TagID tag_id) -> const FieldVariableValue &
309  { return vectorTagValue(tag_id); };
310 
311  return const_cast<MooseVariableDataBase<OutputType> *>(this)
312  ->stateToTagHelper<FieldVariableValue>(state, functor);
313 }
unsigned int TagID
Definition: MooseTypes.h: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 261 of file MooseVariableDataBase.C.

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

◆ var()

template<typename OutputType >
const MooseLinearVariableFV< OutputType > & MooseVariableDataLinearFV< OutputType >::var ( ) const
overrideprotectedvirtual

Get the corresponding variable.

Reimplemented from MooseVariableDataBase< OutputType >.

Definition at line 173 of file MooseVariableDataLinearFV.C.

174 {
175  return _var;
176 }
const MooseLinearVariableFV< OutputType > & _var
A const reference to the owning MooseLinearVariableFV object.

◆ vectorTagDofValue() [1/2]

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

Definition at line 194 of file MooseVariableDataBase.C.

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

329 {
330  auto functor = [this](TagID tag_id) -> const DoFValue & { return vectorTagDofValue(tag_id); };
331 
332  return const_cast<MooseVariableDataBase<OutputType> *>(this)->stateToTagHelper<DoFValue>(state,
333  functor);
334 }
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 209 of file MooseVariableDataBase.C.

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

◆ vectorTagValue()

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

Definition at line 179 of file MooseVariableDataBase.C.

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

◆ zeroSizeDofValues()

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

Definition at line 731 of file MooseVariableDataBase.C.

732 {
733  if (_subproblem.isTransient())
734  {
741  }
742 
743  for (auto & dof_values : _vector_tags_dof_u)
744  dof_values.resize(0);
745 
746  _has_dof_values = false;
747 }
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

Friends And Related Function Documentation

◆ Moose::initDofIndices

template<typename OutputType >
void Moose::initDofIndices ( MooseVariableDataLinearFV< OutputType > &  ,
const Elem &   
)
friend

Member Data Documentation

◆ _assembly

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

Reference to the system assembly of the variable.

Definition at line 154 of file MooseVariableDataLinearFV.h.

◆ _count

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

Number of components of the associated variable.

Definition at line 200 of file MooseVariableDataBase.h.

◆ _displaced

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

Whether this variable is being calculated on a displaced system.

Definition at line 176 of file MooseVariableDataLinearFV.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 279 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 282 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 197 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 271 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 275 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 273 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 277 of file MooseVariableDataBase.h.

◆ _elem

template<typename OutputType >
const Elem* const& MooseVariableDataLinearFV< 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 165 of file MooseVariableDataLinearFV.h.

◆ _element_type

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

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

Definition at line 157 of file MooseVariableDataLinearFV.h.

◆ _fe_type

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

Reference to the variable's finite element type.

Definition at line 148 of file MooseVariableDataLinearFV.h.

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

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

◆ _matrix_tag_u

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

Definition at line 236 of file MooseVariableDataBase.h.

◆ _matrix_tags_dof_u

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

Definition at line 230 of file MooseVariableDataBase.h.

◆ _max_state

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

The maximum number of older solution states our variable needs.

Definition at line 207 of file MooseVariableDataBase.h.

◆ _need_dof_du_dot_du

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

Definition at line 267 of file MooseVariableDataBase.h.

◆ _need_dof_du_dotdot_du

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

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

◆ _need_dof_values_dot_old

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

Definition at line 265 of file MooseVariableDataBase.h.

◆ _need_dof_values_dotdot

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

Definition at line 264 of file MooseVariableDataBase.h.

◆ _need_dof_values_dotdot_old

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

Definition at line 266 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 259 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 260 of file MooseVariableDataBase.h.

◆ _need_matrix_tag_dof_u

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

Definition at line 225 of file MooseVariableDataBase.h.

◆ _need_matrix_tag_u

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

Definition at line 237 of file MooseVariableDataBase.h.

◆ _need_u_dot

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

u dot flags

Definition at line 251 of file MooseVariableDataBase.h.

◆ _need_u_dot_old

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

Definition at line 253 of file MooseVariableDataBase.h.

◆ _need_u_dotdot

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

Definition at line 252 of file MooseVariableDataBase.h.

◆ _need_u_dotdot_old

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

Definition at line 254 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_value

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

Nodal values.

Definition at line 240 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 246 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 285 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 289 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 287 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 291 of file MooseVariableDataBase.h.

◆ _nodal_value_old

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

Definition at line 241 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 242 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 243 of file MooseVariableDataBase.h.

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

◆ _prev_elem

template<typename OutputType >
const Elem* MooseVariableDataLinearFV< OutputType >::_prev_elem = nullptr
mutableprivate

used to keep track of when dof indices are out of date

Definition at line 168 of file MooseVariableDataLinearFV.h.

Referenced by MooseVariableDataLinearFV< OutputType >::clearDofIndices().

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

◆ _qrule

template<typename OutputType >
const libMesh::QBase* MooseVariableDataLinearFV< OutputType >::_qrule
private

Pointer to the quadrature rule.

Definition at line 179 of file MooseVariableDataLinearFV.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 294 of file MooseVariableDataBase.h.

◆ _solution_tag

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

The vector tag ID corresponding to the solution vector.

Definition at line 210 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 297 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 191 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 188 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 194 of file MooseVariableDataBase.h.

◆ _time_integrator

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

Pointer to time integrator.

Definition at line 160 of file MooseVariableDataLinearFV.h.

◆ _var

template<typename OutputType >
const MooseLinearVariableFV<OutputType>& MooseVariableDataLinearFV< OutputType >::_var
private

A const reference to the owning MooseLinearVariableFV object.

Definition at line 145 of file MooseVariableDataLinearFV.h.

◆ _var_num

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

The index of the variable in the system.

Definition at line 151 of file MooseVariableDataLinearFV.h.

◆ _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: