https://mooseframework.inl.gov
ComputeLinearFVLimitedGradientThread.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"
14 #include "MooseLinearVariableFV.h"
15 #include "GradientLimiterType.h"
16 
17 #include <unordered_set>
18 
19 // libmesh
20 #include "libmesh/elem_range.h"
21 #include "libmesh/threads.h"
22 #include "libmesh/system.h"
23 
24 class FEProblemBase;
25 class SystemBase;
26 
33 {
34 public:
46  FEProblemBase & fe_problem,
47  SystemBase & system,
48  const std::vector<std::unique_ptr<NumericVector<Number>>> & raw_gradient,
49  std::vector<std::unique_ptr<NumericVector<Number>>> & temporary_limited_gradient,
50  const Moose::FV::GradientLimiterType limiter_type,
51  const std::unordered_set<unsigned int> & requested_variables);
52 
60 
61  using ElemInfoRange = StoredRange<MooseMesh::const_elem_info_iterator, const ElemInfo *>;
64  void operator()(const ElemInfoRange & range);
65 
68 
69 protected:
72 
74  const unsigned int _dim;
75 
78 
81 
83  const unsigned int _system_number;
84 
86  const std::vector<std::unique_ptr<NumericVector<Number>>> & _raw_gradient;
87 
90 
92  const std::unordered_set<unsigned int> & _requested_variables;
93 
96 
99 
101  std::vector<std::unique_ptr<NumericVector<Number>>> & _temporary_limited_gradient;
102 };
GradientLimiterType
Cell-gradient limiter variants used for MUSCL-style reconstructions.
const libMesh::System & _libmesh_system
Reference to the libMesh system backing the wrapper system.
ComputeLinearFVLimitedGradientThread(FEProblemBase &fe_problem, SystemBase &system, const std::vector< std::unique_ptr< NumericVector< Number >>> &raw_gradient, std::vector< std::unique_ptr< NumericVector< Number >>> &temporary_limited_gradient, const Moose::FV::GradientLimiterType limiter_type, const std::unordered_set< unsigned int > &requested_variables)
Class constructor.
Compute limited cell gradients for linear FV variables.
Base class for a system (of equations)
Definition: SystemBase.h:85
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const std::unordered_set< unsigned int > & _requested_variables
Variable numbers that requested the current limiter.
void join(const ComputeLinearFVLimitedGradientThread &y)
Join threads at the end of the execution.
const unsigned int _system_number
Global system number in the libMesh equation system.
FEProblemBase & _fe_problem
Reference to the problem.
std::vector< std::unique_ptr< NumericVector< Number > > > & _temporary_limited_gradient
Reference to the temporary limited gradient storage.
const Moose::FV::GradientLimiterType _limiter_type
The type of the limiter we requested.
void operator()(const ElemInfoRange &range)
Operator which is used to execute the thread over a certain iterator range.
tbb::split split
SystemBase & _system
The system wrapper this thread operates on.
const unsigned int _dim
The dimension of the domain.
StoredRange< MooseMesh::const_elem_info_iterator, const ElemInfo * > ElemInfoRange
MooseLinearVariableFV< Real > * _current_var
Pointer to the current variable we are operating on.
unsigned int THREAD_ID
Definition: MooseTypes.h:237
const std::vector< std::unique_ptr< NumericVector< Number > > > & _raw_gradient
Reference to the raw gradient storage used as input for limiting.