https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseVariableFE.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 "MooseTypes.h"
13#include "MooseVariableFEBase.h"
14#include "SubProblem.h"
15#include "MooseMesh.h"
16#include "MooseVariableField.h"
17#include "MooseVariableData.h"
18
19#include "libmesh/numeric_vector.h"
20#include "libmesh/dof_map.h"
21#include "libmesh/elem.h"
22#include "libmesh/quadrature.h"
23#include "libmesh/dense_vector.h"
24#include "libmesh/enum_fe_family.h"
25
26class TimeIntegrator;
27template <typename>
28class MooseVariableFE;
32
45template <typename OutputType>
46class MooseVariableFE : public MooseVariableField<OutputType>
47{
48public:
52
58
63
71
79
84
89
91
93
94 void clearDofIndices() override;
95
96 void prepare() override;
97 void prepareNeighbor() override;
98 void prepareLowerD() override;
99 virtual void prepareIC() override;
100
101 void prepareAux() override;
102
103 void reinitNode() override;
104 void reinitAux() override;
105 void reinitAuxNeighbor() override;
106
107 void reinitNodes(const std::vector<dof_id_type> & nodes) override;
108 void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes) override;
109
115 bool usesPhi() const { return true; }
121 bool usesGradPhi() const { return true; }
122
126 bool usesSecondPhi() const;
127
132 bool usesSecondPhiNeighbor() const override final;
133
137 bool computingSecond() const override final { return usesSecondPhi(); }
138
142 bool computingCurl() const override final;
143
147 bool computingDiv() const override final;
148
149 bool isNodal() const override { return _element_data->isNodal(); }
150 bool hasDoFsOnNodes() const override { return _element_data->hasDoFsOnNodes(); }
151 bool supportsQpBasedLoops() const override { return true; }
152 bool supportsGeometricInfoBasedLoops() const override { return false; }
153 libMesh::FEContinuity getContinuity() const override { return _element_data->getContinuity(); };
154 const Node * const & node() const { return _element_data->node(); }
155 const dof_id_type & nodalDofIndex() const override { return _element_data->nodalDofIndex(); }
156 virtual bool isNodalDefined() const override;
157
158 const Node * const & nodeNeighbor() const { return _neighbor_data->node(); }
159 const dof_id_type & nodalDofIndexNeighbor() const override
160 {
161 return _neighbor_data->nodalDofIndex();
162 }
163 bool isNodalNeighborDefined() const;
164
165 const Elem * const & currentElem() const override { return _element_data->currentElem(); }
166
170 const unsigned int & currentSide() const { return _element_data->currentSide(); }
171
175 const Elem * const & neighbor() const { return _neighbor_data->currentElem(); }
176
177 virtual void getDofIndices(const Elem * elem,
178 std::vector<dof_id_type> & dof_indices) const override;
179 const std::vector<dof_id_type> & dofIndices() const final { return _element_data->dofIndices(); }
180 unsigned int numberOfDofs() const final { return _element_data->numberOfDofs(); }
181 const std::vector<dof_id_type> & dofIndicesNeighbor() const final
182 {
183 return _neighbor_data->dofIndices();
184 }
185 const std::vector<dof_id_type> & dofIndicesLower() const final
186 {
187 return _lower_data->dofIndices();
188 }
189
190 void clearAllDofIndices() final;
191
192 unsigned int numberOfDofsNeighbor() override { return _neighbor_data->dofIndices().size(); }
193
194 const FieldVariablePhiValue & phi() const override { return _element_data->phi(); }
195 const FieldVariablePhiGradient & gradPhi() const override final
196 {
197 return _element_data->gradPhi();
198 }
200 {
201 return _element_data->arrayGradPhi();
202 }
203 const FieldVariablePhiSecond & secondPhi() const override final;
204 const FieldVariablePhiCurl & curlPhi() const override final;
205 const FieldVariablePhiDivergence & divPhi() const override final;
206
207 const FieldVariablePhiValue & phiFace() const override final { return _element_data->phiFace(); }
208 const FieldVariablePhiGradient & gradPhiFace() const override final
209 {
210 return _element_data->gradPhiFace();
211 }
213 {
214 return _element_data->arrayGradPhiFace();
215 }
216 const FieldVariablePhiSecond & secondPhiFace() const override final;
217 const FieldVariablePhiCurl & curlPhiFace() const;
219
220 const FieldVariablePhiValue & phiNeighbor() const override final { return _neighbor_data->phi(); }
221 const FieldVariablePhiGradient & gradPhiNeighbor() const override final
222 {
223 return _neighbor_data->gradPhi();
224 }
226 {
227 return _neighbor_data->arrayGradPhi();
228 }
229 const FieldVariablePhiSecond & secondPhiNeighbor() const override final;
232
233 const FieldVariablePhiValue & phiFaceNeighbor() const override final
234 {
235 return _neighbor_data->phiFace();
236 }
237 const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
238 {
239 return _neighbor_data->gradPhiFace();
240 }
242 {
243 return _neighbor_data->arrayGradPhiFace();
244 }
245 const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final;
248
249 virtual const FieldVariablePhiValue & phiLower() const override { return _lower_data->phi(); }
250 const FieldVariablePhiGradient & gradPhiLower() const { return _lower_data->gradPhi(); }
251
253 {
254 return _element_data->adGradPhi();
255 }
256
258 {
259 return _element_data->adGradPhiFace();
260 }
261
263 {
264 return _neighbor_data->adGradPhiFace();
265 }
266
267 // damping
268 const FieldVariableValue & increment() const { return _element_data->increment(); }
269
270 const FieldVariableValue & vectorTagValue(TagID tag) const override
271 {
272 return _element_data->vectorTagValue(tag);
273 }
275 {
276 return _element_data->vectorTagGradient(tag);
277 }
278 const DofValues & vectorTagDofValue(TagID tag) const override
279 {
280 return _element_data->vectorTagDofValue(tag);
281 }
282 const FieldVariableValue & matrixTagValue(TagID tag) const override
283 {
284 return _element_data->matrixTagValue(tag);
285 }
286
288 const FieldVariableValue & sln() const override { return _element_data->sln(Moose::Current); }
289 const FieldVariableValue & slnOld() const override { return _element_data->sln(Moose::Old); }
290 const FieldVariableValue & slnOlder() const override { return _element_data->sln(Moose::Older); }
292
294 const FieldVariableGradient & gradSln() const override
295 {
296 return _element_data->gradSln(Moose::Current);
297 }
298 const FieldVariableGradient & gradSlnOld() const override
299 {
300 return _element_data->gradSln(Moose::Old);
301 }
303 {
304 return _element_data->gradSln(Moose::Older);
305 }
307 {
308 return _element_data->gradSln(Moose::PreviousNL);
309 }
310
312 const FieldVariableGradient & gradSlnDot() const { return _element_data->gradSlnDot(); }
313 const FieldVariableGradient & gradSlnDotDot() const { return _element_data->gradSlnDotDot(); }
314
316 const FieldVariableSecond & secondSln() const { return _element_data->secondSln(Moose::Current); }
317 const FieldVariableSecond & secondSlnOld() const { return _element_data->secondSln(Moose::Old); }
319 {
320 return _element_data->secondSln(Moose::Older);
321 }
323 {
324 return _element_data->secondSln(Moose::PreviousNL);
325 }
326
328 const FieldVariableCurl & curlSln() const { return _element_data->curlSln(Moose::Current); }
329 const FieldVariableCurl & curlSlnOld() const { return _element_data->curlSln(Moose::Old); }
330 const FieldVariableCurl & curlSlnOlder() const { return _element_data->curlSln(Moose::Older); }
331
333 const FieldVariableDivergence & divSln() const { return _element_data->divSln(Moose::Current); }
334 const FieldVariableDivergence & divSlnOld() const { return _element_data->divSln(Moose::Old); }
336 {
337 return _element_data->divSln(Moose::Older);
338 }
339
342 {
343 return _element_data->adSln();
344 }
345
347 {
348 return _element_data->adGradSln();
349 }
350
353 {
354 return _element_data->adSlnFace();
355 }
357 {
358 return _element_data->adGradSlnFace();
359 }
361 {
362 return _element_data->adSecondSln();
363 }
365 {
366 return _element_data->adUDot();
367 }
369 {
370 return _element_data->adUDotDot();
371 }
373 {
374 return _element_data->adGradSlnDot();
375 }
377 {
378 return _element_data->adCurlSln();
379 }
380
383 {
384 return _neighbor_data->adSln();
385 }
387 {
388 return _neighbor_data->adGradSln();
389 }
391 {
392 return _neighbor_data->adSecondSln();
393 }
395 {
396 return _neighbor_data->adUDot();
397 }
399 {
400 return _neighbor_data->adUDotDot();
401 }
403 {
404 return _neighbor_data->adGradSlnDot();
405 }
407 {
408 return _neighbor_data->adCurlSln();
409 }
410
412 const FieldVariableValue & uDot() const { return _element_data->uDot(); }
413 const FieldVariableValue & uDotDot() const { return _element_data->uDotDot(); }
414 const FieldVariableValue & uDotOld() const { return _element_data->uDotOld(); }
415 const FieldVariableValue & uDotDotOld() const { return _element_data->uDotDotOld(); }
416 const VariableValue & duDotDu() const { return _element_data->duDotDu(); }
417 const VariableValue & duDotDotDu() const { return _element_data->duDotDotDu(); }
418
420 const FieldVariableValue & slnNeighbor() const override
421 {
422 return _neighbor_data->sln(Moose::Current);
423 }
424 const FieldVariableValue & slnOldNeighbor() const override
425 {
426 return _neighbor_data->sln(Moose::Old);
427 }
430 {
432 }
433
435 const FieldVariableGradient & gradSlnNeighbor() const override
436 {
437 return _neighbor_data->gradSln(Moose::Current);
438 }
440 {
441 return _neighbor_data->gradSln(Moose::Old);
442 }
444 {
445 return _neighbor_data->gradSln(Moose::Older);
446 }
448 {
449 return _neighbor_data->gradSln(Moose::PreviousNL);
450 }
451
453 const FieldVariableGradient & gradSlnNeighborDot() const { return _neighbor_data->gradSlnDot(); }
455 {
456 return _neighbor_data->gradSlnDotDot();
457 }
458
461 {
462 return _neighbor_data->secondSln(Moose::Current);
463 }
465 {
466 return _neighbor_data->secondSln(Moose::Old);
467 }
469 {
470 return _neighbor_data->secondSln(Moose::Older);
471 }
473 {
474 return _neighbor_data->secondSln(Moose::PreviousNL);
475 }
476
479 {
480 return _neighbor_data->curlSln(Moose::Current);
481 }
483 {
484 return _neighbor_data->curlSln(Moose::Old);
485 }
487 {
488 return _neighbor_data->curlSln(Moose::Older);
489 }
490
493 {
494 return _neighbor_data->divSln(Moose::Current);
495 }
497 {
498 return _neighbor_data->divSln(Moose::Old);
499 }
501 {
502 return _neighbor_data->divSln(Moose::Older);
503 }
504
506 const FieldVariableValue & uDotNeighbor() const { return _neighbor_data->uDot(); }
507 const FieldVariableValue & uDotDotNeighbor() const { return _neighbor_data->uDotDot(); }
508 const FieldVariableValue & uDotOldNeighbor() const { return _neighbor_data->uDotOld(); }
509 const FieldVariableValue & uDotDotOldNeighbor() const { return _neighbor_data->uDotDotOld(); }
510 const VariableValue & duDotDuNeighbor() const { return _neighbor_data->duDotDu(); }
511 const VariableValue & duDotDotDuNeighbor() const { return _neighbor_data->duDotDotDu(); }
512
514 const ADTemplateVariableValue<OutputType> & adSlnLower() const { return _lower_data->adSln(); }
515 const FieldVariableValue & slnLower() const { return _lower_data->sln(Moose::Current); }
516 const FieldVariableValue & slnLowerOld() const { return _lower_data->sln(Moose::Old); }
517
519 virtual void computeElemValues() override;
520 virtual void computeElemValuesFace() override;
521 virtual void computeNeighborValuesFace() override;
522 virtual void computeNeighborValues() override;
523 virtual void computeLowerDValues() override;
524
525 virtual void setNodalValue(const OutputType & value) override;
526
527 virtual void setDofValue(const DofValue & value, unsigned int index) override;
528
532 virtual void setDofValues(const DenseVector<DofValue> & values) override;
533 virtual void setLowerDofValues(const DenseVector<DofValue> & values) override;
534
539
543 DofValue getNodalValue(const Node & node) const;
547 DofValue getNodalValueOld(const Node & node) const;
551 DofValue getNodalValueOlder(const Node & node) const;
558 DofValue getElementalValue(const Elem * elem, unsigned int idx = 0) const;
565 DofValue getElementalValueOld(const Elem * elem, unsigned int idx = 0) const;
572 DofValue getElementalValueOlder(const Elem * elem, unsigned int idx = 0) const;
573
577 virtual void insert(libMesh::NumericVector<libMesh::Number> & vector) override;
578 virtual void insertLower(libMesh::NumericVector<libMesh::Number> & vector) override;
579
583 virtual void add(libMesh::NumericVector<libMesh::Number> & vector) override;
584
588 void addSolution(const DenseVector<libMesh::Number> & v);
589
593 void addSolutionNeighbor(const DenseVector<libMesh::Number> & v);
594
595 const DofValues & dofValue() const;
596 const DofValues & dofValues() const override;
597 const DofValues & dofValuesOld() const override;
598 const DofValues & dofValuesOlder() const override;
599 const DofValues & dofValuesPreviousNL() const override;
600 const DofValues & dofValuesNeighbor() const override;
601 const DofValues & dofValuesOldNeighbor() const override;
602 const DofValues & dofValuesOlderNeighbor() const override;
603 const DofValues & dofValuesPreviousNLNeighbor() const override;
604 const DofValues & dofValuesDot() const override;
605 const DofValues & dofValuesDotNeighbor() const override;
607 const DofValues & dofValuesDotOld() const override;
608 const DofValues & dofValuesDotOldNeighbor() const override;
609 const DofValues & dofValuesDotDot() const override;
610 const DofValues & dofValuesDotDotNeighbor() const override;
612 const DofValues & dofValuesDotDotOld() const override;
613 const DofValues & dofValuesDotDotOldNeighbor() const override;
614 const MooseArray<libMesh::Number> & dofValuesDuDotDu() const override;
616 const MooseArray<libMesh::Number> & dofValuesDuDotDotDu() const override;
618
619 const ADDofValues & adDofValues() const override;
620 const ADDofValues & adDofValuesNeighbor() const override;
621 const ADDofValues & adDofValuesDot() const override;
622
627
632
639 OutputType getValue(const Elem * elem, const std::vector<std::vector<OutputShape>> & phi) const;
640
648 const Elem * elem,
649 const std::vector<std::vector<typename OutputTools<OutputType>::OutputShapeGradient>> &
650 grad_phi) const;
651
655 virtual std::size_t phiSize() const final { return _element_data->phiSize(); }
659 virtual std::size_t phiFaceSize() const final { return _element_data->phiFaceSize(); }
663 virtual std::size_t phiNeighborSize() const final { return _neighbor_data->phiSize(); }
667 virtual std::size_t phiFaceNeighborSize() const final { return _neighbor_data->phiFaceSize(); }
668
669 std::size_t phiLowerSize() const final { return _lower_data->phiSize(); }
670
674 const OutputType & nodalValue() const;
675 const OutputType & nodalValueOld() const;
676 const OutputType & nodalValueOlder() const;
677 const OutputType & nodalValuePreviousNL() const;
678 const OutputType & nodalValueDot() const;
679 const OutputType & nodalValueDotDot() const;
680 const OutputType & nodalValueDotOld() const;
681 const OutputType & nodalValueDotDotOld() const;
682 const OutputType & nodalValueDuDotDu() const;
683 const OutputType & nodalValueDuDotDotDu() const;
684 const OutputType & nodalValueNeighbor() const;
685 const OutputType & nodalValueOldNeighbor() const;
686 const OutputType & nodalValueOlderNeighbor() const;
687 const OutputType & nodalValuePreviousNLNeighbor() const;
688 const OutputType & nodalValueDotNeighbor() const;
689 const OutputType & nodalValueDotNeighborResidual() const;
690 const OutputType & nodalValueDotDotNeighbor() const;
691 const OutputType & nodalValueDotDotNeighborResidual() const;
692 const OutputType & nodalValueDotOldNeighbor() const;
693 const OutputType & nodalValueDotDotOldNeighbor() const;
694 const OutputType & nodalValueDuDotDuNeighbor() const;
695 const OutputType & nodalValueDuDotDotDuNeighbor() const;
696
698 {
699 return _element_data->nodalValueArray(Moose::Current);
700 }
702 {
703 return _element_data->nodalValueArray(Moose::Old);
704 }
706 {
707 return _element_data->nodalValueArray(Moose::Older);
708 }
709
710 const DofValues & nodalVectorTagValue(TagID tag) const override;
711 const DofValues & nodalMatrixTagValue(TagID tag) const override;
712
714
715 virtual void computeNodalValues() override;
716 virtual void computeNodalNeighborValues() override;
717
718 unsigned int oldestSolutionStateRequested() const override final;
719
720 void setActiveTags(const std::set<TagID> & vtags) override;
721
722 virtual void meshChanged() override;
723 virtual void residualSetup() override;
724 virtual void jacobianSetup() override;
725
726 virtual void sizeMatrixTagData() override;
727
728 bool supportsFaceArg() const override final { return true; }
729 bool supportsElemSideQpArg() const override final { return true; }
730
731protected:
733
735 std::unique_ptr<MooseVariableData<OutputType>> _element_data;
736
738 std::unique_ptr<MooseVariableData<OutputType>> _neighbor_data;
739
741 std::unique_ptr<MooseVariableData<OutputType>> _lower_data;
742
743 using MooseVariableField<OutputType>::evaluate;
744 using MooseVariableField<OutputType>::evaluateGradient;
745 using MooseVariableField<OutputType>::evaluateDot;
746 using MooseVariableField<OutputType>::evaluateGradDot;
754
762 faceEvaluate(const FaceArg &, const StateArg &, const std::vector<ValueType> & cache_data) const;
763
764 ValueType evaluate(const ElemQpArg & elem_qp, const StateArg & state) const override final;
765 ValueType evaluate(const ElemSideQpArg & elem_side_qp,
766 const StateArg & state) const override final;
767 ValueType evaluate(const ElemArg &, const StateArg &) const override final;
768 ValueType evaluate(const ElemPointArg &, const StateArg &) const override final;
769 ValueType evaluate(const NodeArg & node_arg, const StateArg & state) const override final;
770 ValueType evaluate(const FaceArg &, const StateArg &) const override final;
771
772 GradientType evaluateGradient(const ElemQpArg & elem_qp, const StateArg & state) const override;
773 GradientType evaluateGradient(const ElemSideQpArg & elem_side_qp,
774 const StateArg & state) const override final;
775 GradientType evaluateGradient(const ElemArg &, const StateArg &) const override final;
776
777 DotType evaluateDot(const ElemQpArg & elem_qp, const StateArg & state) const override final;
778 DotType evaluateDot(const ElemSideQpArg & elem_side_qp,
779 const StateArg & state) const override final;
780 DotType evaluateDot(const ElemArg &, const StateArg &) const override final;
781 DotType evaluateDot(const FaceArg &, const StateArg &) const override final;
782
783 GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final;
784
785private:
790 template <typename Shapes, typename Solution, typename GradShapes, typename GradSolution>
791 void computeSolution(const Elem * elem,
792 unsigned int n_qp,
793 const StateArg & state,
794 const Shapes & phi,
795 Solution & local_soln,
796 const GradShapes & grad_phi,
797 GradSolution & grad_local_soln,
798 Solution & dot_local_soln,
799 GradSolution & grad_dot_local_soln) const;
800
804 void
805 evaluateOnElement(const ElemQpArg & elem_qp, const StateArg & state, bool cache_eligible) const;
806
810 void evaluateOnElementSide(const ElemSideQpArg & elem_side_qp,
811 const StateArg & state,
812 bool cache_eligible) const;
813
817 mutable const Elem * _current_elem_qp_functor_elem = nullptr;
818
820 mutable std::vector<ValueType> _current_elem_qp_functor_sln;
821
823 mutable std::vector<GradientType> _current_elem_qp_functor_gradient;
824
826 mutable std::vector<DotType> _current_elem_qp_functor_dot;
827
829 mutable std::vector<GradientType> _current_elem_qp_functor_grad_dot;
830
834 mutable std::pair<const Elem *, unsigned int> _current_elem_side_qp_functor_elem_side{
835 nullptr, libMesh::invalid_uint};
836
838 mutable std::vector<ValueType> _current_elem_side_qp_functor_sln;
839
841 mutable std::vector<GradientType> _current_elem_side_qp_functor_gradient;
842
844 mutable std::vector<DotType> _current_elem_side_qp_functor_dot;
845
848 mutable std::vector<GradientType> _current_elem_side_qp_functor_grad_dot;
849};
850
851template <typename OutputType>
852inline const typename MooseVariableFE<OutputType>::ADDofValues &
854{
855 return _element_data->adDofValues();
856}
857
858template <typename OutputType>
859inline const typename MooseVariableFE<OutputType>::ADDofValues &
861{
862 return _neighbor_data->adDofValues();
863}
864
865template <typename OutputType>
866inline const typename MooseVariableFE<OutputType>::ADDofValues &
868{
869 return _element_data->adDofValuesDot();
870}
871
872template <typename OutputType>
873inline const typename Moose::ADType<OutputType>::type &
875{
876 return _element_data->adNodalValue();
877}
878
879template <typename OutputType>
880void
881MooseVariableFE<OutputType>::setActiveTags(const std::set<TagID> & vtags)
882{
883 _element_data->setActiveTags(vtags);
884 _neighbor_data->setActiveTags(vtags);
885 _lower_data->setActiveTags(vtags);
886}
887
888// Declare all the specializations, as the template specialization declarations below must know
889template <>
891template <>
893template <>
895template <>
896RealEigenVector
898 const std::vector<std::vector<Real>> & phi) const;
899template <>
901 const Elem * elem, const std::vector<std::vector<RealVectorValue>> & grad_phi) const;
902template <>
904 const StateArg &,
905 bool) const;
906template <>
908 const StateArg &,
909 bool) const;
910template <>
912MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const;
913template <>
915MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const;
916template <>
918MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const;
919template <>
921MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const;
922template <>
924MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const;
925template <>
927MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const;
928
929// Prevent implicit instantiation in other translation units where these classes are used
930extern template class MooseVariableFE<Real>;
931extern template class MooseVariableFE<RealVectorValue>;
932extern template class MooseVariableFE<RealEigenVector>;
unsigned int TagID
Definition MooseTypes.h:238
OutputTools< Real >::VariableValue VariableValue
Definition MooseTypes.h:348
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Definition MooseTypes.h:659
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition MooseTypes.h:653
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
Definition MooseTypes.h:391
typename OutputTools< typename Moose::ADType< T >::type >::VariableTestGradient ADTemplateVariableTestGradient
Definition MooseTypes.h:681
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
Definition MooseTypes.h:661
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition MooseTypes.h:656
MooseVariableFE< Real > MooseVariable
MooseVariableFE< RealEigenVector > ArrayMooseVariable
MooseVariableFE< RealVectorValue > VectorMooseVariable
std::array< Real, 2 > values
Definition MortarUtils.C:52
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Class for stuff related to variables.
const FieldVariableCurl & curlSlnOld() const
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
const FieldVariableGradient & gradSlnNeighborDot() const
neighbor grad dots
typename MooseVariableField< OutputType >::FieldVariablePhiValue FieldVariablePhiValue
const OutputType & nodalValueOldNeighbor() const
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
OutputType getValue(const Elem *elem, const std::vector< std::vector< OutputShape > > &phi) const
Compute the variable value at a point on an element.
typename MooseVariableField< OutputType >::OutputShapeDivergence OutputShapeDivergence
const OutputType & nodalValueDotDotNeighbor() const
GradientType evaluateGradient(const ElemQpArg &elem_qp, const StateArg &state) const override
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the current local DOF values to the input vector.
const ADTemplateVariableSecond< OutputType > & adSecondSln() const override
AD second solution getter.
const std::vector< dof_id_type > & dofIndicesNeighbor() const final
Get neighbor DOF indices for currently selected element.
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
const DofValues & dofValuesDotNeighbor() const override
const MappedArrayVariablePhiGradient & arrayGradPhi() const
virtual void residualSetup() override
Gets called just before the residual is computed and before this object is asked to do its job.
const ADTemplateVariableValue< OutputType > & adSlnNeighbor() const override
neighbor AD
bool computingSecond() const override final
Whether or not this variable is computing any second derivatives.
std::unique_ptr< MooseVariableData< OutputType > > _lower_data
Holder for all the data associated with the lower dimeensional element.
std::pair< const Elem *, unsigned int > _current_elem_side_qp_functor_elem_side
Keep track of the current elem-side-qp functor element and side in order to enable local caching (e....
const ADTemplateVariableValue< OutputType > & adUDot() const override
AD time derivative getter.
unsigned int numberOfDofs() const final
Get the number of local DoFs.
const Elem *const & neighbor() const
Current neighboring element.
const FieldVariableValue & matrixTagValue(TagID tag) const override
OutputTools< OutputType >::OutputGradient getGradient(const Elem *elem, const std::vector< std::vector< typename OutputTools< OutputType >::OutputShapeGradient > > &grad_phi) const
Compute the variable gradient value at a point on an element.
void reinitNode() override
ValueType faceEvaluate(const FaceArg &, const StateArg &, const std::vector< ValueType > &cache_data) const
A common method that both evaluate(FaceArg) and evaluateDot(FaceArg) can call.
const OutputType & nodalValueDotOldNeighbor() const
const OutputType & nodalValueDotNeighborResidual() const
const FieldVariablePhiCurl & curlPhiNeighbor() const
static InputParameters validParams()
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
const ADDofValues & adDofValuesDot() const override
Return the AD time derivatives at dofs.
const FieldVariablePhiGradient & gradPhiLower() const
const FieldVariableSecond & secondSlnPreviousNL() const
void evaluateOnElement(const ElemQpArg &elem_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_qp argument.
const DofValues & dofValuesDot() const override
void prepareAux() override
const FieldVariableSecond & secondSlnNeighbor() const
neighbor solution seconds
const ADTemplateVariableCurl< OutputType > & adCurlSlnNeighbor() const override
AD curl neighbor solution getter.
const DofValues & dofValues() const override
dof values getters
const DofValues & dofValuesPreviousNLNeighbor() const override
const OutputType & nodalValuePreviousNL() const
const std::vector< dof_id_type > & dofIndicesLower() const final
Get dof indices for the current lower dimensional element (this is meaningful when performing mortar ...
const OutputType & nodalValuePreviousNLNeighbor() const
const FieldVariableValue & uDotOldNeighbor() const
const FieldVariableDivergence & divSlnOldNeighbor() const
typename MooseVariableField< OutputType >::OutputShapeSecond OutputShapeSecond
const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
Return the gradients of the variable's shape functions on a neighboring element face.
DofValue getNodalValue(const Node &node) const
Get the value of this variable at given node.
const FieldVariableValue & uDotOld() const
std::vector< DotType > _current_elem_qp_functor_dot
The values of the time derivative for the _current_elem_qp_functor_elem.
std::vector< DotType > _current_elem_side_qp_functor_dot
The values of the time derivative for the _current_elem_side_qp_functor_elem_side.
const ADTemplateVariableSecond< OutputType > & adSecondSlnNeighbor() const override
AD second neighbor solution getter.
void reinitAux() override
virtual std::size_t phiFaceSize() const final
Return phiFace size.
const ADTemplateVariableTestGradient< OutputShape > & adGradPhiFace() const
void computeSolution(const Elem *elem, unsigned int n_qp, const StateArg &state, const Shapes &phi, Solution &local_soln, const GradShapes &grad_phi, GradSolution &grad_local_soln, Solution &dot_local_soln, GradSolution &grad_dot_local_soln) const
Compute the solution, gradient, time derivative, and gradient of the time derivative with provided sh...
void computeIncrementAtNode(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change at the current node based on increment_vec.
const MooseArray< OutputType > & nodalValueArray() const override
Methods for retrieving values of variables at the nodes in a MooseArray for AuxKernelBase.
virtual void computeNodalNeighborValues() override
Compute nodal values of this variable in the neighbor.
const FieldVariableValue & slnOldNeighbor() const override
void prepare() override
Prepare the elemental degrees of freedom.
const FieldVariableValue & slnNeighbor() const override
neighbor solutions
const OutputType & nodalValueOld() const
const FieldVariablePhiGradient & gradPhiNeighbor() const override final
Return the gradients of the variable's shape functions on a neighboring element.
const FieldVariableDivergence & divSlnOlderNeighbor() const
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes) override
const FieldVariableDivergence & divSlnOlder() const
typename MooseVariableField< OutputType >::FieldVariableTestValue FieldVariableTestValue
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
std::vector< GradientType > _current_elem_side_qp_functor_grad_dot
The values of the gradient of the time derivative for the _current_elem_side_qp_functor_elem_side.
const FieldVariablePhiValue & phi() const override
Return the variable's elemental shape functions.
const FieldVariableDivergence & divSln() const
element divergence
typename MooseVariableField< OutputType >::FieldVariableTestGradient FieldVariableTestGradient
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
const FieldVariablePhiValue & phiFaceNeighbor() const override final
Return the variable's shape functions on a neighboring element face.
const FieldVariablePhiDivergence & divPhiFace() const
const DofValues & dofValuesOlderNeighbor() const override
typename MooseVariableField< OutputType >::FieldVariableCurl FieldVariableCurl
libMesh::FEContinuity getContinuity() const override
Return the continuity of this variable.
typename MooseVariableField< OutputType >::FieldVariableSecond FieldVariableSecond
const MooseArray< OutputType > & nodalValueOldArray() const override
const FieldVariableCurl & curlSlnOldNeighbor() const
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old,...
bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivative on a neighbor.
bool isNodal() const override
Is this variable nodal.
const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const override
AD grad of time derivative solution getter.
const OutputType & nodalValueDotNeighbor() const
const OutputType & nodalValueDotDot() const
void reinitAuxNeighbor() override
std::vector< GradientType > _current_elem_qp_functor_gradient
The values of the gradient for the _current_elem_qp_functor_elem.
const OutputType & nodalValue() const
Methods for retrieving values of variables at the nodes.
const FieldVariableGradient & vectorTagGradient(TagID tag) const
const VariableValue & duDotDotDu() const
const FieldVariablePhiCurl & curlPhi() const override final
Curl of the shape functions.
bool isNodalNeighborDefined() const
const FieldVariableValue & slnOlder() const override
typename MooseVariableField< OutputType >::FieldVariablePhiGradient FieldVariablePhiGradient
DofValue getNodalValueOlder(const Node &node) const
Get the t-2 value of this variable at given node.
const DofValues & vectorTagDofValue(TagID tag) const override
bool computingDiv() const override final
Whether or not this variable is computing the divergence.
const dof_id_type & nodalDofIndex() const override
bool computingCurl() const override final
Whether or not this variable is computing the curl.
const ADTemplateVariableValue< OutputType > & adUDotNeighbor() const override
AD neighbor time derivative getter.
const FieldVariableSecond & secondSln() const
element seconds
const FieldVariableCurl & curlSlnOlderNeighbor() const
const DofValues & dofValuesDotOldNeighbor() const override
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
const OutputType & nodalValueDotDotOldNeighbor() const
virtual void setLowerDofValues(const DenseVector< DofValue > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points.
ValueType evaluate(const ElemQpArg &elem_qp, const StateArg &state) const override final
void prepareNeighbor() override
Prepare the neighbor element degrees of freedom.
const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on an element face.
void evaluateOnElementSide(const ElemSideQpArg &elem_side_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_side_qp argument.
const DofValues & dofValuesDotNeighborResidual() const
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
const FieldVariableGradient & gradSlnNeighborDotDot() const
const FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable's elemental shape functions.
std::vector< GradientType > _current_elem_side_qp_functor_gradient
The values of the gradient for the _current_elem_side_qp_functor_elem_side.
const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
std::vector< ValueType > _current_elem_side_qp_functor_sln
The values of the solution for the _current_elem_side_qp_functor_elem_side.
const ADTemplateVariableValue< OutputType > & adSlnLower() const
lower-d element solution
std::size_t phiLowerSize() const final
Return the number of shape functions on the lower dimensional element for this variable.
typename MooseVariableField< OutputType >::FieldVariableValue FieldVariableValue
virtual std::size_t phiSize() const final
Return phi size.
const ADTemplateVariableValue< OutputType > & adSlnFace() const
Face-only AD solution getters; see MooseVariableData::adSlnFace()
void prepareLowerD() override
Prepare a lower dimensional element's degrees of freedom.
const FieldVariableSecond & secondSlnOldNeighbor() const
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
const VariableValue & duDotDu() const
const DofValues & nodalVectorTagValue(TagID tag) const override
typename MooseVariableField< OutputType >::OutputShapeGradient OutputShapeGradient
const ADTemplateVariableValue< OutputType > & adUDotDotNeighbor() const override
AD neighbor second time derivative getter.
const FieldVariableValue & increment() const
const DofValues & dofValuesDotDotNeighbor() const override
typename MooseVariableField< OutputType >::OutputGradient OutputGradient
virtual void setNodalValue(const OutputType &value) override
virtual const FieldVariablePhiValue & phiLower() const override
Return the variable's shape functions on a lower-dimensional element.
virtual std::size_t phiFaceNeighborSize() const final
Return phiFaceNeighbor size.
const ADDofValues & adDofValues() const override
Return the AD dof values.
const ADTemplateVariableCurl< OutputType > & adCurlSln() const override
AD curl solution getter.
const MappedArrayVariablePhiGradient & arrayGradPhiNeighbor() const
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
const ADTemplateVariableValue< OutputType > & adUDotDot() const override
AD second time derivative getter.
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
typename Moose::ADType< OutputType >::type FunctorArg
const FieldVariablePhiCurl & curlPhiFaceNeighbor() const
const Node *const & node() const
const OutputType & nodalValueDotDotNeighborResidual() const
bool hasDoFsOnNodes() const override
Does this variable have DoFs on nodes.
const DofValues & dofValue() const
const Elem *const & currentElem() const override
Current element this variable is evaluated at.
const MappedArrayVariablePhiGradient & arrayGradPhiFace() const
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
const FieldVariableGradient & gradSlnOlder() const
typename MooseVariableField< OutputType >::FieldVariablePhiCurl FieldVariablePhiCurl
const Elem * _current_elem_qp_functor_elem
Keep track of the current elem-qp functor element in order to enable local caching (e....
GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final
Evaluate the functor gradient-dot with a given element.
const ADTemplateVariableGradient< OutputType > & adGradSlnFace() const override
AD grad solution getter for objects evaluating on element faces.
typename MooseVariableField< OutputType >::FieldVariableTestCurl FieldVariableTestCurl
const FieldVariableGradient & gradSlnDotDot() const
const ADTemplateVariableValue< OutputType > & adSln() const override
AD.
const FieldVariableSecond & secondSlnOld() const
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
const FieldVariableValue & uDot() const
element dots
const unsigned int & currentSide() const
Current side this variable is being evaluated on.
const FieldVariablePhiValue & phiFace() const override final
Return the variable's shape functions on an element face.
DofValue getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
const FieldVariableValue & uDotDotNeighbor() const
const ADTemplateVariableTestGradient< OutputShape > & adGradPhiFaceNeighbor() const
const OutputType & nodalValueOlder() const
void setActiveTags(const std::set< TagID > &vtags) override
Set the active vector tags.
const FieldVariableSecond & secondSlnPreviousNLNeighbor() const
const FieldVariableDivergence & divSlnOld() const
const FieldVariablePhiDivergence & divPhiNeighbor() const
const FieldVariableGradient & gradSlnPreviousNL() const
const OutputType & nodalValueNeighbor() const
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
unsigned int numberOfDofsNeighbor() override
const FieldVariableValue & uDotDot() const
virtual void prepareIC() override
Prepare the initial condition.
const FieldVariableGradient & gradSlnOldNeighbor() const override
virtual std::size_t phiNeighborSize() const final
Return phiNeighbor size.
const FieldVariableValue & vectorTagValue(TagID tag) const override
tag values getters
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Set the current local DOF values to the input vector.
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
const VariableValue & duDotDotDuNeighbor() const
const FieldVariableDivergence & divSlnNeighbor() const
neighbor solution divergence
const FieldVariableValue & uDotDotOldNeighbor() const
const OutputType & nodalValueDotDotOld() const
const FieldVariableValue & slnLower() const
const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
const FieldVariablePhiSecond & secondPhiNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
const OutputType & nodalValueDuDotDotDuNeighbor() const
const ADTemplateVariableGradient< OutputType > & adGradSlnNeighborDot() const override
AD grad of time derivative neighbor solution getter.
const OutputType & nodalValueDuDotDuNeighbor() const
const FieldVariablePhiGradient & gradPhi() const override final
Return the gradients of the variable's elemental shape functions.
const FieldVariableValue & slnOld() const override
const FieldVariableGradient & gradSlnOld() const override
virtual void setDofValues(const DenseVector< DofValue > &values) override
Set local DOF values and evaluate the values on quadrature points.
const MappedArrayVariablePhiGradient & arrayGradPhiFaceNeighbor() const
const FieldVariableGradient & gradSlnOlderNeighbor() const
virtual void setDofValue(const DofValue &value, unsigned int index) override
Degree of freedom value setters.
const FieldVariableValue & slnPreviousNLNeighbor() const
virtual void computeLowerDValues() override
compute values at quadrature points on the lower dimensional element
DofValue getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
bool supportsQpBasedLoops() const override
Whether this variable supports QP-indexed loops.
void reinitNodes(const std::vector< dof_id_type > &nodes) override
std::vector< GradientType > _current_elem_qp_functor_grad_dot
The values of the gradient of the time derivative for the _current_elem_qp_functor_elem.
const DofValues & dofValuesDotDotOld() const override
const OutputType & nodalValueDuDotDotDu() const
const Node *const & nodeNeighbor() const
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const DofValue &v)
Write a nodal value to the passed-in solution vector.
const ADTemplateVariableTestGradient< OutputShape > & adGradPhi() const
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
bool supportsGeometricInfoBasedLoops() const override
Whether this variable supports geometric-info-based loops, such as ElemInfo/FaceInfo loops.
const ADTemplateVariableGradient< OutputType > & adGradSlnNeighbor() const override
AD grad neighbor solution getter.
const Moose::ADType< OutputType >::type & adNodalValue() const
std::unique_ptr< MooseVariableData< OutputType > > _element_data
Holder for all the data associated with the "main" element.
bool usesGradPhi() const
Whether or not this variable is actually using the shape function gradient.
const FieldVariableValue & sln() const override
element solutions
DofValue getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
typename MooseVariableField< OutputType >::FieldVariableDivergence FieldVariableDivergence
const FieldVariableValue & slnOlderNeighbor() const
virtual void meshChanged() override
Called on this object when the mesh changes.
const DofValues & dofValuesDotOld() const override
typename MooseVariableField< OutputType >::OutputDivergence OutputDivergence
const FieldVariablePhiValue & phiNeighbor() const override final
Return the variable's shape functions on a neighboring element.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
const FieldVariableCurl & curlSlnNeighbor() const
neighbor solution curls
const FieldVariableGradient & gradSlnDot() const
element gradient dots
const DofValues & dofValuesNeighbor() const override
void clearAllDofIndices() final
const DofValues & dofValuesDotDotOldNeighbor() const override
typename MooseVariableField< OutputType >::FieldVariableTestSecond FieldVariableTestSecond
const VariableValue & duDotDuNeighbor() const
const FieldVariableValue & uDotNeighbor() const
neighbor dots
const MooseArray< OutputType > & nodalValueOlderArray() const override
virtual void computeNodalValues() override
Compute nodal values of this variable.
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
const OutputType & nodalValueOlderNeighbor() const
const DofValues & nodalMatrixTagValue(TagID tag) const override
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
std::vector< ValueType > _current_elem_qp_functor_sln
The values of the solution for the _current_elem_qp_functor_elem.
const FieldVariableCurl & curlSln() const
element curls
const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
virtual void insertLower(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values for a lower-dimensional element into the provide...
void addSolutionNeighbor(const DenseVector< libMesh::Number > &v)
Add passed in local neighbor DOF values onto the current solution.
typename MooseVariableField< OutputType >::OutputShape OutputShape
const FieldVariableGradient & gradSlnNeighbor() const override
neighbor solution gradients
const FieldVariableGradient & gradSlnPreviousNLNeighbor() const
const FieldVariableSecond & secondSlnOlder() const
const DofValues & dofValuesDotDotNeighborResidual() const
const FieldVariableCurl & curlSlnOlder() const
const FieldVariableValue & slnPreviousNL() const
void clearDofIndices() override
Clear out the dof indices.
const OutputType & nodalValueDuDotDu() const
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
bool usesPhi() const
Whether or not this variable is actually using the shape function value.
const FieldVariableValue & uDotDotOld() const
const DofValues & dofValuesOldNeighbor() const override
std::unique_ptr< MooseVariableData< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
typename MooseVariableField< OutputType >::FieldVariableGradient FieldVariableGradient
const FieldVariableSecond & secondSlnOlderNeighbor() const
const DofValues & dofValuesOlder() const override
const FieldVariableValue & slnLowerOld() const
const OutputType & nodalValueDot() const
const DofValues & dofValuesPreviousNL() const override
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
const FieldVariablePhiGradient & gradPhiFace() const override final
Return the gradients of the variable's shape functions on an element face.
const DofValues & dofValuesOld() const override
const OutputType & nodalValueDotOld() const
const FieldVariableGradient & gradSln() const override
element gradients
typename MooseVariableField< OutputType >::OutputSecond OutputSecond
const DofValues & dofValuesDotDot() const override
const dof_id_type & nodalDofIndexNeighbor() const override
const ADDofValues & adDofValuesNeighbor() const override
Return the AD neighbor dof values.
typename MooseVariableField< OutputType >::FieldVariableTestDivergence FieldVariableTestDivergence
const FieldVariablePhiCurl & curlPhiFace() const
Class for stuff related to variables.
typename MooseVariableDataBase< OutputType >::ADDofValue ADDofValue
Moose::ShapeType< OutputType >::type OutputShape
libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
typename MooseVariableDataBase< OutputType >::ADDofValues ADDofValues
libMesh::TensorTools::DecrementRank< OutputType >::type OutputDivergence
typename MooseVariableDataBase< OutputType >::DofValue DofValue
typename MooseVariableDataBase< OutputType >::DofValues DofValues
typename FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector,...
Base class for time integrators.
@ Current
Definition MooseTypes.h:263
@ PreviousNL
Definition MooseTypes.h:266
const unsigned int invalid_uint
A structure that is used to evaluate Moose functors logically at an element/cell center.
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
Argument for requesting functor evaluation at a quadrature point location in an element.
Argument for requesting functor evaluation at quadrature point locations on an element side.
A structure defining a "face" evaluation calling argument for Moose functors.
State argument for evaluating functors.