https://mooseframework.inl.gov
MooseVariableFE.C
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 #include "MooseVariableFE.h"
11 #include <typeinfo>
12 #include "TimeIntegrator.h"
13 #include "NonlinearSystemBase.h"
14 #include "DisplacedSystem.h"
15 #include "Assembly.h"
16 #include "MooseVariableData.h"
17 #include "ArbitraryQuadrature.h"
18 
19 #include "libmesh/quadrature_monomial.h"
20 
21 using namespace libMesh;
22 
23 template <>
26 {
28  params.addClassDescription(
29  "Represents standard field variables, e.g. Lagrange, Hermite, or non-constant Monomials");
30  return params;
31 }
32 
33 template <>
36 {
38  params.addClassDescription(
39  "Represents vector field variables, e.g. Vector Lagrange, Nedelec or Raviart-Thomas");
40  return params;
41 }
42 
43 template <>
46 {
48  params.addClassDescription(
49  "Used for grouping standard field variables with the same finite element family and order");
50  return params;
51 }
52 
53 template <typename OutputType>
55  : MooseVariableField<OutputType>(parameters)
56 {
57  _element_data = std::make_unique<MooseVariableData<OutputType>>(*this,
58  _sys,
59  _tid,
61  this->_assembly.qRule(),
62  this->_assembly.qRuleFace(),
63  this->_assembly.node(),
64  this->_assembly.elem());
65  _neighbor_data = std::make_unique<MooseVariableData<OutputType>>(
66  *this,
67  _sys,
68  _tid,
70  this->_assembly.qRuleNeighbor(), // Place holder
71  this->_assembly.qRuleNeighbor(),
72  this->_assembly.nodeNeighbor(),
73  this->_assembly.neighbor());
74  _lower_data =
75  std::make_unique<MooseVariableData<OutputType>>(*this,
76  _sys,
77  _tid,
79  this->_assembly.qRuleFace(),
80  this->_assembly.qRuleFace(), // Place holder
81  this->_assembly.node(), // Place holder
82  this->_assembly.lowerDElem());
83 }
84 
85 template <typename OutputType>
86 void
88 {
89  _element_data->clearDofIndices();
90 }
91 
92 template <typename OutputType>
93 void
95 {
96  _element_data->prepare();
97 }
98 
99 template <typename OutputType>
100 void
102 {
103  _neighbor_data->prepare();
104 }
105 
106 template <typename OutputType>
107 void
109 {
110  _lower_data->prepare();
111 }
112 
113 template <typename OutputType>
114 void
116 {
117  _element_data->prepareAux();
118  _neighbor_data->prepareAux();
119  _lower_data->prepareAux();
120 }
121 
122 template <typename OutputType>
123 void
125 {
126  _element_data->reinitNode();
127 }
128 
129 template <typename OutputType>
130 void
132 {
133  _element_data->reinitAux();
134 }
135 
136 template <typename OutputType>
137 void
139 {
140  _neighbor_data->reinitAux();
141 }
142 
143 template <typename OutputType>
144 void
145 MooseVariableFE<OutputType>::reinitNodes(const std::vector<dof_id_type> & nodes)
146 {
147  _element_data->reinitNodes(nodes);
148 }
149 
150 template <typename OutputType>
151 void
152 MooseVariableFE<OutputType>::reinitNodesNeighbor(const std::vector<dof_id_type> & nodes)
153 {
154  _neighbor_data->reinitNodes(nodes);
155 }
156 
157 template <typename OutputType>
158 void
160  std::vector<dof_id_type> & dof_indices) const
161 {
162  _element_data->getDofIndices(elem, dof_indices);
163 }
164 
165 template <typename OutputType>
168 {
169  return _element_data->getNodalValue(node, Moose::Current);
170 }
171 
172 template <typename OutputType>
175 {
176  return _element_data->getNodalValue(node, Moose::Old);
177 }
178 
179 template <typename OutputType>
182 {
183  return _element_data->getNodalValue(node, Moose::Older);
184 }
185 
186 template <typename OutputType>
188 MooseVariableFE<OutputType>::getElementalValue(const Elem * elem, unsigned int idx) const
189 {
190  return _element_data->getElementalValue(elem, Moose::Current, idx);
191 }
192 
193 template <typename OutputType>
195 MooseVariableFE<OutputType>::getElementalValueOld(const Elem * elem, unsigned int idx) const
196 {
197  return _element_data->getElementalValue(elem, Moose::Old, idx);
198 }
199 
200 template <typename OutputType>
202 MooseVariableFE<OutputType>::getElementalValueOlder(const Elem * elem, unsigned int idx) const
203 {
204  return _element_data->getElementalValue(elem, Moose::Older, idx);
205 }
206 
207 template <typename OutputType>
208 void
210 {
211  _element_data->insert(vector);
212 }
213 
214 template <typename OutputType>
215 void
217 {
218  _lower_data->insert(vector);
219 }
220 
221 template <typename OutputType>
222 void
224 {
225  _element_data->add(vector);
226 }
227 
228 template <typename OutputType>
229 void
231 {
232  _element_data->addSolution(this->_sys.solution(), v);
233 }
234 
235 template <typename OutputType>
236 void
238 {
239  _neighbor_data->addSolution(this->_sys.solution(), v);
240 }
241 
242 template <typename OutputType>
245 {
246  mooseDeprecated("Use dofValues instead of dofValue");
247  return dofValues();
248 }
249 
250 template <typename OutputType>
253 {
254  return _element_data->dofValues();
255 }
256 
257 template <typename OutputType>
260 {
261  return _element_data->dofValuesOld();
262 }
263 
264 template <typename OutputType>
267 {
268  return _element_data->dofValuesOlder();
269 }
270 
271 template <typename OutputType>
274 {
275  return _element_data->dofValuesPreviousNL();
276 }
277 
278 template <typename OutputType>
281 {
282  return _neighbor_data->dofValues();
283 }
284 
285 template <typename OutputType>
288 {
289  return _neighbor_data->dofValuesOld();
290 }
291 
292 template <typename OutputType>
295 {
296  return _neighbor_data->dofValuesOlder();
297 }
298 
299 template <typename OutputType>
302 {
303  return _neighbor_data->dofValuesPreviousNL();
304 }
305 
306 template <typename OutputType>
309 {
310  return _element_data->dofValuesDot();
311 }
312 
313 template <typename OutputType>
316 {
317  return _element_data->dofValuesDotDot();
318 }
319 
320 template <typename OutputType>
323 {
324  return _element_data->dofValuesDotOld();
325 }
326 
327 template <typename OutputType>
330 {
331  return _element_data->dofValuesDotDotOld();
332 }
333 
334 template <typename OutputType>
337 {
338  return _neighbor_data->dofValuesDot();
339 }
340 
341 template <typename OutputType>
344 {
345  return _neighbor_data->dofValuesDotDot();
346 }
347 
348 template <typename OutputType>
351 {
352  return _neighbor_data->dofValuesDotOld();
353 }
354 
355 template <typename OutputType>
358 {
359  return _neighbor_data->dofValuesDotDotOld();
360 }
361 
362 template <typename OutputType>
363 const MooseArray<Number> &
365 {
366  return _element_data->dofValuesDuDotDu();
367 }
368 
369 template <typename OutputType>
370 const MooseArray<Number> &
372 {
373  return _element_data->dofValuesDuDotDotDu();
374 }
375 
376 template <typename OutputType>
377 const MooseArray<Number> &
379 {
380  return _neighbor_data->dofValuesDuDotDu();
381 }
382 
383 template <typename OutputType>
384 const MooseArray<Number> &
386 {
387  return _neighbor_data->dofValuesDuDotDotDu();
388 }
389 
390 template <typename OutputType>
391 void
393 {
394  _element_data->prepareIC();
395 }
396 
397 template <typename OutputType>
398 void
400 {
401  _element_data->setGeometry(Moose::Volume);
402  _element_data->computeValues();
403 }
404 
405 template <typename OutputType>
406 void
408 {
409  _element_data->setGeometry(Moose::Face);
410  _element_data->computeValues();
411 }
412 
413 template <typename OutputType>
414 void
416 {
417  _neighbor_data->setGeometry(Moose::Face);
418  _neighbor_data->computeValues();
419 }
420 
421 template <typename OutputType>
422 void
424 {
425  _neighbor_data->setGeometry(Moose::Volume);
426  _neighbor_data->computeValues();
427 }
428 
429 template <typename OutputType>
430 void
432 {
433  _lower_data->setGeometry(Moose::Volume);
434  _lower_data->computeValues();
435 }
436 
437 template <typename OutputType>
438 void
440 {
441  _element_data->computeIncrementAtQps(increment_vec);
442 }
443 
444 template <typename OutputType>
445 void
447 {
448  _element_data->computeIncrementAtNode(increment_vec);
449 }
450 
451 template <typename OutputType>
452 OutputType
454  const std::vector<std::vector<OutputShape>> & phi) const
455 {
456  std::vector<dof_id_type> dof_indices;
457  this->_dof_map.dof_indices(elem, dof_indices, _var_num);
458 
459  OutputType value = 0;
460  if (isNodal())
461  {
462  mooseAssert(dof_indices.size() == phi.size(),
463  "The number of shapes does not match the number of dof indices on the elem");
464 
465  for (unsigned int i = 0; i < dof_indices.size(); ++i)
466  {
467  // The zero index is because we only have one point that the phis are evaluated at
468  value += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
469  }
470  }
471  else
472  {
473  mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
474  value = (*this->_sys.currentSolution())(dof_indices[0]);
475  }
476 
477  return value;
478 }
479 
480 template <>
483  const std::vector<std::vector<Real>> & phi) const
484 {
485  std::vector<dof_id_type> dof_indices;
486  this->_dof_map.dof_indices(elem, dof_indices, _var_num);
487 
489  if (isNodal())
490  {
491  for (unsigned int i = 0; i < dof_indices.size(); ++i)
492  for (unsigned int j = 0; j < _count; j++)
493  {
494  // The zero index is because we only have one point that the phis are evaluated at
495  value(j) += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i] + j);
496  }
497  }
498  else
499  {
500  mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
501  unsigned int n = 0;
502  for (unsigned int j = 0; j < _count; j++)
503  {
504  value(j) = (*this->_sys.currentSolution())(dof_indices[0] + n);
505  n += this->_dof_indices.size();
506  }
507  }
508 
509  return value;
510 }
511 
512 template <typename OutputType>
515  const Elem * elem,
516  const std::vector<std::vector<typename OutputTools<OutputType>::OutputShapeGradient>> &
517  grad_phi) const
518 {
519  std::vector<dof_id_type> dof_indices;
520  this->_dof_map.dof_indices(elem, dof_indices, _var_num);
521 
523  if (isNodal())
524  {
525  for (unsigned int i = 0; i < dof_indices.size(); ++i)
526  {
527  // The zero index is because we only have one point that the phis are evaluated at
528  value += grad_phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
529  }
530  }
531  else
532  {
533  mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
534  value = 0.0;
535  }
536 
537  return value;
538 }
539 
540 template <>
543  const Elem * elem, const std::vector<std::vector<RealVectorValue>> & grad_phi) const
544 {
545  std::vector<dof_id_type> dof_indices;
546  this->_dof_map.dof_indices(elem, dof_indices, _var_num);
547 
548  RealVectorArrayValue value(_count, LIBMESH_DIM);
549  if (isNodal())
550  {
551  for (unsigned int i = 0; i < dof_indices.size(); ++i)
552  for (unsigned int j = 0; j < _count; ++j)
553  for (const auto k : make_range(Moose::dim))
554  {
555  // The zero index is because we only have one point that the phis are evaluated at
556  value(j, k) += grad_phi[i][0](k) * (*this->_sys.currentSolution())(dof_indices[i] + j);
557  }
558  }
559  else
560  {
561  mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
562  }
563 
564  return value;
565 }
566 
567 template <typename OutputType>
568 const OutputType &
570 {
571  return _element_data->nodalValue(Moose::Current);
572 }
573 
574 template <typename OutputType>
575 const OutputType &
577 {
578  return _neighbor_data->nodalValue(Moose::Current);
579 }
580 
581 template <typename OutputType>
584 {
585  return _element_data->nodalVectorTagValue(tag);
586 }
587 
588 template <typename OutputType>
591 {
592  return _element_data->nodalMatrixTagValue(tag);
593 }
594 
595 template <typename OutputType>
596 const OutputType &
598 {
599  return _element_data->nodalValue(Moose::Old);
600 }
601 
602 template <typename OutputType>
603 const OutputType &
605 {
606  return _neighbor_data->nodalValue(Moose::Old);
607 }
608 
609 template <typename OutputType>
610 const OutputType &
612 {
613  return _element_data->nodalValue(Moose::Older);
614 }
615 
616 template <typename OutputType>
617 const OutputType &
619 {
620  return _neighbor_data->nodalValue(Moose::Older);
621 }
622 
623 template <typename OutputType>
624 const OutputType &
626 {
627  return _element_data->nodalValue(Moose::PreviousNL);
628 }
629 
630 template <typename OutputType>
631 const OutputType &
633 {
634  return _neighbor_data->nodalValue(Moose::PreviousNL);
635 }
636 
637 template <typename OutputType>
638 const OutputType &
640 {
641  return _element_data->nodalValueDot();
642 }
643 
644 template <typename OutputType>
645 const OutputType &
647 {
648  return _element_data->nodalValueDotDot();
649 }
650 
651 template <typename OutputType>
652 const OutputType &
654 {
655  return _element_data->nodalValueDotOld();
656 }
657 
658 template <typename OutputType>
659 const OutputType &
661 {
662  return _element_data->nodalValueDotDotOld();
663 }
664 
665 template <typename OutputType>
666 void
668 {
669  _element_data->computeNodalValues();
670 }
671 
672 template <typename OutputType>
673 void
675 {
676  _neighbor_data->computeNodalValues();
677 }
678 
679 template <typename OutputType>
680 void
681 MooseVariableFE<OutputType>::setNodalValue(const OutputType & value, unsigned int idx)
682 {
683  _element_data->setNodalValue(value, idx);
684 }
685 
686 template <typename OutputType>
687 void
688 MooseVariableFE<OutputType>::setDofValue(const OutputData & value, unsigned int index)
689 {
690  _element_data->setDofValue(value, index);
691 }
692 
693 template <typename OutputType>
694 void
696 {
697  _element_data->setDofValues(values);
698 }
699 
700 template <typename OutputType>
701 void
703 {
704  _lower_data->setDofValues(values);
705 }
706 
707 template <typename OutputType>
708 void
710  const OutputData & v)
711 {
712  _element_data->insertNodalValue(residual, v);
713 }
714 
715 template <typename OutputType>
718 {
719  return _element_data->secondPhi();
720 }
721 
722 template <typename OutputType>
725 {
726  return _element_data->curlPhi();
727 }
728 
729 template <typename OutputType>
732 {
733  return _element_data->divPhi();
734 }
735 
736 template <typename OutputType>
739 {
740  return _element_data->secondPhiFace();
741 }
742 
743 template <typename OutputType>
746 {
747  return _element_data->curlPhiFace();
748 }
749 
750 template <typename OutputType>
753 {
754  return _element_data->divPhiFace();
755 }
756 
757 template <typename OutputType>
760 {
761  return _neighbor_data->secondPhi();
762 }
763 
764 template <typename OutputType>
767 {
768  return _neighbor_data->curlPhi();
769 }
770 
771 template <typename OutputType>
774 {
775  return _neighbor_data->divPhi();
776 }
777 
778 template <typename OutputType>
781 {
782  return _neighbor_data->secondPhiFace();
783 }
784 
785 template <typename OutputType>
788 {
789  return _neighbor_data->curlPhiFace();
790 }
791 
792 template <typename OutputType>
795 {
796  return _neighbor_data->divPhiFace();
797 }
798 
799 template <typename OutputType>
800 bool
802 {
803  return _element_data->usesSecondPhi();
804 }
805 
806 template <typename OutputType>
807 bool
809 {
810  return _neighbor_data->usesSecondPhi();
811 }
812 
813 template <typename OutputType>
814 bool
816 {
817  return _element_data->computingCurl();
818 }
819 
820 template <typename OutputType>
821 bool
823 {
824  return _element_data->computingDiv();
825 }
826 
827 template <typename OutputType>
828 bool
830 {
831  return _element_data->isNodalDefined();
832 }
833 
834 template <typename OutputType>
835 bool
837 {
838  return _neighbor_data->isNodalDefined();
839 }
840 
841 template <typename OutputType>
842 unsigned int
844 {
845  unsigned int state = 0;
846  state = std::max(state, _element_data->oldestSolutionStateRequested());
847  state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
848  state = std::max(state, _lower_data->oldestSolutionStateRequested());
849  return state;
850 }
851 
852 template <typename OutputType>
853 void
855 {
856  _element_data->clearDofIndices();
857  _neighbor_data->clearDofIndices();
858  _lower_data->clearDofIndices();
859 }
860 
861 template <typename OutputType>
863 MooseVariableFE<OutputType>::evaluate(const NodeArg & node_arg, const StateArg & state) const
864 {
865  mooseAssert(node_arg.node, "Must have a node");
866  const Node & node = *node_arg.node;
867  mooseAssert(node.n_dofs(this->_sys.number(), this->number()),
868  "Our variable must have dofs on the requested node");
869  const auto & soln = this->getSolution(state);
870  if constexpr (std::is_same<OutputType, Real>::value)
871  {
872  const auto dof_number = node.dof_number(this->_sys.number(), this->number(), 0);
873  ValueType ret = soln(dof_number);
874  if (Moose::doDerivatives(_subproblem, _sys))
875  Moose::derivInsert(ret.derivatives(), dof_number, 1);
876  return ret;
877  }
878  else if constexpr (std::is_same<OutputType, RealVectorValue>::value)
879  {
880  ValueType ret;
881  const auto do_derivatives = Moose::doDerivatives(_subproblem, _sys);
882  for (const auto d : make_range(this->_mesh.dimension()))
883  {
884  const auto dof_number = node.dof_number(this->_sys.number(), this->number(), d);
885  auto & component = ret(d);
886  component = soln(dof_number);
887  if (do_derivatives)
888  Moose::derivInsert(component.derivatives(), dof_number, 1);
889  }
890  return ret;
891  }
892  else
893  mooseError("RealEigenVector not yet supported for functors");
894 }
895 
896 namespace
897 {
898 template <typename OutputType>
899 struct FEBaseHelper
900 {
901  typedef FEBase type;
902 };
903 
904 template <>
905 struct FEBaseHelper<RealVectorValue>
906 {
907  typedef FEVectorBase type;
908 };
909 }
910 
911 template <typename OutputType>
912 template <typename Shapes, typename Solution, typename GradShapes, typename GradSolution>
913 void
915  const unsigned int n_qp,
916  const StateArg & state,
917  const Shapes & phi,
918  Solution & local_soln,
919  const GradShapes & grad_phi,
920  GradSolution & grad_local_soln,
921  Solution & dot_local_soln,
922  GradSolution & grad_dot_local_soln) const
923 {
924  std::vector<dof_id_type> dof_indices;
925  this->_dof_map.dof_indices(elem, dof_indices, _var_num);
926  std::vector<ADReal> dof_values;
927  std::vector<ADReal> dof_values_dot;
928  dof_values.reserve(dof_indices.size());
929 
930  const bool computing_dot = _time_integrator && _time_integrator->dt();
931  if (computing_dot)
932  dof_values_dot.reserve(dof_indices.size());
933 
934  const bool do_derivatives = Moose::doDerivatives(_subproblem, _sys);
935  const auto & global_soln = getSolution(state);
936  for (const auto dof_index : dof_indices)
937  {
938  dof_values.push_back(ADReal(global_soln(dof_index)));
939  if (do_derivatives && state.state == 0)
940  Moose::derivInsert(dof_values.back().derivatives(), dof_index, 1.);
941  if (computing_dot)
942  {
943  if (_var_kind == Moose::VAR_SOLVER)
944  {
945  dof_values_dot.push_back(dof_values.back());
946  _time_integrator->computeADTimeDerivatives(
947  dof_values_dot.back(), dof_index, _ad_real_dummy);
948  }
949  else
950  dof_values_dot.push_back((*this->_sys.solutionUDot())(dof_index));
951  }
952  }
953 
954  local_soln.resize(n_qp);
955  grad_local_soln.resize(n_qp);
956  if (computing_dot)
957  {
958  dot_local_soln.resize(n_qp);
959  grad_dot_local_soln.resize(n_qp);
960  }
961 
962  for (const auto qp : make_range(n_qp))
963  {
964  local_soln[qp] = 0;
965  grad_local_soln[qp] = 0;
966  if (computing_dot)
967  {
968  dot_local_soln[qp] = 0;
969  grad_dot_local_soln[qp] = GradientType{};
970  }
971  for (const auto i : index_range(dof_indices))
972  {
973  local_soln[qp] += dof_values[i] * phi[i][qp];
974  grad_local_soln[qp] += dof_values[i] * grad_phi[i][qp];
975  if (computing_dot)
976  {
977  dot_local_soln[qp] += dof_values_dot[i] * phi[i][qp];
978  grad_dot_local_soln[qp] += dof_values_dot[i] * grad_phi[i][qp];
979  }
980  }
981  }
982 }
983 
984 template <typename OutputType>
985 void
987  const StateArg & state,
988  const bool cache_eligible) const
989 {
990  mooseAssert(this->hasBlocks(elem_qp.elem->subdomain_id()),
991  "Variable " + this->name() + " doesn't exist on block " +
992  std::to_string(elem_qp.elem->subdomain_id()));
993 
994  const Elem * const elem = elem_qp.elem;
995  if (!cache_eligible || (elem != _current_elem_qp_functor_elem))
996  {
997  const QBase * const qrule_template = elem_qp.qrule;
998 
999  using FEBaseType = typename FEBaseHelper<OutputType>::type;
1000  std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->dim(), _fe_type));
1001  auto qrule = qrule_template->clone();
1002 
1003  const auto & phi = fe->get_phi();
1004  const auto & dphi = fe->get_dphi();
1005  fe->attach_quadrature_rule(qrule.get());
1006  fe->reinit(elem);
1007 
1008  computeSolution(elem,
1009  qrule->n_points(),
1010  state,
1011  phi,
1012  _current_elem_qp_functor_sln,
1013  dphi,
1014  _current_elem_qp_functor_gradient,
1015  _current_elem_qp_functor_dot,
1016  _current_elem_qp_functor_grad_dot);
1017  }
1018  if (cache_eligible)
1019  _current_elem_qp_functor_elem = elem;
1020  else
1021  // These evaluations are not eligible for caching, e.g. maybe this is a single point quadrature
1022  // rule evaluation at an arbitrary point and we don't want those evaluations to potentially be
1023  // re-used when this function is called with a standard quadrature rule or a different point
1024  _current_elem_qp_functor_elem = nullptr;
1025 }
1026 
1027 template <>
1028 void
1029 MooseVariableFE<RealEigenVector>::evaluateOnElement(const ElemQpArg &, const StateArg &, bool) const
1030 {
1031  mooseError("evaluate not implemented for array variables");
1032 }
1033 
1034 template <typename OutputType>
1036 MooseVariableFE<OutputType>::evaluate(const ElemQpArg & elem_qp, const StateArg & state) const
1037 {
1038  evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1039  const auto qp = elem_qp.qp;
1040  mooseAssert(qp < _current_elem_qp_functor_sln.size(),
1041  "The requested " << qp << " is outside our solution size");
1042  return _current_elem_qp_functor_sln[qp];
1043 }
1044 
1045 template <typename OutputType>
1047 MooseVariableFE<OutputType>::evaluate(const ElemArg & elem_arg, const StateArg & state) const
1048 {
1049  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1050  // We can use whatever we want for the point argument since it won't be used
1051  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1052  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1053  return _current_elem_qp_functor_sln[0];
1054 }
1055 
1056 template <typename OutputType>
1059  const StateArg & state,
1060  const std::vector<ValueType> & cache_data) const
1061 {
1062  const QMonomial qrule(face_arg.fi->elem().dim() - 1, CONSTANT);
1063  auto side_evaluate =
1064  [this, &qrule, &state, &cache_data](const Elem * const elem, const unsigned int side)
1065  {
1066  // We can use whatever we want for the point argument since it won't be used
1067  const ElemSideQpArg elem_side_qp_arg{elem, side, /*qp=*/0, &qrule, Point(0, 0, 0)};
1068  evaluateOnElementSide(elem_side_qp_arg, state, /*cache_eligible=*/false);
1069  return cache_data[0];
1070  };
1071 
1072  const auto continuity = this->getContinuity();
1073  bool on_elem;
1074  bool on_neighbor;
1075  if (!face_arg.face_side)
1076  {
1077  on_elem = this->hasBlocks(face_arg.fi->elemPtr()->subdomain_id());
1078  on_neighbor =
1079  face_arg.fi->neighborPtr() && this->hasBlocks(face_arg.fi->neighborPtr()->subdomain_id());
1080  }
1081  else
1082  {
1083  on_elem = face_arg.face_side == face_arg.fi->elemPtr();
1084  on_neighbor = face_arg.face_side == face_arg.fi->neighborPtr();
1085  }
1086 
1087  // Only do multiple evaluations if we are not continuous and we are on an internal face
1088  if ((continuity != C_ZERO && continuity != C_ONE) && on_elem && on_neighbor)
1089  return (side_evaluate(face_arg.fi->elemPtr(), face_arg.fi->elemSideID()) +
1090  side_evaluate(face_arg.fi->neighborPtr(), face_arg.fi->neighborSideID())) /
1091  2;
1092  else if (on_elem)
1093  return side_evaluate(face_arg.fi->elemPtr(), face_arg.fi->elemSideID());
1094  else if (on_neighbor)
1095  return side_evaluate(face_arg.fi->neighborPtr(), face_arg.fi->neighborSideID());
1096  else
1097  mooseError(
1098  "Attempted to evaluate a moose finite element variable on a face where it is not defined");
1099 }
1100 
1101 template <typename OutputType>
1103 MooseVariableFE<OutputType>::evaluate(const FaceArg & face_arg, const StateArg & state) const
1104 {
1105  return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1106 }
1107 
1108 template <typename OutputType>
1111  const StateArg & state) const
1112 {
1113  mooseAssert(elem_point_arg.elem, "We need an Elem");
1114  const Elem & elem = *elem_point_arg.elem;
1115  const auto dim = elem.dim();
1116  ArbitraryQuadrature qrule(dim);
1117  const std::vector<Point> ref_point = {FEMap::inverse_map(dim, &elem, elem_point_arg.point)};
1118  qrule.setPoints(ref_point);
1119  // We can use whatever we want for the point argument since it won't be used
1120  const ElemQpArg elem_qp_arg{elem_point_arg.elem, /*qp=*/0, &qrule, elem_point_arg.point};
1121  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1122  return _current_elem_qp_functor_sln[0];
1123 }
1124 
1125 template <typename OutputType>
1128  const StateArg & state) const
1129 {
1130  evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1131  const auto qp = elem_qp.qp;
1132  mooseAssert(qp < _current_elem_qp_functor_gradient.size(),
1133  "The requested " << qp << " is outside our gradient size");
1134  return _current_elem_qp_functor_gradient[qp];
1135 }
1136 
1137 template <typename OutputType>
1140  const StateArg & state) const
1141 {
1142  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1143  // We can use whatever we want for the point argument since it won't be used
1144  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1145  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1146  return _current_elem_qp_functor_gradient[0];
1147 }
1148 
1149 template <typename OutputType>
1151 MooseVariableFE<OutputType>::evaluateDot(const ElemQpArg & elem_qp, const StateArg & state) const
1152 {
1153  mooseAssert(_time_integrator,
1154  "A time derivative is being requested but we do not have a time integrator so we'll "
1155  "have no idea how to compute it");
1156  mooseAssert(_time_integrator->dt(),
1157  "A time derivative is being requested but the time integrator wants to perform a 0s "
1158  "time step");
1159  evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1160  const auto qp = elem_qp.qp;
1161  mooseAssert(qp < _current_elem_qp_functor_dot.size(),
1162  "The requested " << qp << " is outside our dot size");
1163  return _current_elem_qp_functor_dot[qp];
1164 }
1165 
1166 template <typename OutputType>
1168 MooseVariableFE<OutputType>::evaluateDot(const ElemArg & elem_arg, const StateArg & state) const
1169 {
1170  mooseAssert(_time_integrator,
1171  "A time derivative is being requested but we do not have a time integrator so we'll "
1172  "have no idea how to compute it");
1173  mooseAssert(_time_integrator->dt(),
1174  "A time derivative is being requested but the time integrator wants to perform a 0s "
1175  "time step");
1176  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1177  // We can use whatever we want for the point argument since it won't be used
1178  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1179  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1180  return _current_elem_qp_functor_dot[0];
1181 }
1182 
1183 template <typename OutputType>
1185 MooseVariableFE<OutputType>::evaluateGradDot(const ElemArg & elem_arg, const StateArg & state) const
1186 {
1187  mooseAssert(_time_integrator,
1188  "A time derivative is being requested but we do not have a time integrator so we'll "
1189  "have no idea how to compute it");
1190  mooseAssert(_time_integrator->dt(),
1191  "A time derivative is being requested but the time integrator wants to perform a 0s "
1192  "time step");
1193  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1194  // We can use whatever we want for the point argument since it won't be used
1195  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1196  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1197  return _current_elem_qp_functor_grad_dot[0];
1198 }
1199 
1200 template <typename OutputType>
1201 void
1203  const StateArg & state,
1204  const bool cache_eligible) const
1205 {
1206  mooseAssert(this->hasBlocks(elem_side_qp.elem->subdomain_id()),
1207  "Variable " + this->name() + " doesn't exist on block " +
1208  std::to_string(elem_side_qp.elem->subdomain_id()));
1209 
1210  const Elem * const elem = elem_side_qp.elem;
1211  const auto side = elem_side_qp.side;
1212  if (!cache_eligible || elem != _current_elem_side_qp_functor_elem_side.first ||
1213  side != _current_elem_side_qp_functor_elem_side.second)
1214  {
1215  const QBase * const qrule_template = elem_side_qp.qrule;
1216 
1217  using FEBaseType = typename FEBaseHelper<OutputType>::type;
1218  std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->dim(), _fe_type));
1219  auto qrule = qrule_template->clone();
1220 
1221  const auto & phi = fe->get_phi();
1222  const auto & dphi = fe->get_dphi();
1223  fe->attach_quadrature_rule(qrule.get());
1224  fe->reinit(elem, side);
1225 
1226  computeSolution(elem,
1227  qrule->n_points(),
1228  state,
1229  phi,
1230  _current_elem_side_qp_functor_sln,
1231  dphi,
1232  _current_elem_side_qp_functor_gradient,
1233  _current_elem_side_qp_functor_dot,
1234  _current_elem_side_qp_functor_grad_dot);
1235  }
1236  if (cache_eligible)
1237  _current_elem_side_qp_functor_elem_side = std::make_pair(elem, side);
1238  else
1239  // These evaluations are not eligible for caching, e.g. maybe this is a single point quadrature
1240  // rule evaluation at an arbitrary point and we don't want those evaluations to potentially be
1241  // re-used when this function is called with a standard quadrature rule or a different point
1242  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1243 }
1244 
1245 template <>
1246 void
1248  const StateArg &,
1249  bool) const
1250 {
1251  mooseError("evaluate not implemented for array variables");
1252 }
1253 
1254 template <typename OutputType>
1257  const StateArg & state) const
1258 {
1259  evaluateOnElementSide(elem_side_qp, state, true);
1260  const auto qp = elem_side_qp.qp;
1261  mooseAssert(qp < _current_elem_side_qp_functor_sln.size(),
1262  "The requested " << qp << " is outside our solution size");
1263  return _current_elem_side_qp_functor_sln[qp];
1264 }
1265 
1266 template <typename OutputType>
1269  const StateArg & state) const
1270 {
1271  evaluateOnElementSide(elem_side_qp, state, true);
1272  const auto qp = elem_side_qp.qp;
1273  mooseAssert(qp < _current_elem_side_qp_functor_gradient.size(),
1274  "The requested " << qp << " is outside our gradient size");
1275  return _current_elem_side_qp_functor_gradient[qp];
1276 }
1277 
1278 template <typename OutputType>
1281  const StateArg & state) const
1282 {
1283  mooseAssert(_time_integrator && _time_integrator->dt(),
1284  "A time derivative is being requested but we do not have a time integrator so we'll "
1285  "have no idea how to compute it");
1286  evaluateOnElementSide(elem_side_qp, state, true);
1287  const auto qp = elem_side_qp.qp;
1288  mooseAssert(qp < _current_elem_side_qp_functor_dot.size(),
1289  "The requested " << qp << " is outside our dot size");
1290  return _current_elem_side_qp_functor_dot[qp];
1291 }
1292 
1293 template <typename OutputType>
1295 MooseVariableFE<OutputType>::evaluateDot(const FaceArg & face_arg, const StateArg & state) const
1296 {
1297  mooseAssert(_time_integrator && _time_integrator->dt(),
1298  "A time derivative is being requested but we do not have a time integrator so we'll "
1299  "have no idea how to compute it");
1300  return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_dot);
1301 }
1302 
1303 template <>
1305 MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const
1306 {
1307  mooseError(
1308  "MooseVariableFE::evaluate(ElemQpArg &, const StateArg &) overload not implemented for "
1309  "array variables");
1310 }
1311 
1312 template <>
1314 MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const
1315 {
1316  mooseError("MooseVariableFE::evaluate(ElemSideQpArg &, const StateArg &) overload not "
1317  "implemented for array variables");
1318 }
1319 
1320 template <>
1322 MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const
1323 {
1324  mooseError("MooseVariableFE::evaluateGradient(ElemQpArg &, const StateArg &) overload not "
1325  "implemented for array variables");
1326 }
1327 
1328 template <>
1330 MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const
1331 {
1332  mooseError("MooseVariableFE::evaluateGradient(ElemSideQpArg &, const StateArg &) overload not "
1333  "implemented for array variables");
1334 }
1335 
1336 template <>
1338 MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const
1339 {
1340  mooseError("MooseVariableFE::evaluateDot(ElemQpArg &, const StateArg &) overload not "
1341  "implemented for array variables");
1342 }
1343 
1344 template <>
1346 MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const
1347 {
1348  mooseError("MooseVariableFE::evaluateDot(ElemSideQpArg &, const StateArg &) overload not "
1349  "implemented for array variables");
1350 }
1351 
1352 template <typename OutputType>
1353 void
1355 {
1356  _current_elem_qp_functor_elem = nullptr;
1357  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1359 }
1360 
1361 template <typename OutputType>
1362 void
1364 {
1365  _current_elem_qp_functor_elem = nullptr;
1366  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1368 }
1369 
1370 template <typename OutputType>
1371 void
1373 {
1374  _current_elem_qp_functor_elem = nullptr;
1375  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1377 }
1378 
1379 template class MooseVariableFE<Real>;
1380 template class MooseVariableFE<RealVectorValue>;
1381 template class MooseVariableFE<RealEigenVector>;
std::string name(const ElemQuality q)
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:375
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...
unsigned int side
The local side index.
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
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 libMesh::QBase * qrule
The quadrature rule.
bool computingDiv() const override final
Whether or not this variable is computing the divergence.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) 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 DoFValue & dofValuesDotOld() const override
const unsigned int invalid_uint
const OutputType & nodalValueOld() const
Class for stuff related to variables.
Definition: Adaptivity.h:31
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
unsigned int TagID
Definition: MooseTypes.h:210
const OutputType & nodalValueDotDotOld() const
const FieldVariablePhiDivergence & divPhiNeighbor() const
const OutputType & nodalValueDot() const
Class for stuff related to variables.
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
virtual void meshChanged()
Called on this object when the mesh changes.
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition: Assembly.h:294
OutputType getValue(const Elem *elem, const std::vector< std::vector< OutputShape >> &phi) const
Compute the variable value at a point on an element.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual void setNodalValue(const OutputType &value, unsigned int idx=0) override
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
virtual void computeLowerDValues() override
compute values at quadrature points on the lower dimensional element
const OutputType & nodalValueNeighbor() const
typename MooseVariableField< OutputType >::FieldVariablePhiCurl FieldVariablePhiCurl
const Elem & elem() const
Definition: FaceInfo.h:81
const FieldVariablePhiCurl & curlPhiFaceNeighbor() const
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 DoFValue & dofValue() const
void reinitAux() override
const OutputType & nodalValuePreviousNLNeighbor() const
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
void reinitNodes(const std::vector< dof_id_type > &nodes) override
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)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:154
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
const DoFValue & dofValuesDotOldNeighbor() const override
const FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s elemental shape functions.
unsigned int elemSideID() const
Definition: FaceInfo.h:109
OutputData getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
const DoFValue & dofValuesNeighbor() const override
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void prepareIC() override
Prepare the initial condition.
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:46
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 DoFValue & dofValuesDotDot() const override
virtual void jacobianSetup() override
void addSolutionNeighbor(const DenseVector< libMesh::Number > &v)
Add passed in local neighbor DOF values onto the current solution.
const libMesh::Node * node
The node which defines our location in space.
unsigned int neighborSideID() const
Definition: FaceInfo.h:110
virtual void jacobianSetup() override
typename FunctorReturnType< Moose::ADType< OutputType >::type, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
Definition: MooseFunctor.h:149
THREAD_ID _tid
Thread ID.
auto max(const L &left, const R &right)
OutputData getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
std::vector< dof_id_type > _dof_indices
DOF indices.
virtual void computeNodalValues() override
Compute nodal values of this variable.
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
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...
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
Definition: ADUtils.C:83
static InputParameters validParams()
GradientType evaluateGradient(const ElemQpArg &elem_qp, const StateArg &state) const override
void prepareLowerD() override
Prepare a lower dimensional element&#39;s degrees of freedom.
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
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 DoFValue & dofValuesOlder() const override
const FieldVariablePhiCurl & curlPhiFace() const
const OutputType & nodalValueDotDot() const
CONSTANT
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
void setPoints(const std::vector< libMesh::Point > &points)
Set the quadrature points.
const Elem * neighborPtr() const
Definition: FaceInfo.h:84
const libMesh::DofMap & _dof_map
DOF map.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const OutputType & nodalValueOlder() const
A structure defining a "face" evaluation calling argument for Moose functors.
void reinitAuxNeighbor() override
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
unsigned int qp
The quadrature point index.
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
const FaceInfo * fi
a face information object which defines our location in space
SystemBase & _sys
System this variable is part of.
C_ZERO
const FieldVariablePhiValue & phi() const override
Return the variable&#39;s elemental shape functions.
const libMesh::QBase * qrule
The quadrature rule.
const libMesh::Elem * elem
const DoFValue & dofValuesOld() const override
const DoFValue & dofValuesPreviousNLNeighbor() const override
const DoFValue & dofValuesOldNeighbor() const override
const libMesh::Elem * elem
virtual void computeNodalNeighborValues() override
Compute nodal values of this variable in the neighbor.
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 FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on an element face...
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353
Argument for requesting functor evaluation at a quadrature point location in an element.
const unsigned int _count
Number of variables in the array.
const OutputType & nodalValue() const
Methods for retrieving values of variables at the nodes.
const libMesh::Elem * elem
The element.
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 DoFValue & dofValuesDotDotOld() const override
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
Definition: Assembly.h:512
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 Elem * elemPtr() const
Definition: FaceInfo.h:82
OutputData getNodalValue(const Node &node) const
Get the value of this variable at given node.
bool isNodal() const override
Is this variable nodal.
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.
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
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 void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Set the current local DOF values to the input vector.
virtual std::unique_ptr< QBase > clone() const
const OutputType & nodalValueOldNeighbor() const
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
subdomain_id_type subdomain_id() const
OutputData getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
Assembly & _assembly
Assembly data.
virtual unsigned short dim() const=0
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.
C_ONE
const DoFValue & dofValues() const override
dof values getters
unsigned int _var_num
variable number (from libMesh)
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
const Elem *const & neighbor() const
Return the neighbor element.
Definition: Assembly.h:431
IntRange< T > make_range(T beg, T end)
typename MooseVariableField< OutputType >::DoFValue DoFValue
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:218
void evaluateOnElementSide(const ElemSideQpArg &elem_side_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_side_qp argument.
State argument for evaluating functors.
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Definition: ADReal.h:21
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor. ...
Definition: Assembly.h:479
const DoFValue & dofValuesPreviousNL() const override
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
unsigned int qp
The quadrature point index.
void prepare() override
Prepare the elemental degrees of freedom.
void reinitNode() override
const DoFValue & dofValuesDotNeighbor() const override
const DoFValue & nodalMatrixTagValue(TagID tag) const override
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
std::unique_ptr< MooseVariableData< OutputType > > _element_data
Holder for all the data associated with the "main" element.
const DoFValue & dofValuesDotDotOldNeighbor() const override
const Node *const & node() const
Returns the reference to the node.
Definition: Assembly.h:506
virtual void residualSetup() override
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
const libMesh::Elem * elem
The element.
const OutputType & nodalValueOlderNeighbor() const
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:437
const OutputType & nodalValueDotOld() const
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
typename MooseVariableField< OutputType >::OutputData OutputData
auto index_range(const T &sizable)
Argument for requesting functor evaluation at quadrature point locations on an element side...
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
const DoFValue & dofValuesDot() const override
unsigned int state
The state.
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
virtual void residualSetup() override
const FieldVariablePhiDivergence & divPhiFace() const
const OutputType & nodalValuePreviousNL() const
OutputData getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
void prepareAux() override
void clearAllDofIndices() final