https://mooseframework.inl.gov
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 
26 class TimeIntegrator;
27 template <typename>
32 
45 template <typename OutputType>
46 class MooseVariableFE : public MooseVariableField<OutputType>
47 {
48 public:
52 
58 
63 
71 
79 
82 
87 
89 
91 
92  void clearDofIndices() override;
93 
94  void prepare() override;
95  void prepareNeighbor() override;
96  void prepareLowerD() override;
97  virtual void prepareIC() override;
98 
99  void prepareAux() override;
100 
101  void reinitNode() override;
102  void reinitAux() override;
103  void reinitAuxNeighbor() override;
104 
105  void reinitNodes(const std::vector<dof_id_type> & nodes) override;
106  void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes) override;
107 
113  bool usesPhi() const { return true; }
119  bool usesGradPhi() const { return true; }
120 
124  bool usesSecondPhi() const;
125 
130  bool usesSecondPhiNeighbor() const override final;
131 
135  bool computingSecond() const override final { return usesSecondPhi(); }
136 
140  bool computingCurl() const override final;
141 
145  bool computingDiv() const override final;
146 
147  bool isNodal() const override { return _element_data->isNodal(); }
148  bool hasDoFsOnNodes() const override { return _element_data->hasDoFsOnNodes(); }
149  libMesh::FEContinuity getContinuity() const override { return _element_data->getContinuity(); };
150  const Node * const & node() const { return _element_data->node(); }
151  const dof_id_type & nodalDofIndex() const override { return _element_data->nodalDofIndex(); }
152  virtual bool isNodalDefined() const override;
153 
154  const Node * const & nodeNeighbor() const { return _neighbor_data->node(); }
155  const dof_id_type & nodalDofIndexNeighbor() const override
156  {
157  return _neighbor_data->nodalDofIndex();
158  }
159  bool isNodalNeighborDefined() const;
160 
161  const Elem * const & currentElem() const override { return _element_data->currentElem(); }
162 
166  const unsigned int & currentSide() const { return _element_data->currentSide(); }
167 
171  const Elem * const & neighbor() const { return _neighbor_data->currentElem(); }
172 
173  virtual void getDofIndices(const Elem * elem,
174  std::vector<dof_id_type> & dof_indices) const override;
175  const std::vector<dof_id_type> & dofIndices() const final { return _element_data->dofIndices(); }
176  unsigned int numberOfDofs() const final { return _element_data->numberOfDofs(); }
177  const std::vector<dof_id_type> & dofIndicesNeighbor() const final
178  {
179  return _neighbor_data->dofIndices();
180  }
181  const std::vector<dof_id_type> & dofIndicesLower() const final
182  {
183  return _lower_data->dofIndices();
184  }
185 
186  void clearAllDofIndices() final;
187 
188  unsigned int numberOfDofsNeighbor() override { return _neighbor_data->dofIndices().size(); }
189 
190  const FieldVariablePhiValue & phi() const override { return _element_data->phi(); }
191  const FieldVariablePhiGradient & gradPhi() const override final
192  {
193  return _element_data->gradPhi();
194  }
196  {
197  return _element_data->arrayGradPhi();
198  }
199  const FieldVariablePhiSecond & secondPhi() const override final;
200  const FieldVariablePhiCurl & curlPhi() const override final;
201  const FieldVariablePhiDivergence & divPhi() const override final;
202 
203  const FieldVariablePhiValue & phiFace() const override final { return _element_data->phiFace(); }
204  const FieldVariablePhiGradient & gradPhiFace() const override final
205  {
206  return _element_data->gradPhiFace();
207  }
209  {
210  return _element_data->arrayGradPhiFace();
211  }
212  const FieldVariablePhiSecond & secondPhiFace() const override final;
213  const FieldVariablePhiCurl & curlPhiFace() const;
214  const FieldVariablePhiDivergence & divPhiFace() const;
215 
216  const FieldVariablePhiValue & phiNeighbor() const override final { return _neighbor_data->phi(); }
217  const FieldVariablePhiGradient & gradPhiNeighbor() const override final
218  {
219  return _neighbor_data->gradPhi();
220  }
222  {
223  return _neighbor_data->arrayGradPhi();
224  }
225  const FieldVariablePhiSecond & secondPhiNeighbor() const override final;
226  const FieldVariablePhiCurl & curlPhiNeighbor() const;
228 
229  const FieldVariablePhiValue & phiFaceNeighbor() const override final
230  {
231  return _neighbor_data->phiFace();
232  }
233  const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
234  {
235  return _neighbor_data->gradPhiFace();
236  }
238  {
239  return _neighbor_data->arrayGradPhiFace();
240  }
241  const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final;
244 
245  virtual const FieldVariablePhiValue & phiLower() const override { return _lower_data->phi(); }
246  const FieldVariablePhiGradient & gradPhiLower() const { return _lower_data->gradPhi(); }
247 
249  {
250  return _element_data->adGradPhi();
251  }
252 
254  {
255  return _element_data->adGradPhiFace();
256  }
257 
259  {
260  return _neighbor_data->adGradPhiFace();
261  }
262 
263  // damping
264  const FieldVariableValue & increment() const { return _element_data->increment(); }
265 
266  const FieldVariableValue & vectorTagValue(TagID tag) const override
267  {
268  return _element_data->vectorTagValue(tag);
269  }
271  {
272  return _element_data->vectorTagGradient(tag);
273  }
274  const DoFValue & vectorTagDofValue(TagID tag) const override
275  {
276  return _element_data->vectorTagDofValue(tag);
277  }
278  const FieldVariableValue & matrixTagValue(TagID tag) const override
279  {
280  return _element_data->matrixTagValue(tag);
281  }
282 
284  const FieldVariableValue & sln() const override { return _element_data->sln(Moose::Current); }
285  const FieldVariableValue & slnOld() const override { return _element_data->sln(Moose::Old); }
286  const FieldVariableValue & slnOlder() const override { return _element_data->sln(Moose::Older); }
288 
290  const FieldVariableGradient & gradSln() const override
291  {
292  return _element_data->gradSln(Moose::Current);
293  }
294  const FieldVariableGradient & gradSlnOld() const override
295  {
296  return _element_data->gradSln(Moose::Old);
297  }
299  {
300  return _element_data->gradSln(Moose::Older);
301  }
303  {
304  return _element_data->gradSln(Moose::PreviousNL);
305  }
306 
308  const FieldVariableGradient & gradSlnDot() const { return _element_data->gradSlnDot(); }
309  const FieldVariableGradient & gradSlnDotDot() const { return _element_data->gradSlnDotDot(); }
310 
312  const FieldVariableSecond & secondSln() const { return _element_data->secondSln(Moose::Current); }
313  const FieldVariableSecond & secondSlnOld() const { return _element_data->secondSln(Moose::Old); }
315  {
316  return _element_data->secondSln(Moose::Older);
317  }
319  {
320  return _element_data->secondSln(Moose::PreviousNL);
321  }
322 
324  const FieldVariableCurl & curlSln() const { return _element_data->curlSln(Moose::Current); }
325  const FieldVariableCurl & curlSlnOld() const { return _element_data->curlSln(Moose::Old); }
326  const FieldVariableCurl & curlSlnOlder() const { return _element_data->curlSln(Moose::Older); }
327 
329  const FieldVariableDivergence & divSln() const { return _element_data->divSln(Moose::Current); }
330  const FieldVariableDivergence & divSlnOld() const { return _element_data->divSln(Moose::Old); }
332  {
333  return _element_data->divSln(Moose::Older);
334  }
335 
338  {
339  return _element_data->adSln();
340  }
341 
343  {
344  return _element_data->adGradSln();
345  }
347  {
348  return _element_data->adSecondSln();
349  }
351  {
352  return _element_data->adUDot();
353  }
355  {
356  return _element_data->adUDotDot();
357  }
359  {
360  return _element_data->adGradSlnDot();
361  }
363  {
364  return _element_data->adCurlSln();
365  }
366 
369  {
370  return _neighbor_data->adSln();
371  }
373  {
374  return _neighbor_data->adGradSln();
375  }
377  {
378  return _neighbor_data->adSecondSln();
379  }
381  {
382  return _neighbor_data->adUDot();
383  }
385  {
386  return _neighbor_data->adUDotDot();
387  }
389  {
390  return _neighbor_data->adGradSlnDot();
391  }
393  {
394  return _neighbor_data->adCurlSln();
395  }
396 
398  const FieldVariableValue & uDot() const { return _element_data->uDot(); }
399  const FieldVariableValue & uDotDot() const { return _element_data->uDotDot(); }
400  const FieldVariableValue & uDotOld() const { return _element_data->uDotOld(); }
401  const FieldVariableValue & uDotDotOld() const { return _element_data->uDotDotOld(); }
402  const VariableValue & duDotDu() const { return _element_data->duDotDu(); }
403  const VariableValue & duDotDotDu() const { return _element_data->duDotDotDu(); }
404 
406  const FieldVariableValue & slnNeighbor() const override
407  {
408  return _neighbor_data->sln(Moose::Current);
409  }
410  const FieldVariableValue & slnOldNeighbor() const override
411  {
412  return _neighbor_data->sln(Moose::Old);
413  }
416  {
417  return _neighbor_data->sln(Moose::PreviousNL);
418  }
419 
421  const FieldVariableGradient & gradSlnNeighbor() const override
422  {
423  return _neighbor_data->gradSln(Moose::Current);
424  }
425  const FieldVariableGradient & gradSlnOldNeighbor() const override
426  {
427  return _neighbor_data->gradSln(Moose::Old);
428  }
430  {
431  return _neighbor_data->gradSln(Moose::Older);
432  }
434  {
435  return _neighbor_data->gradSln(Moose::PreviousNL);
436  }
437 
439  const FieldVariableGradient & gradSlnNeighborDot() const { return _neighbor_data->gradSlnDot(); }
441  {
442  return _neighbor_data->gradSlnDotDot();
443  }
444 
447  {
448  return _neighbor_data->secondSln(Moose::Current);
449  }
451  {
452  return _neighbor_data->secondSln(Moose::Old);
453  }
455  {
456  return _neighbor_data->secondSln(Moose::Older);
457  }
459  {
460  return _neighbor_data->secondSln(Moose::PreviousNL);
461  }
462 
465  {
466  return _neighbor_data->curlSln(Moose::Current);
467  }
469  {
470  return _neighbor_data->curlSln(Moose::Old);
471  }
473  {
474  return _neighbor_data->curlSln(Moose::Older);
475  }
476 
479  {
480  return _neighbor_data->divSln(Moose::Current);
481  }
483  {
484  return _neighbor_data->divSln(Moose::Old);
485  }
487  {
488  return _neighbor_data->divSln(Moose::Older);
489  }
490 
492  const FieldVariableValue & uDotNeighbor() const { return _neighbor_data->uDot(); }
493  const FieldVariableValue & uDotDotNeighbor() const { return _neighbor_data->uDotDot(); }
494  const FieldVariableValue & uDotOldNeighbor() const { return _neighbor_data->uDotOld(); }
495  const FieldVariableValue & uDotDotOldNeighbor() const { return _neighbor_data->uDotDotOld(); }
496  const VariableValue & duDotDuNeighbor() const { return _neighbor_data->duDotDu(); }
497  const VariableValue & duDotDotDuNeighbor() const { return _neighbor_data->duDotDotDu(); }
498 
500  const ADTemplateVariableValue<OutputType> & adSlnLower() const { return _lower_data->adSln(); }
501  const FieldVariableValue & slnLower() const { return _lower_data->sln(Moose::Current); }
502  const FieldVariableValue & slnLowerOld() const { return _lower_data->sln(Moose::Old); }
503 
505  virtual void computeElemValues() override;
506  virtual void computeElemValuesFace() override;
507  virtual void computeNeighborValuesFace() override;
508  virtual void computeNeighborValues() override;
509  virtual void computeLowerDValues() override;
510 
511  virtual void setNodalValue(const OutputType & value, unsigned int idx = 0) override;
512 
513  virtual void setDofValue(const OutputData & value, unsigned int index) override;
514 
518  virtual void setDofValues(const DenseVector<OutputData> & values) override;
519  virtual void setLowerDofValues(const DenseVector<OutputData> & values) override;
520 
525 
529  OutputData getNodalValue(const Node & node) const;
533  OutputData getNodalValueOld(const Node & node) const;
537  OutputData getNodalValueOlder(const Node & node) const;
544  OutputData getElementalValue(const Elem * elem, unsigned int idx = 0) const;
551  OutputData getElementalValueOld(const Elem * elem, unsigned int idx = 0) const;
558  OutputData getElementalValueOlder(const Elem * elem, unsigned int idx = 0) const;
559 
563  virtual void insert(libMesh::NumericVector<libMesh::Number> & vector) override;
564  virtual void insertLower(libMesh::NumericVector<libMesh::Number> & vector) override;
565 
569  virtual void add(libMesh::NumericVector<libMesh::Number> & vector) override;
570 
574  void addSolution(const DenseVector<libMesh::Number> & v);
575 
579  void addSolutionNeighbor(const DenseVector<libMesh::Number> & v);
580 
581  const DoFValue & dofValue() const;
582  const DoFValue & dofValues() const override;
583  const DoFValue & dofValuesOld() const override;
584  const DoFValue & dofValuesOlder() const override;
585  const DoFValue & dofValuesPreviousNL() const override;
586  const DoFValue & dofValuesNeighbor() const override;
587  const DoFValue & dofValuesOldNeighbor() const override;
588  const DoFValue & dofValuesOlderNeighbor() const override;
589  const DoFValue & dofValuesPreviousNLNeighbor() const override;
590  const DoFValue & dofValuesDot() const override;
591  const DoFValue & dofValuesDotNeighbor() const override;
592  const DoFValue & dofValuesDotNeighborResidual() const;
593  const DoFValue & dofValuesDotOld() const override;
594  const DoFValue & dofValuesDotOldNeighbor() const override;
595  const DoFValue & dofValuesDotDot() const override;
596  const DoFValue & dofValuesDotDotNeighbor() const override;
598  const DoFValue & dofValuesDotDotOld() const override;
599  const DoFValue & dofValuesDotDotOldNeighbor() const override;
600  const MooseArray<libMesh::Number> & dofValuesDuDotDu() const override;
601  const MooseArray<libMesh::Number> & dofValuesDuDotDuNeighbor() const override;
602  const MooseArray<libMesh::Number> & dofValuesDuDotDotDu() const override;
604 
605  const MooseArray<ADReal> & adDofValues() const override;
606  const MooseArray<ADReal> & adDofValuesNeighbor() const override;
607  const MooseArray<ADReal> & adDofValuesDot() const override;
608 
613 
618 
625  OutputType getValue(const Elem * elem, const std::vector<std::vector<OutputShape>> & phi) const;
626 
634  const Elem * elem,
635  const std::vector<std::vector<typename OutputTools<OutputType>::OutputShapeGradient>> &
636  grad_phi) const;
637 
641  virtual std::size_t phiSize() const final { return _element_data->phiSize(); }
645  virtual std::size_t phiFaceSize() const final { return _element_data->phiFaceSize(); }
649  virtual std::size_t phiNeighborSize() const final { return _neighbor_data->phiSize(); }
653  virtual std::size_t phiFaceNeighborSize() const final { return _neighbor_data->phiFaceSize(); }
654 
655  std::size_t phiLowerSize() const final { return _lower_data->phiSize(); }
656 
660  const OutputType & nodalValue() const;
661  const OutputType & nodalValueOld() const;
662  const OutputType & nodalValueOlder() const;
663  const OutputType & nodalValuePreviousNL() const;
664  const OutputType & nodalValueDot() const;
665  const OutputType & nodalValueDotDot() const;
666  const OutputType & nodalValueDotOld() const;
667  const OutputType & nodalValueDotDotOld() const;
668  const OutputType & nodalValueDuDotDu() const;
669  const OutputType & nodalValueDuDotDotDu() const;
670  const OutputType & nodalValueNeighbor() const;
671  const OutputType & nodalValueOldNeighbor() const;
672  const OutputType & nodalValueOlderNeighbor() const;
673  const OutputType & nodalValuePreviousNLNeighbor() const;
674  const OutputType & nodalValueDotNeighbor() const;
675  const OutputType & nodalValueDotNeighborResidual() const;
676  const OutputType & nodalValueDotDotNeighbor() const;
677  const OutputType & nodalValueDotDotNeighborResidual() const;
678  const OutputType & nodalValueDotOldNeighbor() const;
679  const OutputType & nodalValueDotDotOldNeighbor() const;
680  const OutputType & nodalValueDuDotDuNeighbor() const;
681  const OutputType & nodalValueDuDotDotDuNeighbor() const;
682 
683  const MooseArray<OutputType> & nodalValueArray() const override
684  {
685  return _element_data->nodalValueArray(Moose::Current);
686  }
688  {
689  return _element_data->nodalValueArray(Moose::Old);
690  }
692  {
693  return _element_data->nodalValueArray(Moose::Older);
694  }
695 
696  const DoFValue & nodalVectorTagValue(TagID tag) const override;
697  const DoFValue & nodalMatrixTagValue(TagID tag) const override;
698 
699  const typename Moose::ADType<OutputType>::type & adNodalValue() const;
700 
701  virtual void computeNodalValues() override;
702  virtual void computeNodalNeighborValues() override;
703 
704  unsigned int oldestSolutionStateRequested() const override final;
705 
706  void setActiveTags(const std::set<TagID> & vtags) override;
707 
708  virtual void meshChanged() override;
709  virtual void residualSetup() override;
710  virtual void jacobianSetup() override;
711 
712  bool supportsFaceArg() const override final { return true; }
713  bool supportsElemSideQpArg() const override final { return true; }
714 
715 protected:
717 
719  std::unique_ptr<MooseVariableData<OutputType>> _element_data;
720 
722  std::unique_ptr<MooseVariableData<OutputType>> _neighbor_data;
723 
725  std::unique_ptr<MooseVariableData<OutputType>> _lower_data;
726 
738 
745  ValueType
746  faceEvaluate(const FaceArg &, const StateArg &, const std::vector<ValueType> & cache_data) const;
747 
748  ValueType evaluate(const ElemQpArg & elem_qp, const StateArg & state) const override final;
749  ValueType evaluate(const ElemSideQpArg & elem_side_qp,
750  const StateArg & state) const override final;
751  ValueType evaluate(const ElemArg &, const StateArg &) const override final;
752  ValueType evaluate(const ElemPointArg &, const StateArg &) const override final;
753  ValueType evaluate(const NodeArg & node_arg, const StateArg & state) const override final;
754  ValueType evaluate(const FaceArg &, const StateArg &) const override final;
755 
756  GradientType evaluateGradient(const ElemQpArg & elem_qp, const StateArg & state) const override;
757  GradientType evaluateGradient(const ElemSideQpArg & elem_side_qp,
758  const StateArg & state) const override final;
759  GradientType evaluateGradient(const ElemArg &, const StateArg &) const override final;
760 
761  DotType evaluateDot(const ElemQpArg & elem_qp, const StateArg & state) const override final;
762  DotType evaluateDot(const ElemSideQpArg & elem_side_qp,
763  const StateArg & state) const override final;
764  DotType evaluateDot(const ElemArg &, const StateArg &) const override final;
765  DotType evaluateDot(const FaceArg &, const StateArg &) const override final;
766 
767  GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final;
768 
769 private:
774  template <typename Shapes, typename Solution, typename GradShapes, typename GradSolution>
775  void computeSolution(const Elem * elem,
776  unsigned int n_qp,
777  const StateArg & state,
778  const Shapes & phi,
779  Solution & local_soln,
780  const GradShapes & grad_phi,
781  GradSolution & grad_local_soln,
782  Solution & dot_local_soln,
783  GradSolution & grad_dot_local_soln) const;
784 
788  void
789  evaluateOnElement(const ElemQpArg & elem_qp, const StateArg & state, bool cache_eligible) const;
790 
794  void evaluateOnElementSide(const ElemSideQpArg & elem_side_qp,
795  const StateArg & state,
796  bool cache_eligible) const;
797 
801  mutable const Elem * _current_elem_qp_functor_elem = nullptr;
802 
804  mutable std::vector<ValueType> _current_elem_qp_functor_sln;
805 
807  mutable std::vector<GradientType> _current_elem_qp_functor_gradient;
808 
810  mutable std::vector<DotType> _current_elem_qp_functor_dot;
811 
813  mutable std::vector<GradientType> _current_elem_qp_functor_grad_dot;
814 
818  mutable std::pair<const Elem *, unsigned int> _current_elem_side_qp_functor_elem_side{
819  nullptr, libMesh::invalid_uint};
820 
822  mutable std::vector<ValueType> _current_elem_side_qp_functor_sln;
823 
825  mutable std::vector<GradientType> _current_elem_side_qp_functor_gradient;
826 
828  mutable std::vector<DotType> _current_elem_side_qp_functor_dot;
829 
832  mutable std::vector<GradientType> _current_elem_side_qp_functor_grad_dot;
833 };
834 
835 template <typename OutputType>
836 inline const MooseArray<ADReal> &
838 {
839  return _element_data->adDofValues();
840 }
841 
842 template <typename OutputType>
843 inline const MooseArray<ADReal> &
845 {
846  return _neighbor_data->adDofValues();
847 }
848 
849 template <typename OutputType>
850 inline const MooseArray<ADReal> &
852 {
853  return _element_data->adDofValuesDot();
854 }
855 
856 template <typename OutputType>
857 inline const typename Moose::ADType<OutputType>::type &
859 {
860  return _element_data->adNodalValue();
861 }
862 
863 template <typename OutputType>
864 void
865 MooseVariableFE<OutputType>::setActiveTags(const std::set<TagID> & vtags)
866 {
867  _element_data->setActiveTags(vtags);
868  _neighbor_data->setActiveTags(vtags);
869  _lower_data->setActiveTags(vtags);
870 }
871 
872 // Declare all the specializations, as the template specialization declarations below must know
873 template <>
875 template <>
877 template <>
879 template <>
882  const std::vector<std::vector<Real>> & phi) const;
883 template <>
885  const Elem * elem, const std::vector<std::vector<RealVectorValue>> & grad_phi) const;
886 template <>
888  const StateArg &,
889  bool) const;
890 template <>
892  const StateArg &,
893  bool) const;
894 template <>
896 MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const;
897 template <>
899 MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const;
900 template <>
902 MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const;
903 template <>
905 MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const;
906 template <>
908 MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const;
909 template <>
911 MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const;
912 
913 // Prevent implicit instantiation in other translation units where these classes are used
914 extern template class MooseVariableFE<Real>;
915 extern template class MooseVariableFE<RealVectorValue>;
916 extern template class MooseVariableFE<RealEigenVector>;
typename MooseVariableField< Real >::FieldVariablePhiValue FieldVariablePhiValue
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Definition: MooseTypes.h:609
const FieldVariableValue & vectorTagValue(TagID tag) const override
tag values getters
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...
const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const override
AD grad of time derivative solution getter.
const FieldVariableValue & uDotDotNeighbor() const
const FieldVariableCurl & curlSlnNeighbor() const
neighbor solution curls
const Node *const & node() const
typename MooseVariableField< Real >::OutputShapeGradient OutputShapeGradient
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
Definition: MooseTypes.h:611
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
const FieldVariableSecond & secondSlnOlderNeighbor() const
GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final
Evaluate the functor gradient-dot with a given element.
bool computingCurl() const override final
Whether or not this variable is computing the curl.
bool isNodalNeighborDefined() const
const OutputType & nodalValueDuDotDotDu() const
bool computingDiv() const override final
Whether or not this variable is computing the divergence.
const ADTemplateVariableTestGradient< OutputShape > & adGradPhiFace() const
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.
ValueType evaluate(const ElemQpArg &elem_qp, const StateArg &state) const override final
const DoFValue & dofValuesOlderNeighbor() const override
const FieldVariableGradient & gradSlnPreviousNL() const
const DoFValue & dofValuesDotOld() const override
typename MooseVariableField< Real >::OutputGradient OutputGradient
const unsigned int invalid_uint
const FieldVariablePhiValue & phiNeighbor() const override final
Return the variable&#39;s shape functions on a neighboring element.
const OutputType & nodalValueOld() const
Class for stuff related to variables.
Definition: Adaptivity.h:31
typename MooseVariableField< Real >::FieldVariablePhiSecond FieldVariablePhiSecond
unsigned int TagID
Definition: MooseTypes.h:210
const OutputType & nodalValueDuDotDu() const
const OutputType & nodalValueDotDotOld() const
const FieldVariablePhiDivergence & divPhiNeighbor() const
const DoFValue & dofValuesDotNeighborResidual() const
const OutputType & nodalValueDot() const
Class for stuff related to variables.
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
const FieldVariableSecond & secondSlnPreviousNLNeighbor() const
OutputType getValue(const Elem *elem, const std::vector< std::vector< OutputShape >> &phi) const
Compute the variable value at a point on an element.
const FieldVariableCurl & curlSlnOldNeighbor() const
virtual void setNodalValue(const OutputType &value, unsigned int idx=0) override
virtual void computeLowerDValues() override
compute values at quadrature points on the lower dimensional element
const FieldVariableGradient & gradSlnNeighborDotDot() const
std::vector< DotType > _current_elem_qp_functor_dot
The values of the time derivative for the _current_elem_qp_functor_elem.
const OutputType & nodalValueNeighbor() const
typename MooseVariableField< Real >::FieldVariablePhiCurl FieldVariablePhiCurl
const FieldVariableGradient & gradSln() const override
element gradients
const FieldVariablePhiCurl & curlPhiFaceNeighbor() const
const FieldVariableValue & slnNeighbor() const override
neighbor solutions
const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
virtual void setDofValues(const DenseVector< OutputData > &values) override
Set local DOF values and evaluate the values on quadrature points.
const VariableValue & duDotDuNeighbor() const
const DoFValue & dofValue() const
void reinitAux() override
const FieldVariableSecond & secondSlnOld() const
const FieldVariableValue & slnOlderNeighbor() const
const OutputType & nodalValuePreviousNLNeighbor() const
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
const ADTemplateVariableSecond< OutputType > & adSecondSlnNeighbor() const override
AD second neighbor solution getter.
virtual std::size_t phiFaceNeighborSize() const final
Return phiFaceNeighbor size.
void reinitNodes(const std::vector< dof_id_type > &nodes) override
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 & nodalValueDuDotDuNeighbor() const
const OutputType & nodalValueDuDotDotDuNeighbor() const
std::unique_ptr< MooseVariableData< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
void prepareNeighbor() override
Prepare the neighbor element degrees of freedom.
const DoFValue & dofValuesDotDotNeighbor() const override
MooseVariableFE(const InputParameters &parameters)
const FieldVariablePhiGradient & gradPhiNeighbor() const override final
Return the gradients of the variable&#39;s shape functions on a neighboring element.
const OutputType & nodalValueDotDotNeighbor() const
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition: MooseTypes.h:603
const FieldVariableValue & slnLowerOld() const
const FieldVariableDivergence & divSlnOld() const
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
const FieldVariableGradient & gradSlnPreviousNLNeighbor() const
typename MooseVariableField< Real >::FieldVariableValue FieldVariableValue
const OutputType & nodalValueDotDotOldNeighbor() const
const DoFValue & dofValuesDotOldNeighbor() const override
const ADTemplateVariableValue< OutputType > & adSlnNeighbor() const override
neighbor AD
const FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s elemental shape functions.
const MappedArrayVariablePhiGradient & arrayGradPhiFaceNeighbor() const
const FieldVariableValue & uDotOld() const
OutputData getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
typename MooseVariableField< Real >::OutputShapeSecond OutputShapeSecond
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
const DoFValue & dofValuesNeighbor() const override
typename MooseVariableField< Real >::FieldVariableGradient FieldVariableGradient
bool hasDoFsOnNodes() const override
Does this variable have DoFs on nodes.
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
virtual void prepareIC() override
Prepare the initial condition.
A structure for storing the various lists that contain the names of the items to be exported...
bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivative on a neighbor...
virtual void setDofValue(const OutputData &value, unsigned int index) override
Degree of freedom value setters.
const ADTemplateVariableValue< OutputType > & adUDotNeighbor() const override
AD neighbor time derivative getter.
const FieldVariableCurl & curlSlnOld() const
const DoFValue & dofValuesDotDot() const override
const ADTemplateVariableValue< OutputType > & adUDot() const override
AD time derivative getter.
const ADTemplateVariableGradient< OutputType > & adGradSlnNeighborDot() const override
AD grad of time derivative neighbor solution getter.
typename MooseVariableField< Real >::OutputSecond OutputSecond
void addSolutionNeighbor(const DenseVector< libMesh::Number > &v)
Add passed in local neighbor DOF values onto the current solution.
virtual void jacobianSetup() override
typename FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
Definition: MooseFunctor.h:149
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 ADTemplateVariableSecond< OutputType > & adSecondSln() const override
AD second solution getter.
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
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...
OutputData getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
const FieldVariableGradient & gradSlnOlderNeighbor() const
Moose::DOFType< OutputType >::type OutputData
virtual void computeNodalValues() override
Compute nodal values of this variable.
const FieldVariableSecond & secondSlnOldNeighbor() const
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
const MooseArray< OutputType > & nodalValueOldArray() const override
const FieldVariablePhiCurl & curlPhiNeighbor() const
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...
const FieldVariableValue & uDot() const
element dots
MooseVariableFE< RealVectorValue > VectorMooseVariable
const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
Return the gradients of the variable&#39;s shape functions on a neighboring element face.
GradientType evaluateGradient(const ElemQpArg &elem_qp, const StateArg &state) const override
void prepareLowerD() override
Prepare a lower dimensional element&#39;s degrees of freedom.
const FieldVariableCurl & curlSln() const
element curls
typename MooseVariableField< Real >::FieldVariableTestValue FieldVariableTestValue
std::vector< DotType > _current_elem_side_qp_functor_dot
The values of the time derivative for the _current_elem_side_qp_functor_elem_side.
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.
unsigned int numberOfDofsNeighbor() override
const VariableValue & duDotDotDu() const
const ADTemplateVariableCurl< OutputType > & adCurlSln() const override
AD curl solution getter.
libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
const DoFValue & dofValuesOlder() const override
const MappedArrayVariablePhiGradient & arrayGradPhi() const
typename MooseVariableField< Real >::FieldVariableDivergence FieldVariableDivergence
const FieldVariablePhiCurl & curlPhiFace() const
const MooseArray< OutputType > & nodalValueOlderArray() const override
const OutputType & nodalValueDotDot() const
const FieldVariableValue & uDotDotOldNeighbor() const
const OutputType & nodalValueDotDotNeighborResidual() const
const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
const ADTemplateVariableTestGradient< OutputShape > & adGradPhiFaceNeighbor() const
const FieldVariableDivergence & divSlnOlder() const
const FieldVariableSecond & secondSlnPreviousNL() const
const OutputType & nodalValueOlder() const
A structure defining a "face" evaluation calling argument for Moose functors.
void reinitAuxNeighbor() override
const MappedArrayVariablePhiGradient & arrayGradPhiNeighbor() const
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
const FieldVariableValue & slnPreviousNL() const
const OutputType & nodalValueDotNeighbor() const
unsigned int numberOfDofs() const final
Get the number of local DoFs.
const FieldVariableValue & uDotDot() const
const FieldVariableValue & sln() const override
element solutions
void setActiveTags(const std::set< TagID > &vtags) override
Set the active vector tags.
const FieldVariableSecond & secondSlnNeighbor() const
neighbor solution seconds
const FieldVariablePhiValue & phi() const override
Return the variable&#39;s elemental shape functions.
libMesh::FEContinuity getContinuity() const override
Return the continuity of this variable.
MooseVariableFE< RealEigenVector > ArrayMooseVariable
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
Definition: MooseTypes.h:355
std::size_t phiLowerSize() const final
Return the number of shape functions on the lower dimensional element for this variable.
typename OutputTools< typename Moose::ADType< T >::type >::VariableTestGradient ADTemplateVariableTestGradient
Definition: MooseTypes.h:631
typename MooseVariableField< Real >::FieldVariableTestDivergence FieldVariableTestDivergence
const DoFValue & dofValuesOld() const override
const FieldVariableSecond & secondSlnOlder() const
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 DoFValue & dofValuesPreviousNLNeighbor() const override
typename MooseVariableField< Real >::FieldVariableTestSecond FieldVariableTestSecond
typename MooseVariableField< Real >::OutputShapeDivergence OutputShapeDivergence
const FieldVariableValue & uDotDotOld() const
const DoFValue & dofValuesOldNeighbor() const override
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition: MooseTypes.h:606
const unsigned int & currentSide() const
Current side this variable is being evaluated on.
virtual void computeNodalNeighborValues() override
Compute nodal values of this variable in the neighbor.
typename MooseVariableField< Real >::FieldVariableSecond FieldVariableSecond
const FieldVariableGradient & vectorTagGradient(TagID tag) const
A structure that is used to evaluate Moose functors logically at an element/cell center.
virtual void meshChanged() override
Called on this object when the mesh changes.
const ADTemplateVariableValue< OutputType > & adSln() const override
AD.
std::vector< ValueType > _current_elem_qp_functor_sln
The values of the solution for the _current_elem_qp_functor_elem.
const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on an element face...
const Node *const & nodeNeighbor() const
Argument for requesting functor evaluation at a quadrature point location in an element.
const FieldVariableValue & uDotNeighbor() const
neighbor dots
const OutputType & nodalValue() const
Methods for retrieving values of variables at the nodes.
const FieldVariableValue & increment() const
typename MooseVariableField< Real >::FieldVariableCurl FieldVariableCurl
OutputData getNodalValueOlder(const Node &node) const
Get the t-2 value of this variable at given node.
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the current local DOF values to the input vector.
virtual void setLowerDofValues(const DenseVector< OutputData > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points...
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes) override
const FieldVariablePhiSecond & secondPhiNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on a neighboring ele...
std::unique_ptr< MooseVariableData< OutputType > > _lower_data
Holder for all the data associated with the lower dimeensional element.
const FieldVariableSecond & secondSln() const
element seconds
virtual std::size_t phiFaceSize() const final
Return phiFace size.
const DoFValue & dofValuesDotDotOld() const override
typename MooseVariableField< Real >::FieldVariableTestGradient FieldVariableTestGradient
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
const DoFValue & nodalVectorTagValue(TagID tag) const override
void clearDofIndices() override
Clear out the dof indices.
const FieldVariableValue & slnLower() const
const FieldVariableGradient & gradSlnOldNeighbor() const override
MooseVariableFE< Real > MooseVariable
const MooseArray< ADReal > & adDofValues() const override
Return the AD dof values.
const ADTemplateVariableValue< OutputType > & adUDotDot() const override
AD second time derivative getter.
const FieldVariableGradient & gradSlnOld() const override
typename MooseVariableField< Real >::FieldVariablePhiGradient FieldVariablePhiGradient
const ADTemplateVariableGradient< OutputType > & adGradSlnNeighbor() const override
AD grad neighbor solution getter.
OutputData getNodalValue(const Node &node) const
Get the value of this variable at given node.
bool isNodal() const override
Is this variable nodal.
const FieldVariableGradient & gradSlnNeighbor() const override
neighbor solution gradients
void evaluateOnElement(const ElemQpArg &elem_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_qp argument.
void computeIncrementAtNode(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change at the current node based on increment_vec.
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
const Elem *const & neighbor() const
Current neighboring element.
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const OutputData &v)
Write a nodal value to the passed-in solution vector.
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
Definition: MooseTypes.h:147
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:314
const MooseArray< OutputType > & nodalValueArray() const override
Methods for retrieving values of variables at the nodes in a MooseArray for AuxKernelBase.
const FieldVariableValue & slnOlder() const override
const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on a neighboring ele...
virtual std::size_t phiSize() const final
Return phi size.
const dof_id_type & nodalDofIndexNeighbor() const override
const OutputType & nodalValueDotOldNeighbor() const
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Set the current local DOF values to the input vector.
Base class for time integrators.
const OutputType & nodalValueOldNeighbor() const
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
const ADTemplateVariableCurl< OutputType > & adCurlSlnNeighbor() const override
AD curl neighbor solution getter.
const dof_id_type & nodalDofIndex() const override
const FieldVariableGradient & gradSlnNeighborDot() const
neighbor grad dots
OutputData getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
const DoFValue & dofValuesDotDotNeighborResidual() const
const DoFValue & vectorTagDofValue(TagID tag) const override
const FieldVariableGradient & gradSlnDotDot() const
const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
const FieldVariableCurl & curlSlnOlder() const
const FieldVariablePhiCurl & curlPhi() const override final
Curl of the shape functions.
static InputParameters validParams()
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
const DoFValue & dofValues() const override
dof values getters
const std::vector< dof_id_type > & dofIndicesNeighbor() const final
Get neighbor DOF indices for currently selected element.
typename MooseVariableField< Real >::OutputShape OutputShape
std::vector< GradientType > _current_elem_qp_functor_gradient
The values of the gradient for the _current_elem_qp_functor_elem.
const FieldVariableValue & matrixTagValue(TagID tag) const override
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
bool computingSecond() const override final
Whether or not this variable is computing any second derivatives.
std::vector< GradientType > _current_elem_side_qp_functor_gradient
The values of the gradient for the _current_elem_side_qp_functor_elem_side.
const FieldVariableDivergence & divSlnOldNeighbor() const
virtual const FieldVariablePhiValue & phiLower() const override
Return the variable&#39;s shape functions on a lower-dimensional element.
const FieldVariablePhiGradient & gradPhiLower() const
bool usesGradPhi() const
Whether or not this variable is actually using the shape function gradient.
const ADTemplateVariableTestGradient< OutputShape > & adGradPhi() const
const FieldVariableValue & uDotOldNeighbor() const
const MooseArray< ADReal > & adDofValuesNeighbor() const override
Return the AD neighbor dof values.
const VariableValue & duDotDu() const
typename MooseVariableField< Real >::DoFValue DoFValue
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
const MooseArray< ADReal > & adDofValuesDot() const override
Return the AD time derivatives at dofs.
const Elem * _current_elem_qp_functor_elem
Keep track of the current elem-qp functor element in order to enable local caching (e...
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 InputParameters & parameters() const
Get the parameters of the object.
State argument for evaluating functors.
const FieldVariablePhiValue & phiFace() const override final
Return the variable&#39;s shape functions on an element face.
const DoFValue & dofValuesPreviousNL() const override
bool usesPhi() const
Whether or not this variable is actually using the shape function value.
const FieldVariableGradient & gradSlnOlder() const
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
void prepare() override
Prepare the elemental degrees of freedom.
const FieldVariableDivergence & divSlnOlderNeighbor() const
const FieldVariableGradient & gradSlnDot() const
element gradient dots
std::vector< ValueType > _current_elem_side_qp_functor_sln
The values of the solution for the _current_elem_side_qp_functor_elem_side.
const VariableValue & duDotDotDuNeighbor() const
void reinitNode() override
const Moose::ADType< OutputType >::type & adNodalValue() const
const DoFValue & dofValuesDotNeighbor() const override
libMesh::TensorTools::DecrementRank< OutputType >::type OutputDivergence
const FieldVariablePhiGradient & gradPhi() const override final
Return the gradients of the variable&#39;s elemental shape functions.
const FieldVariableCurl & curlSlnOlderNeighbor() const
const DoFValue & nodalMatrixTagValue(TagID tag) const override
typename MooseVariableField< Real >::FieldVariableTestCurl FieldVariableTestCurl
const OutputType & nodalValueDotNeighborResidual() const
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
const ADTemplateVariableValue< OutputType > & adSlnLower() const
lower-d element solution
typename MooseVariableField< Real >::OutputDivergence OutputDivergence
const FieldVariableDivergence & divSln() const
element divergence
std::unique_ptr< MooseVariableData< OutputType > > _element_data
Holder for all the data associated with the "main" element.
const FieldVariableValue & slnOld() const override
const DoFValue & dofValuesDotDotOldNeighbor() const override
virtual void residualSetup() override
typename MooseVariableField< Real >::FieldVariablePhiDivergence FieldVariablePhiDivergence
const Elem *const & currentElem() const override
Current element this variable is evaluated at.
const OutputType & nodalValueOlderNeighbor() const
const OutputType & nodalValueDotOld() const
const FieldVariableValue & slnOldNeighbor() const override
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
virtual std::size_t phiNeighborSize() const final
Return phiNeighbor size.
Argument for requesting functor evaluation at quadrature point locations on an element side...
const FieldVariableValue & slnPreviousNLNeighbor() const
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
Moose::ShapeType< OutputType >::type OutputShape
const DoFValue & dofValuesDot() const override
const MappedArrayVariablePhiGradient & arrayGradPhiFace() const
typename Moose::ADType< Real >::type FunctorArg
const FieldVariableDivergence & divSlnNeighbor() const
neighbor solution divergence
const FieldVariablePhiGradient & gradPhiFace() const override final
Return the gradients of the variable&#39;s shape functions on an element face.
uint8_t dof_id_type
const FieldVariablePhiDivergence & divPhiFace() const
const FieldVariablePhiValue & phiFaceNeighbor() const override final
Return the variable&#39;s shape functions on a neighboring element face.
const OutputType & nodalValuePreviousNL() const
OutputData getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
const ADTemplateVariableValue< OutputType > & adUDotDotNeighbor() const override
AD neighbor second time derivative getter.
void prepareAux() override
void clearAllDofIndices() final