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");
53template <
typename OutputType>
57 _element_data = std::make_unique<MooseVariableData<OutputType>>(*
this,
75 std::make_unique<MooseVariableData<OutputType>>(*
this,
85template <
typename OutputType>
92template <
typename OutputType>
96 _element_data->prepare();
99template <
typename OutputType>
103 _neighbor_data->prepare();
106template <
typename OutputType>
110 _lower_data->prepare();
113template <
typename OutputType>
117 _element_data->prepareAux();
118 _neighbor_data->prepareAux();
119 _lower_data->prepareAux();
122template <
typename OutputType>
126 _element_data->reinitNode();
129template <
typename OutputType>
133 _element_data->reinitAux();
136template <
typename OutputType>
140 _neighbor_data->reinitAux();
143template <
typename OutputType>
147 _element_data->reinitNodes(nodes);
150template <
typename OutputType>
154 _neighbor_data->reinitNodes(nodes);
157template <
typename OutputType>
160 std::vector<dof_id_type> & dof_indices)
const
162 _element_data->getDofIndices(elem, dof_indices);
165template <
typename OutputType>
172template <
typename OutputType>
176 return _element_data->getNodalValue(node,
Moose::Old);
179template <
typename OutputType>
183 return _element_data->getNodalValue(node,
Moose::Older);
186template <
typename OutputType>
193template <
typename OutputType>
197 return _element_data->getElementalValue(elem,
Moose::Old, idx);
200template <
typename OutputType>
207template <
typename OutputType>
211 _element_data->insert(vector);
214template <
typename OutputType>
218 _lower_data->insert(vector);
221template <
typename OutputType>
225 _element_data->add(vector);
228template <
typename OutputType>
232 _element_data->addSolution(this->_sys.solution(), v);
235template <
typename OutputType>
239 _neighbor_data->addSolution(this->_sys.solution(), v);
242template <
typename OutputType>
250template <
typename OutputType>
254 return _element_data->dofValues();
257template <
typename OutputType>
261 return _element_data->dofValuesOld();
264template <
typename OutputType>
268 return _element_data->dofValuesOlder();
271template <
typename OutputType>
275 return _element_data->dofValuesPreviousNL();
278template <
typename OutputType>
282 return _neighbor_data->dofValues();
285template <
typename OutputType>
289 return _neighbor_data->dofValuesOld();
292template <
typename OutputType>
296 return _neighbor_data->dofValuesOlder();
299template <
typename OutputType>
303 return _neighbor_data->dofValuesPreviousNL();
306template <
typename OutputType>
310 return _element_data->dofValuesDot();
313template <
typename OutputType>
317 return _element_data->dofValuesDotDot();
320template <
typename OutputType>
324 return _element_data->dofValuesDotOld();
327template <
typename OutputType>
331 return _element_data->dofValuesDotDotOld();
334template <
typename OutputType>
338 return _neighbor_data->dofValuesDot();
341template <
typename OutputType>
345 return _neighbor_data->dofValuesDotDot();
348template <
typename OutputType>
352 return _neighbor_data->dofValuesDotOld();
355template <
typename OutputType>
359 return _neighbor_data->dofValuesDotDotOld();
362template <
typename OutputType>
366 return _element_data->dofValuesDuDotDu();
369template <
typename OutputType>
373 return _element_data->dofValuesDuDotDotDu();
376template <
typename OutputType>
380 return _neighbor_data->dofValuesDuDotDu();
383template <
typename OutputType>
387 return _neighbor_data->dofValuesDuDotDotDu();
390template <
typename OutputType>
394 _element_data->prepareIC();
397template <
typename OutputType>
402 _element_data->computeValues();
405template <
typename OutputType>
410 _element_data->computeValues();
413template <
typename OutputType>
418 _neighbor_data->computeValues();
421template <
typename OutputType>
426 _neighbor_data->computeValues();
429template <
typename OutputType>
434 _lower_data->computeValues();
437template <
typename OutputType>
441 _element_data->computeIncrementAtQps(increment_vec);
444template <
typename OutputType>
448 _element_data->computeIncrementAtNode(increment_vec);
451template <
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;
486 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
491 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
492 for (
unsigned int j = 0; j < _count; j++)
495 value(j) += phi[i][0] * (*this->_sys.currentSolution())(dof_indices[i] + j);
500 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
502 for (
unsigned int j = 0; j < _count; j++)
504 value(j) = (*this->_sys.currentSolution())(dof_indices[0] + n);
505 n += this->_dof_indices.size();
512template <
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;
546 this->_dof_map.dof_indices(elem, dof_indices, _var_num);
551 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
552 for (
unsigned int j = 0; j < _count; ++j)
556 value(j, k) += grad_phi[i][0](k) * (*this->_sys.currentSolution())(dof_indices[i] + j);
561 mooseAssert(dof_indices.size() == 1,
"Wrong size for dof indices");
567template <
typename OutputType>
574template <
typename OutputType>
581template <
typename OutputType>
585 return _element_data->nodalVectorTagValue(tag);
588template <
typename OutputType>
592 return _element_data->nodalMatrixTagValue(tag);
595template <
typename OutputType>
602template <
typename OutputType>
609template <
typename OutputType>
616template <
typename OutputType>
623template <
typename OutputType>
630template <
typename OutputType>
637template <
typename OutputType>
641 return _element_data->nodalValueDot();
644template <
typename OutputType>
648 return _element_data->nodalValueDotDot();
651template <
typename OutputType>
655 return _element_data->nodalValueDotOld();
658template <
typename OutputType>
662 return _element_data->nodalValueDotDotOld();
665template <
typename OutputType>
669 _element_data->computeNodalValues();
672template <
typename OutputType>
676 _neighbor_data->computeNodalValues();
679template <
typename OutputType>
683 _element_data->setNodalValue(value, idx);
686template <
typename OutputType>
690 _element_data->setDofValue(value, index);
693template <
typename OutputType>
697 _element_data->setDofValues(
values);
700template <
typename OutputType>
704 _lower_data->setDofValues(
values);
707template <
typename OutputType>
711 _element_data->insertNodalValue(residual, v);
714template <
typename OutputType>
718 return _element_data->secondPhi();
721template <
typename OutputType>
725 return _element_data->curlPhi();
728template <
typename OutputType>
732 return _element_data->divPhi();
735template <
typename OutputType>
739 return _element_data->secondPhiFace();
742template <
typename OutputType>
746 return _element_data->curlPhiFace();
749template <
typename OutputType>
753 return _element_data->divPhiFace();
756template <
typename OutputType>
760 return _neighbor_data->secondPhi();
763template <
typename OutputType>
767 return _neighbor_data->curlPhi();
770template <
typename OutputType>
774 return _neighbor_data->divPhi();
777template <
typename OutputType>
781 return _neighbor_data->secondPhiFace();
784template <
typename OutputType>
788 return _neighbor_data->curlPhiFace();
791template <
typename OutputType>
795 return _neighbor_data->divPhiFace();
798template <
typename OutputType>
802 return _element_data->usesSecondPhi();
805template <
typename OutputType>
809 return _neighbor_data->usesSecondPhi();
812template <
typename OutputType>
816 return _element_data->computingCurl();
819template <
typename OutputType>
823 return _element_data->computingDiv();
826template <
typename OutputType>
830 return _element_data->isNodalDefined();
833template <
typename OutputType>
837 return _neighbor_data->isNodalDefined();
840template <
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());
851template <
typename OutputType>
855 _element_data->clearDofIndices();
856 _neighbor_data->clearDofIndices();
857 _lower_data->clearDofIndices();
860template <
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");
897template <
typename OutputType>
910template <
typename OutputType>
911template <
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];
983template <
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");
1033template <
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];
1044template <
typename OutputType>
1051 evaluateOnElement(elem_qp_arg, state,
false);
1052 return _current_elem_qp_functor_sln[0];
1055template <
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");
1100template <
typename OutputType>
1104 return faceEvaluate(face_arg, state, _current_elem_side_qp_functor_sln);
1107template <
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();
1120 evaluateOnElement(elem_qp_arg, state,
false);
1121 return _current_elem_qp_functor_sln[0];
1124template <
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];
1136template <
typename OutputType>
1144 evaluateOnElement(elem_qp_arg, state,
false);
1145 return _current_elem_qp_functor_gradient[0];
1148template <
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];
1165template <
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];
1182template <
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];
1199template <
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");
1253template <
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];
1265template <
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];
1277template <
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];
1292template <
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");
1351template <
typename OutputType>
1355 _current_elem_qp_functor_elem =
nullptr;
1360template <
typename OutputType>
1364 _current_elem_qp_functor_elem =
nullptr;
1369template <
typename OutputType>
1373 _current_elem_qp_functor_elem =
nullptr;
1378template <
typename OutputType>
1382 _element_data->sizeMatrixTagData();
1383 _neighbor_data->sizeMatrixTagData();
1384 _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
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
virtual unsigned short dim() const=0
subdomain_id_type subdomain_id() const
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
virtual std::unique_ptr< QBase > clone() const
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
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)
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
auto index_range(const T &sizable)
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
const unsigned int invalid_uint
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
IntRange< T > make_range(T beg, T end)
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.