12 #include "NonlinearSystemBase.h"
19 params.addClassDescription(
20 "This is the material class used to compute the stabilization parameter tau.");
21 params.addParam<Real>(
"alpha",
23 "Multiplicative factor on the stabilization parameter tau."););
25 template <ComputeStage compute_stage>
28 _alpha(getParam<Real>(
"alpha")),
29 _tau(declareADProperty<Real>(
"tau"))
33 template <ComputeStage compute_stage>
37 _hmax = _current_elem->hmax();
44 if (!_displacements.size())
46 _hmax = _current_elem->hmax();
52 for (
unsigned int n_outer = 0; n_outer < _current_elem->n_vertices(); n_outer++)
53 for (
unsigned int n_inner = n_outer + 1; n_inner < _current_elem->n_vertices(); n_inner++)
55 VectorValue<DualReal> diff = (_current_elem->point(n_outer) - _current_elem->point(n_inner));
56 unsigned dimension = 0;
57 for (
const auto & disp_num : _displacements)
60 .derivatives()[disp_num * _fe_problem.getNonlinearSystemBase().getMaxVarNDofsPerElem() +
63 .derivatives()[disp_num * _fe_problem.getNonlinearSystemBase().getMaxVarNDofsPerElem() +
67 _hmax = std::max(_hmax, diff.norm_sq());
70 _hmax = std::sqrt(_hmax);
73 template <ComputeStage compute_stage>
79 Material::computeProperties();
82 template <ComputeStage compute_stage>
88 auto && nu = _mu[_qp] / _rho[_qp];
89 auto && transient_part = _transient_term ? 4. / (_dt * _dt) : 0.;
90 _tau[_qp] = _alpha / std::sqrt(transient_part +
91 (2. * _velocity[_qp].norm() / _hmax) *
92 (2. * _velocity[_qp].norm() / _hmax) +
93 9. * (4. * nu / (_hmax * _hmax)) * (4. * nu / (_hmax * _hmax)));