19 std::vector<std::unique_ptr<NumericVector<Number>>> & temporary_gradient)
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();
73 for (
const auto elem_i : make_range(size))
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);
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
FEProblemBase & _fe_problem
SystemBase & _system
The system wrapper this thread operates on.
const unsigned int _system_number
Global system number.
void operator()(const ElemInfoRange &range)
Operator which is used to execute the thread over a certain iterator range.
StoredRange< MooseMesh::const_elem_info_iterator, const ElemInfo * > ElemInfoRange
MooseLinearVariableFV< Real > * _current_var
Pointer to the current variable.
std::vector< std::unique_ptr< NumericVector< Number > > > & _temporary_gradient
Cache for the temporary gradient being built.
void join(const ComputeLinearFVGreenGaussGradientVolumeThread &y)
Join threads at the end of the execution.
ComputeLinearFVGreenGaussGradientVolumeThread(FEProblemBase &fe_problem, SystemBase &system, std::vector< std::unique_ptr< NumericVector< Number > > > &temporary_gradient)
Class constructor.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual MooseMesh & mesh() override
This class provides variable solution interface for linear finite volume problems.
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...
virtual bool needsGradientVectorStorage() const override
Check if cell gradient computations were requested for this variable.
unsigned int getAxisymmetricRadialCoord() const
Returns the desired radial direction for RZ coordinate transformation.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
Get the coordinate system type, e.g.
unsigned int number() const
Get variable number coming from libMesh.
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
Base class for a system (of equations)
const std::vector< MooseVariableFieldBase * > & getVariables(THREAD_ID tid)