20 : _fe_problem(fe_problem),
21 _dim(_fe_problem.
mesh().dimension()),
23 _libmesh_system(system.system()),
24 _system_number(_libmesh_system.number()),
25 _temporary_gradient(temporary_gradient)
31 : _fe_problem(x._fe_problem),
34 _libmesh_system(x._libmesh_system),
35 _system_number(x._system_number),
36 _temporary_gradient(x._temporary_gradient)
47 unsigned int size = 0;
64 std::vector<Real>(size, 0.0));
65 std::vector<dof_id_type> dof_indices(size, 0);
67 std::vector<PetscVectorReader> grad_reader;
72 auto elem_iterator = range.begin();
75 const auto & elem_info = *elem_iterator;
81 "We have not yet implemented the correct translation from gradient to " 83 "spherical coordinates yet.");
86 const auto volume = elem_info->volume() * elem_info->coordFactor();
89 temporary_values[dim_index][elem_i] =
90 grad_reader[dim_index](dof_indices[elem_i]) /
volume;
94 mooseAssert(elem_info->centroid()(rz_radial_coord) != 0,
95 "Axisymmetric control volumes should not have a zero radial coordinate");
96 temporary_values[rz_radial_coord][elem_i] -=
98 elem_info->centroid()(rz_radial_coord);
107 _temporary_gradient[dim_index]->add_vector(temporary_values[dim_index].data(), dof_indices);
const std::vector< MooseVariableFieldBase * > & getVariables(THREAD_ID tid)
StoredRange< MooseMesh::const_elem_info_iterator, const ElemInfo * > ElemInfoRange
const unsigned int _system_number
Global system number.
unsigned int number() const
Get variable number coming from libMesh.
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
Base class for a system (of equations)
std::vector< std::unique_ptr< NumericVector< Number > > > & _temporary_gradient
Cache for the temporary gradient being built.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
void operator()(const ElemInfoRange &range)
Operator which is used to execute the thread over a certain iterator range.
SystemBase & _system
The system wrapper this thread operates on.
MooseLinearVariableFV< Real > * _current_var
Pointer to the current variable.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
Get the coordinate system type, e.g.
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
Get the solution value for the provided element and seed the derivative for the corresponding dof ind...
void join(const ComputeLinearFVGreenGaussGradientVolumeThread &y)
Join threads at the end of the execution.
FEProblemBase & _fe_problem
IntRange< T > make_range(T beg, T end)
virtual MooseMesh & mesh() override
ComputeLinearFVGreenGaussGradientVolumeThread(FEProblemBase &fe_problem, SystemBase &system, std::vector< std::unique_ptr< NumericVector< Number >>> &temporary_gradient)
Class constructor.
virtual bool needsGradientVectorStorage() const override
Check if cell gradient computations were requested for this variable.
auto index_range(const T &sizable)