18#include "libmesh/tensor_tools.h"
19#include "libmesh/vector_value.h"
20#include "libmesh/tensor_value.h"
21#include "libmesh/type_n_tensor.h"
22#include "libmesh/fe_type.h"
23#include "libmesh/dof_map.h"
24#include "libmesh/enum_fe_family.h"
49 if (data._prev_elem != &elem)
51 data._dof_map.dof_indices(&elem, data._dof_indices, data._var_num);
52 data._prev_elem = &elem;
59template <
typename T,
typename T2>
61assignForAllQps(
const T & value, T2 & array,
const unsigned int nqp)
68template <
typename OutputType>
100 const Elem *
const & elem);
102 bool isNodal()
const override {
return false; }
132 void computeAD(
const unsigned int num_dofs,
const unsigned int nqp);
187 mooseError(
"Gradient of time derivative not yet implemented for FV");
237 void getDofIndices(
const Elem * elem, std::vector<dof_id_type> & dof_indices)
const;
238 const std::vector<dof_id_type> &
dofIndices()
const;
471template <
typename OutputType>
484template <
typename OutputType>
491 _need_ad = _need_ad_u_dotdot =
true;
493 if (!safeToComputeADUDot())
495 _need_u_dotdot =
true;
500template <
typename OutputType>
501const std::vector<dof_id_type> &
507template <
typename OutputType>
511 return dofIndices().size();
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
OutputTools< Real >::VariableValue VariableValue
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
std::array< Real, 2 > values
Keeps track of stuff related to assembling.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Interface for notifications that the mesh has changed.
OutputType _nodal_value_dotdot
nodal values of u_dotdot
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
OutputType _nodal_value_dot_old
nodal values of u_dot_old
bool _need_dof_values_dot
local solution flags
std::vector< FieldVariableValue > _vector_tag_u
TagID _previous_nl_solution_tag
The vector tag ID corresponding to the previous nonlinear iteration's solution vector.
bool _need_u_dot
u dot flags
DofValues _dof_values_dotdot
second time derivative of the solution values
TagID _old_solution_tag
The vector tag ID corresponding to the old solution vector.
SystemBase & _sys
The MOOSE system which ultimately holds the vectors and matrices relevant to this variable data.
std::vector< FieldVariableValue > _matrix_tag_u
bool _need_dof_du_dotdot_du
std::vector< bool > _need_matrix_tag_u
void fetchDofValues()
Helper methods for assigning dof values from their corresponding solution values.
const libMesh::DofMap & _dof_map
The degree of freedom map from libMesh.
OutputType _nodal_value_dotdot_old
nodal values of u_dotdot_old
std::vector< DofValues > _vector_tags_dof_u
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
bool _need_dof_values_dotdot_old
std::vector< bool > _need_matrix_tag_dof_u
std::vector< DofValues > _matrix_tags_dof_u
bool _need_dof_values_dotdot
TagID _older_solution_tag
The vector tag ID corresponding to the older solution vector.
std::vector< bool > _need_vector_tag_u
DofValues _dof_values_dot_old
the previous time step's solution value time derivative
DofValues _dof_values_dot
time derivative of the solution values
MooseArray< libMesh::Number > _dof_du_dotdot_du
derivatives of the solution value second time derivative with respect to the degrees of freedom
std::vector< FieldVariableGradient > _vector_tag_grad
DofValues _dof_values_dotdot_old
the previous time step's solution value second time derivative
bool _need_dof_values_dot_old
std::set< TagID > _required_vector_tags
The set of vector tags (residual + solution) we need to evaluate.
const THREAD_ID _tid
The thread ID that this object is on.
std::vector< bool > _need_vector_tag_dof_u
bool _need_grad_dot
gradient dot flags
OutputType _nodal_value_dot
nodal values of u_dot
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
bool _has_dof_values
Whether we currently have degree of freedom values stored in our local containers (corresponding to t...
MooseArray< libMesh::Number > _dof_du_dot_du
derivatives of the solution value time derivative with respect to the degrees of freedom
std::vector< bool > _need_vector_tag_grad
const ADReal _ad_zero
A zero AD variable.
const Assembly & _assembly
const FieldVariableValue & uDotDot() const
VariableValue _du_dotdot_du
derivative of u_dotdot wrt u
FieldVariableGradient _grad_u_dotdot
void computeValues()
compute the variable values
libMesh::FEContinuity _continuity
Continuity type of the variable.
const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const
bool safeToComputeADUDot() const
Helper method that tells us whether it's safe to compute _ad_u_dot.
MooseArray< ADReal > _ad_dof_values
bool _has_dirichlet_bc
if this variable has a dirichlet bc defined on a particular face
libMesh::TensorTools::IncrementRank< OutputShape >::type OutputShapeGradient
void setGeometry(Moose::GeometryType gm_type)
Set the geometry type before calculating variables values.
MooseArray< OutputType > FieldVariableCurl
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
ADTemplateVariableGradient< OutputShape > _ad_grad_u_dot
const Elem *const & _elem
The current elem.
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
const DofValue & dofValuesDot() const
ADTemplateVariableValue< OutputShape > _ad_u_dot
void fetchADDofValues()
Helper methods for assigning nodal values from their corresponding solution values (dof values as the...
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const
Moose::DOFType< OutputType >::type OutputData
bool hasDoFsOnNodes() const override
Whether this data is associated with a variable that has DoFs on nodes.
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor,...
FieldVariableSecond _second_u_previous_nl
const FieldVariableValue & uDotDotOld() const
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const
const DofValue & dofValuesDotDotOld() const
virtual const MooseVariableFV< OutputType > & var() const override
ADTemplateVariableGradient< OutputShape > _ad_grad_u
const Elem *const & currentElem() const
The current element.
VariableValue _du_dot_du
derivative of u_dot wrt u
FieldVariableValue _u_dot_old
u_dot_old (time derivative)
const VariableValue & duDotDu() const
unsigned int numberOfDofs() const
bool _need_second
SolutionState second_u flags.
const MooseArray< ADReal > & adDofValues() const
Return the AD dof values.
MooseArray< ADReal > _ad_dofs_dotdot
const libMesh::FEType & _fe_type
const FieldVariableGradient & gradSlnDotDot() const
Local second time derivative of solution gradient getter.
MooseArray< ADReal > _ad_dofs_dot
ADTemplateVariableValue< OutputShape > _ad_u_dotdot
libMesh::FEContinuity getContinuity() const override
Return the variable continuity.
FieldVariableValue _u_dotdot_old
u_dotdot_old (second time derivative)
FieldVariableCurl _curl_u
curl_u
const DofValue & dofValuesDotOld() const
void computeValuesFace(const FaceInfo &fi)
compute the variable values
const bool _displaced
Whether this variable is being calculated on a displaced system.
const std::vector< dof_id_type > & dofIndices() const
FieldVariableCurl _curl_u_older
const ADTemplateVariableValue< OutputType > & adUDotDot() const
const MooseArray< ADReal > & adDofValuesDot() const
Return the AD dof time derivatives.
void meshChanged() override
Called on this object when the mesh changes.
const MooseVariableFV< OutputType > & _var
A const reference to the owning MooseVariableFV object.
const FieldVariableValue & uDotOld() const
const VariableValue & duDotDotDu() const
void computeAD(const unsigned int num_dofs, const unsigned int nqp)
compute AD things
ADReal _ad_real_dummy
A dummy ADReal variable.
libMesh::TensorTools::IncrementRank< OutputGradient >::type OutputSecond
MooseArray< OutputType > FieldVariableValue
const libMesh::QBase * _qrule
The quadrature rule.
libMesh::TensorTools::DecrementRank< OutputType >::type OutputDivergence
FieldVariableValue _u_dot
u_dot (time derivative)
FieldVariableSecond _second_u_old
FieldVariableGradient _grad_u_dot
grad_u dots
const TimeIntegrator *const _time_integrator
Pointer to time integrator.
FieldVariableValue _increment
Increment in the variable used in dampers.
MooseArray< OutputGradient > FieldVariableGradient
const ADTemplateVariableValue< OutputType > & adUDot() const
TheWarehouse::QueryCache _fv_flux_kernel_query_cache
Cached warehouse query for FVFluxKernels.
FieldVariableSecond _second_u
second_u
libMesh::TensorTools::IncrementRank< OutputShapeGradient >::type OutputShapeSecond
const ADTemplateVariableValue< OutputType > & adSln() const
libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
void setDofValues(const DenseVector< OutputData > &values)
Set local DOF values and evaluate the values on quadrature points.
bool needsAD() const
Returns whether this data structure needs automatic differentiation calculations.
const FieldVariableCurl & curlSln(Moose::SolutionState state) const
Local solution curl getter.
const FieldVariableValue & sln(Moose::SolutionState state) const
Local solution value.
FieldVariableCurl _curl_u_old
MooseArray< OutputDivergence > FieldVariableDivergence
const Elem * _prev_elem
used to keep track of when dof indices are out of date
OutputData getElementalValue(const Elem *elem, Moose::SolutionState state, unsigned int idx=0) const
void initializeSolnVars()
ADTemplateVariableValue< OutputShape > _ad_u
AD u.
Moose::ShapeType< OutputType >::type OutputShape
void setDofValue(const OutputData &value, unsigned int index)
dof value setters
libMesh::TensorTools::IncrementRank< OutputType >::type OutputGradient
bool _need_second_previous_nl
bool _need_curl
curl flags
const FieldVariableValue & uDot() const
MooseArray< OutputSecond > FieldVariableSecond
const std::vector< dof_id_type > & initDofIndices()
TheWarehouse::QueryCache _fv_elemental_kernel_query_cache
Cached warehouse query for FVElementalKernels.
const FieldVariableSecond & secondSln(Moose::SolutionState state) const
Local solution second spatial derivative getter.
const FieldVariableGradient & gradSlnDot() const
Local time derivative of solution gradient getter.
ADTemplateVariableSecond< OutputShape > _ad_second_u
const ADTemplateVariableGradient< OutputType > & adGradSln() const
const unsigned int _var_num
void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const
const DofValue & dofValuesDotDot() const
bool isNodal() const override
MooseArray< OutputData > DofValue
void prepareIC()
prepare the initial condition
FieldVariableSecond _second_u_older
const FieldVariableValue & increment() const
Increment getter.
bool hasDirichletBC() const
checks if a Dirichlet BC exists on this face
const ADTemplateVariableSecond< OutputType > & adSecondSln() const
This class provides variable solution values for other classes/objects to bind to when looping over f...
Base class for a system (of equations)
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
Base class for time integrators.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
void initDofIndices(T &data, const Elem &elem)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
IntRange< T > make_range(T beg, T end)
A structure for storing the various lists that contain the names of the items to be exported.