27 #include "libmesh/quadrature.h" 28 #include "libmesh/fe_base.h" 29 #include "libmesh/system.h" 30 #include "libmesh/type_n_tensor.h" 32 template <
typename OutputType>
38 const Elem *
const & elem)
41 _fe_type(_var.feType()),
42 _var_num(_var.number()),
43 _assembly(_subproblem.assembly(_tid, var.kind() ==
Moose::
VAR_SOLVER ? sys.number() : 0)),
44 _element_type(element_type),
45 _time_integrator(_sys.queryTimeIntegrator(_var_num)),
47 _displaced(dynamic_cast<const
DisplacedSystem *>(&_sys) ? true : false),
52 template <
typename OutputType>
60 _qrule = _assembly.qRule();
66 _qrule = _assembly.qRuleFace();
73 template <
typename OutputType>
77 auto && active_coupleable_matrix_tags =
78 _sys.subproblem().getActiveFEVariableCoupleableMatrixTags(_tid);
79 mooseAssert(_qrule,
"We should have a non-null qrule");
80 const auto nqp = _qrule->n_points();
82 for (
auto tag : _required_vector_tags)
83 if (_need_vector_tag_u[tag])
85 _vector_tag_u[tag].resize(nqp);
86 assignForAllQps(0, _vector_tag_u[tag], nqp);
89 for (
auto tag : active_coupleable_matrix_tags)
90 if (_need_matrix_tag_u[tag])
92 _matrix_tag_u[tag].resize(nqp);
93 assignForAllQps(0, _matrix_tag_u[tag], nqp);
97 template <
typename OutputType>
98 const std::vector<dof_id_type> &
105 template <
typename OutputType>
110 initializeSolnVars();
112 unsigned int num_dofs = _dof_indices.size();
120 mooseAssert(num_dofs == 1 && _vector_tags_dof_u[_solution_tag].size() == 1,
121 "There should only be one dof per elem for FV variables");
123 const auto nqp = _qrule->n_points();
124 auto && active_coupleable_matrix_tags =
125 _sys.subproblem().getActiveFEVariableCoupleableMatrixTags(_tid);
129 for (
auto tag : _required_vector_tags)
130 if (_need_vector_tag_u[tag])
131 _vector_tag_u[tag][qp] = _vector_tags_dof_u[tag][0];
133 for (
auto tag : active_coupleable_matrix_tags)
134 if (_need_matrix_tag_u[tag])
135 _matrix_tag_u[tag][qp] = _matrix_tags_dof_u[tag][0];
139 template <
typename OutputType>
143 mooseAssert(index == 0,
"We only ever have one dof value locally");
144 _vector_tags_dof_u[_solution_tag][index] =
value;
145 _has_dof_values =
true;
147 auto & u = _vector_tag_u[_solution_tag];
153 template <
typename OutputType>
157 auto & dof_values = _vector_tags_dof_u[_solution_tag];
158 for (
unsigned int i = 0; i < values.size(); i++)
159 dof_values[i] = values(i);
160 _has_dof_values =
true;
163 template <
typename OutputType>
166 std::vector<dof_id_type> & dof_indices)
const 168 _dof_map.dof_indices(elem, dof_indices, _var_num);
171 template <
typename OutputType>
void initDofIndices(T &data, const Elem &elem)
Moose::DOFType< OutputType >::type OutputData
MooseVariableDataLinearFV(const MooseLinearVariableFV< OutputType > &var, SystemBase &sys, THREAD_ID tid, Moose::ElementType element_type, const Elem *const &elem)
Base class for a system (of equations)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void setGeometry(Moose::GeometryType gm_type)
Set the geometry type before calculating variables values.
void computeValues()
Compute the variable values.
void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const
Get the dof indices for an element.
Class holding the data members for linear finite volume variables.
void setDofValue(const OutputData &value, unsigned int index)
Set local DOF value at index to value .
IntRange< T > make_range(T beg, T end)
virtual const MooseLinearVariableFV< OutputType > & var() const override
Get the corresponding variable.
void initializeSolnVars()
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const std::vector< dof_id_type > & initDofIndices()
Fetch and return the dof indices of this variable on the current element.
This class provides variable solution interface for linear finite volume problems.
auto index_range(const T &sizable)
void setDofValues(const DenseVector< OutputData > &values)
Set local DOF values to the entries of values .