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>
711 _element_data->insertNodalValue(residual, v);
714 template <
typename OutputType>
718 return _element_data->secondPhi();
721 template <
typename OutputType>
725 return _element_data->curlPhi();
728 template <
typename OutputType>
732 return _element_data->divPhi();
735 template <
typename OutputType>
739 return _element_data->secondPhiFace();
742 template <
typename OutputType>
746 return _element_data->curlPhiFace();
749 template <
typename OutputType>
753 return _element_data->divPhiFace();
756 template <
typename OutputType>
760 return _neighbor_data->secondPhi();
763 template <
typename OutputType>
767 return _neighbor_data->curlPhi();
770 template <
typename OutputType>
774 return _neighbor_data->divPhi();
777 template <
typename OutputType>
781 return _neighbor_data->secondPhiFace();
784 template <
typename OutputType>
788 return _neighbor_data->curlPhiFace();
791 template <
typename OutputType>
795 return _neighbor_data->divPhiFace();
798 template <
typename OutputType>
802 return _element_data->usesSecondPhi();
805 template <
typename OutputType>
809 return _neighbor_data->usesSecondPhi();
812 template <
typename OutputType>
816 return _element_data->computingCurl();
819 template <
typename OutputType>
823 return _element_data->computingDiv();
826 template <
typename OutputType>
830 return _element_data->isNodalDefined();
833 template <
typename OutputType>
837 return _neighbor_data->isNodalDefined();
840 template <
typename OutputType>
844 unsigned int state = 0;
845 state =
std::max(state, _element_data->oldestSolutionStateRequested());
846 state =
std::max(state, _neighbor_data->oldestSolutionStateRequested());
847 state =
std::max(state, _lower_data->oldestSolutionStateRequested());
851 template <
typename OutputType>
855 _element_data->clearDofIndices();
856 _neighbor_data->clearDofIndices();
857 _lower_data->clearDofIndices();
860 template <
typename OutputType>
864 mooseAssert(node_arg.
node,
"Must have a node");
866 mooseAssert(node.
n_dofs(this->_sys.number(), this->number()),
867 "Our variable must have dofs on the requested node");
868 const auto & soln = this->getSolution(state);
869 if constexpr (std::is_same<OutputType, Real>::value)
871 const auto dof_number = node.
dof_number(this->_sys.number(), this->number(), 0);
877 else if constexpr (std::is_same<OutputType, RealVectorValue>::value)
881 for (
const auto d :
make_range(this->_mesh.dimension()))
883 const auto dof_number = node.
dof_number(this->_sys.number(), this->number(), d);
884 auto & component = ret(d);
885 component = soln(dof_number);
892 mooseError(
"RealEigenVector not yet supported for functors");
897 template <
typename OutputType>
910 template <
typename OutputType>
911 template <
typename Shapes,
typename Solution,
typename GradShapes,
typename GradSolution>
914 const unsigned int n_qp,
917 Solution & local_soln,
918 const GradShapes & grad_phi,
919 GradSolution & grad_local_soln,
920 Solution & dot_local_soln,
921 GradSolution & grad_dot_local_soln)
const 923 std::vector<dof_id_type> dof_indices;
924 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
925 std::vector<ADReal> dof_values;
926 std::vector<ADReal> dof_values_dot;
927 dof_values.reserve(dof_indices.size());
929 const bool computing_dot = _time_integrator && _time_integrator->dt();
931 dof_values_dot.reserve(dof_indices.size());
934 const auto & global_soln = getSolution(state);
935 for (
const auto dof_index : dof_indices)
937 dof_values.push_back(
ADReal(global_soln(dof_index)));
938 if (do_derivatives && state.
state == 0)
944 dof_values_dot.push_back(dof_values.back());
945 _time_integrator->computeADTimeDerivatives(
946 dof_values_dot.back(), dof_index, _ad_real_dummy);
949 dof_values_dot.push_back((*this->_sys.solutionUDot())(dof_index));
953 local_soln.resize(n_qp);
954 grad_local_soln.resize(n_qp);
957 dot_local_soln.resize(n_qp);
958 grad_dot_local_soln.resize(n_qp);
964 grad_local_soln[qp] = 0;
967 dot_local_soln[qp] = 0;
972 local_soln[qp] += dof_values[i] * phi[i][qp];
973 grad_local_soln[qp] += dof_values[i] * grad_phi[i][qp];
976 dot_local_soln[qp] += dof_values_dot[i] * phi[i][qp];
977 grad_dot_local_soln[qp] += dof_values_dot[i] * grad_phi[i][qp];
983 template <
typename OutputType>
987 const bool cache_eligible)
const 990 "Variable " + this->
name() +
" doesn't exist on block " +
993 const Elem *
const elem = elem_qp.
elem;
994 if (!cache_eligible || (elem != _current_elem_qp_functor_elem))
996 const QBase *
const qrule_template = elem_qp.
qrule;
999 std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->
dim(), _fe_type));
1000 auto qrule = qrule_template->
clone();
1002 const auto & phi = fe->get_phi();
1003 const auto & dphi = fe->get_dphi();
1004 fe->attach_quadrature_rule(qrule.get());
1007 computeSolution(elem,
1011 _current_elem_qp_functor_sln,
1013 _current_elem_qp_functor_gradient,
1014 _current_elem_qp_functor_dot,
1015 _current_elem_qp_functor_grad_dot);
1018 _current_elem_qp_functor_elem = elem;
1023 _current_elem_qp_functor_elem =
nullptr;
1030 mooseError(
"evaluate not implemented for array variables");
1033 template <
typename OutputType>
1037 evaluateOnElement(elem_qp, state,
true);
1038 const auto qp = elem_qp.
qp;
1039 mooseAssert(qp < _current_elem_qp_functor_sln.size(),
1040 "The requested " << qp <<
" is outside our solution size");
1041 return _current_elem_qp_functor_sln[qp];
1044 template <
typename OutputType>
1051 evaluateOnElement(elem_qp_arg, state,
false);
1052 return _current_elem_qp_functor_sln[0];
1055 template <
typename OutputType>
1059 const std::vector<ValueType> & cache_data)
const 1062 auto side_evaluate =
1063 [
this, &qrule, &state, &cache_data](
const Elem *
const elem,
const unsigned int side)
1067 evaluateOnElementSide(elem_side_qp_arg, state,
false);
1068 return cache_data[0];
1071 const auto continuity = this->getContinuity();
1087 if ((continuity !=
C_ZERO && continuity !=
C_ONE) && on_elem && on_neighbor)
1093 else if (on_neighbor)
1097 "Attempted to evaluate a moose finite element variable on a face where it is not defined");
1100 template <
typename OutputType>
1104 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1107 template <
typename OutputType>
1112 mooseAssert(elem_point_arg.
elem,
"We need an Elem");
1113 const Elem & elem = *elem_point_arg.
elem;
1114 const auto dim = elem.
dim();
1116 const std::vector<Point> ref_point = {FEMap::inverse_map(
dim, &elem, elem_point_arg.
point)};
1120 evaluateOnElement(elem_qp_arg, state,
false);
1121 return _current_elem_qp_functor_sln[0];
1124 template <
typename OutputType>
1129 evaluateOnElement(elem_qp, state,
true);
1130 const auto qp = elem_qp.
qp;
1131 mooseAssert(qp < _current_elem_qp_functor_gradient.size(),
1132 "The requested " << qp <<
" is outside our gradient size");
1133 return _current_elem_qp_functor_gradient[qp];
1136 template <
typename OutputType>
1144 evaluateOnElement(elem_qp_arg, state,
false);
1145 return _current_elem_qp_functor_gradient[0];
1148 template <
typename OutputType>
1152 mooseAssert(_time_integrator,
1153 "A time derivative is being requested but we do not have a time integrator so we'll " 1154 "have no idea how to compute it");
1155 mooseAssert(_time_integrator->dt(),
1156 "A time derivative is being requested but the time integrator wants to perform a 0s " 1158 evaluateOnElement(elem_qp, state,
true);
1159 const auto qp = elem_qp.
qp;
1160 mooseAssert(qp < _current_elem_qp_functor_dot.size(),
1161 "The requested " << qp <<
" is outside our dot size");
1162 return _current_elem_qp_functor_dot[qp];
1165 template <
typename OutputType>
1169 mooseAssert(_time_integrator,
1170 "A time derivative is being requested but we do not have a time integrator so we'll " 1171 "have no idea how to compute it");
1172 mooseAssert(_time_integrator->dt(),
1173 "A time derivative is being requested but the time integrator wants to perform a 0s " 1178 evaluateOnElement(elem_qp_arg, state,
false);
1179 return _current_elem_qp_functor_dot[0];
1182 template <
typename OutputType>
1186 mooseAssert(_time_integrator,
1187 "A time derivative is being requested but we do not have a time integrator so we'll " 1188 "have no idea how to compute it");
1189 mooseAssert(_time_integrator->dt(),
1190 "A time derivative is being requested but the time integrator wants to perform a 0s " 1195 evaluateOnElement(elem_qp_arg, state,
false);
1196 return _current_elem_qp_functor_grad_dot[0];
1199 template <
typename OutputType>
1203 const bool cache_eligible)
const 1206 "Variable " + this->
name() +
" doesn't exist on block " +
1209 const Elem *
const elem = elem_side_qp.
elem;
1210 const auto side = elem_side_qp.
side;
1211 if (!cache_eligible || elem != _current_elem_side_qp_functor_elem_side.first ||
1212 side != _current_elem_side_qp_functor_elem_side.second)
1214 const QBase *
const qrule_template = elem_side_qp.
qrule;
1217 std::unique_ptr<FEBaseType> fe(FEBaseType::build(elem->
dim(), _fe_type));
1218 auto qrule = qrule_template->
clone();
1220 const auto & phi = fe->get_phi();
1221 const auto & dphi = fe->get_dphi();
1222 fe->attach_quadrature_rule(qrule.get());
1223 fe->reinit(elem, side);
1225 computeSolution(elem,
1229 _current_elem_side_qp_functor_sln,
1231 _current_elem_side_qp_functor_gradient,
1232 _current_elem_side_qp_functor_dot,
1233 _current_elem_side_qp_functor_grad_dot);
1236 _current_elem_side_qp_functor_elem_side = std::make_pair(elem, side);
1250 mooseError(
"evaluate not implemented for array variables");
1253 template <
typename OutputType>
1258 evaluateOnElementSide(elem_side_qp, state,
true);
1259 const auto qp = elem_side_qp.
qp;
1260 mooseAssert(qp < _current_elem_side_qp_functor_sln.size(),
1261 "The requested " << qp <<
" is outside our solution size");
1262 return _current_elem_side_qp_functor_sln[qp];
1265 template <
typename OutputType>
1270 evaluateOnElementSide(elem_side_qp, state,
true);
1271 const auto qp = elem_side_qp.
qp;
1272 mooseAssert(qp < _current_elem_side_qp_functor_gradient.size(),
1273 "The requested " << qp <<
" is outside our gradient size");
1274 return _current_elem_side_qp_functor_gradient[qp];
1277 template <
typename OutputType>
1282 mooseAssert(_time_integrator && _time_integrator->dt(),
1283 "A time derivative is being requested but we do not have a time integrator so we'll " 1284 "have no idea how to compute it");
1285 evaluateOnElementSide(elem_side_qp, state,
true);
1286 const auto qp = elem_side_qp.
qp;
1287 mooseAssert(qp < _current_elem_side_qp_functor_dot.size(),
1288 "The requested " << qp <<
" is outside our dot size");
1289 return _current_elem_side_qp_functor_dot[qp];
1292 template <
typename OutputType>
1296 mooseAssert(_time_integrator && _time_integrator->dt(),
1297 "A time derivative is being requested but we do not have a time integrator so we'll " 1298 "have no idea how to compute it");
1299 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_dot);
1307 "MooseVariableFE::evaluate(ElemQpArg &, const StateArg &) overload not implemented for " 1315 mooseError(
"MooseVariableFE::evaluate(ElemSideQpArg &, const StateArg &) overload not " 1316 "implemented for array variables");
1323 mooseError(
"MooseVariableFE::evaluateGradient(ElemQpArg &, const StateArg &) overload not " 1324 "implemented for array variables");
1331 mooseError(
"MooseVariableFE::evaluateGradient(ElemSideQpArg &, const StateArg &) overload not " 1332 "implemented for array variables");
1339 mooseError(
"MooseVariableFE::evaluateDot(ElemQpArg &, const StateArg &) overload not " 1340 "implemented for array variables");
1347 mooseError(
"MooseVariableFE::evaluateDot(ElemSideQpArg &, const StateArg &) overload not " 1348 "implemented for array variables");
1351 template <
typename OutputType>
1355 _current_elem_qp_functor_elem =
nullptr;
1360 template <
typename OutputType>
1364 _current_elem_qp_functor_elem =
nullptr;
1369 template <
typename OutputType>
1373 _current_elem_qp_functor_elem =
nullptr;
1378 template <
typename OutputType>
1382 _element_data->sizeMatrixTagData();
1383 _neighbor_data->sizeMatrixTagData();
1384 _lower_data->sizeMatrixTagData();
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...
virtual void setDofValues(const DenseVector< DofValue > &values) override
Set local DOF values and evaluate the values on quadrature points.
unsigned int side
The local side index.
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override final
Evaluate the functor gradient-dot with a given element.
bool computingCurl() const override final
Whether or not this variable is computing the curl.
bool isNodalNeighborDefined() const
const libMesh::QBase * qrule
The quadrature rule.
const DofValues & nodalVectorTagValue(TagID tag) const override
bool computingDiv() const override final
Whether or not this variable is computing the divergence.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
OutputTools< OutputType >::OutputGradient getGradient(const Elem *elem, const std::vector< std::vector< typename OutputTools< OutputType >::OutputShapeGradient >> &grad_phi) const
Compute the variable gradient value at a point on an element.
ValueType evaluate(const ElemQpArg &elem_qp, const StateArg &state) const override final
const unsigned int invalid_uint
const OutputType & nodalValueOld() const
Class for stuff related to variables.
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
DofValue getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
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
void reinitAux() override
const OutputType & nodalValuePreviousNLNeighbor() const
void addSolution(const DenseVector< libMesh::Number > &v)
Add passed in local DOF values onto the current solution.
void reinitNodes(const std::vector< dof_id_type > &nodes) override
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
std::unique_ptr< MooseVariableData< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
virtual void setDofValue(const DofValue &value, unsigned int index) override
Degree of freedom value setters.
void prepareNeighbor() override
Prepare the neighbor element degrees of freedom.
MooseVariableFE(const InputParameters ¶meters)
const DofValues & dofValuesOlder() const override
void insertNodalValue(libMesh::NumericVector< libMesh::Number > &residual, const DofValue &v)
Write a nodal value to the passed-in solution vector.
const DofValues & dofValuesDotDotOldNeighbor() const override
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 FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable's elemental shape functions.
unsigned int elemSideID() const
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void prepareIC() override
Prepare the initial condition.
DualNumber< Real, DNDerivativeType, true > ADReal
bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivative on a neighbor...
const DofValues & dofValuesOld() const override
virtual void jacobianSetup() override
void addSolutionNeighbor(const DenseVector< libMesh::Number > &v)
Add passed in local neighbor DOF values onto the current solution.
const libMesh::Node * node
The node which defines our location in space.
const DofValues & nodalMatrixTagValue(TagID tag) const override
unsigned int neighborSideID() const
virtual void jacobianSetup() override
typename FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
auto max(const L &left, const R &right)
const DofValues & dofValuesDotOldNeighbor() const override
std::vector< dof_id_type > _dof_indices
DOF indices.
virtual void computeNodalValues() override
Compute nodal values of this variable.
const DofValues & dofValuesDot() const override
bool usesSecondPhi() const
Whether or not this variable is computing any second derivatives.
const FieldVariablePhiCurl & curlPhiNeighbor() const
virtual void insertLower(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values for a lower-dimensional element into the provide...
const DofValues & dofValue() const
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
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 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.
DofValue getNodalValueOlder(const Node &node) const
Get the t-2 value of this variable at given node.
const Elem * neighborPtr() const
const DofValues & dofValuesOlderNeighbor() const override
const libMesh::DofMap & _dof_map
DOF map.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const OutputType & nodalValueOlder() const
A structure defining a "face" evaluation calling argument for Moose functors.
void reinitAuxNeighbor() override
DofValue getNodalValueOld(const Node &node) const
Get the old value of this variable at given node.
const DofValues & dofValuesDotDotOld() const override
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
unsigned int qp
The quadrature point index.
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
const FaceInfo * fi
a face information object which defines our location in space
SystemBase & _sys
System this variable is part of.
const FieldVariablePhiValue & phi() const override
Return the variable's elemental shape functions.
const libMesh::QBase * qrule
The quadrature rule.
const libMesh::Elem * elem
const libMesh::Elem * elem
virtual void computeNodalNeighborValues() override
Compute nodal values of this variable in the neighbor.
A structure that is used to evaluate Moose functors logically at an element/cell center.
virtual void meshChanged() override
Called on this object when the mesh changes.
const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable'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.
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the current local DOF values to the input vector.
void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes) override
const DofValues & dofValuesNeighbor() const override
const FieldVariablePhiSecond & secondPhiNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on a neighboring ele...
std::unique_ptr< MooseVariableData< OutputType > > _lower_data
Holder for all the data associated with the lower dimeensional element.
const DofValues & dofValuesDotDot() const override
const Node *const & nodeNeighbor() const
Returns the reference to the neighboring node.
void computeIncrementAtQps(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change in solution at QPs based on increment_vec.
void clearDofIndices() override
Clear out the dof indices.
const Elem * elemPtr() const
bool isNodal() const override
Is this variable nodal.
void evaluateOnElement(const ElemQpArg &elem_qp, const StateArg &state, bool cache_eligible) const
Evaluate solution and gradient for the elem_qp argument.
void computeIncrementAtNode(const libMesh::NumericVector< libMesh::Number > &increment_vec)
Compute and store incremental change at the current node based on increment_vec.
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
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
const DofValues & dofValuesPreviousNL() const override
virtual bool isNodalDefined() const override
Is this variable defined at nodes.
const DofValues & dofValues() const override
dof values getters
subdomain_id_type subdomain_id() const
Assembly & _assembly
Assembly data.
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.
virtual void setLowerDofValues(const DenseVector< DofValue > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points...
unsigned int _var_num
variable number (from libMesh)
const FieldVariablePhiDivergence & divPhiFaceNeighbor() const
DofValue getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
DofValue getNodalValue(const Node &node) const
Get the value of this variable at given node.
const Elem *const & neighbor() const
Return the neighbor element.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
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 DofValues & dofValuesDotOld() const override
typename MooseVariableDataBase< OutputType >::DofValues DofValues
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
unsigned int qp
The quadrature point index.
void prepare() override
Prepare the elemental degrees of freedom.
const DofValues & dofValuesDotNeighbor() const override
void reinitNode() override
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
std::unique_ptr< MooseVariableData< OutputType > > _element_data
Holder for all the data associated with the "main" element.
const Node *const & node() const
Returns the reference to the node.
virtual void residualSetup() override
typename MooseVariableDataBase< OutputType >::DofValue DofValue
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
const DofValues & dofValuesPreviousNLNeighbor() const override
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
const libMesh::Elem * elem
The element.
const OutputType & nodalValueOlderNeighbor() const
const Elem *const & lowerDElem() const
Return the lower dimensional element.
const DofValues & dofValuesOldNeighbor() const override
const OutputType & nodalValueDotOld() const
DotType evaluateDot(const ElemQpArg &elem_qp, const StateArg &state) const override final
const DofValues & dofValuesDotDotNeighbor() const override
auto index_range(const T &sizable)
Argument for requesting functor evaluation at quadrature point locations on an element side...
virtual void computeElemValues() override
Actually compute variable values from the solution vectors.
unsigned int state
The state.
virtual void residualSetup() override
const FieldVariablePhiDivergence & divPhiFace() const
const OutputType & nodalValuePreviousNL() const
void prepareAux() override
void clearAllDofIndices() final