https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FVGreenGaussGradient.C
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
11
14#include "FEProblemBase.h"
15#include "SystemBase.h"
16
18
21{
23 params.addClassDescription("Green-Gauss cell-centered gradient method.");
24 return params;
25}
26
31
32void
34 SystemBase & system,
35 GradientContainer & gradient,
36 const std::unordered_set<unsigned int> & variable_numbers) const
37{
38 auto & fe_problem = system.feProblem();
39
40 PARALLEL_TRY
41 {
43 FaceInfoRange face_info_range(fe_problem.mesh().ownedFaceInfoBegin(),
44 fe_problem.mesh().ownedFaceInfoEnd());
45
47 fe_problem, system, gradient, variable_numbers);
48 Threads::parallel_reduce(face_info_range, gradient_face_thread);
49 }
50 fe_problem.checkExceptionAndStopSolve();
51
52 for (auto & vec : gradient)
53 vec->close();
54
55 PARALLEL_TRY
56 {
58 ElemInfoRange elem_info_range(fe_problem.mesh().ownedElemInfoBegin(),
59 fe_problem.mesh().ownedElemInfoEnd());
60
62 fe_problem, system, gradient, variable_numbers);
63 Threads::parallel_reduce(elem_info_range, gradient_volume_thread);
64 }
65 fe_problem.checkExceptionAndStopSolve();
66}
registerMooseObject("MooseApp", FVGreenGaussGradient)
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
StoredRange< MooseMesh::const_face_info_iterator, const FaceInfo * > FaceInfoRange
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
StoredRange< MooseMesh::const_elem_info_iterator, const ElemInfo * > ElemInfoRange
Base class for linear finite-volume cell-gradient methods.
static InputParameters validParams()
Input parameters shared by all the gradient methods.
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > GradientContainer
One vector per spatial component of the cell-centered gradient.
Green-Gauss cell-centered gradient method for linear finite-volume variables.
static InputParameters validParams()
void computeGradientWithoutLimiter(SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const override
Compute the method-specific gradient before this base class applies any limiter.
FVGreenGaussGradient(const InputParameters &params)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Base class for a system (of equations)
Definition SystemBase.h:87
FEProblemBase & feProblem()
Definition SystemBase.h:104
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())