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;
59 template <
typename T,
typename T2>
61 assignForAllQps(
const T & value, T2 & array,
const unsigned int nqp)
68 template <
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);
189 mooseError(
"Gradient of time derivative not yet implemented for FV");
225 void setDofValues(
const DenseVector<OutputData> & values);
239 void getDofIndices(
const Elem * elem, std::vector<dof_id_type> & dof_indices)
const;
240 const std::vector<dof_id_type> &
dofIndices()
const;
473 template <
typename OutputType>
478 return _ad_dof_values;
481 template <
typename OutputType>
485 _need_ad = _need_ad_u_dot =
true;
489 template <
typename OutputType>
502 template <
typename OutputType>
506 _need_ad = _need_ad_u_dot =
true;
508 if (!safeToComputeADUDot())
515 template <
typename OutputType>
522 _need_ad = _need_ad_u_dotdot =
true;
524 if (!safeToComputeADUDot())
526 _need_u_dotdot =
true;
531 template <
typename OutputType>
532 const std::vector<dof_id_type> &
538 template <
typename OutputType>
542 return dofIndices().size();
void initDofIndices(T &data, const Elem &elem)
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
const VariableValue & duDotDu() const
libMesh::FEContinuity getContinuity() const override
Return the variable continuity.
const unsigned int _var_num
FieldVariableValue _u_dot
u_dot (time derivative)
const std::vector< dof_id_type > & initDofIndices()
FieldVariableGradient _grad_u_dotdot
const FieldVariableValue & uDotOld() const
VariableValue _du_dotdot_du
derivative of u_dotdot wrt u
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
FieldVariableValue _u_dotdot_old
u_dotdot_old (second time derivative)
const MooseArray< ADReal > & adDofValuesDot() const
Return the AD dof time derivatives.
Keeps track of stuff related to assembling.
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
bool needsAD() const
Returns whether this data structure needs automatic differentiation calculations. ...
const ADTemplateVariableSecond< OutputType > & adSecondSln() const
bool hasDoFsOnNodes() const override
Whether this data is associated with a variable that has DoFs on nodes.
const FieldVariableValue & uDot() const
const MooseVariableFV< OutputType > & _var
A const reference to the owning MooseVariableFV object.
const MooseArray< ADReal > & adDofValues() const
Return the AD dof values.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
void setDofValue(const OutputData &value, unsigned int index)
dof value setters
bool hasDirichletBC() const
checks if a Dirichlet BC exists on this face
const bool _displaced
Whether this variable is being calculated on a displaced system.
unsigned int numberOfDofs() const
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const
const FieldVariableValue & uDotDotOld() const
const ADTemplateVariableValue< OutputType > & adSln() const
void setGeometry(Moose::GeometryType gm_type)
Set the geometry type before calculating variables values.
const Assembly & _assembly
MooseArray< ADReal > _ad_dof_values
virtual const MooseVariableFV< OutputType > & var() const override
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
bool _has_dirichlet_bc
if this variable has a dirichlet bc defined on a particular face
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
MooseArray< OutputSecond > FieldVariableSecond
Base class for a system (of equations)
void fetchADDoFValues()
Helper methods for assigning nodal values from their corresponding solution values (dof values as the...
DualNumber< Real, DNDerivativeType, true > ADReal
A structure for storing the various lists that contain the names of the items to be exported...
FieldVariableSecond _second_u
second_u
FieldVariableCurl _curl_u
curl_u
const TimeIntegrator *const _time_integrator
Pointer to time integrator.
TheWarehouse::QueryCache _fv_flux_kernel_query_cache
Cached warehouse query for FVFluxKernels.
void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const
MooseArray< ADReal > _ad_dofs_dot
const ADTemplateVariableGradient< OutputType > & adGradSln() const
const ADTemplateVariableValue< OutputType > & adUDot() const
FieldVariableCurl _curl_u_older
const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const
const DoFValue & dofValuesDotDot() const
This data structure is used to store geometric and variable related metadata about each cell face in ...
libMesh::TensorTools::IncrementRank< OutputShape >::type OutputShapeGradient
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
const FieldVariableValue & sln(Moose::SolutionState state) const
Local solution value.
Interface for notifications that the mesh has changed.
ADTemplateVariableGradient< OutputShape > _ad_grad_u_dot
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
ADTemplateVariableValue< OutputShape > _ad_u_dot
libMesh::TensorTools::IncrementRank< OutputGradient >::type OutputSecond
void setDofValues(const DenseVector< OutputData > &values)
Set local DOF values and evaluate the values on quadrature points.
const VariableValue & duDotDotDu() const
MooseArray< OutputType > FieldVariableCurl
const libMesh::FEType & _fe_type
void initializeSolnVars()
void prepareIC()
prepare the initial condition
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
ADReal _ad_real_dummy
A dummy ADReal variable.
const FieldVariableValue & uDotDot() const
const DoFValue & dofValuesDot() const
FieldVariableSecond _second_u_older
const DoFValue & dofValuesDotOld() const
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const
const FieldVariableValue & increment() const
Increment getter.
bool isNodal() const override
const DoFValue & dofValuesDotDotOld() const
void computeValues()
compute the variable values
FieldVariableSecond _second_u_old
OutputTools< Real >::VariableValue VariableValue
libMesh::TensorTools::IncrementRank< OutputShapeGradient >::type OutputShapeSecond
FieldVariableValue _increment
Increment in the variable used in dampers.
FieldVariableSecond _second_u_previous_nl
Moose::DOFType< OutputType >::type OutputData
libMesh::TensorTools::IncrementRank< OutputType >::type OutputGradient
const libMesh::QBase * _qrule
The quadrature rule.
Base class for time integrators.
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor, or Lower.
void meshChanged() override
Called on this object when the mesh changes.
Moose::ShapeType< OutputType >::type OutputShape
libMesh::TensorTools::DecrementRank< OutputType >::type OutputDivergence
bool _need_second_previous_nl
bool _need_second
SolutionState second_u flags.
FieldVariableGradient _grad_u_dot
grad_u dots
libMesh::FEContinuity _continuity
Continuity type of the variable.
void computeValuesFace(const FaceInfo &fi)
compute the variable values
MooseVariableDataFV(const MooseVariableFV< OutputType > &var, SystemBase &sys, THREAD_ID tid, Moose::ElementType element_type, const Elem *const &elem)
bool safeToComputeADUDot() const
Helper method that tells us whether it's safe to compute _ad_u_dot.
IntRange< T > make_range(T beg, T end)
const std::vector< dof_id_type > & dofIndices() const
OutputData getElementalValue(const Elem *elem, Moose::SolutionState state, unsigned int idx=0) const
libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
MooseArray< OutputGradient > FieldVariableGradient
FieldVariableValue _u_dot_old
u_dot_old (time derivative)
ADTemplateVariableSecond< OutputShape > _ad_second_u
MooseArray< OutputDivergence > FieldVariableDivergence
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
MooseArray< ADReal > _ad_dofs_dotdot
const Elem *const & _elem
The current elem.
MooseArray< OutputData > DoFValue
ADTemplateVariableValue< OutputShape > _ad_u
AD u.
This class provides variable solution values for other classes/objects to bind to when looping over f...
const FieldVariableCurl & curlSln(Moose::SolutionState state) const
Local solution curl getter.
const ADTemplateVariableValue< OutputType > & adUDotDot() const
VariableValue _du_dot_du
derivative of u_dot wrt u
const FieldVariableSecond & secondSln(Moose::SolutionState state) const
Local solution second spatial derivative getter.
FieldVariableCurl _curl_u_old
std::vector< dof_id_type > _dof_indices
The dof indices for the current element.
void computeAD(const unsigned int num_dofs, const unsigned int nqp)
compute AD things
const FieldVariableGradient & gradSlnDot() const
Local time derivative of solution gradient getter.
MooseArray< OutputType > FieldVariableValue
ADTemplateVariableGradient< OutputShape > _ad_grad_u
bool _need_curl
curl flags
const FieldVariableGradient & gradSlnDotDot() const
Local second time derivative of solution gradient getter.
const Elem * _prev_elem
used to keep track of when dof indices are out of date
TheWarehouse::QueryCache _fv_elemental_kernel_query_cache
Cached warehouse query for FVElementalKernels.
ADTemplateVariableValue< OutputShape > _ad_u_dotdot
const Elem *const & currentElem() const
The current element.
const ADReal _ad_zero
A zero AD variable.