19 #include "libmesh/quadrature_monomial.h" 28 params.addClassDescription(
29 "Represents standard field variables, e.g. Lagrange, Hermite, or non-constant Monomials");
38 params.addClassDescription(
39 "Represents vector field variables, e.g. Vector Lagrange, Nedelec or Raviart-Thomas");
48 params.addClassDescription(
49 "Used for grouping standard field variables with the same finite element family and order");
53 template <
typename OutputType>
57 _element_data = std::make_unique<MooseVariableData<OutputType>>(*
this,
75 std::make_unique<MooseVariableData<OutputType>>(*
this,
85 template <
typename OutputType>
89 _element_data->clearDofIndices();
92 template <
typename OutputType>
96 _element_data->prepare();
99 template <
typename OutputType>
103 _neighbor_data->prepare();
106 template <
typename OutputType>
110 _lower_data->prepare();
113 template <
typename OutputType>
117 _element_data->prepareAux();
118 _neighbor_data->prepareAux();
119 _lower_data->prepareAux();
122 template <
typename OutputType>
126 _element_data->reinitNode();
129 template <
typename OutputType>
133 _element_data->reinitAux();
136 template <
typename OutputType>
140 _neighbor_data->reinitAux();
143 template <
typename OutputType>
147 _element_data->reinitNodes(nodes);
150 template <
typename OutputType>
154 _neighbor_data->reinitNodes(nodes);
157 template <
typename OutputType>
160 std::vector<dof_id_type> & dof_indices)
const 162 _element_data->getDofIndices(elem, dof_indices);
165 template <
typename OutputType>
172 template <
typename OutputType>
176 return _element_data->getNodalValue(node,
Moose::Old);
179 template <
typename OutputType>
183 return _element_data->getNodalValue(node,
Moose::Older);
186 template <
typename OutputType>
193 template <
typename OutputType>
197 return _element_data->getElementalValue(elem,
Moose::Old,
idx);
200 template <
typename OutputType>
207 template <
typename OutputType>
211 _element_data->insert(vector);
214 template <
typename OutputType>
218 _lower_data->insert(vector);
221 template <
typename OutputType>
225 _element_data->add(vector);
228 template <
typename OutputType>
232 _element_data->addSolution(this->_sys.solution(), v);
235 template <
typename OutputType>
239 _neighbor_data->addSolution(this->_sys.solution(), v);
242 template <
typename OutputType>
250 template <
typename OutputType>
254 return _element_data->dofValues();
257 template <
typename OutputType>
261 return _element_data->dofValuesOld();
264 template <
typename OutputType>
268 return _element_data->dofValuesOlder();
271 template <
typename OutputType>
275 return _element_data->dofValuesPreviousNL();
278 template <
typename OutputType>
282 return _neighbor_data->dofValues();
285 template <
typename OutputType>
289 return _neighbor_data->dofValuesOld();
292 template <
typename OutputType>
296 return _neighbor_data->dofValuesOlder();
299 template <
typename OutputType>
303 return _neighbor_data->dofValuesPreviousNL();
306 template <
typename OutputType>
310 return _element_data->dofValuesDot();
313 template <
typename OutputType>
317 return _element_data->dofValuesDotDot();
320 template <
typename OutputType>
324 return _element_data->dofValuesDotOld();
327 template <
typename OutputType>
331 return _element_data->dofValuesDotDotOld();
334 template <
typename OutputType>
338 return _neighbor_data->dofValuesDot();
341 template <
typename OutputType>
345 return _neighbor_data->dofValuesDotDot();
348 template <
typename OutputType>
352 return _neighbor_data->dofValuesDotOld();
355 template <
typename OutputType>
359 return _neighbor_data->dofValuesDotDotOld();
362 template <
typename OutputType>
366 return _element_data->dofValuesDuDotDu();
369 template <
typename OutputType>
373 return _element_data->dofValuesDuDotDotDu();
376 template <
typename OutputType>
380 return _neighbor_data->dofValuesDuDotDu();
383 template <
typename OutputType>
387 return _neighbor_data->dofValuesDuDotDotDu();
390 template <
typename OutputType>
394 _element_data->prepareIC();
397 template <
typename OutputType>
402 _element_data->computeValues();
405 template <
typename OutputType>
410 _element_data->computeValues();
413 template <
typename OutputType>
418 _neighbor_data->computeValues();
421 template <
typename OutputType>
426 _neighbor_data->computeValues();
429 template <
typename OutputType>
434 _lower_data->computeValues();
437 template <
typename OutputType>
441 _element_data->computeIncrementAtQps(increment_vec);
444 template <
typename OutputType>
448 _element_data->computeIncrementAtNode(increment_vec);
451 template <
typename OutputType>
454 const std::vector<std::vector<OutputShape>> & phi)
const 456 std::vector<dof_id_type> dof_indices;
457 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
459 OutputType
value = 0;
462 mooseAssert(dof_indices.size() == phi.size(),
463 "The number of shapes does not match the number of dof indices on the elem");
465 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
468 value += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
473 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
474 value = (*this->_sys.currentSolution())(dof_indices[0]);
483 const std::vector<std::vector<Real>> & phi)
const 485 std::vector<dof_id_type> dof_indices;
491 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
492 for (
unsigned int j = 0; j <
_count; j++)
500 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
502 for (
unsigned int j = 0; j <
_count; j++)
512 template <
typename OutputType>
519 std::vector<dof_id_type> dof_indices;
520 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
525 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
528 value += grad_phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i]);
533 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
543 const Elem * elem,
const std::vector<std::vector<RealVectorValue>> & grad_phi)
const 545 std::vector<dof_id_type> dof_indices;
551 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
552 for (
unsigned int j = 0; j <
_count; ++j)
561 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
567 template <
typename OutputType>
574 template <
typename OutputType>
581 template <
typename OutputType>
585 return _element_data->nodalVectorTagValue(tag);
588 template <
typename OutputType>
592 return _element_data->nodalMatrixTagValue(tag);
595 template <
typename OutputType>
602 template <
typename OutputType>
606 return _neighbor_data->nodalValue(
Moose::Old);
609 template <
typename OutputType>
616 template <
typename OutputType>
623 template <
typename OutputType>
630 template <
typename OutputType>
637 template <
typename OutputType>
641 return _element_data->nodalValueDot();
644 template <
typename OutputType>
648 return _element_data->nodalValueDotDot();
651 template <
typename OutputType>
655 return _element_data->nodalValueDotOld();
658 template <
typename OutputType>
662 return _element_data->nodalValueDotDotOld();
665 template <
typename OutputType>
669 _element_data->computeNodalValues();
672 template <
typename OutputType>
676 _neighbor_data->computeNodalValues();
679 template <
typename OutputType>
683 _element_data->setNodalValue(
value,
idx);
686 template <
typename OutputType>
690 _element_data->setDofValue(
value, index);
693 template <
typename OutputType>
697 _element_data->setDofValues(values);
700 template <
typename OutputType>
704 _lower_data->setDofValues(values);
707 template <
typename OutputType>
712 _element_data->insertNodalValue(residual, v);
715 template <
typename OutputType>
719 return _element_data->secondPhi();
722 template <
typename OutputType>
726 return _element_data->curlPhi();
729 template <
typename OutputType>
733 return _element_data->divPhi();
736 template <
typename OutputType>
740 return _element_data->secondPhiFace();
743 template <
typename OutputType>
747 return _element_data->curlPhiFace();
750 template <
typename OutputType>
754 return _element_data->divPhiFace();
757 template <
typename OutputType>
761 return _neighbor_data->secondPhi();
764 template <
typename OutputType>
768 return _neighbor_data->curlPhi();
771 template <
typename OutputType>
775 return _neighbor_data->divPhi();
778 template <
typename OutputType>
782 return _neighbor_data->secondPhiFace();
785 template <
typename OutputType>
789 return _neighbor_data->curlPhiFace();
792 template <
typename OutputType>
796 return _neighbor_data->divPhiFace();
799 template <
typename OutputType>
803 return _element_data->usesSecondPhi();
806 template <
typename OutputType>
810 return _neighbor_data->usesSecondPhi();
813 template <
typename OutputType>
817 return _element_data->computingCurl();
820 template <
typename OutputType>
824 return _element_data->computingDiv();
827 template <
typename OutputType>
831 return _element_data->isNodalDefined();
834 template <
typename OutputType>
838 return _neighbor_data->isNodalDefined();
841 template <
typename OutputType>
845 unsigned int state = 0;
846 state =
std::max(state, _element_data->oldestSolutionStateRequested());
847 state =
std::max(state, _neighbor_data->oldestSolutionStateRequested());
848 state =
std::max(state, _lower_data->oldestSolutionStateRequested());
852 template <
typename OutputType>
856 _element_data->clearDofIndices();
857 _neighbor_data->clearDofIndices();
858 _lower_data->clearDofIndices();
861 template <
typename OutputType>
865 mooseAssert(node_arg.
node,
"Must have a node");
867 mooseAssert(node.
n_dofs(this->_sys.number(), this->number()),
868 "Our variable must have dofs on the requested node");
869 const auto & soln = this->getSolution(state);
870 if constexpr (std::is_same<OutputType, Real>::value)
872 const auto dof_number = node.
dof_number(this->_sys.number(), this->number(), 0);
878 else if constexpr (std::is_same<OutputType, RealVectorValue>::value)
882 for (
const auto d :
make_range(this->_mesh.dimension()))
884 const auto dof_number = node.
dof_number(this->_sys.number(), this->number(), d);
885 auto & component = ret(d);
886 component = soln(dof_number);
893 mooseError(
"RealEigenVector not yet supported for functors");
898 template <
typename OutputType>
911 template <
typename OutputType>
912 template <
typename Shapes,
typename Solution,
typename GradShapes,
typename GradSolution>
915 const unsigned int n_qp,
918 Solution & local_soln,
919 const GradShapes & grad_phi,
920 GradSolution & grad_local_soln,
921 Solution & dot_local_soln,
922 GradSolution & grad_dot_local_soln)
const 924 std::vector<dof_id_type> dof_indices;
925 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
926 std::vector<ADReal> dof_values;
927 std::vector<ADReal> dof_values_dot;
928 dof_values.reserve(dof_indices.size());
930 const bool computing_dot = _time_integrator && _time_integrator->dt();
932 dof_values_dot.reserve(dof_indices.size());
935 const auto & global_soln = getSolution(state);
936 for (
const auto dof_index : dof_indices)
938 dof_values.push_back(
ADReal(global_soln(dof_index)));
939 if (do_derivatives && state.
state == 0)
945 dof_values_dot.push_back(dof_values.back());
946 _time_integrator->computeADTimeDerivatives(
947 dof_values_dot.back(), dof_index, _ad_real_dummy);
950 dof_values_dot.push_back((*this->_sys.solutionUDot())(dof_index));
954 local_soln.resize(n_qp);
955 grad_local_soln.resize(n_qp);
958 dot_local_soln.resize(n_qp);
959 grad_dot_local_soln.resize(n_qp);
965 grad_local_soln[qp] = 0;
968 dot_local_soln[qp] = 0;
973 local_soln[qp] += dof_values[i] * phi[i][qp];
974 grad_local_soln[qp] += dof_values[i] * grad_phi[i][qp];
977 dot_local_soln[qp] += dof_values_dot[i] * phi[i][qp];
978 grad_dot_local_soln[qp] += dof_values_dot[i] * grad_phi[i][qp];
984 template <
typename OutputType>
988 const bool cache_eligible)
const 991 "Variable " + this->
name() +
" doesn't exist on block " +
994 const Elem *
const elem = elem_qp.
elem;
995 if (!cache_eligible || (elem != _current_elem_qp_functor_elem))
997 const QBase *
const qrule_template = elem_qp.
qrule;
1000 std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->
dim(), _fe_type));
1001 auto qrule = qrule_template->
clone();
1003 const auto & phi = fe->get_phi();
1004 const auto & dphi = fe->get_dphi();
1005 fe->attach_quadrature_rule(qrule.get());
1008 computeSolution(elem,
1012 _current_elem_qp_functor_sln,
1014 _current_elem_qp_functor_gradient,
1015 _current_elem_qp_functor_dot,
1016 _current_elem_qp_functor_grad_dot);
1019 _current_elem_qp_functor_elem = elem;
1024 _current_elem_qp_functor_elem =
nullptr;
1031 mooseError(
"evaluate not implemented for array variables");
1034 template <
typename OutputType>
1038 evaluateOnElement(elem_qp, state,
true);
1039 const auto qp = elem_qp.
qp;
1040 mooseAssert(qp < _current_elem_qp_functor_sln.size(),
1041 "The requested " << qp <<
" is outside our solution size");
1042 return _current_elem_qp_functor_sln[qp];
1045 template <
typename OutputType>
1052 evaluateOnElement(elem_qp_arg, state,
false);
1053 return _current_elem_qp_functor_sln[0];
1056 template <
typename OutputType>
1060 const std::vector<ValueType> & cache_data)
const 1063 auto side_evaluate =
1064 [
this, &qrule, &state, &cache_data](
const Elem *
const elem,
const unsigned int side)
1068 evaluateOnElementSide(elem_side_qp_arg, state,
false);
1069 return cache_data[0];
1072 const auto continuity = this->getContinuity();
1088 if ((continuity !=
C_ZERO && continuity !=
C_ONE) && on_elem && on_neighbor)
1094 else if (on_neighbor)
1098 "Attempted to evaluate a moose finite element variable on a face where it is not defined");
1101 template <
typename OutputType>
1105 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1108 template <
typename OutputType>
1113 mooseAssert(elem_point_arg.
elem,
"We need an Elem");
1114 const Elem & elem = *elem_point_arg.
elem;
1115 const auto dim = elem.
dim();
1117 const std::vector<Point> ref_point = {FEMap::inverse_map(
dim, &elem, elem_point_arg.
point)};
1121 evaluateOnElement(elem_qp_arg, state,
false);
1122 return _current_elem_qp_functor_sln[0];
1125 template <
typename OutputType>
1130 evaluateOnElement(elem_qp, state,
true);
1131 const auto qp = elem_qp.
qp;
1132 mooseAssert(qp < _current_elem_qp_functor_gradient.size(),
1133 "The requested " << qp <<
" is outside our gradient size");
1134 return _current_elem_qp_functor_gradient[qp];
1137 template <
typename OutputType>
1145 evaluateOnElement(elem_qp_arg, state,
false);
1146 return _current_elem_qp_functor_gradient[0];
1149 template <
typename OutputType>
1153 mooseAssert(_time_integrator,
1154 "A time derivative is being requested but we do not have a time integrator so we'll " 1155 "have no idea how to compute it");
1156 mooseAssert(_time_integrator->dt(),
1157 "A time derivative is being requested but the time integrator wants to perform a 0s " 1159 evaluateOnElement(elem_qp, state,
true);
1160 const auto qp = elem_qp.
qp;
1161 mooseAssert(qp < _current_elem_qp_functor_dot.size(),
1162 "The requested " << qp <<
" is outside our dot size");
1163 return _current_elem_qp_functor_dot[qp];
1166 template <
typename OutputType>
1170 mooseAssert(_time_integrator,
1171 "A time derivative is being requested but we do not have a time integrator so we'll " 1172 "have no idea how to compute it");
1173 mooseAssert(_time_integrator->dt(),
1174 "A time derivative is being requested but the time integrator wants to perform a 0s " 1179 evaluateOnElement(elem_qp_arg, state,
false);
1180 return _current_elem_qp_functor_dot[0];
1183 template <
typename OutputType>
1187 mooseAssert(_time_integrator,
1188 "A time derivative is being requested but we do not have a time integrator so we'll " 1189 "have no idea how to compute it");
1190 mooseAssert(_time_integrator->dt(),
1191 "A time derivative is being requested but the time integrator wants to perform a 0s " 1196 evaluateOnElement(elem_qp_arg, state,
false);
1197 return _current_elem_qp_functor_grad_dot[0];
1200 template <
typename OutputType>
1204 const bool cache_eligible)
const 1207 "Variable " + this->
name() +
" doesn't exist on block " +
1210 const Elem *
const elem = elem_side_qp.
elem;
1211 const auto side = elem_side_qp.
side;
1212 if (!cache_eligible || elem != _current_elem_side_qp_functor_elem_side.first ||
1213 side != _current_elem_side_qp_functor_elem_side.second)
1215 const QBase *
const qrule_template = elem_side_qp.
qrule;
1218 std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->
dim(), _fe_type));
1219 auto qrule = qrule_template->
clone();
1221 const auto & phi = fe->get_phi();
1222 const auto & dphi = fe->get_dphi();
1223 fe->attach_quadrature_rule(qrule.get());
1224 fe->reinit(elem, side);
1226 computeSolution(elem,
1230 _current_elem_side_qp_functor_sln,
1232 _current_elem_side_qp_functor_gradient,
1233 _current_elem_side_qp_functor_dot,
1234 _current_elem_side_qp_functor_grad_dot);
1237 _current_elem_side_qp_functor_elem_side = std::make_pair(elem, side);
1251 mooseError(
"evaluate not implemented for array variables");
1254 template <
typename OutputType>
1259 evaluateOnElementSide(elem_side_qp, state,
true);
1260 const auto qp = elem_side_qp.
qp;
1261 mooseAssert(qp < _current_elem_side_qp_functor_sln.size(),
1262 "The requested " << qp <<
" is outside our solution size");
1263 return _current_elem_side_qp_functor_sln[qp];
1266 template <
typename OutputType>
1271 evaluateOnElementSide(elem_side_qp, state,
true);
1272 const auto qp = elem_side_qp.
qp;
1273 mooseAssert(qp < _current_elem_side_qp_functor_gradient.size(),
1274 "The requested " << qp <<
" is outside our gradient size");
1275 return _current_elem_side_qp_functor_gradient[qp];
1278 template <
typename OutputType>
1283 mooseAssert(_time_integrator && _time_integrator->dt(),
1284 "A time derivative is being requested but we do not have a time integrator so we'll " 1285 "have no idea how to compute it");
1286 evaluateOnElementSide(elem_side_qp, state,
true);
1287 const auto qp = elem_side_qp.
qp;
1288 mooseAssert(qp < _current_elem_side_qp_functor_dot.size(),
1289 "The requested " << qp <<
" is outside our dot size");
1290 return _current_elem_side_qp_functor_dot[qp];
1293 template <
typename OutputType>
1297 mooseAssert(_time_integrator && _time_integrator->dt(),
1298 "A time derivative is being requested but we do not have a time integrator so we'll " 1299 "have no idea how to compute it");
1300 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_dot);
1308 "MooseVariableFE::evaluate(ElemQpArg &, const StateArg &) overload not implemented for " 1316 mooseError(
"MooseVariableFE::evaluate(ElemSideQpArg &, const StateArg &) overload not " 1317 "implemented for array variables");
1324 mooseError(
"MooseVariableFE::evaluateGradient(ElemQpArg &, const StateArg &) overload not " 1325 "implemented for array variables");
1332 mooseError(
"MooseVariableFE::evaluateGradient(ElemSideQpArg &, const StateArg &) overload not " 1333 "implemented for array variables");
1340 mooseError(
"MooseVariableFE::evaluateDot(ElemQpArg &, const StateArg &) overload not " 1341 "implemented for array variables");
1348 mooseError(
"MooseVariableFE::evaluateDot(ElemSideQpArg &, const StateArg &) overload not " 1349 "implemented for array variables");
1352 template <
typename OutputType>
1356 _current_elem_qp_functor_elem =
nullptr;
1361 template <
typename OutputType>
1365 _current_elem_qp_functor_elem =
nullptr;
1370 template <
typename OutputType>
1374 _current_elem_qp_functor_elem =
nullptr;
std::string name(const ElemQuality q)
const Elem *const & elem() const
Return the current element.
void computeSolution(const Elem *elem, unsigned int n_qp, const StateArg &state, const Shapes &phi, Solution &local_soln, const GradShapes &grad_phi, GradSolution &grad_local_soln, Solution &dot_local_soln, GradSolution &grad_dot_local_soln) const
Compute the solution, gradient, time derivative, and gradient of the time derivative with provided sh...
unsigned int side
The local side index.
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final
Evaluate the functor gradient-dot with a given element.
bool computingCurl() const override final
Whether or not this variable is computing the curl.
bool isNodalNeighborDefined() const
const libMesh::QBase * qrule
The quadrature rule.
bool computingDiv() const override final
Whether or not this variable is computing the divergence.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
OutputTools< OutputType >::OutputGradient getGradient(const Elem *elem, const std::vector< std::vector< typename OutputTools< OutputType >::OutputShapeGradient >> &grad_phi) const
Compute the variable gradient value at a point on an element.
ValueType evaluate(const ElemQpArg &elem_qp, const StateArg &state) const override final
const DoFValue & dofValuesOlderNeighbor() const override
const DoFValue & dofValuesDotOld() const override
const unsigned int invalid_uint
const OutputType & nodalValueOld() const
Class for stuff related to variables.
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
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.
OutputType getValue(const Elem *elem, const std::vector< std::vector< OutputShape >> &phi) const
Compute the variable value at a point on an element.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
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
const FieldVariablePhiCurl & curlPhiFaceNeighbor() const
const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
virtual void setDofValues(const DenseVector< OutputData > &values) override
Set local DOF values and evaluate the values on quadrature points.
const DoFValue & dofValue() const
void reinitAux() override
const OutputType & nodalValuePreviousNLNeighbor() const
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
void reinitNodes(const std::vector< dof_id_type > &nodes) override
std::unique_ptr< MooseVariableData< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
void prepareNeighbor() override
Prepare the neighbor element degrees of freedom.
const DoFValue & dofValuesDotDotNeighbor() const override
MooseVariableFE(const InputParameters ¶meters)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
const DoFValue & dofValuesDotOldNeighbor() const override
const FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable's elemental shape functions.
unsigned int elemSideID() const
OutputData getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
const DoFValue & dofValuesNeighbor() const override
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void prepareIC() override
Prepare the initial condition.
DualNumber< Real, DNDerivativeType, true > ADReal
A structure for storing the various lists that contain the names of the items to be exported...
bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivative on a neighbor...
virtual void setDofValue(const OutputData &value, unsigned int index) override
Degree of freedom value setters.
const DoFValue & dofValuesDotDot() const override
virtual void jacobianSetup() override
void addSolutionNeighbor(const DenseVector< libMesh::Number > &v)
Add passed in local neighbor DOF values onto the current solution.
const libMesh::Node * node
The node which defines our location in space.
unsigned int neighborSideID() const
virtual void jacobianSetup() override
typename FunctorReturnType< Moose::ADType< OutputType >::type, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
auto max(const L &left, const R &right)
OutputData getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
std::vector< dof_id_type > _dof_indices
DOF indices.
virtual void computeNodalValues() override
Compute nodal values of this variable.
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
const FieldVariablePhiCurl & curlPhiNeighbor() const
virtual void insertLower(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values for a lower-dimensional element into the provide...
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
static InputParameters validParams()
GradientType evaluateGradient(const ElemQpArg &elem_qp, const StateArg &state) const override
void prepareLowerD() override
Prepare a lower dimensional element's degrees of freedom.
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
ValueType faceEvaluate(const FaceArg &, const StateArg &, const std::vector< ValueType > &cache_data) const
A common method that both evaluate(FaceArg) and evaluateDot(FaceArg) can call.
const DoFValue & dofValuesOlder() const override
const FieldVariablePhiCurl & curlPhiFace() const
const OutputType & nodalValueDotDot() const
Implements a fake quadrature rule where you can specify the locations (in the reference domain) of th...
void setPoints(const std::vector< libMesh::Point > &points)
Set the quadrature points.
const Elem * neighborPtr() const
const libMesh::DofMap & _dof_map
DOF map.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const OutputType & nodalValueOlder() const
A structure defining a "face" evaluation calling argument for Moose functors.
void reinitAuxNeighbor() override
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
unsigned int qp
The quadrature point index.
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
const FaceInfo * fi
a face information object which defines our location in space
SystemBase & _sys
System this variable is part of.
const FieldVariablePhiValue & phi() const override
Return the variable's elemental shape functions.
const libMesh::QBase * qrule
The quadrature rule.
const libMesh::Elem * elem
const DoFValue & dofValuesOld() const override
const DoFValue & dofValuesPreviousNLNeighbor() const override
const DoFValue & dofValuesOldNeighbor() const override
const libMesh::Elem * elem
virtual void computeNodalNeighborValues() override
Compute nodal values of this variable in the neighbor.
A structure that is used to evaluate Moose functors logically at an element/cell center.
virtual void meshChanged() override
Called on this object when the mesh changes.
const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on an element face...
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Argument for requesting functor evaluation at a quadrature point location in an element.
const unsigned int _count
Number of variables in the array.
const OutputType & nodalValue() const
Methods for retrieving values of variables at the nodes.
const libMesh::Elem * elem
The element.
OutputData getNodalValueOlder(const Node &node) const
Get the t-2 value of this variable at given node.
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the current local DOF values to the input vector.
virtual void setLowerDofValues(const DenseVector< OutputData > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points...
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes) override
const FieldVariablePhiSecond & secondPhiNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
std::unique_ptr< MooseVariableData< OutputType > > _lower_data
Holder for all the data associated with the lower dimeensional element.
const DoFValue & dofValuesDotDotOld() const override
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
const DoFValue & nodalVectorTagValue(TagID tag) const override
void clearDofIndices() override
Clear out the dof indices.
const Elem * elemPtr() const
OutputData getNodalValue(const Node &node) const
Get the value of this variable at given node.
bool isNodal() const override
Is this variable nodal.
void evaluateOnElement(const ElemQpArg &elem_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_qp argument.
void computeIncrementAtNode(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change at the current node based on increment_vec.
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const OutputData &v)
Write a nodal value to the passed-in solution vector.
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Set the current local DOF values to the input vector.
virtual std::unique_ptr< QBase > clone() const
const OutputType & nodalValueOldNeighbor() const
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
subdomain_id_type subdomain_id() const
OutputData getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
Assembly & _assembly
Assembly data.
Moose::ADType< OutputType >::type ValueType
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.
const DoFValue & dofValues() const override
dof values getters
unsigned int _var_num
variable number (from libMesh)
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
const Elem *const & neighbor() const
Return the neighbor element.
IntRange< T > make_range(T beg, T end)
typename MooseVariableField< OutputType >::DoFValue DoFValue
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const libMesh::QBase *const & qRule() const
Returns the reference to the current quadrature being used.
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)
const libMesh::QBase *const & qRuleNeighbor() const
Returns the reference to the current quadrature being used on a current neighbor. ...
const DoFValue & dofValuesPreviousNL() const override
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
unsigned int qp
The quadrature point index.
void prepare() override
Prepare the elemental degrees of freedom.
void reinitNode() override
const DoFValue & dofValuesDotNeighbor() const override
const DoFValue & nodalMatrixTagValue(TagID tag) const override
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
std::unique_ptr< MooseVariableData< OutputType > > _element_data
Holder for all the data associated with the "main" element.
const DoFValue & dofValuesDotDotOldNeighbor() const override
const Node *const & node() const
Returns the reference to the node.
virtual void residualSetup() override
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
const libMesh::Elem * elem
The element.
const OutputType & nodalValueOlderNeighbor() const
const Elem *const & lowerDElem() const
Return the lower dimensional element.
const OutputType & nodalValueDotOld() const
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
typename MooseVariableField< OutputType >::OutputData OutputData
auto index_range(const T &sizable)
Argument for requesting functor evaluation at quadrature point locations on an element side...
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
const DoFValue & dofValuesDot() const override
unsigned int state
The state.
virtual void residualSetup() override
const FieldVariablePhiDivergence & divPhiFace() const
const OutputType & nodalValuePreviousNL() const
OutputData getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
void prepareAux() override
void clearAllDofIndices() final