16#include "libmesh/numeric_vector.h"
21selectGradientLimiter(
const std::string & limiter_name)
23 if (limiter_name ==
"none")
25 if (limiter_name ==
"venkatakrishnan")
28 mooseError(
"Linear FV gradient limiter '", limiter_name,
"' is not currently supported.");
38 params.
addClassDescription(
"Base class for defining cell-centered gradient methods used by "
39 "linear finite volume objects. The method produces final gradient "
40 "values, including the selected limiter when requested.");
42 MooseEnum(
"none venkatakrishnan",
"none"),
43 "Limiter to apply to gradients produced by this method.");
55 const std::unordered_set<unsigned int> & variable_numbers)
const
57 for (
auto & vec : gradient)
62 for (
auto & vec : gradient)
70 ElemInfoRange elem_info_range(fe_problem.mesh().ownedElemInfoBegin(),
71 fe_problem.mesh().ownedElemInfoEnd());
76 fe_problem, system, gradient,
_limiter_type, variable_numbers);
79 fe_problem.checkExceptionAndStopSolve();
81 for (
auto & vec : gradient)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Compute limited cell gradients for linear FV variables.
StoredRange< MooseMesh::const_elem_info_iterator, const ElemInfo * > ElemInfoRange
FVGradientMethod(const InputParameters ¶ms)
Constructor.
static InputParameters validParams()
Input parameters shared by all the gradient methods.
const Moose::FV::GradientLimiterType _limiter_type
Limiter applied after method-specific pre-limiter gradient computation.
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > GradientContainer
One vector per spatial component of the cell-centered gradient.
void computeGradient(SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const
Compute the final gradient values for the requested variables.
virtual void computeGradientWithoutLimiter(SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const =0
Compute the method-specific gradient before this base class applies any limiter.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Every object that can be built by the factory should be derived from this class.
static InputParameters validParams()
Base class for a system (of equations)
FEProblemBase & feProblem()
GradientLimiterType
Cell-gradient limiter variants used for MUSCL-style reconstructions.
@ Venkatakrishnan
Venkatakrishnan limiter (smooth, multidimensional).
@ None
No gradient limiting.
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())