https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
21template <>
24{
26 params.addClassDescription(
27 "Represents standard field variables, e.g. Lagrange, Hermite, or non-constant Monomials");
28 return params;
29}
30
31template <>
34{
36 params.addClassDescription(
37 "Represents vector field variables, e.g. Vector Lagrange, Nedelec or Raviart-Thomas");
38 return params;
39}
40
41template <>
44{
46 params.addClassDescription(
47 "Used for grouping standard field variables with the same finite element family and order");
48 return params;
49}
50
51template <typename OutputType>
53 : MooseVariableField<OutputType>(parameters)
54{
55 _element_data = std::make_unique<MooseVariableData<OutputType>>(*this,
56 _sys,
57 _tid,
59 this->_assembly.qRule(),
60 this->_assembly.qRuleFace(),
61 this->_assembly.node(),
62 this->_assembly.elem());
63 _neighbor_data = std::make_unique<MooseVariableData<OutputType>>(
64 *this,
65 _sys,
66 _tid,
68 this->_assembly.qRuleNeighbor(), // Place holder
70 this->_assembly.nodeNeighbor(),
71 this->_assembly.neighbor());
73 std::make_unique<MooseVariableData<OutputType>>(*this,
74 _sys,
75 _tid,
77 this->_assembly.qRuleFace(),
78 this->_assembly.qRuleFace(), // Place holder
79 this->_assembly.node(), // Place holder
80 this->_assembly.lowerDElem());
81}
82
83template <typename OutputType>
84void
89
90template <typename OutputType>
91void
93{
94 _element_data->prepare();
95}
97template <typename OutputType>
98void
100{
101 _neighbor_data->prepare();
102}
104template <typename OutputType>
105void
108 _lower_data->prepare();
109}
110
111template <typename OutputType>
112void
114{
115 _element_data->prepareAux();
116 _neighbor_data->prepareAux();
117 _lower_data->prepareAux();
118}
119
120template <typename OutputType>
121void
123{
124 _element_data->reinitNode();
125}
127template <typename OutputType>
128void
130{
131 _element_data->reinitAux();
133
134template <typename OutputType>
135void
137{
138 _neighbor_data->reinitAux();
139}
140
141template <typename OutputType>
142void
143MooseVariableFE<OutputType>::reinitNodes(const std::vector<dof_id_type> & nodes)
144{
145 _element_data->reinitNodes(nodes);
146}
148template <typename OutputType>
149void
150MooseVariableFE<OutputType>::reinitNodesNeighbor(const std::vector<dof_id_type> & nodes)
151{
152 _neighbor_data->reinitNodes(nodes);
153}
154
155template <typename OutputType>
156void
158 std::vector<dof_id_type> & dof_indices) const
159{
160 _element_data->getDofIndices(elem, dof_indices);
161}
162
163template <typename OutputType>
166{
167 return _element_data->getNodalValue(node, Moose::Current);
168}
169
170template <typename OutputType>
173{
174 return _element_data->getNodalValue(node, Moose::Old);
175}
176
177template <typename OutputType>
180{
181 return _element_data->getNodalValue(node, Moose::Older);
182}
183
184template <typename OutputType>
186MooseVariableFE<OutputType>::getElementalValue(const Elem * elem, unsigned int idx) const
187{
188 return _element_data->getElementalValue(elem, Moose::Current, idx);
189}
191template <typename OutputType>
193MooseVariableFE<OutputType>::getElementalValueOld(const Elem * elem, unsigned int idx) const
194{
195 return _element_data->getElementalValue(elem, Moose::Old, idx);
196}
197
198template <typename OutputType>
200MooseVariableFE<OutputType>::getElementalValueOlder(const Elem * elem, unsigned int idx) const
201{
202 return _element_data->getElementalValue(elem, Moose::Older, idx);
205template <typename OutputType>
206void
207MooseVariableFE<OutputType>::insert(NumericVector<Number> & vector)
208{
209 _element_data->insert(vector);
210}
211
212template <typename OutputType>
213void
214MooseVariableFE<OutputType>::insertLower(NumericVector<Number> & vector)
215{
216 _lower_data->insert(vector);
219template <typename OutputType>
220void
221MooseVariableFE<OutputType>::add(NumericVector<Number> & vector)
222{
223 _element_data->add(vector);
224}
225
226template <typename OutputType>
227void
228MooseVariableFE<OutputType>::addSolution(const DenseVector<Number> & v)
230 _element_data->addSolution(this->_sys.solution(), v);
232
233template <typename OutputType>
234void
236{
237 _neighbor_data->addSolution(this->_sys.solution(), v);
238}
239
240template <typename OutputType>
243{
244 mooseDeprecated("Use dofValues instead of dofValue");
245 return dofValues();
248template <typename OutputType>
251{
252 return _element_data->dofValues();
253}
254
255template <typename OutputType>
258{
259 return _element_data->dofValuesOld();
260}
261
262template <typename OutputType>
265{
266 return _element_data->dofValuesOlder();
267}
268
269template <typename OutputType>
272{
273 return _element_data->dofValuesPreviousNL();
274}
275
276template <typename OutputType>
279{
280 return _neighbor_data->dofValues();
281}
282
283template <typename OutputType>
286{
287 return _neighbor_data->dofValuesOld();
288}
289
290template <typename OutputType>
293{
294 return _neighbor_data->dofValuesOlder();
295}
296
297template <typename OutputType>
300{
301 return _neighbor_data->dofValuesPreviousNL();
302}
303
304template <typename OutputType>
307{
308 return _element_data->dofValuesDot();
309}
310
311template <typename OutputType>
314{
315 return _element_data->dofValuesDotDot();
316}
317
318template <typename OutputType>
321{
322 return _element_data->dofValuesDotOld();
323}
324
325template <typename OutputType>
328{
329 return _element_data->dofValuesDotDotOld();
330}
331
332template <typename OutputType>
335{
336 return _neighbor_data->dofValuesDot();
337}
338
339template <typename OutputType>
342{
343 return _neighbor_data->dofValuesDotDot();
344}
345
346template <typename OutputType>
349{
350 return _neighbor_data->dofValuesDotOld();
351}
352
353template <typename OutputType>
356{
357 return _neighbor_data->dofValuesDotDotOld();
358}
359
360template <typename OutputType>
361const MooseArray<Number> &
363{
364 return _element_data->dofValuesDuDotDu();
365}
366
367template <typename OutputType>
368const MooseArray<Number> &
370{
371 return _element_data->dofValuesDuDotDotDu();
372}
373
374template <typename OutputType>
375const MooseArray<Number> &
377{
378 return _neighbor_data->dofValuesDuDotDu();
379}
380
381template <typename OutputType>
382const MooseArray<Number> &
384{
385 return _neighbor_data->dofValuesDuDotDotDu();
386}
387
388template <typename OutputType>
389void
391{
392 _element_data->prepareIC();
393}
394
395template <typename OutputType>
396void
398{
399 _element_data->setGeometry(Moose::Volume);
400 _element_data->computeValues();
401}
402
403template <typename OutputType>
404void
406{
407 _element_data->setGeometry(Moose::Face);
408 _element_data->computeValues();
409}
410
411template <typename OutputType>
412void
414{
415 _neighbor_data->setGeometry(Moose::Face);
416 _neighbor_data->computeValues();
417}
418
419template <typename OutputType>
420void
422{
423 _neighbor_data->setGeometry(Moose::Volume);
424 _neighbor_data->computeValues();
425}
426
427template <typename OutputType>
428void
430{
431 _lower_data->setGeometry(Moose::Volume);
432 _lower_data->computeValues();
433}
434
435template <typename OutputType>
436void
437MooseVariableFE<OutputType>::computeIncrementAtQps(const NumericVector<Number> & increment_vec)
438{
439 _element_data->computeIncrementAtQps(increment_vec);
440}
441
442template <typename OutputType>
443void
444MooseVariableFE<OutputType>::computeIncrementAtNode(const NumericVector<Number> & increment_vec)
445{
446 _element_data->computeIncrementAtNode(increment_vec);
447}
448
449template <typename OutputType>
450OutputType
452 const std::vector<std::vector<OutputShape>> & phi) const
453{
454 std::vector<dof_id_type> dof_indices;
455 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
456
457 OutputType value = 0;
458 if (isNodal())
459 {
460 mooseAssert(dof_indices.size() == phi.size(),
461 "The number of shapes does not match the number of dof indices on the elem");
462
463 for (unsigned int i = 0; i < dof_indices.size(); ++i)
464 {
465 // The zero index is because we only have one point that the phis are evaluated at
466 value += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
467 }
468 }
469 else
470 {
471 mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
472 value = (*this->_sys.currentSolution())(dof_indices[0]);
473 }
474
475 return value;
476}
477
478template <>
479RealEigenVector
481 const std::vector<std::vector<Real>> & phi) const
482{
483 std::vector<dof_id_type> dof_indices;
484 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
485
486 RealEigenVector value(_count);
487 if (isNodal())
488 {
489 for (unsigned int i = 0; i < dof_indices.size(); ++i)
490 for (unsigned int j = 0; j < _count; j++)
491 {
492 // The zero index is because we only have one point that the phis are evaluated at
493 value(j) += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i] + j);
494 }
495 }
496 else
497 {
498 mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
499 unsigned int n = 0;
500 for (unsigned int j = 0; j < _count; j++)
501 {
502 value(j) = (*this->_sys.currentSolution())(dof_indices[0] + n);
503 n += this->_dof_indices.size();
504 }
505 }
506
507 return value;
508}
510template <typename OutputType>
513 const Elem * elem,
514 const std::vector<std::vector<typename OutputTools<OutputType>::OutputShapeGradient>> &
515 grad_phi) const
516{
517 std::vector<dof_id_type> dof_indices;
518 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
519
521 if (isNodal())
523 for (unsigned int i = 0; i < dof_indices.size(); ++i)
524 {
525 // The zero index is because we only have one point that the phis are evaluated at
526 value += grad_phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
527 }
529 else
530 {
531 mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
532 value = 0.0;
534
535 return value;
536}
538template <>
539RealVectorArrayValue
541 const Elem * elem, const std::vector<std::vector<RealVectorValue>> & grad_phi) const
542{
543 std::vector<dof_id_type> dof_indices;
544 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
545
546 RealVectorArrayValue value(_count, LIBMESH_DIM);
547 if (isNodal())
549 for (unsigned int i = 0; i < dof_indices.size(); ++i)
550 for (unsigned int j = 0; j < _count; ++j)
551 for (const auto k : make_range(Moose::dim))
552 {
553 // The zero index is because we only have one point that the phis are evaluated at
554 value(j, k) += grad_phi[i][0](k) * (*this->_sys.currentSolution())(dof_indices[i] + j);
556 }
557 else
558 {
559 mooseAssert(dof_indices.size() == 1, "Wrong size for dof indices");
560 }
561
562 return value;
563}
564
565template <typename OutputType>
566const OutputType &
569 return _element_data->nodalValue(Moose::Current);
570}
571
572template <typename OutputType>
573const OutputType &
575{
576 return _neighbor_data->nodalValue(Moose::Current);
577}
579template <typename OutputType>
582{
583 return _element_data->nodalVectorTagValue(tag);
584}
586template <typename OutputType>
590 return _element_data->nodalMatrixTagValue(tag);
593template <typename OutputType>
594const OutputType &
596{
597 return _element_data->nodalValue(Moose::Old);
600template <typename OutputType>
601const OutputType &
604 return _neighbor_data->nodalValue(Moose::Old);
607template <typename OutputType>
608const OutputType &
610{
611 return _element_data->nodalValue(Moose::Older);
612}
613
614template <typename OutputType>
615const OutputType &
617{
618 return _neighbor_data->nodalValue(Moose::Older);
619}
620
621template <typename OutputType>
622const OutputType &
624{
625 return _element_data->nodalValue(Moose::PreviousNL);
626}
627
628template <typename OutputType>
629const OutputType &
631{
632 return _neighbor_data->nodalValue(Moose::PreviousNL);
633}
634
635template <typename OutputType>
636const OutputType &
638{
639 return _element_data->nodalValueDot();
640}
641
642template <typename OutputType>
643const OutputType &
645{
646 return _element_data->nodalValueDotDot();
647}
648
649template <typename OutputType>
650const OutputType &
652{
653 return _element_data->nodalValueDotOld();
654}
655
656template <typename OutputType>
657const OutputType &
659{
660 return _element_data->nodalValueDotDotOld();
661}
662
663template <typename OutputType>
664void
667 _element_data->computeNodalValues();
670template <typename OutputType>
671void
673{
674 _neighbor_data->computeNodalValues();
677template <typename OutputType>
678void
679MooseVariableFE<OutputType>::setNodalValue(const OutputType & value, unsigned int idx)
680{
681 _element_data->setNodalValue(value, idx);
682}
683
684template <typename OutputType>
685void
686MooseVariableFE<OutputType>::setDofValue(const DofValue & value, unsigned int index)
687{
688 _element_data->setDofValue(value, index);
689}
690
691template <typename OutputType>
692void
694{
695 _element_data->setDofValues(values);
696}
697
698template <typename OutputType>
699void
702 _lower_data->setDofValues(values);
703}
704
705template <typename OutputType>
706void
707MooseVariableFE<OutputType>::insertNodalValue(NumericVector<Number> & residual, const DofValue & v)
709 _element_data->insertNodalValue(residual, v);
710}
711
712template <typename OutputType>
715{
716 return _element_data->secondPhi();
717}
718
719template <typename OutputType>
722{
723 return _element_data->curlPhi();
724}
725
726template <typename OutputType>
729{
730 return _element_data->divPhi();
731}
732
733template <typename OutputType>
736{
737 return _element_data->secondPhiFace();
738}
739
740template <typename OutputType>
743{
744 return _element_data->curlPhiFace();
745}
746
747template <typename OutputType>
750{
751 return _element_data->divPhiFace();
753
754template <typename OutputType>
758 return _neighbor_data->secondPhi();
761template <typename OutputType>
764{
765 return _neighbor_data->curlPhi();
766}
768template <typename OutputType>
772 return _neighbor_data->divPhi();
774
775template <typename OutputType>
778{
779 return _neighbor_data->secondPhiFace();
780}
782template <typename OutputType>
785{
786 return _neighbor_data->curlPhiFace();
787}
788
789template <typename OutputType>
792{
793 return _neighbor_data->divPhiFace();
794}
796template <typename OutputType>
797bool
799{
800 return _element_data->usesSecondPhi();
801}
802
803template <typename OutputType>
804bool
806{
807 return _neighbor_data->usesSecondPhi();
808}
809
810template <typename OutputType>
811bool
813{
814 return _element_data->computingCurl();
815}
816
817template <typename OutputType>
818bool
820{
821 return _element_data->computingDiv();
822}
823
824template <typename OutputType>
825bool
827{
828 return _element_data->isNodalDefined();
829}
830
831template <typename OutputType>
832bool
834{
835 return _neighbor_data->isNodalDefined();
836}
837
838template <typename OutputType>
839unsigned int
841{
842 unsigned int state = 0;
843 state = std::max(state, _element_data->oldestSolutionStateRequested());
844 state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
845 state = std::max(state, _lower_data->oldestSolutionStateRequested());
846 return state;
847}
848
849template <typename OutputType>
850void
852{
853 _element_data->clearDofIndices();
854 _neighbor_data->clearDofIndices();
855 _lower_data->clearDofIndices();
856}
857
858template <typename OutputType>
860MooseVariableFE<OutputType>::evaluate(const NodeArg & node_arg, const StateArg & state) const
861{
862 mooseAssert(node_arg.node, "Must have a node");
863 const Node & node = *node_arg.node;
864 mooseAssert(node.n_dofs(this->_sys.number(), this->number()),
865 "Our variable must have dofs on the requested node");
866 const auto & soln = this->getSolution(state);
867 if constexpr (std::is_same<OutputType, Real>::value)
868 {
869 const auto dof_number = node.dof_number(this->_sys.number(), this->number(), 0);
870 ValueType ret = soln(dof_number);
871 if (Moose::doDerivatives(_subproblem, _sys))
872 Moose::derivInsert(ret.derivatives(), dof_number, 1);
873 return ret;
874 }
875 else if constexpr (std::is_same<OutputType, RealVectorValue>::value)
876 {
877 ValueType ret;
878 const auto do_derivatives = Moose::doDerivatives(_subproblem, _sys);
879 for (const auto d : make_range(this->_mesh.dimension()))
880 {
881 const auto dof_number = node.dof_number(this->_sys.number(), this->number(), d);
882 auto & component = ret(d);
883 component = soln(dof_number);
884 if (do_derivatives)
885 Moose::derivInsert(component.derivatives(), dof_number, 1);
886 }
887 return ret;
888 }
889 else
890 mooseError("RealEigenVector not yet supported for functors");
891}
892
893namespace
894{
895template <typename OutputType>
896struct FEBaseHelper
897{
898 typedef FEBase type;
899};
900
901template <>
902struct FEBaseHelper<RealVectorValue>
903{
904 typedef FEVectorBase type;
905};
906}
907
908template <typename OutputType>
909template <typename Shapes, typename Solution, typename GradShapes, typename GradSolution>
910void
912 const unsigned int n_qp,
913 const StateArg & state,
914 const Shapes & phi,
915 Solution & local_soln,
916 const GradShapes & grad_phi,
917 GradSolution & grad_local_soln,
918 Solution & dot_local_soln,
919 GradSolution & grad_dot_local_soln) const
920{
921 std::vector<dof_id_type> dof_indices;
922 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
923 std::vector<ADReal> dof_values;
924 std::vector<ADReal> dof_values_dot;
925 dof_values.reserve(dof_indices.size());
926
927 const bool computing_dot = _time_integrator && _time_integrator->dt();
928 if (computing_dot)
929 dof_values_dot.reserve(dof_indices.size());
930
931 const bool do_derivatives = Moose::doDerivatives(_subproblem, _sys);
932 const auto & global_soln = getSolution(state);
933 for (const auto dof_index : dof_indices)
934 {
935 dof_values.push_back(ADReal(global_soln(dof_index)));
936 if (do_derivatives && state.state == 0)
937 Moose::derivInsert(dof_values.back().derivatives(), dof_index, 1.);
938 if (computing_dot)
939 {
940 if (_var_kind == Moose::VAR_SOLVER)
941 {
942 dof_values_dot.push_back(dof_values.back());
943 _time_integrator->computeADTimeDerivatives(
944 dof_values_dot.back(), dof_index, _ad_real_dummy);
945 }
946 else
947 dof_values_dot.push_back((*this->_sys.solutionUDot())(dof_index));
948 }
949 }
950
951 local_soln.resize(n_qp);
952 grad_local_soln.resize(n_qp);
953 if (computing_dot)
954 {
955 dot_local_soln.resize(n_qp);
956 grad_dot_local_soln.resize(n_qp);
957 }
958
959 for (const auto qp : make_range(n_qp))
960 {
961 local_soln[qp] = 0;
962 grad_local_soln[qp] = 0;
963 if (computing_dot)
964 {
965 dot_local_soln[qp] = 0;
966 grad_dot_local_soln[qp] = GradientType{};
967 }
968 for (const auto i : index_range(dof_indices))
969 {
970 local_soln[qp] += dof_values[i] * phi[i][qp];
971 grad_local_soln[qp] += dof_values[i] * grad_phi[i][qp];
972 if (computing_dot)
973 {
974 dot_local_soln[qp] += dof_values_dot[i] * phi[i][qp];
975 grad_dot_local_soln[qp] += dof_values_dot[i] * grad_phi[i][qp];
976 }
977 }
978 }
979}
980
981template <typename OutputType>
982void
984 const StateArg & state,
985 const bool cache_eligible) const
986{
987 mooseAssert(this->hasBlocks(elem_qp.elem->subdomain_id()),
988 "Variable " + this->name() + " doesn't exist on block " +
989 std::to_string(elem_qp.elem->subdomain_id()));
990
991 const Elem * const elem = elem_qp.elem;
992 if (!cache_eligible || (elem != _current_elem_qp_functor_elem))
993 {
994 const QBase * const qrule_template = elem_qp.qrule;
995
996 using FEBaseType = typename FEBaseHelper<OutputType>::type;
997 std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->dim(), _fe_type));
998 auto qrule = qrule_template->clone();
999
1000 const auto & phi = fe->get_phi();
1001 const auto & dphi = fe->get_dphi();
1002 fe->attach_quadrature_rule(qrule.get());
1003 fe->reinit(elem);
1004
1005 computeSolution(elem,
1006 qrule->n_points(),
1007 state,
1008 phi,
1009 _current_elem_qp_functor_sln,
1010 dphi,
1011 _current_elem_qp_functor_gradient,
1012 _current_elem_qp_functor_dot,
1013 _current_elem_qp_functor_grad_dot);
1014 }
1015 if (cache_eligible)
1016 _current_elem_qp_functor_elem = elem;
1017 else
1018 // These evaluations are not eligible for caching, e.g. maybe this is a single point quadrature
1019 // rule evaluation at an arbitrary point and we don't want those evaluations to potentially be
1020 // re-used when this function is called with a standard quadrature rule or a different point
1021 _current_elem_qp_functor_elem = nullptr;
1022}
1023
1024template <>
1025void
1026MooseVariableFE<RealEigenVector>::evaluateOnElement(const ElemQpArg &, const StateArg &, bool) const
1027{
1028 mooseError("evaluate not implemented for array variables");
1029}
1030
1031template <typename OutputType>
1033MooseVariableFE<OutputType>::evaluate(const ElemQpArg & elem_qp, const StateArg & state) const
1034{
1035 evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1036 const auto qp = elem_qp.qp;
1037 mooseAssert(qp < _current_elem_qp_functor_sln.size(),
1038 "The requested " << qp << " is outside our solution size");
1039 return _current_elem_qp_functor_sln[qp];
1040}
1041
1042template <typename OutputType>
1044MooseVariableFE<OutputType>::evaluate(const ElemArg & elem_arg, const StateArg & state) const
1045{
1046 const libMesh::QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1047 // We can use whatever we want for the point argument since it won't be used
1048 const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1049 evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1050 return _current_elem_qp_functor_sln[0];
1051}
1052
1053template <typename OutputType>
1056 const StateArg & state,
1057 const std::vector<ValueType> & cache_data) const
1058{
1059 const libMesh::QMonomial qrule(face_arg.fi->elem().dim() - 1, CONSTANT);
1060 auto side_evaluate =
1061 [this, &qrule, &state, &cache_data](const Elem * const elem, const unsigned int side)
1062 {
1063 // We can use whatever we want for the point argument since it won't be used
1064 const ElemSideQpArg elem_side_qp_arg{elem, side, /*qp=*/0, &qrule, Point(0, 0, 0)};
1065 evaluateOnElementSide(elem_side_qp_arg, state, /*cache_eligible=*/false);
1066 return cache_data[0];
1067 };
1068
1069 const auto continuity = this->getContinuity();
1070 bool on_elem;
1071 bool on_neighbor;
1072 if (!face_arg.face_side)
1073 {
1074 on_elem = this->hasBlocks(face_arg.fi->elemPtr()->subdomain_id());
1075 on_neighbor =
1076 face_arg.fi->neighborPtr() && this->hasBlocks(face_arg.fi->neighborPtr()->subdomain_id());
1077 }
1078 else
1079 {
1080 on_elem = face_arg.face_side == face_arg.fi->elemPtr();
1081 on_neighbor = face_arg.face_side == face_arg.fi->neighborPtr();
1082 }
1083
1084 // Only do multiple evaluations if we are not continuous and we are on an internal face
1085 if ((continuity != C_ZERO && continuity != C_ONE) && on_elem && on_neighbor)
1086 return (side_evaluate(face_arg.fi->elemPtr(), face_arg.fi->elemSideID()) +
1087 side_evaluate(face_arg.fi->neighborPtr(), face_arg.fi->neighborSideID())) /
1088 2;
1089 else if (on_elem)
1090 return side_evaluate(face_arg.fi->elemPtr(), face_arg.fi->elemSideID());
1091 else if (on_neighbor)
1092 return side_evaluate(face_arg.fi->neighborPtr(), face_arg.fi->neighborSideID());
1093 else
1094 mooseError(
1095 "Attempted to evaluate a moose finite element variable on a face where it is not defined");
1096}
1097
1098template <typename OutputType>
1100MooseVariableFE<OutputType>::evaluate(const FaceArg & face_arg, const StateArg & state) const
1101{
1102 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1103}
1104
1105template <typename OutputType>
1108 const StateArg & state) const
1109{
1110 mooseAssert(elem_point_arg.elem, "We need an Elem");
1111 const Elem & elem = *elem_point_arg.elem;
1112 const auto dim = elem.dim();
1113 ArbitraryQuadrature qrule(dim);
1114 const std::vector<Point> ref_point = {FEMap::inverse_map(dim, &elem, elem_point_arg.point)};
1115 qrule.setPoints(ref_point);
1116 // We can use whatever we want for the point argument since it won't be used
1117 const ElemQpArg elem_qp_arg{elem_point_arg.elem, /*qp=*/0, &qrule, elem_point_arg.point};
1118 evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1119 return _current_elem_qp_functor_sln[0];
1120}
1121
1122template <typename OutputType>
1125 const StateArg & state) const
1126{
1127 evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1128 const auto qp = elem_qp.qp;
1129 mooseAssert(qp < _current_elem_qp_functor_gradient.size(),
1130 "The requested " << qp << " is outside our gradient size");
1131 return _current_elem_qp_functor_gradient[qp];
1132}
1133
1134template <typename OutputType>
1137 const StateArg & state) const
1138{
1139 const libMesh::QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1140 // We can use whatever we want for the point argument since it won't be used
1141 const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1142 evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1143 return _current_elem_qp_functor_gradient[0];
1144}
1145
1146template <typename OutputType>
1149{
1150 mooseAssert(_time_integrator,
1151 "A time derivative is being requested but we do not have a time integrator so we'll "
1152 "have no idea how to compute it");
1153 mooseAssert(_time_integrator->dt(),
1154 "A time derivative is being requested but the time integrator wants to perform a 0s "
1155 "time step");
1156 evaluateOnElement(elem_qp, state, /*query_cache=*/true);
1157 const auto qp = elem_qp.qp;
1158 mooseAssert(qp < _current_elem_qp_functor_dot.size(),
1159 "The requested " << qp << " is outside our dot size");
1160 return _current_elem_qp_functor_dot[qp];
1161}
1162
1163template <typename OutputType>
1165MooseVariableFE<OutputType>::evaluateDot(const ElemArg & elem_arg, const StateArg & state) const
1166{
1167 mooseAssert(_time_integrator,
1168 "A time derivative is being requested but we do not have a time integrator so we'll "
1169 "have no idea how to compute it");
1170 mooseAssert(_time_integrator->dt(),
1171 "A time derivative is being requested but the time integrator wants to perform a 0s "
1172 "time step");
1173 const libMesh::QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1174 // We can use whatever we want for the point argument since it won't be used
1175 const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1176 evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1177 return _current_elem_qp_functor_dot[0];
1178}
1179
1180template <typename OutputType>
1183{
1184 mooseAssert(_time_integrator,
1185 "A time derivative is being requested but we do not have a time integrator so we'll "
1186 "have no idea how to compute it");
1187 mooseAssert(_time_integrator->dt(),
1188 "A time derivative is being requested but the time integrator wants to perform a 0s "
1189 "time step");
1190 const libMesh::QMonomial qrule(elem_arg.elem->dim(), CONSTANT);
1191 // We can use whatever we want for the point argument since it won't be used
1192 const ElemQpArg elem_qp_arg{elem_arg.elem, /*qp=*/0, &qrule, Point(0, 0, 0)};
1193 evaluateOnElement(elem_qp_arg, state, /*cache_eligible=*/false);
1194 return _current_elem_qp_functor_grad_dot[0];
1195}
1196
1197template <typename OutputType>
1198void
1200 const StateArg & state,
1201 const bool cache_eligible) const
1202{
1203 mooseAssert(this->hasBlocks(elem_side_qp.elem->subdomain_id()),
1204 "Variable " + this->name() + " doesn't exist on block " +
1205 std::to_string(elem_side_qp.elem->subdomain_id()));
1206
1207 const Elem * const elem = elem_side_qp.elem;
1208 const auto side = elem_side_qp.side;
1209 if (!cache_eligible || elem != _current_elem_side_qp_functor_elem_side.first ||
1210 side != _current_elem_side_qp_functor_elem_side.second)
1211 {
1212 const QBase * const qrule_template = elem_side_qp.qrule;
1213
1214 using FEBaseType = typename FEBaseHelper<OutputType>::type;
1215 std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->dim(), _fe_type));
1216 auto qrule = qrule_template->clone();
1217
1218 const auto & phi = fe->get_phi();
1219 const auto & dphi = fe->get_dphi();
1220 fe->attach_quadrature_rule(qrule.get());
1221 fe->reinit(elem, side);
1222
1223 computeSolution(elem,
1224 qrule->n_points(),
1225 state,
1226 phi,
1227 _current_elem_side_qp_functor_sln,
1228 dphi,
1229 _current_elem_side_qp_functor_gradient,
1230 _current_elem_side_qp_functor_dot,
1231 _current_elem_side_qp_functor_grad_dot);
1232 }
1233 if (cache_eligible)
1234 _current_elem_side_qp_functor_elem_side = std::make_pair(elem, side);
1235 else
1236 // These evaluations are not eligible for caching, e.g. maybe this is a single point quadrature
1237 // rule evaluation at an arbitrary point and we don't want those evaluations to potentially be
1238 // re-used when this function is called with a standard quadrature rule or a different point
1239 _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1240}
1241
1242template <>
1243void
1245 const StateArg &,
1246 bool) const
1247{
1248 mooseError("evaluate not implemented for array variables");
1249}
1250
1251template <typename OutputType>
1254 const StateArg & state) const
1255{
1256 evaluateOnElementSide(elem_side_qp, state, true);
1257 const auto qp = elem_side_qp.qp;
1258 mooseAssert(qp < _current_elem_side_qp_functor_sln.size(),
1259 "The requested " << qp << " is outside our solution size");
1260 return _current_elem_side_qp_functor_sln[qp];
1261}
1262
1263template <typename OutputType>
1266 const StateArg & state) const
1267{
1268 evaluateOnElementSide(elem_side_qp, state, true);
1269 const auto qp = elem_side_qp.qp;
1270 mooseAssert(qp < _current_elem_side_qp_functor_gradient.size(),
1271 "The requested " << qp << " is outside our gradient size");
1272 return _current_elem_side_qp_functor_gradient[qp];
1273}
1274
1275template <typename OutputType>
1278 const StateArg & state) const
1279{
1280 mooseAssert(_time_integrator && _time_integrator->dt(),
1281 "A time derivative is being requested but we do not have a time integrator so we'll "
1282 "have no idea how to compute it");
1283 evaluateOnElementSide(elem_side_qp, state, true);
1284 const auto qp = elem_side_qp.qp;
1285 mooseAssert(qp < _current_elem_side_qp_functor_dot.size(),
1286 "The requested " << qp << " is outside our dot size");
1287 return _current_elem_side_qp_functor_dot[qp];
1288}
1289
1290template <typename OutputType>
1292MooseVariableFE<OutputType>::evaluateDot(const FaceArg & face_arg, const StateArg & state) const
1293{
1294 mooseAssert(_time_integrator && _time_integrator->dt(),
1295 "A time derivative is being requested but we do not have a time integrator so we'll "
1296 "have no idea how to compute it");
1297 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_dot);
1298}
1299
1300template <>
1302MooseVariableFE<RealEigenVector>::evaluate(const ElemQpArg &, const StateArg &) const
1303{
1304 mooseError(
1305 "MooseVariableFE::evaluate(ElemQpArg &, const StateArg &) overload not implemented for "
1306 "array variables");
1307}
1308
1309template <>
1311MooseVariableFE<RealEigenVector>::evaluate(const ElemSideQpArg &, const StateArg &) const
1312{
1313 mooseError("MooseVariableFE::evaluate(ElemSideQpArg &, const StateArg &) overload not "
1314 "implemented for array variables");
1315}
1316
1317template <>
1319MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemQpArg &, const StateArg &) const
1320{
1321 mooseError("MooseVariableFE::evaluateGradient(ElemQpArg &, const StateArg &) overload not "
1322 "implemented for array variables");
1323}
1324
1325template <>
1327MooseVariableFE<RealEigenVector>::evaluateGradient(const ElemSideQpArg &, const StateArg &) const
1328{
1329 mooseError("MooseVariableFE::evaluateGradient(ElemSideQpArg &, const StateArg &) overload not "
1330 "implemented for array variables");
1331}
1332
1333template <>
1335MooseVariableFE<RealEigenVector>::evaluateDot(const ElemQpArg &, const StateArg &) const
1336{
1337 mooseError("MooseVariableFE::evaluateDot(ElemQpArg &, const StateArg &) overload not "
1338 "implemented for array variables");
1339}
1340
1341template <>
1343MooseVariableFE<RealEigenVector>::evaluateDot(const ElemSideQpArg &, const StateArg &) const
1344{
1345 mooseError("MooseVariableFE::evaluateDot(ElemSideQpArg &, const StateArg &) overload not "
1346 "implemented for array variables");
1347}
1348
1349template <typename OutputType>
1350void
1352{
1353 _current_elem_qp_functor_elem = nullptr;
1354 _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1356}
1357
1358template <typename OutputType>
1359void
1361{
1362 _current_elem_qp_functor_elem = nullptr;
1363 _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1365}
1366
1367template <typename OutputType>
1368void
1370{
1371 _current_elem_qp_functor_elem = nullptr;
1372 _current_elem_side_qp_functor_elem_side = std::make_pair(nullptr, libMesh::invalid_uint);
1374}
1375
1376template <typename OutputType>
1377void
1379{
1380 _element_data->sizeMatrixTagData();
1381 _neighbor_data->sizeMatrixTagData();
1382 _lower_data->sizeMatrixTagData();
1383}
1384
1385template class MooseVariableFE<Real>;
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition MooseError.h:363
unsigned int TagID
Definition MooseTypes.h:238
std::array< Real, 2 > values
Definition MortarUtils.C:52
unsigned int dim
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 *const & elem() const
Return the current element.
Definition Assembly.h:405
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor.
Definition Assembly.h:509
const Node *const & node() const
Returns the reference to the node.
Definition Assembly.h:536
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
Definition Assembly.h:313
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
Definition Assembly.h:226
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
Definition Assembly.h:542
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:461
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition Assembly.h:467
unsigned int neighborSideID() const
Definition FaceInfo.h:114
const Elem & elem() const
Definition FaceInfo.h:85
const Elem * neighborPtr() const
Definition FaceInfo.h:88
unsigned int elemSideID() const
Definition FaceInfo.h:113
const Elem * elemPtr() const
Definition FaceInfo.h:86
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
virtual void meshChanged()
Called on this object when the mesh changes.
forward declarations
Definition MooseArray.h:18
THREAD_ID _tid
Thread ID.
Assembly & _assembly
Assembly data.
SystemBase & _sys
System this variable is part of.
Class for stuff related to variables.
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
const OutputType & nodalValueOldNeighbor() const
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
OutputType getValue(const Elem *elem, const std::vector< std::vector< OutputShape > > &phi) const
Compute the variable value at a point on an element.
GradientType evaluateGradient(const ElemQpArg &elem_qp, const StateArg &state) const override
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the current local DOF values to the input vector.
const DofValues & dofValuesDotNeighbor() const override
virtual void residualSetup() override
Gets called just before the residual is computed and before this object is asked to do its job.
std::unique_ptr< MooseVariableData< OutputType > > _lower_data
Holder for all the data associated with the lower dimeensional element.
OutputTools< OutputType >::OutputGradient getGradient(const Elem *elem, const std::vector< std::vector< typename OutputTools< OutputType >::OutputShapeGradient > > &grad_phi) const
Compute the variable gradient value at a point on an element.
void reinitNode() override
ValueType faceEvaluate(const FaceArg &, const StateArg &, const std::vector< ValueType > &cache_data) const
A common method that both evaluate(FaceArg) and evaluateDot(FaceArg) can call.
const FieldVariablePhiCurl & curlPhiNeighbor() const
static InputParameters validParams()
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
void evaluateOnElement(const ElemQpArg &elem_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_qp argument.
const DofValues & dofValuesDot() const override
void prepareAux() override
const DofValues & dofValues() const override
dof values getters
const DofValues & dofValuesPreviousNLNeighbor() const override
const OutputType & nodalValuePreviousNL() const
const OutputType & nodalValuePreviousNLNeighbor() const
DofValue getNodalValue(const Node &node) const
Get the value of this variable at given node.
void reinitAux() override
void computeSolution(const Elem *elem, unsigned int n_qp, const StateArg &state, const Shapes &phi, Solution &local_soln, const GradShapes &grad_phi, GradSolution &grad_local_soln, Solution &dot_local_soln, GradSolution &grad_dot_local_soln) const
Compute the solution, gradient, time derivative, and gradient of the time derivative with provided sh...
void computeIncrementAtNode(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change at the current node based on increment_vec.
virtual void computeNodalNeighborValues() override
Compute nodal values of this variable in the neighbor.
void prepare() override
Prepare the elemental degrees of freedom.
const OutputType & nodalValueOld() const
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes) override
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
const FieldVariablePhiDivergence & divPhiFace() const
const DofValues & dofValuesOlderNeighbor() const override
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old,...
bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivative on a neighbor.
const OutputType & nodalValueDotDot() const
void reinitAuxNeighbor() override
const OutputType & nodalValue() const
Methods for retrieving values of variables at the nodes.
const FieldVariablePhiCurl & curlPhi() const override final
Curl of the shape functions.
bool isNodalNeighborDefined() const
DofValue getNodalValueOlder(const Node &node) const
Get the t-2 value of this variable at given node.
bool computingDiv() const override final
Whether or not this variable is computing the divergence.
bool computingCurl() const override final
Whether or not this variable is computing the curl.
const DofValues & dofValuesDotOldNeighbor() const override
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
MooseVariableFE(const InputParameters &parameters)
virtual void setLowerDofValues(const DenseVector< DofValue > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points.
ValueType evaluate(const ElemQpArg &elem_qp, const StateArg &state) const override final
void prepareNeighbor() override
Prepare the neighbor element degrees of freedom.
const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on an element face.
void evaluateOnElementSide(const ElemSideQpArg &elem_side_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_side_qp argument.
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
const FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable's elemental shape functions.
const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
void prepareLowerD() override
Prepare a lower dimensional element's degrees of freedom.
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
const DofValues & nodalVectorTagValue(TagID tag) const override
const DofValues & dofValuesDotDotNeighbor() const override
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
const FieldVariablePhiCurl & curlPhiFaceNeighbor() const
const DofValues & dofValue() const
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
typename MooseVariableField< OutputType >::FieldVariablePhiCurl FieldVariablePhiCurl
GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final
Evaluate the functor gradient-dot with a given element.
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
DofValue getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
const OutputType & nodalValueOlder() const
const FieldVariablePhiDivergence & divPhiNeighbor() const
const OutputType & nodalValueNeighbor() const
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
virtual void prepareIC() override
Prepare the initial condition.
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Set the current local DOF values to the input vector.
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
const OutputType & nodalValueDotDotOld() const
const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
const FieldVariablePhiSecond & secondPhiNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
virtual void setDofValues(const DenseVector< DofValue > &values) override
Set local DOF values and evaluate the values on quadrature points.
virtual void setDofValue(const DofValue &value, unsigned int index) override
Degree of freedom value setters.
virtual void computeLowerDValues() override
compute values at quadrature points on the lower dimensional element
DofValue getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
void reinitNodes(const std::vector< dof_id_type > &nodes) override
const DofValues & dofValuesDotDotOld() const override
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const DofValue &v)
Write a nodal value to the passed-in solution vector.
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
std::unique_ptr< MooseVariableData< OutputType > > _element_data
Holder for all the data associated with the "main" element.
DofValue getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
virtual void meshChanged() override
Called on this object when the mesh changes.
const DofValues & dofValuesDotOld() const override
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
const DofValues & dofValuesNeighbor() const override
void clearAllDofIndices() final
const DofValues & dofValuesDotDotOldNeighbor() const override
virtual void setNodalValue(const OutputType &value, unsigned int idx=0) override
virtual void computeNodalValues() override
Compute nodal values of this variable.
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
const OutputType & nodalValueOlderNeighbor() const
const DofValues & nodalMatrixTagValue(TagID tag) const override
virtual void insertLower(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values for a lower-dimensional element into the provide...
void addSolutionNeighbor(const DenseVector< libMesh::Number > &v)
Add passed in local neighbor DOF values onto the current solution.
void clearDofIndices() override
Clear out the dof indices.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
const DofValues & dofValuesOldNeighbor() const override
std::unique_ptr< MooseVariableData< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
const DofValues & dofValuesOlder() const override
const OutputType & nodalValueDot() const
const DofValues & dofValuesPreviousNL() const override
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
const DofValues & dofValuesOld() const override
const OutputType & nodalValueDotOld() const
const DofValues & dofValuesDotDot() const override
const FieldVariablePhiCurl & curlPhiFace() const
virtual void clearDofIndices()=0
Clear out the dof indices.
Class for stuff related to variables.
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
typename MooseVariableDataBase< OutputType >::DofValue DofValue
static InputParameters validParams()
typename MooseVariableDataBase< OutputType >::DofValues DofValues
virtual void residualSetup() override
Gets called just before the residual is computed and before this object is asked to do its job.
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,...
virtual unsigned short dim() const=0
subdomain_id_type subdomain_id() const
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
Definition ADUtils.C:83
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition Moose.h:175
@ Current
Definition MooseTypes.h:263
@ PreviousNL
Definition MooseTypes.h:266
@ VAR_SOLVER
Definition MooseTypes.h:770
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
Definition ADReal.h:21
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
FEGenericBase< RealGradient > FEVectorBase
const unsigned int invalid_uint
VectorValue< Real > RealVectorValue
Definition SubProblem.h:34
A structure that is used to evaluate Moose functors logically at an element/cell center.
const libMesh::Elem * elem
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
const libMesh::Elem * elem
Argument for requesting functor evaluation at a quadrature point location in an element.
const libMesh::Elem * elem
The element.
const libMesh::QBase * qrule
The quadrature rule.
unsigned int qp
The quadrature point index.
Argument for requesting functor evaluation at quadrature point locations on an element side.
const libMesh::Elem * elem
The element.
unsigned int qp
The quadrature point index.
unsigned int side
The local side index.
const libMesh::QBase * qrule
The quadrature rule.
A structure defining a "face" evaluation calling argument for Moose functors.
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
const FaceInfo * fi
a face information object which defines our location in space
const libMesh::Node * node
The node which defines our location in space.
State argument for evaluating functors.
unsigned int state
The state.