https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeLinearFVGreenGaussGradientVolumeThread.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MooseTypes.h"
13#include "MooseMesh.h"
15
16// libmesh
17#include "libmesh/elem_range.h"
18#include "libmesh/threads.h"
19#include "libmesh/system.h"
20
21#include <unordered_set>
22
23class FEProblemBase;
24class SystemBase;
25
41{
42public:
51 FEProblemBase & fe_problem,
52 SystemBase & system,
53 std::vector<std::unique_ptr<NumericVector<Number>>> & gradient,
54 const std::unordered_set<unsigned int> & gradient_variables);
55
62 Threads::split split);
63
65
66 using ElemInfoRange = StoredRange<MooseMesh::const_elem_info_iterator, const ElemInfo *>;
69 void operator()(const ElemInfoRange & range);
70
74
75protected:
76 // Reference to the problem
78
80 const unsigned int _dim;
81
84
87
89 const unsigned int _system_number;
90
93
96
98 std::vector<std::unique_ptr<NumericVector<Number>>> & _gradient;
99
107 std::vector<Real *> _gradient_data;
108
111
113 const std::unordered_set<unsigned int> & _gradient_variables;
114};
unsigned int THREAD_ID
Definition MooseTypes.h:237
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
const libMesh::System & _libmesh_system
Reference to the libmesh system.
SystemBase & _system
The system wrapper this thread operates on.
const std::unordered_set< unsigned int > & _gradient_variables
Indices of the variables this producer should compute gradients for.
std::vector< Real * > _gradient_data
Writable local arrays, one per gradient component.
void operator()(const ElemInfoRange &range)
Operator which is used to execute the thread over a certain iterator range.
std::vector< std::unique_ptr< NumericVector< Number > > > & _gradient
Normalized (by cell volume) gradients to write into.
StoredRange< MooseMesh::const_elem_info_iterator, const ElemInfo * > ElemInfoRange
MooseLinearVariableFV< Real > * _current_var
Pointer to the current variable.
void join(const ComputeLinearFVGreenGaussGradientVolumeThread &y)
Join threads at the end of the execution.
const bool _owns_gradient_data
True only for the original thread object that acquired and must restore the arrays.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
This class provides variable solution interface for linear finite volume problems.
Base class for a system (of equations)
Definition SystemBase.h:87