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");
45 params.
addParam<
bool>(
"suppress_invalid_metric_warning",
47 "Whether to print the warning related to the quality metric type not being " 48 "applicable to a given element type.");
51 "The way how the failure of quality metric check should respond");
60 _has_upper_bound(isParamValid(
"upper_bound")),
61 _has_lower_bound(isParamValid(
"lower_bound")),
62 _upper_bound(_has_upper_bound ? getParam<
Real>(
"upper_bound") : 0.0),
63 _lower_bound(_has_lower_bound ? getParam<
Real>(
"lower_bound") : 0.0),
67 _suppress_invalid_metric_warning(getParam<bool>(
"suppress_invalid_metric_warning")),
100 std::pair<Real, Real> actual_bounds;
104 mooseError(
"Provided lower bound should be less than provided upper bound!");
111 mooseError(
"Provided lower bound should less than the default upper bound: ",
112 default_bounds.second);
114 actual_bounds = std::make_pair(
_lower_bound, default_bounds.second);
119 mooseError(
"Provided upper bound should larger than the default lower bound: ",
120 default_bounds.first);
122 actual_bounds = std::make_pair(default_bounds.first,
_upper_bound);
125 actual_bounds = default_bounds;
139 if (mv < actual_bounds.first || mv > actual_bounds.second)
147 _elem_ids.insert(eqc._elem_ids.begin(), eqc._elem_ids.end());
148 _bypassed_elem_type.insert(eqc._bypassed_elem_type.begin(), eqc._bypassed_elem_type.end());
172 mooseWarning(
"Provided quality metric doesn't apply to following element type: " +
208 const std::vector<libMesh::ElemQuality> & elem_metrics)
210 bool has_metric =
false;
212 for (
unsigned int i = 0; i < elem_metrics.size(); ++i)
213 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
set to save ids for all failed elements
static InputParameters validParams()
unsigned int _checked_elem_num
number of checked elements
bool checkMetricApplicability(const libMesh::ElemQuality &elem_metric, const std::vector< libMesh::ElemQuality > &elem_metrics)
void finalize() override
Finalize.
registerMooseObject("MooseApp", ElementQualityChecker)
const Parallel::Communicator & _communicator
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
static InputParameters validParams()
bool _bypassed
whether the element quality check is bypassed or not
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.
Real _m_min
minimum, maximum and summation of quality metric values of all checked elements
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
set to save bypassed element type
libMesh::ElemQuality _m_type
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
const bool _suppress_invalid_metric_warning
Whether to print element applicability warning for bypassed elements.
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