17 FEProblemBase & fe_problem,
const unsigned int linear_system_num)
18 : _fe_problem(fe_problem),
19 _dim(_fe_problem.
mesh().dimension()),
20 _linear_system_number(linear_system_num),
22 _fe_problem.getLinearSystem(_linear_system_number).system())),
23 _system_number(_linear_system.number())
29 : _fe_problem(x._fe_problem),
31 _linear_system_number(x._linear_system_number),
32 _linear_system(x._linear_system),
33 _system_number(x._system_number)
50 unsigned int size = 0;
52 for (
const auto & variable : linear_system.getVariables(
_tid))
56 "This should be a linear FV variable, did we somehow add a nonlinear variable to " 57 "the linear system?");
66 std::vector<std::vector<Real>> new_values(grad_container.size(),
67 std::vector<Real>(size, 0.0));
68 std::vector<dof_id_type> dof_indices(size, 0);
70 std::vector<PetscVectorReader> grad_reader;
71 for (
const auto dim_index :
index_range(grad_container))
72 grad_reader.emplace_back(*grad_container[dim_index]);
75 auto elem_iterator = range.begin();
78 const auto & elem_info = *elem_iterator;
84 "We have not yet implemented the correct translation from gradient to " 86 "spherical coordinates yet.");
89 const auto volume = elem_info->volume() * elem_info->coordFactor();
91 for (
const auto dim_index :
index_range(grad_container))
92 new_values[dim_index][elem_i] = grad_reader[dim_index](dof_indices[elem_i]) /
volume;
97 elem_info->centroid()(rz_radial_coord);
98 new_values[rz_radial_coord][elem_i] += radial_contrib;
104 for (
const auto dim_index :
index_range(grad_container))
106 grad_container[dim_index]->zero();
107 grad_container[dim_index]->add_vector(new_values[dim_index].data(), dof_indices);
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...
std::vector< std::unique_ptr< NumericVector< Number > > > & newGradientContainer()
Return a reference to the new (temporary) gradient container vectors.
Tnew cast_ref(Told &oldvar)
const unsigned int _linear_system_number
The number of the linear system on which this thread is acting.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
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.
MooseLinearVariableFV< Real > * _current_var
Pointer to the current variable.
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
Get the coordinate system type, e.g.
LinearSystem & getLinearSystem(unsigned int sys_num)
Get non-constant reference to a linear system.
ComputeLinearFVGreenGaussGradientVolumeThread(FEProblemBase &fe_problem, const unsigned int linear_system_num)
Class constructor.
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
virtual bool needsGradientVectorStorage() const override
Check if cell gradient computations were requested for this variable.
auto index_range(const T &sizable)