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 DofValue & 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 {
711  _element_data->insertNodalValue(residual, v);
712 }
713 
714 template <typename OutputType>
717 {
718  return _element_data->secondPhi();
719 }
720 
721 template <typename OutputType>
724 {
725  return _element_data->curlPhi();
726 }
727 
728 template <typename OutputType>
731 {
732  return _element_data->divPhi();
733 }
734 
735 template <typename OutputType>
738 {
739  return _element_data->secondPhiFace();
740 }
741 
742 template <typename OutputType>
745 {
746  return _element_data->curlPhiFace();
747 }
748 
749 template <typename OutputType>
752 {
753  return _element_data->divPhiFace();
754 }
755 
756 template <typename OutputType>
759 {
760  return _neighbor_data->secondPhi();
761 }
762 
763 template <typename OutputType>
766 {
767  return _neighbor_data->curlPhi();
768 }
769 
770 template <typename OutputType>
773 {
774  return _neighbor_data->divPhi();
775 }
776 
777 template <typename OutputType>
780 {
781  return _neighbor_data->secondPhiFace();
782 }
783 
784 template <typename OutputType>
787 {
788  return _neighbor_data->curlPhiFace();
789 }
790 
791 template <typename OutputType>
794 {
795  return _neighbor_data->divPhiFace();
796 }
797 
798 template <typename OutputType>
799 bool
801 {
802  return _element_data->usesSecondPhi();
803 }
804 
805 template <typename OutputType>
806 bool
808 {
809  return _neighbor_data->usesSecondPhi();
810 }
811 
812 template <typename OutputType>
813 bool
815 {
816  return _element_data->computingCurl();
817 }
818 
819 template <typename OutputType>
820 bool
822 {
823  return _element_data->computingDiv();
824 }
825 
826 template <typename OutputType>
827 bool
829 {
830  return _element_data->isNodalDefined();
831 }
832 
833 template <typename OutputType>
834 bool
836 {
837  return _neighbor_data->isNodalDefined();
838 }
839 
840 template <typename OutputType>
841 unsigned int
843 {
844  unsigned int state = 0;
845  state = std::max(state, _element_data->oldestSolutionStateRequested());
846  state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
847  state = std::max(state, _lower_data->oldestSolutionStateRequested());
848  return state;
849 }
850 
851 template <typename OutputType>
852 void
854 {
855  _element_data->clearDofIndices();
856  _neighbor_data->clearDofIndices();
857  _lower_data->clearDofIndices();
858 }
859 
860 template <typename OutputType>
862 MooseVariableFE<OutputType>::evaluate(const NodeArg & node_arg, const StateArg & state) const
863 {
864  mooseAssert(node_arg.node, "Must have a node");
865  const Node & node = *node_arg.node;
866  mooseAssert(node.n_dofs(this->_sys.number(), this->number()),
867  "Our variable must have dofs on the requested node");
868  const auto & soln = this->getSolution(state);
869  if constexpr (std::is_same<OutputType, Real>::value)
870  {
871  const auto dof_number = node.dof_number(this->_sys.number(), this->number(), 0);
872  ValueType ret = soln(dof_number);
873  if (Moose::doDerivatives(_subproblem, _sys))
874  Moose::derivInsert(ret.derivatives(), dof_number, 1);
875  return ret;
876  }
877  else if constexpr (std::is_same<OutputType, RealVectorValue>::value)
878  {
879  ValueType ret;
880  const auto do_derivatives = Moose::doDerivatives(_subproblem, _sys);
881  for (const auto d : make_range(this->_mesh.dimension()))
882  {
883  const auto dof_number = node.dof_number(this->_sys.number(), this->number(), d);
884  auto & component = ret(d);
885  component = soln(dof_number);
886  if (do_derivatives)
887  Moose::derivInsert(component.derivatives(), dof_number, 1);
888  }
889  return ret;
890  }
891  else
892  mooseError("RealEigenVector not yet supported for functors");
893 }
894 
895 namespace
896 {
897 template <typename OutputType>
898 struct FEBaseHelper
899 {
900  typedef FEBase type;
901 };
902 
903 template <>
904 struct FEBaseHelper<RealVectorValue>
905 {
906  typedef FEVectorBase type;
907 };
908 }
909 
910 template <typename OutputType>
911 template <typename Shapes, typename Solution, typename GradShapes, typename GradSolution>
912 void
914  const unsigned int n_qp,
915  const StateArg & state,
916  const Shapes & phi,
917  Solution & local_soln,
918  const GradShapes & grad_phi,
919  GradSolution & grad_local_soln,
920  Solution & dot_local_soln,
921  GradSolution & grad_dot_local_soln) const
922 {
923  std::vector<dof_id_type> dof_indices;
924  this->_dof_map.dof_indices(elem, dof_indices, _var_num);
925  std::vector<ADReal> dof_values;
926  std::vector<ADReal> dof_values_dot;
927  dof_values.reserve(dof_indices.size());
928 
929  const bool computing_dot = _time_integrator && _time_integrator->dt();
930  if (computing_dot)
931  dof_values_dot.reserve(dof_indices.size());
932 
933  const bool do_derivatives = Moose::doDerivatives(_subproblem, _sys);
934  const auto & global_soln = getSolution(state);
935  for (const auto dof_index : dof_indices)
936  {
937  dof_values.push_back(ADReal(global_soln(dof_index)));
938  if (do_derivatives && state.state == 0)
939  Moose::derivInsert(dof_values.back().derivatives(), dof_index, 1.);
940  if (computing_dot)
941  {
942  if (_var_kind == Moose::VAR_SOLVER)
943  {
944  dof_values_dot.push_back(dof_values.back());
945  _time_integrator->computeADTimeDerivatives(
946  dof_values_dot.back(), dof_index, _ad_real_dummy);
947  }
948  else
949  dof_values_dot.push_back((*this->_sys.solutionUDot())(dof_index));
950  }
951  }
952 
953  local_soln.resize(n_qp);
954  grad_local_soln.resize(n_qp);
955  if (computing_dot)
956  {
957  dot_local_soln.resize(n_qp);
958  grad_dot_local_soln.resize(n_qp);
959  }
960 
961  for (const auto qp : make_range(n_qp))
962  {
963  local_soln[qp] = 0;
964  grad_local_soln[qp] = 0;
965  if (computing_dot)
966  {
967  dot_local_soln[qp] = 0;
968  grad_dot_local_soln[qp] = GradientType{};
969  }
970  for (const auto i : index_range(dof_indices))
971  {
972  local_soln[qp] += dof_values[i] * phi[i][qp];
973  grad_local_soln[qp] += dof_values[i] * grad_phi[i][qp];
974  if (computing_dot)
975  {
976  dot_local_soln[qp] += dof_values_dot[i] * phi[i][qp];
977  grad_dot_local_soln[qp] += dof_values_dot[i] * grad_phi[i][qp];
978  }
979  }
980  }
981 }
982 
983 template <typename OutputType>
984 void
986  const StateArg & state,
987  const bool cache_eligible) const
988 {
989  mooseAssert(this->hasBlocks(elem_qp.elem->subdomain_id()),
990  "Variable " + this->name() + " doesn't exist on block " +
991  std::to_string(elem_qp.elem->subdomain_id()));
992 
993  const Elem * const elem = elem_qp.elem;
994  if (!cache_eligible || (elem != _current_elem_qp_functor_elem))
995  {
996  const QBase * const qrule_template = elem_qp.qrule;
997 
998  using FEBaseType = typename FEBaseHelper<OutputType>::type;
999  std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->dim(), _fe_type));
1000  auto qrule = qrule_template->clone();
1001 
1002  const auto & phi = fe->get_phi();
1003  const auto & dphi = fe->get_dphi();
1004  fe->attach_quadrature_rule(qrule.get());
1005  fe->reinit(elem);
1006 
1007  computeSolution(elem,
1008  qrule->n_points(),
1009  state,
1010  phi,
1011  _current_elem_qp_functor_sln,
1012  dphi,
1013  _current_elem_qp_functor_gradient,
1014  _current_elem_qp_functor_dot,
1015  _current_elem_qp_functor_grad_dot);
1016  }
1017  if (cache_eligible)
1018  _current_elem_qp_functor_elem = elem;
1019  else
1020  // These evaluations are not eligible for caching, e.g. maybe this is a single point quadrature
1021  // rule evaluation at an arbitrary point and we don't want those evaluations to potentially be
1022  // re-used when this function is called with a standard quadrature rule or a different point
1023  _current_elem_qp_functor_elem = nullptr;
1024 }
1025 
1026 template <>
1027 void
1028 MooseVariableFE<RealEigenVector>::evaluateOnElement(const ElemQpArg &, const StateArg &, bool) const
1029 {
1030  mooseError("evaluate not implemented for array variables");
1031 }
1032 
1033 template <typename OutputType>
1035 MooseVariableFE<OutputType>::evaluate(const ElemQpArg & elem_qp, const StateArg & state) const
1036 {
1037  evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1038  const auto qp = elem_qp.qp;
1039  mooseAssert(qp < _current_elem_qp_functor_sln.size(),
1040  "The requested " << qp << " is outside our solution size");
1041  return _current_elem_qp_functor_sln[qp];
1042 }
1043 
1044 template <typename OutputType>
1046 MooseVariableFE<OutputType>::evaluate(const ElemArg & elem_arg, const StateArg & state) const
1047 {
1048  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1049  // We can use whatever we want for the point argument since it won't be used
1050  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1051  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1052  return _current_elem_qp_functor_sln[0];
1053 }
1054 
1055 template <typename OutputType>
1058  const StateArg & state,
1059  const std::vector<ValueType> & cache_data) const
1060 {
1061  const QMonomial qrule(face_arg.fi->elem().dim() - 1, CONSTANT);
1062  auto side_evaluate =
1063  [this, &qrule, &state, &cache_data](const Elem * const elem, const unsigned int side)
1064  {
1065  // We can use whatever we want for the point argument since it won't be used
1066  const ElemSideQpArg elem_side_qp_arg{elem, side, /*qp=*/0, &qrule, Point(0, 0, 0)};
1067  evaluateOnElementSide(elem_side_qp_arg, state, /*cache_eligible=*/false);
1068  return cache_data[0];
1069  };
1070 
1071  const auto continuity = this->getContinuity();
1072  bool on_elem;
1073  bool on_neighbor;
1074  if (!face_arg.face_side)
1075  {
1076  on_elem = this->hasBlocks(face_arg.fi->elemPtr()->subdomain_id());
1077  on_neighbor =
1078  face_arg.fi->neighborPtr() && this->hasBlocks(face_arg.fi->neighborPtr()->subdomain_id());
1079  }
1080  else
1081  {
1082  on_elem = face_arg.face_side == face_arg.fi->elemPtr();
1083  on_neighbor = face_arg.face_side == face_arg.fi->neighborPtr();
1084  }
1085 
1086  // Only do multiple evaluations if we are not continuous and we are on an internal face
1087  if ((continuity != C_ZERO && continuity != C_ONE) && on_elem && on_neighbor)
1088  return (side_evaluate(face_arg.fi->elemPtr(), face_arg.fi->elemSideID()) +
1089  side_evaluate(face_arg.fi->neighborPtr(), face_arg.fi->neighborSideID())) /
1090  2;
1091  else if (on_elem)
1092  return side_evaluate(face_arg.fi->elemPtr(), face_arg.fi->elemSideID());
1093  else if (on_neighbor)
1094  return side_evaluate(face_arg.fi->neighborPtr(), face_arg.fi->neighborSideID());
1095  else
1096  mooseError(
1097  "Attempted to evaluate a moose finite element variable on a face where it is not defined");
1098 }
1099 
1100 template <typename OutputType>
1102 MooseVariableFE<OutputType>::evaluate(const FaceArg & face_arg, const StateArg & state) const
1103 {
1104  return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1105 }
1106 
1107 template <typename OutputType>
1110  const StateArg & state) const
1111 {
1112  mooseAssert(elem_point_arg.elem, "We need an Elem");
1113  const Elem & elem = *elem_point_arg.elem;
1114  const auto dim = elem.dim();
1115  ArbitraryQuadrature qrule(dim);
1116  const std::vector<Point> ref_point = {FEMap::inverse_map(dim, &elem, elem_point_arg.point)};
1117  qrule.setPoints(ref_point);
1118  // We can use whatever we want for the point argument since it won't be used
1119  const ElemQpArg elem_qp_arg{elem_point_arg.elem, /*qp=*/0, &qrule, elem_point_arg.point};
1120  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1121  return _current_elem_qp_functor_sln[0];
1122 }
1123 
1124 template <typename OutputType>
1127  const StateArg & state) const
1128 {
1129  evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1130  const auto qp = elem_qp.qp;
1131  mooseAssert(qp < _current_elem_qp_functor_gradient.size(),
1132  "The requested " << qp << " is outside our gradient size");
1133  return _current_elem_qp_functor_gradient[qp];
1134 }
1135 
1136 template <typename OutputType>
1139  const StateArg & state) const
1140 {
1141  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1142  // We can use whatever we want for the point argument since it won't be used
1143  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1144  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1145  return _current_elem_qp_functor_gradient[0];
1146 }
1147 
1148 template <typename OutputType>
1150 MooseVariableFE<OutputType>::evaluateDot(const ElemQpArg & elem_qp, const StateArg & state) const
1151 {
1152  mooseAssert(_time_integrator,
1153  "A time derivative is being requested but we do not have a time integrator so we'll "
1154  "have no idea how to compute it");
1155  mooseAssert(_time_integrator->dt(),
1156  "A time derivative is being requested but the time integrator wants to perform a 0s "
1157  "time step");
1158  evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1159  const auto qp = elem_qp.qp;
1160  mooseAssert(qp < _current_elem_qp_functor_dot.size(),
1161  "The requested " << qp << " is outside our dot size");
1162  return _current_elem_qp_functor_dot[qp];
1163 }
1164 
1165 template <typename OutputType>
1167 MooseVariableFE<OutputType>::evaluateDot(const ElemArg & elem_arg, const StateArg & state) const
1168 {
1169  mooseAssert(_time_integrator,
1170  "A time derivative is being requested but we do not have a time integrator so we'll "
1171  "have no idea how to compute it");
1172  mooseAssert(_time_integrator->dt(),
1173  "A time derivative is being requested but the time integrator wants to perform a 0s "
1174  "time step");
1175  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1176  // We can use whatever we want for the point argument since it won't be used
1177  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1178  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1179  return _current_elem_qp_functor_dot[0];
1180 }
1181 
1182 template <typename OutputType>
1184 MooseVariableFE<OutputType>::evaluateGradDot(const ElemArg & elem_arg, const StateArg & state) const
1185 {
1186  mooseAssert(_time_integrator,
1187  "A time derivative is being requested but we do not have a time integrator so we'll "
1188  "have no idea how to compute it");
1189  mooseAssert(_time_integrator->dt(),
1190  "A time derivative is being requested but the time integrator wants to perform a 0s "
1191  "time step");
1192  const QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1193  // We can use whatever we want for the point argument since it won't be used
1194  const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1195  evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1196  return _current_elem_qp_functor_grad_dot[0];
1197 }
1198 
1199 template <typename OutputType>
1200 void
1202  const StateArg & state,
1203  const bool cache_eligible) const
1204 {
1205  mooseAssert(this->hasBlocks(elem_side_qp.elem->subdomain_id()),
1206  "Variable " + this->name() + " doesn't exist on block " +
1207  std::to_string(elem_side_qp.elem->subdomain_id()));
1208 
1209  const Elem * const elem = elem_side_qp.elem;
1210  const auto side = elem_side_qp.side;
1211  if (!cache_eligible || elem != _current_elem_side_qp_functor_elem_side.first ||
1212  side != _current_elem_side_qp_functor_elem_side.second)
1213  {
1214  const QBase * const qrule_template = elem_side_qp.qrule;
1215 
1216  using FEBaseType = typename FEBaseHelper<OutputType>::type;
1217  std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->dim(), _fe_type));
1218  auto qrule = qrule_template->clone();
1219 
1220  const auto & phi = fe->get_phi();
1221  const auto & dphi = fe->get_dphi();
1222  fe->attach_quadrature_rule(qrule.get());
1223  fe->reinit(elem, side);
1224 
1225  computeSolution(elem,
1226  qrule->n_points(),
1227  state,
1228  phi,
1229  _current_elem_side_qp_functor_sln,
1230  dphi,
1231  _current_elem_side_qp_functor_gradient,
1232  _current_elem_side_qp_functor_dot,
1233  _current_elem_side_qp_functor_grad_dot);
1234  }
1235  if (cache_eligible)
1236  _current_elem_side_qp_functor_elem_side = std::make_pair(elem, side);
1237  else
1238  // These evaluations are not eligible for caching, e.g. maybe this is a single point quadrature
1239  // rule evaluation at an arbitrary point and we don't want those evaluations to potentially be
1240  // re-used when this function is called with a standard quadrature rule or a different point
1241  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1242 }
1243 
1244 template <>
1245 void
1247  const StateArg &,
1248  bool) const
1249 {
1250  mooseError("evaluate not implemented for array variables");
1251 }
1252 
1253 template <typename OutputType>
1256  const StateArg & state) const
1257 {
1258  evaluateOnElementSide(elem_side_qp, state, true);
1259  const auto qp = elem_side_qp.qp;
1260  mooseAssert(qp < _current_elem_side_qp_functor_sln.size(),
1261  "The requested " << qp << " is outside our solution size");
1262  return _current_elem_side_qp_functor_sln[qp];
1263 }
1264 
1265 template <typename OutputType>
1268  const StateArg & state) const
1269 {
1270  evaluateOnElementSide(elem_side_qp, state, true);
1271  const auto qp = elem_side_qp.qp;
1272  mooseAssert(qp < _current_elem_side_qp_functor_gradient.size(),
1273  "The requested " << qp << " is outside our gradient size");
1274  return _current_elem_side_qp_functor_gradient[qp];
1275 }
1276 
1277 template <typename OutputType>
1280  const StateArg & state) const
1281 {
1282  mooseAssert(_time_integrator && _time_integrator->dt(),
1283  "A time derivative is being requested but we do not have a time integrator so we'll "
1284  "have no idea how to compute it");
1285  evaluateOnElementSide(elem_side_qp, state, true);
1286  const auto qp = elem_side_qp.qp;
1287  mooseAssert(qp < _current_elem_side_qp_functor_dot.size(),
1288  "The requested " << qp << " is outside our dot size");
1289  return _current_elem_side_qp_functor_dot[qp];
1290 }
1291 
1292 template <typename OutputType>
1294 MooseVariableFE<OutputType>::evaluateDot(const FaceArg & face_arg, const StateArg & state) const
1295 {
1296  mooseAssert(_time_integrator && _time_integrator->dt(),
1297  "A time derivative is being requested but we do not have a time integrator so we'll "
1298  "have no idea how to compute it");
1299  return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_dot);
1300 }
1301 
1302 template <>
1304 MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const
1305 {
1306  mooseError(
1307  "MooseVariableFE::evaluate(ElemQpArg &, const StateArg &) overload not implemented for "
1308  "array variables");
1309 }
1310 
1311 template <>
1313 MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const
1314 {
1315  mooseError("MooseVariableFE::evaluate(ElemSideQpArg &, const StateArg &) overload not "
1316  "implemented for array variables");
1317 }
1318 
1319 template <>
1321 MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const
1322 {
1323  mooseError("MooseVariableFE::evaluateGradient(ElemQpArg &, const StateArg &) overload not "
1324  "implemented for array variables");
1325 }
1326 
1327 template <>
1329 MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const
1330 {
1331  mooseError("MooseVariableFE::evaluateGradient(ElemSideQpArg &, const StateArg &) overload not "
1332  "implemented for array variables");
1333 }
1334 
1335 template <>
1337 MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const
1338 {
1339  mooseError("MooseVariableFE::evaluateDot(ElemQpArg &, const StateArg &) overload not "
1340  "implemented for array variables");
1341 }
1342 
1343 template <>
1345 MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const
1346 {
1347  mooseError("MooseVariableFE::evaluateDot(ElemSideQpArg &, const StateArg &) overload not "
1348  "implemented for array variables");
1349 }
1350 
1351 template <typename OutputType>
1352 void
1354 {
1355  _current_elem_qp_functor_elem = nullptr;
1356  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1358 }
1359 
1360 template <typename OutputType>
1361 void
1363 {
1364  _current_elem_qp_functor_elem = nullptr;
1365  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1367 }
1368 
1369 template <typename OutputType>
1370 void
1372 {
1373  _current_elem_qp_functor_elem = nullptr;
1374  _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1376 }
1377 
1378 template <typename OutputType>
1379 void
1381 {
1382  _element_data->sizeMatrixTagData();
1383  _neighbor_data->sizeMatrixTagData();
1384  _lower_data->sizeMatrixTagData();
1385 }
1386 
1387 template class MooseVariableFE<Real>;
1388 template class MooseVariableFE<RealVectorValue>;
1389 template class MooseVariableFE<RealEigenVector>;
std::string name(const ElemQuality q)
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:414
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...
virtual void setDofValues(const DenseVector< DofValue > &values) override
Set local DOF values and evaluate the values on quadrature points.
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.
const DofValues & nodalVectorTagValue(TagID tag) const override
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 unsigned int invalid_uint
const OutputType & nodalValueOld() const
Class for stuff related to variables.
Definition: Adaptivity.h:33
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
unsigned int TagID
Definition: MooseTypes.h:238
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:322
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
DofValue getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:85
const FieldVariablePhiCurl & curlPhiFaceNeighbor() const
const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
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
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
std::unique_ptr< MooseVariableData< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
virtual void setDofValue(const DofValue &value, unsigned int index) override
Degree of freedom value setters.
void prepareNeighbor() override
Prepare the neighbor element degrees of freedom.
MooseVariableFE(const InputParameters &parameters)
const DofValues & dofValuesOlder() const override
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const DofValue &v)
Write a nodal value to the passed-in solution vector.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const DofValues & dofValuesDotDotOldNeighbor() const override
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() 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:113
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
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:42
bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivative on a neighbor...
const DofValues & dofValuesOld() 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.
const DofValues & nodalMatrixTagValue(TagID tag) const override
unsigned int neighborSideID() const
Definition: FaceInfo.h:114
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
THREAD_ID _tid
Thread ID.
auto max(const L &left, const R &right)
const DofValues & dofValuesDotOldNeighbor() const override
std::vector< dof_id_type > _dof_indices
DOF indices.
virtual void computeNodalValues() override
Compute nodal values of this variable.
const DofValues & dofValuesDot() const override
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...
const DofValues & dofValue() const
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 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.
DofValue getNodalValueOlder(const Node &node) const
Get the t-2 value of this variable at given node.
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
const DofValues & dofValuesOlderNeighbor() const override
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
DofValue getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
const DofValues & dofValuesDotDotOld() const 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 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:363
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.
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the current local DOF values to the input vector.
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes) override
const DofValues & dofValuesNeighbor() const 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 DofValues & dofValuesDotDot() const override
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
Definition: Assembly.h:551
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
void clearDofIndices() override
Clear out the dof indices.
const Elem * elemPtr() const
Definition: FaceInfo.h:86
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.
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
Definition: MooseTypes.h:149
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
const DofValues & dofValuesPreviousNL() const override
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
const DofValues & dofValues() const override
dof values getters
subdomain_id_type subdomain_id() const
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
virtual void setLowerDofValues(const DenseVector< DofValue > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points...
unsigned int _var_num
variable number (from libMesh)
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
DofValue getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
DofValue getNodalValue(const Node &node) const
Get the value of this variable at given node.
const Elem *const & neighbor() const
Return the neighbor element.
Definition: Assembly.h:470
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:281
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition: Assembly.h:235
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:518
const DofValues & dofValuesDotOld() const override
typename MooseVariableDataBase< OutputType >::DofValues DofValues
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:147
unsigned int qp
The quadrature point index.
void prepare() override
Prepare the elemental degrees of freedom.
const DofValues & dofValuesDotNeighbor() const override
void reinitNode() 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 Node *const & node() const
Returns the reference to the node.
Definition: Assembly.h:545
virtual void residualSetup() override
typename MooseVariableDataBase< OutputType >::DofValue DofValue
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
const DofValues & dofValuesPreviousNLNeighbor() const override
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
const libMesh::Elem * elem
The element.
const OutputType & nodalValueOlderNeighbor() const
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:476
const DofValues & dofValuesOldNeighbor() const override
const OutputType & nodalValueDotOld() const
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
const DofValues & dofValuesDotDotNeighbor() const override
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.
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
void prepareAux() override
void clearAllDofIndices() final