15 #include "libmesh/quadrature.h" 27 params.
addClassDescription(
"This postprocessor estimates a timestep that reduces the increment " 28 "change in a material property below a given threshold.");
30 params.
addParam<
bool>(
"use_material_timestep_limit",
32 "if true, the time step is limited by the minimum value of the " 33 "material_timestep_limit property");
35 params.
addParam<MaterialPropertyName>(
"elements_changed_property",
36 "Name of the material property used to limit the time step " 37 "if its value changes by more than " 38 "'elements_changed_threshold' in at least " 39 "'elements_changed' elements");
42 "elements_changed > 0",
43 "Maximum number of elements within which the property named in " 44 "'elements_changed_property' is allowed to change by more than " 45 "'elements_changed_threshold' before the time step is limited.");
48 "elements_changed_threshold' > 0",
49 "Maximum permitted change in the value of " 50 "'elements_changed_property' in 'elements_changed' elements " 51 "before the time step is limited.");
53 std::numeric_limits<Real>::max(),
55 "Maximum value returned by this postprocessor.");
62 _use_material_timestep_limit(getParam<bool>(
"use_material_timestep_limit")),
63 _matl_time_step(_use_material_timestep_limit
64 ? &getMaterialPropertyByName<
Real>(
"material_timestep_limit")
66 _matl_value(getParam<
Real>(
"maximum_value")),
67 _use_elements_changed(parameters.isParamSetByUser(
"elements_changed_property")),
68 _changed_property(_use_elements_changed
69 ? &getMaterialPropertyByName<
Real>(
70 getParam<MaterialPropertyName>(
"elements_changed_property"))
72 _changed_property_old(_use_elements_changed
73 ? &getMaterialPropertyOldByName<
Real>(
74 getParam<MaterialPropertyName>(
"elements_changed_property"))
76 _elements_changed(isParamValid(
"elements_changed") ? getParam<
int>(
"elements_changed") : 0),
78 _elements_changed_threshold(parameters.isParamSetByUser(
"elements_changed_threshold'")
79 ? getParam<
Real>(
"elements_changed_threshold'")
80 : TOLERANCE * TOLERANCE),
81 _max(getParam<
Real>(
"maximum_value")),
85 paramError(
"elements_changed",
"needs to be set when elements_changed_property is defined");
88 mooseError(
"either use_material_timestep_limit needs to be true or elements_changed_property " virtual void execute() override
unsigned int _qp
Current quadrature point.
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
virtual void initialize() override
virtual void threadJoin(const UserObject &y) override
virtual Real getValue() const override
MaterialTimeStepPostprocessor(const InputParameters ¶meters)
static InputParameters validParams()
virtual void finalize() override
registerMooseObject("SolidMechanicsApp", MaterialTimeStepPostprocessor)
const std::vector< double > y
static InputParameters validParams()
Real _matl_value
Current time step limit from the material properties.
const bool _use_material_timestep_limit
Flag to find the time step limit from material properties.
int _count
Current number of elements changed.
void paramError(const std::string ¶m, Args... args) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const QBase *const & _qrule
const Real _max
Maximum allowed value.
This postporocessor calculates an estimated timestep size that limits an auxiliary variable to below ...
const bool _use_elements_changed
Flag to limit the time step based on the number of elements changed.
const int _elements_changed
Target number of changed elements used to determine if we need to change the time step...
void mooseError(Args &&... args) const
const InputParameters & parameters() const
const MaterialProperty< Real > *const _changed_property
Material property used to determine if elements have changed.
const Real _elements_changed_threshold
Tolerance to determine if elements have changed.
const MaterialProperty< Real > *const _changed_property_old
void ErrorVector unsigned int
const MaterialProperty< Real > *const _matl_time_step
Pointer to the material property containing the time step limit.