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 }
351 {
352 return _element_data->adSecondSln();
353 }
355 {
356 return _element_data->adUDot();
357 }
359 {
360 return _element_data->adUDotDot();
361 }
363 {
364 return _element_data->adGradSlnDot();
365 }
367 {
368 return _element_data->adCurlSln();
369 }
370
373 {
374 return _neighbor_data->adSln();
375 }
377 {
378 return _neighbor_data->adGradSln();
379 }
381 {
382 return _neighbor_data->adSecondSln();
383 }
385 {
386 return _neighbor_data->adUDot();
387 }
389 {
390 return _neighbor_data->adUDotDot();
391 }
393 {
394 return _neighbor_data->adGradSlnDot();
395 }
397 {
398 return _neighbor_data->adCurlSln();
399 }
400
402 const FieldVariableValue & uDot() const { return _element_data->uDot(); }
403 const FieldVariableValue & uDotDot() const { return _element_data->uDotDot(); }
404 const FieldVariableValue & uDotOld() const { return _element_data->uDotOld(); }
405 const FieldVariableValue & uDotDotOld() const { return _element_data->uDotDotOld(); }
406 const VariableValue & duDotDu() const { return _element_data->duDotDu(); }
407 const VariableValue & duDotDotDu() const { return _element_data->duDotDotDu(); }
408
410 const FieldVariableValue & slnNeighbor() const override
411 {
412 return _neighbor_data->sln(Moose::Current);
413 }
414 const FieldVariableValue & slnOldNeighbor() const override
415 {
416 return _neighbor_data->sln(Moose::Old);
417 }
420 {
422 }
423
425 const FieldVariableGradient & gradSlnNeighbor() const override
426 {
427 return _neighbor_data->gradSln(Moose::Current);
428 }
430 {
431 return _neighbor_data->gradSln(Moose::Old);
432 }
434 {
435 return _neighbor_data->gradSln(Moose::Older);
436 }
438 {
439 return _neighbor_data->gradSln(Moose::PreviousNL);
440 }
441
443 const FieldVariableGradient & gradSlnNeighborDot() const { return _neighbor_data->gradSlnDot(); }
445 {
446 return _neighbor_data->gradSlnDotDot();
447 }
448
451 {
452 return _neighbor_data->secondSln(Moose::Current);
453 }
455 {
456 return _neighbor_data->secondSln(Moose::Old);
457 }
459 {
460 return _neighbor_data->secondSln(Moose::Older);
461 }
463 {
464 return _neighbor_data->secondSln(Moose::PreviousNL);
465 }
466
469 {
470 return _neighbor_data->curlSln(Moose::Current);
471 }
473 {
474 return _neighbor_data->curlSln(Moose::Old);
475 }
477 {
478 return _neighbor_data->curlSln(Moose::Older);
479 }
480
483 {
484 return _neighbor_data->divSln(Moose::Current);
485 }
487 {
488 return _neighbor_data->divSln(Moose::Old);
489 }
491 {
492 return _neighbor_data->divSln(Moose::Older);
493 }
494
496 const FieldVariableValue & uDotNeighbor() const { return _neighbor_data->uDot(); }
497 const FieldVariableValue & uDotDotNeighbor() const { return _neighbor_data->uDotDot(); }
498 const FieldVariableValue & uDotOldNeighbor() const { return _neighbor_data->uDotOld(); }
499 const FieldVariableValue & uDotDotOldNeighbor() const { return _neighbor_data->uDotDotOld(); }
500 const VariableValue & duDotDuNeighbor() const { return _neighbor_data->duDotDu(); }
501 const VariableValue & duDotDotDuNeighbor() const { return _neighbor_data->duDotDotDu(); }
502
504 const ADTemplateVariableValue<OutputType> & adSlnLower() const { return _lower_data->adSln(); }
505 const FieldVariableValue & slnLower() const { return _lower_data->sln(Moose::Current); }
506 const FieldVariableValue & slnLowerOld() const { return _lower_data->sln(Moose::Old); }
507
509 virtual void computeElemValues() override;
510 virtual void computeElemValuesFace() override;
511 virtual void computeNeighborValuesFace() override;
512 virtual void computeNeighborValues() override;
513 virtual void computeLowerDValues() override;
514
515 virtual void setNodalValue(const OutputType & value, unsigned int idx = 0) override;
516
517 virtual void setDofValue(const DofValue & value, unsigned int index) override;
518
522 virtual void setDofValues(const DenseVector<DofValue> & values) override;
523 virtual void setLowerDofValues(const DenseVector<DofValue> & values) override;
524
529
533 DofValue getNodalValue(const Node & node) const;
537 DofValue getNodalValueOld(const Node & node) const;
541 DofValue getNodalValueOlder(const Node & node) const;
548 DofValue getElementalValue(const Elem * elem, unsigned int idx = 0) const;
555 DofValue getElementalValueOld(const Elem * elem, unsigned int idx = 0) const;
562 DofValue getElementalValueOlder(const Elem * elem, unsigned int idx = 0) const;
563
567 virtual void insert(libMesh::NumericVector<libMesh::Number> & vector) override;
568 virtual void insertLower(libMesh::NumericVector<libMesh::Number> & vector) override;
569
573 virtual void add(libMesh::NumericVector<libMesh::Number> & vector) override;
574
578 void addSolution(const DenseVector<libMesh::Number> & v);
579
583 void addSolutionNeighbor(const DenseVector<libMesh::Number> & v);
584
585 const DofValues & dofValue() const;
586 const DofValues & dofValues() const override;
587 const DofValues & dofValuesOld() const override;
588 const DofValues & dofValuesOlder() const override;
589 const DofValues & dofValuesPreviousNL() const override;
590 const DofValues & dofValuesNeighbor() const override;
591 const DofValues & dofValuesOldNeighbor() const override;
592 const DofValues & dofValuesOlderNeighbor() const override;
593 const DofValues & dofValuesPreviousNLNeighbor() const override;
594 const DofValues & dofValuesDot() const override;
595 const DofValues & dofValuesDotNeighbor() const override;
597 const DofValues & dofValuesDotOld() const override;
598 const DofValues & dofValuesDotOldNeighbor() const override;
599 const DofValues & dofValuesDotDot() const override;
600 const DofValues & dofValuesDotDotNeighbor() const override;
602 const DofValues & dofValuesDotDotOld() const override;
603 const DofValues & dofValuesDotDotOldNeighbor() const override;
604 const MooseArray<libMesh::Number> & dofValuesDuDotDu() const override;
606 const MooseArray<libMesh::Number> & dofValuesDuDotDotDu() const override;
608
609 const ADDofValues & adDofValues() const override;
610 const ADDofValues & adDofValuesNeighbor() const override;
611 const ADDofValues & adDofValuesDot() const override;
612
617
622
629 OutputType getValue(const Elem * elem, const std::vector<std::vector<OutputShape>> & phi) const;
630
638 const Elem * elem,
639 const std::vector<std::vector<typename OutputTools<OutputType>::OutputShapeGradient>> &
640 grad_phi) const;
641
645 virtual std::size_t phiSize() const final { return _element_data->phiSize(); }
649 virtual std::size_t phiFaceSize() const final { return _element_data->phiFaceSize(); }
653 virtual std::size_t phiNeighborSize() const final { return _neighbor_data->phiSize(); }
657 virtual std::size_t phiFaceNeighborSize() const final { return _neighbor_data->phiFaceSize(); }
658
659 std::size_t phiLowerSize() const final { return _lower_data->phiSize(); }
660
664 const OutputType & nodalValue() const;
665 const OutputType & nodalValueOld() const;
666 const OutputType & nodalValueOlder() const;
667 const OutputType & nodalValuePreviousNL() const;
668 const OutputType & nodalValueDot() const;
669 const OutputType & nodalValueDotDot() const;
670 const OutputType & nodalValueDotOld() const;
671 const OutputType & nodalValueDotDotOld() const;
672 const OutputType & nodalValueDuDotDu() const;
673 const OutputType & nodalValueDuDotDotDu() const;
674 const OutputType & nodalValueNeighbor() const;
675 const OutputType & nodalValueOldNeighbor() const;
676 const OutputType & nodalValueOlderNeighbor() const;
677 const OutputType & nodalValuePreviousNLNeighbor() const;
678 const OutputType & nodalValueDotNeighbor() const;
679 const OutputType & nodalValueDotNeighborResidual() const;
680 const OutputType & nodalValueDotDotNeighbor() const;
681 const OutputType & nodalValueDotDotNeighborResidual() const;
682 const OutputType & nodalValueDotOldNeighbor() const;
683 const OutputType & nodalValueDotDotOldNeighbor() const;
684 const OutputType & nodalValueDuDotDuNeighbor() const;
685 const OutputType & nodalValueDuDotDotDuNeighbor() const;
686
688 {
689 return _element_data->nodalValueArray(Moose::Current);
690 }
692 {
693 return _element_data->nodalValueArray(Moose::Old);
694 }
696 {
697 return _element_data->nodalValueArray(Moose::Older);
698 }
699
700 const DofValues & nodalVectorTagValue(TagID tag) const override;
701 const DofValues & nodalMatrixTagValue(TagID tag) const override;
702
704
705 virtual void computeNodalValues() override;
706 virtual void computeNodalNeighborValues() override;
707
708 unsigned int oldestSolutionStateRequested() const override final;
709
710 void setActiveTags(const std::set<TagID> & vtags) override;
711
712 virtual void meshChanged() override;
713 virtual void residualSetup() override;
714 virtual void jacobianSetup() override;
715
716 virtual void sizeMatrixTagData() override;
717
718 bool supportsFaceArg() const override final { return true; }
719 bool supportsElemSideQpArg() const override final { return true; }
720
721protected:
723
725 std::unique_ptr<MooseVariableData<OutputType>> _element_data;
726
728 std::unique_ptr<MooseVariableData<OutputType>> _neighbor_data;
729
731 std::unique_ptr<MooseVariableData<OutputType>> _lower_data;
732
733 using MooseVariableField<OutputType>::evaluate;
734 using MooseVariableField<OutputType>::evaluateGradient;
735 using MooseVariableField<OutputType>::evaluateDot;
736 using MooseVariableField<OutputType>::evaluateGradDot;
744
752 faceEvaluate(const FaceArg &, const StateArg &, const std::vector<ValueType> & cache_data) const;
753
754 ValueType evaluate(const ElemQpArg & elem_qp, const StateArg & state) const override final;
755 ValueType evaluate(const ElemSideQpArg & elem_side_qp,
756 const StateArg & state) const override final;
757 ValueType evaluate(const ElemArg &, const StateArg &) const override final;
758 ValueType evaluate(const ElemPointArg &, const StateArg &) const override final;
759 ValueType evaluate(const NodeArg & node_arg, const StateArg & state) const override final;
760 ValueType evaluate(const FaceArg &, const StateArg &) const override final;
761
762 GradientType evaluateGradient(const ElemQpArg & elem_qp, const StateArg & state) const override;
763 GradientType evaluateGradient(const ElemSideQpArg & elem_side_qp,
764 const StateArg & state) const override final;
765 GradientType evaluateGradient(const ElemArg &, const StateArg &) const override final;
766
767 DotType evaluateDot(const ElemQpArg & elem_qp, const StateArg & state) const override final;
768 DotType evaluateDot(const ElemSideQpArg & elem_side_qp,
769 const StateArg & state) const override final;
770 DotType evaluateDot(const ElemArg &, const StateArg &) const override final;
771 DotType evaluateDot(const FaceArg &, const StateArg &) const override final;
772
773 GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final;
774
775private:
780 template <typename Shapes, typename Solution, typename GradShapes, typename GradSolution>
781 void computeSolution(const Elem * elem,
782 unsigned int n_qp,
783 const StateArg & state,
784 const Shapes & phi,
785 Solution & local_soln,
786 const GradShapes & grad_phi,
787 GradSolution & grad_local_soln,
788 Solution & dot_local_soln,
789 GradSolution & grad_dot_local_soln) const;
790
794 void
795 evaluateOnElement(const ElemQpArg & elem_qp, const StateArg & state, bool cache_eligible) const;
796
800 void evaluateOnElementSide(const ElemSideQpArg & elem_side_qp,
801 const StateArg & state,
802 bool cache_eligible) const;
803
807 mutable const Elem * _current_elem_qp_functor_elem = nullptr;
808
810 mutable std::vector<ValueType> _current_elem_qp_functor_sln;
811
813 mutable std::vector<GradientType> _current_elem_qp_functor_gradient;
814
816 mutable std::vector<DotType> _current_elem_qp_functor_dot;
817
819 mutable std::vector<GradientType> _current_elem_qp_functor_grad_dot;
820
824 mutable std::pair<const Elem *, unsigned int> _current_elem_side_qp_functor_elem_side{
825 nullptr, libMesh::invalid_uint};
826
828 mutable std::vector<ValueType> _current_elem_side_qp_functor_sln;
829
831 mutable std::vector<GradientType> _current_elem_side_qp_functor_gradient;
832
834 mutable std::vector<DotType> _current_elem_side_qp_functor_dot;
835
838 mutable std::vector<GradientType> _current_elem_side_qp_functor_grad_dot;
839};
840
841template <typename OutputType>
842inline const typename MooseVariableFE<OutputType>::ADDofValues &
844{
845 return _element_data->adDofValues();
846}
847
848template <typename OutputType>
849inline const typename MooseVariableFE<OutputType>::ADDofValues &
851{
852 return _neighbor_data->adDofValues();
853}
854
855template <typename OutputType>
856inline const typename MooseVariableFE<OutputType>::ADDofValues &
858{
859 return _element_data->adDofValuesDot();
860}
861
862template <typename OutputType>
863inline const typename Moose::ADType<OutputType>::type &
865{
866 return _element_data->adNodalValue();
867}
868
869template <typename OutputType>
870void
871MooseVariableFE<OutputType>::setActiveTags(const std::set<TagID> & vtags)
872{
873 _element_data->setActiveTags(vtags);
874 _neighbor_data->setActiveTags(vtags);
875 _lower_data->setActiveTags(vtags);
876}
877
878// Declare all the specializations, as the template specialization declarations below must know
879template <>
881template <>
883template <>
885template <>
886RealEigenVector
888 const std::vector<std::vector<Real>> & phi) const;
889template <>
891 const Elem * elem, const std::vector<std::vector<RealVectorValue>> & grad_phi) const;
892template <>
894 const StateArg &,
895 bool) const;
896template <>
898 const StateArg &,
899 bool) const;
900template <>
902MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const;
903template <>
905MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const;
906template <>
908MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const;
909template <>
911MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const;
912template <>
914MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const;
915template <>
917MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const;
918
919// Prevent implicit instantiation in other translation units where these classes are used
920extern template class MooseVariableFE<Real>;
921extern template class MooseVariableFE<RealVectorValue>;
922extern 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.
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 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.
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
virtual void setNodalValue(const OutputType &value, unsigned int idx=0) override
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.