14 #include "libmesh/elem_quality.h" 15 #include "libmesh/enum_elem_quality.h" 16 #include "libmesh/string_to_enum.h" 21 return MooseEnum(
"ASPECT_RATIO SKEW SHEAR SHAPE MAX_ANGLE MIN_ANGLE CONDITION DISTORTION TAPER " 22 "WARP STRETCH DIAGONAL ASPECT_RATIO_BETA ASPECT_RATIO_GAMMA SIZE JACOBIAN");
28 return MooseEnum(
"WARNING ERROR",
"WARNING");
37 params.
addClassDescription(
"Class to check the quality of each element using different metrics " 42 "Type of quality metric to be checked");
43 params.
addParam<
Real>(
"upper_bound",
"the upper bound for provided metric type");
44 params.
addParam<
Real>(
"lower_bound",
"The lower bound for provided metric type");
47 "The way how the failure of quality metric check should respond");
56 _has_upper_bound(isParamValid(
"upper_bound")),
57 _has_lower_bound(isParamValid(
"lower_bound")),
58 _upper_bound(_has_upper_bound ? getParam<
Real>(
"upper_bound") : 0.0),
59 _lower_bound(_has_lower_bound ? getParam<
Real>(
"lower_bound") : 0.0),
95 std::pair<Real, Real> actual_bounds;
99 mooseError(
"Provided lower bound should be less than provided upper bound!");
106 mooseError(
"Provided lower bound should less than the default upper bound: ",
107 default_bounds.second);
109 actual_bounds = std::make_pair(
_lower_bound, default_bounds.second);
114 mooseError(
"Provided upper bound should larger than the default lower bound: ",
115 default_bounds.first);
117 actual_bounds = std::make_pair(default_bounds.first,
_upper_bound);
120 actual_bounds = default_bounds;
134 if (mv < actual_bounds.first || mv > actual_bounds.second)
142 _elem_ids.insert(eqc._elem_ids.begin(), eqc._elem_ids.end());
143 _bypassed_elem_type.insert(eqc._bypassed_elem_type.begin(), eqc._bypassed_elem_type.end());
166 mooseWarning(
"Provided quality metric doesn't apply to following element type: " +
201 const std::vector<ElemQuality> & elem_metrics)
203 bool has_metric =
false;
205 for (
unsigned int i = 0; i < elem_metrics.size(); ++i)
206 if (elem_metric == elem_metrics[i])
std::string name(const ElemQuality q)
void initialize() override
Called before execute() is ever called so that data can be cleared.
A MultiMooseEnum object to hold "execute_on" flags.
const FailureType _failure_type
void execute() override
Execute method.
std::set< dof_id_type > _elem_ids
static InputParameters validParams()
unsigned int _checked_elem_num
void finalize() override
Finalize.
registerMooseObject("MooseApp", ElementQualityChecker)
bool checkMetricApplicability(const ElemQuality &elem_metric, const std::vector< ElemQuality > &elem_metrics)
const Parallel::Communicator & _communicator
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
static InputParameters validParams()
void min(const T &r, T &o, Request &req) const
const bool _has_lower_bound
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static MooseEnum FailureMessageType()
std::string stringify(const T &t)
conversion to string
void threadJoin(const UserObject &uo) override
Must override.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ElementQualityChecker(const InputParameters ¶meters)
const Elem *const & _current_elem
The current element pointer (available during execute())
void max(const T &r, T &o, Request &req) const
static MooseEnum QualityMetricType()
const bool _has_upper_bound
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
std::set< std::string > _bypassed_elem_type
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
std::vector< ElemQuality > valid(const ElemType t)
Base class for user-specific data.
void set_union(T &data, const unsigned int root_id) const
const ExecFlagType EXEC_INITIAL