19#include "libmesh/quadrature_monomial.h"
26 params.addClassDescription(
27 "Represents standard field variables, e.g. Lagrange, Hermite, or non-constant Monomials");
36 params.addClassDescription(
37 "Represents vector field variables, e.g. Vector Lagrange, Nedelec or Raviart-Thomas");
46 params.addClassDescription(
47 "Used for grouping standard field variables with the same finite element family and order");
51template <
typename OutputType>
55 _element_data = std::make_unique<MooseVariableData<OutputType>>(*
this,
73 std::make_unique<MooseVariableData<OutputType>>(*
this,
83template <
typename OutputType>
90template <
typename OutputType>
94 _element_data->prepare();
97template <
typename OutputType>
101 _neighbor_data->prepare();
104template <
typename OutputType>
108 _lower_data->prepare();
111template <
typename OutputType>
115 _element_data->prepareAux();
116 _neighbor_data->prepareAux();
117 _lower_data->prepareAux();
120template <
typename OutputType>
124 _element_data->reinitNode();
127template <
typename OutputType>
131 _element_data->reinitAux();
134template <
typename OutputType>
138 _neighbor_data->reinitAux();
141template <
typename OutputType>
145 _element_data->reinitNodes(nodes);
148template <
typename OutputType>
152 _neighbor_data->reinitNodes(nodes);
155template <
typename OutputType>
158 std::vector<dof_id_type> & dof_indices)
const
160 _element_data->getDofIndices(elem, dof_indices);
163template <
typename OutputType>
170template <
typename OutputType>
174 return _element_data->getNodalValue(node,
Moose::Old);
177template <
typename OutputType>
181 return _element_data->getNodalValue(node,
Moose::Older);
184template <
typename OutputType>
188 return _element_data->getElementalValue(elem,
Moose::Current, idx);
191template <
typename OutputType>
195 return _element_data->getElementalValue(elem,
Moose::Old, idx);
198template <
typename OutputType>
202 return _element_data->getElementalValue(elem,
Moose::Older, idx);
205template <
typename OutputType>
209 _element_data->insert(vector);
212template <
typename OutputType>
216 _lower_data->insert(vector);
219template <
typename OutputType>
223 _element_data->add(vector);
226template <
typename OutputType>
230 _element_data->addSolution(this->_sys.solution(), v);
233template <
typename OutputType>
237 _neighbor_data->addSolution(this->_sys.solution(), v);
240template <
typename OutputType>
248template <
typename OutputType>
252 return _element_data->dofValues();
255template <
typename OutputType>
259 return _element_data->dofValuesOld();
262template <
typename OutputType>
266 return _element_data->dofValuesOlder();
269template <
typename OutputType>
273 return _element_data->dofValuesPreviousNL();
276template <
typename OutputType>
280 return _neighbor_data->dofValues();
283template <
typename OutputType>
287 return _neighbor_data->dofValuesOld();
290template <
typename OutputType>
294 return _neighbor_data->dofValuesOlder();
297template <
typename OutputType>
301 return _neighbor_data->dofValuesPreviousNL();
304template <
typename OutputType>
308 return _element_data->dofValuesDot();
311template <
typename OutputType>
315 return _element_data->dofValuesDotDot();
318template <
typename OutputType>
322 return _element_data->dofValuesDotOld();
325template <
typename OutputType>
329 return _element_data->dofValuesDotDotOld();
332template <
typename OutputType>
336 return _neighbor_data->dofValuesDot();
339template <
typename OutputType>
343 return _neighbor_data->dofValuesDotDot();
346template <
typename OutputType>
350 return _neighbor_data->dofValuesDotOld();
353template <
typename OutputType>
357 return _neighbor_data->dofValuesDotDotOld();
360template <
typename OutputType>
364 return _element_data->dofValuesDuDotDu();
367template <
typename OutputType>
371 return _element_data->dofValuesDuDotDotDu();
374template <
typename OutputType>
378 return _neighbor_data->dofValuesDuDotDu();
381template <
typename OutputType>
385 return _neighbor_data->dofValuesDuDotDotDu();
388template <
typename OutputType>
392 _element_data->prepareIC();
395template <
typename OutputType>
400 _element_data->computeValues();
403template <
typename OutputType>
408 _element_data->computeValues();
411template <
typename OutputType>
416 _neighbor_data->computeValues();
419template <
typename OutputType>
424 _neighbor_data->computeValues();
427template <
typename OutputType>
432 _lower_data->computeValues();
435template <
typename OutputType>
439 _element_data->computeIncrementAtQps(increment_vec);
442template <
typename OutputType>
446 _element_data->computeIncrementAtNode(increment_vec);
449template <
typename OutputType>
452 const std::vector<std::vector<OutputShape>> & phi)
const
454 std::vector<dof_id_type> dof_indices;
455 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
457 OutputType value = 0;
460 mooseAssert(dof_indices.size() == phi.size(),
461 "The number of shapes does not match the number of dof indices on the elem");
463 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
466 value += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
471 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
472 value = (*this->_sys.currentSolution())(dof_indices[0]);
481 const std::vector<std::vector<Real>> & phi)
const
483 std::vector<dof_id_type> dof_indices;
484 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
486 RealEigenVector value(_count);
489 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
490 for (
unsigned int j = 0; j < _count; j++)
493 value(j) += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i] + j);
498 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
500 for (
unsigned int j = 0; j < _count; j++)
502 value(j) = (*this->_sys.currentSolution())(dof_indices[0] + n);
503 n += this->_dof_indices.size();
510template <
typename OutputType>
517 std::vector<dof_id_type> dof_indices;
518 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
523 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
526 value += grad_phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
531 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
541 const Elem * elem,
const std::vector<std::vector<RealVectorValue>> & grad_phi)
const
543 std::vector<dof_id_type> dof_indices;
544 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
546 RealVectorArrayValue value(_count, LIBMESH_DIM);
549 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
550 for (
unsigned int j = 0; j < _count; ++j)
554 value(j, k) += grad_phi[i][0](k) * (*this->_sys.currentSolution())(dof_indices[i] + j);
559 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
565template <
typename OutputType>
572template <
typename OutputType>
579template <
typename OutputType>
583 return _element_data->nodalVectorTagValue(tag);
586template <
typename OutputType>
590 return _element_data->nodalMatrixTagValue(tag);
593template <
typename OutputType>
600template <
typename OutputType>
607template <
typename OutputType>
614template <
typename OutputType>
621template <
typename OutputType>
628template <
typename OutputType>
635template <
typename OutputType>
639 return _element_data->nodalValueDot();
642template <
typename OutputType>
646 return _element_data->nodalValueDotDot();
649template <
typename OutputType>
653 return _element_data->nodalValueDotOld();
656template <
typename OutputType>
660 return _element_data->nodalValueDotDotOld();
663template <
typename OutputType>
667 _element_data->computeNodalValues();
670template <
typename OutputType>
674 _neighbor_data->computeNodalValues();
677template <
typename OutputType>
681 _element_data->setNodalValue(value, idx);
684template <
typename OutputType>
688 _element_data->setDofValue(value, index);
691template <
typename OutputType>
695 _element_data->setDofValues(
values);
698template <
typename OutputType>
702 _lower_data->setDofValues(
values);
705template <
typename OutputType>
709 _element_data->insertNodalValue(residual, v);
712template <
typename OutputType>
716 return _element_data->secondPhi();
719template <
typename OutputType>
723 return _element_data->curlPhi();
726template <
typename OutputType>
730 return _element_data->divPhi();
733template <
typename OutputType>
737 return _element_data->secondPhiFace();
740template <
typename OutputType>
744 return _element_data->curlPhiFace();
747template <
typename OutputType>
751 return _element_data->divPhiFace();
754template <
typename OutputType>
758 return _neighbor_data->secondPhi();
761template <
typename OutputType>
765 return _neighbor_data->curlPhi();
768template <
typename OutputType>
772 return _neighbor_data->divPhi();
775template <
typename OutputType>
779 return _neighbor_data->secondPhiFace();
782template <
typename OutputType>
786 return _neighbor_data->curlPhiFace();
789template <
typename OutputType>
793 return _neighbor_data->divPhiFace();
796template <
typename OutputType>
800 return _element_data->usesSecondPhi();
803template <
typename OutputType>
807 return _neighbor_data->usesSecondPhi();
810template <
typename OutputType>
814 return _element_data->computingCurl();
817template <
typename OutputType>
821 return _element_data->computingDiv();
824template <
typename OutputType>
828 return _element_data->isNodalDefined();
831template <
typename OutputType>
835 return _neighbor_data->isNodalDefined();
838template <
typename OutputType>
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());
849template <
typename OutputType>
853 _element_data->clearDofIndices();
854 _neighbor_data->clearDofIndices();
855 _lower_data->clearDofIndices();
858template <
typename OutputType>
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)
869 const auto dof_number = node.dof_number(this->_sys.number(), this->number(), 0);
875 else if constexpr (std::is_same<OutputType, RealVectorValue>::value)
879 for (
const auto d : make_range(this->_mesh.dimension()))
881 const auto dof_number = node.dof_number(this->_sys.number(), this->number(), d);
882 auto & component = ret(d);
883 component = soln(dof_number);
890 mooseError(
"RealEigenVector not yet supported for functors");
895template <
typename OutputType>
908template <
typename OutputType>
909template <
typename Shapes,
typename Solution,
typename GradShapes,
typename GradSolution>
912 const unsigned int n_qp,
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
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());
927 const bool computing_dot = _time_integrator && _time_integrator->dt();
929 dof_values_dot.reserve(dof_indices.size());
932 const auto & global_soln = getSolution(state);
933 for (
const auto dof_index : dof_indices)
935 dof_values.push_back(
ADReal(global_soln(dof_index)));
936 if (do_derivatives && state.
state == 0)
942 dof_values_dot.push_back(dof_values.back());
943 _time_integrator->computeADTimeDerivatives(
944 dof_values_dot.back(), dof_index, _ad_real_dummy);
947 dof_values_dot.push_back((*this->_sys.solutionUDot())(dof_index));
951 local_soln.resize(n_qp);
952 grad_local_soln.resize(n_qp);
955 dot_local_soln.resize(n_qp);
956 grad_dot_local_soln.resize(n_qp);
959 for (
const auto qp : make_range(n_qp))
962 grad_local_soln[qp] = 0;
965 dot_local_soln[qp] = 0;
968 for (
const auto i : index_range(dof_indices))
970 local_soln[qp] += dof_values[i] * phi[i][qp];
971 grad_local_soln[qp] += dof_values[i] * grad_phi[i][qp];
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];
981template <
typename OutputType>
985 const bool cache_eligible)
const
988 "Variable " + this->name() +
" doesn't exist on block " +
991 const Elem *
const elem = elem_qp.
elem;
992 if (!cache_eligible || (elem != _current_elem_qp_functor_elem))
994 const QBase *
const qrule_template = elem_qp.
qrule;
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();
1000 const auto & phi = fe->get_phi();
1001 const auto & dphi = fe->get_dphi();
1002 fe->attach_quadrature_rule(qrule.get());
1005 computeSolution(elem,
1009 _current_elem_qp_functor_sln,
1011 _current_elem_qp_functor_gradient,
1012 _current_elem_qp_functor_dot,
1013 _current_elem_qp_functor_grad_dot);
1016 _current_elem_qp_functor_elem = elem;
1021 _current_elem_qp_functor_elem =
nullptr;
1028 mooseError(
"evaluate not implemented for array variables");
1031template <
typename OutputType>
1035 evaluateOnElement(elem_qp, state,
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];
1042template <
typename OutputType>
1048 const ElemQpArg elem_qp_arg{elem_arg.
elem, 0, &qrule, Point(0, 0, 0)};
1049 evaluateOnElement(elem_qp_arg, state,
false);
1050 return _current_elem_qp_functor_sln[0];
1053template <
typename OutputType>
1057 const std::vector<ValueType> & cache_data)
const
1060 auto side_evaluate =
1061 [
this, &qrule, &state, &cache_data](
const Elem *
const elem,
const unsigned int side)
1064 const ElemSideQpArg elem_side_qp_arg{elem, side, 0, &qrule, Point(0, 0, 0)};
1065 evaluateOnElementSide(elem_side_qp_arg, state,
false);
1066 return cache_data[0];
1069 const auto continuity = this->getContinuity();
1074 on_elem = this->hasBlocks(face_arg.
fi->
elemPtr()->subdomain_id());
1085 if ((continuity != C_ZERO && continuity != C_ONE) && on_elem && on_neighbor)
1091 else if (on_neighbor)
1095 "Attempted to evaluate a moose finite element variable on a face where it is not defined");
1098template <
typename OutputType>
1102 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1105template <
typename OutputType>
1110 mooseAssert(elem_point_arg.
elem,
"We need an Elem");
1111 const Elem & elem = *elem_point_arg.
elem;
1112 const auto dim = elem.dim();
1114 const std::vector<Point> ref_point = {FEMap::inverse_map(
dim, &elem, elem_point_arg.
point)};
1118 evaluateOnElement(elem_qp_arg, state,
false);
1119 return _current_elem_qp_functor_sln[0];
1122template <
typename OutputType>
1127 evaluateOnElement(elem_qp, state,
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];
1134template <
typename OutputType>
1141 const ElemQpArg elem_qp_arg{elem_arg.
elem, 0, &qrule, Point(0, 0, 0)};
1142 evaluateOnElement(elem_qp_arg, state,
false);
1143 return _current_elem_qp_functor_gradient[0];
1146template <
typename OutputType>
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 "
1156 evaluateOnElement(elem_qp, state,
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];
1163template <
typename OutputType>
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 "
1175 const ElemQpArg elem_qp_arg{elem_arg.
elem, 0, &qrule, Point(0, 0, 0)};
1176 evaluateOnElement(elem_qp_arg, state,
false);
1177 return _current_elem_qp_functor_dot[0];
1180template <
typename OutputType>
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 "
1192 const ElemQpArg elem_qp_arg{elem_arg.
elem, 0, &qrule, Point(0, 0, 0)};
1193 evaluateOnElement(elem_qp_arg, state,
false);
1194 return _current_elem_qp_functor_grad_dot[0];
1197template <
typename OutputType>
1201 const bool cache_eligible)
const
1204 "Variable " + this->name() +
" doesn't exist on block " +
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)
1212 const QBase *
const qrule_template = elem_side_qp.
qrule;
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();
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);
1223 computeSolution(elem,
1227 _current_elem_side_qp_functor_sln,
1229 _current_elem_side_qp_functor_gradient,
1230 _current_elem_side_qp_functor_dot,
1231 _current_elem_side_qp_functor_grad_dot);
1234 _current_elem_side_qp_functor_elem_side = std::make_pair(elem, side);
1248 mooseError(
"evaluate not implemented for array variables");
1251template <
typename OutputType>
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];
1263template <
typename OutputType>
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];
1275template <
typename OutputType>
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];
1290template <
typename OutputType>
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);
1305 "MooseVariableFE::evaluate(ElemQpArg &, const StateArg &) overload not implemented for "
1313 mooseError(
"MooseVariableFE::evaluate(ElemSideQpArg &, const StateArg &) overload not "
1314 "implemented for array variables");
1321 mooseError(
"MooseVariableFE::evaluateGradient(ElemQpArg &, const StateArg &) overload not "
1322 "implemented for array variables");
1329 mooseError(
"MooseVariableFE::evaluateGradient(ElemSideQpArg &, const StateArg &) overload not "
1330 "implemented for array variables");
1337 mooseError(
"MooseVariableFE::evaluateDot(ElemQpArg &, const StateArg &) overload not "
1338 "implemented for array variables");
1345 mooseError(
"MooseVariableFE::evaluateDot(ElemSideQpArg &, const StateArg &) overload not "
1346 "implemented for array variables");
1349template <
typename OutputType>
1353 _current_elem_qp_functor_elem =
nullptr;
1358template <
typename OutputType>
1362 _current_elem_qp_functor_elem =
nullptr;
1367template <
typename OutputType>
1371 _current_elem_qp_functor_elem =
nullptr;
1376template <
typename OutputType>
1380 _element_data->sizeMatrixTagData();
1381 _neighbor_data->sizeMatrixTagData();
1382 _lower_data->sizeMatrixTagData();
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
std::array< Real, 2 > values
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.
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor.
const Node *const & node() const
Returns the reference to the node.
const libMesh::QBase *const & qRuleFace() const
Returns the reference to the current quadrature being used on a current face.
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
const Elem *const & neighbor() const
Return the neighbor element.
const Elem *const & lowerDElem() const
Return the lower dimensional element.
unsigned int neighborSideID() const
const Elem & elem() const
const Elem * neighborPtr() const
unsigned int elemSideID() const
const Elem * elemPtr() const
virtual void meshChanged()
Called on this object when the mesh changes.
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 ¶meters)
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,...
Moose::ADType< OutputType >::type ValueType
virtual unsigned short dim() const=0
subdomain_id_type subdomain_id() const
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
FEGenericBase< RealGradient > FEVectorBase
const unsigned int invalid_uint
VectorValue< Real > RealVectorValue
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.