https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseVariableData.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MooseArray.h"
13#include "MooseTypes.h"
15#include "Conversion.h"
16
17#include "libmesh/tensor_tools.h"
18#include "libmesh/vector_value.h"
19#include "libmesh/tensor_value.h"
20#include "libmesh/type_n_tensor.h"
21#include "libmesh/enum_fe_family.h"
22#include "libmesh/fe_type.h"
23#include "ADUtils.h"
24
25#include <functional>
26#include <vector>
27
28namespace libMesh
29{
30class QBase;
31class DofMap;
32template <typename>
33class DenseVector;
34}
35
37using libMesh::DofMap;
38using libMesh::QBase;
39
40class TimeIntegrator;
41class Assembly;
42class SubProblem;
43template <typename>
44class MooseVariableFE;
45class SystemBase;
46
47template <typename OutputType>
48class MooseVariableData : public MooseVariableDataBase<OutputType>
49{
50public:
51 // type for gradient, second and divergence of template class OutputType
55
56 // shortcut for types storing values on quadrature points
62
63 // shape function type for the template class OutputType
65
66 // type for gradient, second and divergence of shape functions of template class OutputType
70
71 // shortcut for types storing shape function values on quadrature points
77
78 // shortcut for types storing test function values on quadrature points
79 // Note: here we assume the types are the same as of shape functions.
85
86 // DoF value type for the template class OutputType
91
93 SystemBase & sys,
94 THREAD_ID tid,
95 Moose::ElementType element_type,
96 const QBase * const & qrule_in,
97 const QBase * const & qrule_face_in,
98 const Node * const & node,
99 const Elem * const & elem);
100
104 bool needsAD() const { return _need_ad; }
105
110 void setGeometry(Moose::GeometryType gm_type);
111
113
117 void computeValues();
118
123
127 template <bool constant_monomial>
128 void computeAD(const unsigned int num_dofs, const unsigned int nqp);
129
133 void computeNodalValues();
134
136
140 const FieldVariablePhiValue & phi() const { return *_phi; }
141
145 const FieldVariablePhiValue & phiFace() const { return *_phi_face; }
146
150 const FieldVariablePhiGradient & gradPhi() const { return *_grad_phi; }
151
156 {
157 mooseAssert(var().fieldType() == Moose::VarFieldType::VAR_FIELD_ARRAY, "Not an array variable");
158 return _mapped_grad_phi;
159 }
160
165
170 {
171 mooseAssert(var().fieldType() == Moose::VarFieldType::VAR_FIELD_ARRAY, "Not an array variable");
173 }
174
178 const FieldVariablePhiSecond & secondPhi() const;
179
184
188 const FieldVariablePhiCurl & curlPhi() const;
189
193 const FieldVariablePhiCurl & curlPhiFace() const;
194
198 const FieldVariablePhiDivergence & divPhi() const;
199
204
209
214
218 std::size_t phiSize() const { return _phi->size(); }
219
223 std::size_t phiFaceSize() const { return _phi_face->size(); }
224
232
236 bool computingCurl() const { return _need_curl || _need_curl_old; }
237
241 bool computingDiv() const { return _need_div || _need_div_old; }
242
244
245 bool isNodal() const override { return _is_nodal; }
246 bool hasDoFsOnNodes() const override { return _continuity != libMesh::DISCONTINUOUS; }
247 libMesh::FEContinuity getContinuity() const override { return _continuity; };
248 const Node * const & node() const { return _node; }
249 const dof_id_type & nodalDofIndex() const { return _nodal_dof_index; }
250 bool isNodalDefined() const { return _has_dof_indices; }
251
255 const Elem * const & currentElem() const { return _elem; }
256
260 const unsigned int & currentSide() const { return _current_side; }
261
265 void prepareIC();
266
268
272 const FieldVariableGradient & gradSlnDot() const;
273
277 const FieldVariableGradient & gradSlnDotDot() const;
278
284
290
296
298 {
300 return _ad_u;
301 }
302
309
316 {
317 _need_ad = _need_ad_u = true;
318 return _ad_u;
319 }
320
331
337 {
340
341 if (!_time_integrator)
342 // If we don't have a time integrator (this will be the case for variables that are a part of
343 // the AuxiliarySystem) then we have no way to calculate _ad_grad_u_dot and we are just going
344 // to copy the values from _grad_u_dot. Of course in order to be able to do that we need to
345 // calculate _grad_u_dot
346 _need_grad_dot = true;
347
348 return _ad_grad_u_dot;
349 }
350
358
360
362
363 const FieldVariableValue & uDot() const;
364
365 const FieldVariableValue & uDotDot() const;
366
367 const FieldVariableValue & uDotOld() const;
368
369 const FieldVariableValue & uDotDotOld() const;
370
371 const VariableValue & duDotDu() const
372 {
373 _need_du_dot_du = true;
374 return _du_dot_du;
375 }
376
377 const VariableValue & duDotDotDu() const
378 {
379 _need_du_dotdot_du = true;
380 return _du_dotdot_du;
381 }
382
384 {
386 curlPhi();
387 curlPhiFace();
388 return _ad_curl_u;
389 }
390
392 {
394 divPhi();
395 divPhiFace();
396 return _ad_div_u;
397 }
398
400
401 const OutputType & nodalValueDot() const;
402 const OutputType & nodalValueDotDot() const;
403 const OutputType & nodalValueDotOld() const;
404 const OutputType & nodalValueDotDotOld() const;
405 const OutputType & nodalValueDuDotDu() const;
406 const OutputType & nodalValueDuDotDotDu() const;
407
408 const typename Moose::ADType<OutputType>::type & adNodalValue() const;
409
414
416
419 void setDofValue(const DofValue & value, unsigned int index);
421
428 getElementalValue(const Elem * elem, Moose::SolutionState state, unsigned int idx = 0) const;
429
431
432 void getDofIndices(const Elem * elem, std::vector<dof_id_type> & dof_indices) const;
433 const std::vector<dof_id_type> & dofIndices() const { return _dof_indices; }
434 unsigned int numberOfDofs() const { return _dof_indices.size(); }
435 void clearDofIndices() { _dof_indices.clear(); }
436
440 void prepare();
441
445 void reinitNode();
446
450 void reinitAux();
451
456 void reinitNodes(const std::vector<dof_id_type> & nodes);
457
462 const DenseVector<libMesh::Number> & v) const;
463
465
466 const DofValues & dofValuesDot() const;
467 const DofValues & dofValuesDotOld() const;
468 const DofValues & dofValuesDotDot() const;
469 const DofValues & dofValuesDotDotOld() const;
472
476 const ADDofValues & adDofValues() const;
477
481 const ADDofValues & adDofValuesDot() const;
482
484
489 const FieldVariableValue & increment() const { return _increment; }
490
495
500
501private:
505 void fetchADDofValues();
506
512 void assignADNodalValue();
513
520 template <bool constant_monomial>
522
523 template <bool constant_monomial,
524 typename DestinationType,
525 typename ShapeType,
526 typename DofValuesType>
527 void fill(DestinationType & dest,
528 const ShapeType & phi,
529 const DofValuesType & dof_values,
530 unsigned int nqp,
531 std::size_t num_shapes);
532
535 void needADGradPhiFace() const;
536
539 void needADGradPhi() const;
540
543
545
546 const unsigned int _var_num;
547
549
552
555
558
561
564
567
570
572 mutable bool _need_second = false;
573 mutable bool _need_second_old = false;
574 mutable bool _need_second_older = false;
575 mutable bool _need_second_previous_nl = false;
576
578 mutable bool _need_curl = false;
579 mutable bool _need_curl_old = false;
580 mutable bool _need_curl_older = false;
581
583 mutable bool _need_div = false;
584 mutable bool _need_div_old = false;
585 mutable bool _need_div_older = false;
586
588 mutable bool _need_ad = false;
592 mutable bool _need_ad_volume = false;
593 mutable bool _need_ad_u = false;
594 mutable bool _need_ad_grad_u = false;
596 mutable bool _need_ad_grad_u_face = false;
597 mutable bool _need_ad_grad_u_dot = false;
598 mutable bool _need_ad_second_u = false;
599 mutable bool _need_ad_curl_u = false;
600 mutable bool _need_ad_div_u = false;
601 mutable bool _need_ad_u_dot = false;
602 mutable bool _need_ad_u_dotdot = false;
603
605
609
615
620
625
640
641 // time derivatives
642
645
648
651
654
657
660
664 const QBase * const & _qrule;
665 const QBase * const & _qrule_face;
666
667 // Shape function values, gradients, second derivatives
673
674 // Mapped array phi
679
680 // Values, gradients and second derivatives of shape function on faces
686
689
697
698 // dual mortar
699 const bool _use_dual;
700
701 std::function<const typename OutputTools<OutputType>::VariablePhiValue &(const Assembly &,
704 std::function<const typename OutputTools<OutputShape>::VariablePhiValue &(const Assembly &,
707
708 std::function<const typename OutputTools<OutputShape>::VariablePhiGradient &(const Assembly &,
711 std::function<const typename OutputTools<OutputShape>::VariablePhiGradient &(const Assembly &,
714
715 std::function<const typename OutputTools<OutputShape>::VariablePhiSecond &(const Assembly &,
718 std::function<const typename OutputTools<OutputShape>::VariablePhiSecond &(const Assembly &,
721
722 std::function<const typename OutputTools<OutputShape>::VariablePhiCurl &(const Assembly &,
725 std::function<const typename OutputTools<OutputShape>::VariablePhiCurl &(const Assembly &,
728
729 std::function<const typename OutputTools<OutputShape>::VariablePhiDivergence &(const Assembly &,
732
733 std::function<const typename OutputTools<OutputShape>::VariablePhiDivergence &(const Assembly &,
736
737 std::function<const ADTemplateVariablePhiGradient<OutputShape> &(const Assembly &,
740 std::function<const ADTemplateVariablePhiGradient<OutputShape> &(const Assembly &,
743
746
750 const Node * const & _node;
751
755 const Elem * const & _elem;
756
758 const bool _displaced;
759
761 const unsigned int & _current_side;
762
765
766 using MooseVariableDataBase<OutputType>::var;
767 using MooseVariableDataBase<OutputType>::_sys;
768 using MooseVariableDataBase<OutputType>::_subproblem;
773 using MooseVariableDataBase<OutputType>::_vector_tag_u;
777 using MooseVariableDataBase<OutputType>::_matrix_tag_u;
779 using MooseVariableDataBase<OutputType>::_dof_indices;
784 using MooseVariableDataBase<OutputType>::_solution_tag;
788 using MooseVariableDataBase<OutputType>::_dof_map;
789 using MooseVariableDataBase<OutputType>::_need_u_dot;
809 using MooseVariableDataBase<OutputType>::_tid;
815 using MooseVariableDataBase<OutputType>::_count;
816};
817
819
820template <typename OutputType>
823{
824 _need_ad = _need_ad_volume = true;
825 return _ad_dof_values;
826}
827
828template <typename OutputType>
831{
832 _need_ad = _need_ad_volume = _need_ad_u_dot = true;
833 if (!_time_integrator)
834 // See explanation in adUDot() body
835 _need_u_dot = true;
836 return _ad_dofs_dot;
837}
838
839template <typename OutputType>
840const typename Moose::ADType<OutputType>::type &
842{
843 // _ad_nodal_value is assigned by computeNodalValues(), not by the quadrature-rule path, so
844 // this request carries no need for AD with the volume quadrature rule.
845 _need_ad = true;
846 return _ad_nodal_value;
847}
848
849template <typename OutputType>
852{
853 _need_ad = _need_ad_volume = _need_ad_u_dot = true;
854
855 if (!_time_integrator)
856 // If we don't have a time integrator (this will be the case for variables that are a part of
857 // the AuxiliarySystem) then we have no way to calculate _ad_u_dot and we are just going to
858 // copy the values from _u_dot. Of course in order to be able to do that we need to calculate
859 // _u_dot
860 _need_u_dot = true;
861
862 return _ad_u_dot;
863}
864
865template <typename OutputType>
868{
869 // the time integrator computes the second time derivative together with the first one
870 _need_ad = _need_ad_volume = _need_ad_u_dot = _need_ad_u_dotdot = true;
871
872 // If we don't have a time integrator (this will be the case for variables that are a part
873 // of the AuxiliarySystem) then we have no way to calculate _ad_u_dotdot and we are just
874 // going to copy the values from _u_dotdot. Of course in order to be able to do that we need
875 // to calculate _u_dotdot, and _u_dot for the first time derivative copied alongside
876 if (!_time_integrator)
877 {
878 _need_u_dot = true;
879 _need_u_dotdot = true;
880 }
881
882 return _ad_u_dotdot;
883}
884
885template <typename OutputType>
888{
889 if (_element_type == Moose::ElementType::Neighbor || _element_type == Moose::ElementType::Lower)
890 mooseError("Unsupported element type: ", Moose::stringify(_element_type));
891 mooseAssert(_ad_grad_phi, "this should be non-null");
892 needADGradPhi();
893 return *_ad_grad_phi;
894}
895
896template <typename OutputType>
899{
900 if (_element_type == Moose::ElementType::Neighbor || _element_type == Moose::ElementType::Lower)
901 mooseError("Unsupported element type: ", Moose::stringify(_element_type));
902 mooseAssert(_ad_grad_phi_face, "this should be non-null");
903 needADGradPhiFace();
904 return *_ad_grad_phi_face;
905}
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
OutputTools< Real >::VariableValue VariableValue
Definition MooseTypes.h:348
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Definition MooseTypes.h:660
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition MooseTypes.h:654
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
Definition MooseTypes.h:391
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
Definition MooseTypes.h:691
typename OutputTools< typename Moose::ADType< T >::type >::VariableDivergence ADTemplateVariableDivergence
Definition MooseTypes.h:665
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
Definition MooseTypes.h:662
unsigned int THREAD_ID
Definition MooseTypes.h:237
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition MooseTypes.h:657
std::array< Real, 2 > values
Definition MortarUtils.C:52
ShapeType
Users of this template class must specify the type of shape functions that will be used in the Jacobi...
Keeps track of stuff related to assembling.
Definition Assembly.h:102
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition MooseArray.h:259
OutputType _nodal_value_dotdot
nodal values of u_dotdot
MooseArray< OutputGradient > FieldVariableGradient
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.
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
std::vector< bool > _need_matrix_tag_u
Moose::DOFType< OutputType >::type DofValue
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
libMesh::TensorTools::DecrementRank< OutputType >::type OutputDivergence
TagID _solution_tag
The vector tag ID corresponding to the solution vector.
std::vector< bool > _need_matrix_tag_dof_u
std::vector< DofValues > _matrix_tags_dof_u
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
MooseArray< OutputType > FieldVariableValue
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
Moose::ADType< DofValue >::type ADDofValue
MooseArray< DofValue > DofValues
DofValues _dof_values_dotdot_old
the previous time step's solution value second time derivative
virtual const MooseVariableField< OutputType > & var() const
MooseArray< ADDofValue > ADDofValues
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
unsigned int _count
Number of components of the associated variable.
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 VariableValue & duDotDu() const
const ADTemplateVariablePhiGradient< OutputShape > & adGradPhiFace() const
ad_grad_phi_face getter
MooseArray< std::vector< OutputShapeDivergence > > FieldVariableTestDivergence
const OutputType & nodalValueDotDot() const
void setGeometry(Moose::GeometryType gm_type)
Set the geometry type before calculating variables values.
VariableValue _du_dotdot_du
derivative of u_dotdot wrt u
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_assembly_method
MooseArray< std::vector< OutputShapeSecond > > FieldVariableTestSecond
bool _need_curl
curl flags
const OutputType & nodalValueDot() const
const FieldVariableDivergence & divSln(Moose::SolutionState state) const
Local solution divergence getter.
const ADTemplateVariableGradient< OutputType > & adGradSlnFace() const
Face counterpart of adGradSln(); see adSlnFace().
void reinitNode()
Prepare degrees of freedom for the current node.
FieldVariableCurl _curl_u
curl_u
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
const FieldVariableCurl & curlSln(Moose::SolutionState state) const
Local solution curl getter.
const ADTemplateVariableDivergence< OutputType > & adDivSln() const
const FieldVariablePhiSecond * _second_phi_face
const libMesh::FEType & _fe_type
const FieldVariablePhiDivergence & divPhiFace() const
divergence_phi_face getter
const FieldVariablePhiCurl & curlPhi() const
curl_phi getter
void setDofValue(const DofValue &value, unsigned int index)
dof value setters
const ADTemplateVariableValue< OutputType > & adUDot() const
const FieldVariableGradient & gradSlnDotDot() const
Local second time derivative of solution gradient getter.
void reinitNodes(const std::vector< dof_id_type > &nodes)
Set _dof_indices to the degrees of freedom existing on the passed-in nodes.
bool _need_ad_grad_u_face
Whether the AD gradient is needed on element faces, i.e. requested through adGradSlnFace()
const FieldVariableValue & uDotDot() const
void computeConstantMonomialValues()
compute the values for const monomial variables
std::function< const typename OutputTools< OutputShape >::VariablePhiSecond &(const Assembly &, libMesh::FEType)> _second_phi_face_assembly_method
ADTemplateVariableGradient< OutputType > _ad_grad_u_dot
FieldVariableGradient _grad_u_dot
grad_u dots
MooseArray< std::vector< OutputShapeSecond > > FieldVariablePhiSecond
const FieldVariablePhiCurl * _curl_phi_face
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_face_assembly_method
ADTemplateVariableSecond< OutputType > _ad_second_u
bool computingDiv() const
Whether or not this variable is computing the divergence.
const FieldVariablePhiValue & phi() const
phi getter
const FieldVariableGradient & gradSlnDot() const
Local time derivative of solution gradient getter.
MappedArrayVariablePhiGradient _mapped_grad_phi
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_face_assembly_method
std::size_t phiSize() const
Return phi size.
const FieldVariableValue & uDotOld() const
const FieldVariablePhiGradient * _grad_phi_face
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
const QBase *const & _qrule
The current qrule.
const FieldVariablePhiGradient & gradPhiFace() const
grad_phi_face getter
MooseArray< std::vector< OutputShape > > FieldVariableTestValue
bool _need_second
SolutionState second_u flags.
libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
void computeIncrementAtNode(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change at the current node based on increment_vec.
Moose::ShapeType< OutputType >::type OutputShape
FieldVariableSecond _second_u_previous_nl
MooseArray< std::vector< OutputShape > > FieldVariablePhiValue
Moose::ADType< OutputType >::type _ad_nodal_value
AD nodal value.
FieldVariableValue _u_dot_old
u_dot_old (time derivative)
const dof_id_type & nodalDofIndex() const
const ADTemplateVariableCurl< OutputType > & adCurlSln() const
const OutputType & nodalValueDuDotDu() const
const FieldVariablePhiGradient * _current_grad_phi
std::size_t phiFaceSize() const
Return phiFace size.
const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const
Volume-only: on element faces the AD gradient time derivative is not computed, because it would requi...
std::function< const ADTemplateVariablePhiGradient< OutputShape > &(const Assembly &, libMesh::FEType)> _ad_grad_phi_assembly_method
FieldVariableDivergence _div_u
divergence_u
DofValue getNodalValue(const Node &node, Moose::SolutionState state) const
const FieldVariablePhiGradient & gradPhi() const
grad_phi getter
const FieldVariablePhiSecond * _second_phi
const ADDofValues & adDofValues() const
Return the AD dof values.
const Moose::ADType< OutputType >::type & adNodalValue() const
bool needsAD() const
Returns whether this data structure needs automatic differentiation calculations.
bool hasDoFsOnNodes() const override
Whether this data is associated with a variable that has DoFs on nodes.
bool _is_nodal
if variable is nodal
const MooseVariableFE< OutputType > & _var
A const reference to the owning MooseVariableFE object.
FieldVariableValue _u_dot
u_dot (time derivative)
MooseArray< ADRealEigenVector > _ad_dofs_dot_eigen
const QBase * _current_qrule
const FieldVariablePhiValue * _phi
const DofValues & dofValuesDot() const
std::function< const typename OutputTools< OutputShape >::VariablePhiGradient &(const Assembly &, libMesh::FEType)> _grad_phi_assembly_method
FieldVariableDivergence _div_u_old
const FieldVariablePhiValue * _phi_face
void computeNodalValues()
compute nodal things
MooseArray< std::vector< OutputShapeGradient > > FieldVariablePhiGradient
ADReal _ad_zero
A zero AD variable.
const VariableValue & duDotDotDu() const
void computeValuesInternal()
Internal method for computeValues() and computeConstantMonomialValues()
MooseArray< std::vector< OutputShape > > FieldVariablePhiCurl
const unsigned int _var_num
const FieldVariablePhiGradient * _grad_phi
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi
MooseArray< std::vector< OutputShapeDivergence > > FieldVariablePhiDivergence
ADTemplateVariableGradient< OutputType > _ad_grad_u
FieldVariableSecond _second_u
second_u
const ADTemplateVariableSecond< OutputType > & adSecondSln() const
MooseArray< OutputSecond > FieldVariableSecond
const unsigned int & currentSide() const
The current side.
const FieldVariablePhiSecond & secondPhi() const
second_phi getter
const FieldVariablePhiCurl * _curl_phi
void needADGradPhiFace() const
Ask the assembly to compute the AD face shape function gradients, which this variable's AD face gradi...
const ADTemplateVariablePhiGradient< OutputShape > * _current_ad_grad_phi
std::function< const typename OutputTools< OutputShape >::VariablePhiCurl &(const Assembly &, libMesh::FEType)> _curl_phi_assembly_method
FieldVariableCurl _curl_u_old
const MappedArrayVariablePhiGradient & arrayGradPhi() const
mapped_grad_phi getter
const ADTemplateVariablePhiGradient< OutputShape > * _ad_grad_phi_face
FieldVariableValue _u_dotdot
u_dotdot (second time derivative)
void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const
const FieldVariablePhiDivergence & divPhi() const
divergence_phi getter
const QBase *const & _qrule_face
ADTemplateVariableCurl< OutputType > _ad_curl_u
const FieldVariableSecond & secondSln(Moose::SolutionState state) const
Local solution second spatial derivative getter.
bool computingCurl() const
Whether or not this variable is computing the curl.
const FieldVariablePhiSecond * _current_second_phi
void needADGradPhi() const
Ask the assembly to compute the AD element shape function gradients, which this variable's AD gradien...
void setDofValues(const DenseVector< DofValue > &values)
Set local DOF values and evaluate the values on quadrature points.
const FieldVariableValue & uDotDotOld() const
const MappedArrayVariablePhiGradient & arrayGradPhiFace() const
mapped_grad_phi_face getter
void addSolution(libMesh::NumericVector< libMesh::Number > &sol, const DenseVector< libMesh::Number > &v) const
Add passed in local DOF values to a solution vector.
MappedArrayVariablePhiGradient _mapped_grad_phi_neighbor
const FieldVariableValue & increment() const
Increment getter.
const FieldVariableValue & uDot() const
const ADTemplateVariableValue< OutputType > & adSlnFace() const
Solution getter for objects that only ever evaluate on element faces, such as AD integrated BCs.
ADReal _ad_real_dummy
A dummy ADReal variable.
bool isNodal() const override
ADTemplateVariableValue< OutputType > _ad_u_dot
const OutputType & nodalValueDuDotDotDu() const
FieldVariableSecond _second_u_old
void prepare()
Get the dof indices corresponding to the current element.
bool isNodalDefined() const
std::function< const typename OutputTools< OutputShape >::VariablePhiGradient &(const Assembly &, libMesh::FEType)> _grad_phi_face_assembly_method
FieldVariableDivergence _div_u_older
ADTemplateVariableValue< OutputType > _ad_u
AD u.
std::function< const ADTemplateVariablePhiGradient< OutputShape > &(const Assembly &, libMesh::FEType)> _ad_grad_phi_face_assembly_method
FieldVariableValue _increment
Increment in the variable used in dampers.
const Elem *const & _elem
The current elem.
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const
void prepareIC()
prepare the initial condition
bool _need_ad_volume
Whether AD is needed with the volume quadrature rule.
const ADTemplateVariableValue< OutputType > & adSln() const
const bool _displaced
Whether this variable is being calculated on a displaced system.
MooseArray< ADRealEigenVector > _ad_dofs_dotdot_eigen
ADTemplateVariableDivergence< OutputType > _ad_div_u
void fill(DestinationType &dest, const ShapeType &phi, const DofValuesType &dof_values, unsigned int nqp, std::size_t num_shapes)
MooseArray< std::vector< OutputShapeGradient > > FieldVariableTestGradient
FieldVariableSecond _second_u_older
MappedArrayVariablePhiGradient _mapped_grad_phi_face_neighbor
const Node *const & _node
The current node.
std::function< const typename OutputTools< OutputShape >::VariablePhiDivergence &(const Assembly &, libMesh::FEType)> _div_phi_assembly_method
const OutputType & nodalValueDotOld() const
MappedArrayVariablePhiGradient _mapped_grad_phi_face
void fetchADDofValues()
Helper method for assigning the ad_dof* arrays.
void assignADNodalValue()
Helper method for assigning nodal values from their corresponding solution values (dof values as they...
const FieldVariablePhiCurl * _current_curl_phi
const TimeIntegrator * _time_integrator
Pointer to time integrator.
void computeValues()
compute the variable values
const FieldVariablePhiDivergence * _current_div_phi
const unsigned int & _current_side
The current element side.
void reinitAux()
Prepare dof indices and solution values for elemental auxiliary variables.
const FieldVariablePhiDivergence * _div_phi
const Elem *const & currentElem() const
The current element.
ADTemplateVariableValue< OutputType > _ad_u_dotdot
DofValue getElementalValue(const Elem *elem, Moose::SolutionState state, unsigned int idx=0) const
const ADTemplateVariablePhiGradient< OutputShape > & adGradPhi() const
ad_grad_phi getter
const Assembly & _assembly
Moose::ElementType _element_type
The element type this object is storing data for. This is either Element, Neighbor,...
const ADTemplateVariableGradient< OutputType > & adGradSln() const
libMesh::TensorTools::IncrementRank< OutputShape >::type OutputShapeGradient
bool _need_div
divergence flags
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const DofValue &v)
Write a nodal value to the passed-in solution vector.
libMesh::FEContinuity _continuity
Continuity type of the variable.
unsigned int numberOfDofs() const
const Node *const & node() const
const FieldVariablePhiCurl & curlPhiFace() const
curl_phi_face getter
const FieldVariablePhiDivergence * _div_phi_face
const ADTemplateVariableValue< OutputType > & adUDotDot() const
const FieldVariablePhiSecond & secondPhiFace() const
second_phi_face getter
const DofValues & dofValuesDotDotOld() const
ADDofValues _ad_dofs_dotdot
FieldVariableValue _u_dotdot_old
u_dotdot_old (second time derivative)
const OutputType & nodalValueDotDotOld() const
const FieldVariablePhiValue * _current_phi
const DofValues & dofValuesDotOld() const
const std::vector< dof_id_type > & dofIndices() const
VariableValue _du_dot_du
derivative of u_dot wrt u
MooseArray< OutputType > FieldVariableCurl
const FieldVariablePhiValue & phiFace() const
phi_face getter
libMesh::TensorTools::IncrementRank< OutputShapeGradient >::type OutputShapeSecond
std::function< const typename OutputTools< OutputShape >::VariablePhiValue &(const Assembly &, libMesh::FEType)> _phi_face_assembly_method
void computeAD(const unsigned int num_dofs, const unsigned int nqp)
compute AD things
libMesh::FEContinuity getContinuity() const override
Return the variable continuity.
MooseArray< std::vector< OutputShape > > FieldVariableTestCurl
const ADDofValues & adDofValuesDot() const
Return the AD time derivative values of degrees of freedom.
MooseArray< OutputDivergence > FieldVariableDivergence
const DofValues & dofValuesDotDot() const
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const
dof_id_type _nodal_dof_index
The dof index for the current node.
std::function< const typename OutputTools< OutputType >::VariablePhiValue &(const Assembly &, libMesh::FEType)> _phi_assembly_method
FieldVariableCurl _curl_u_older
FieldVariableGradient _grad_u_dotdot
Class for stuff related to variables.
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
Base class for a system (of equations)
Definition SystemBase.h:87
Base class for time integrators.
@ VAR_FIELD_ARRAY
Definition MooseTypes.h:784
SolutionState
Definition MooseTypes.h:262
std::string stringify(const T &t)
conversion to string
Definition Conversion.h:65
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
uint8_t dof_id_type
OutputType type
Definition MooseTypes.h:291