Skip to content
Permalink
Browse files

Merge pull request #13458 from tophmatthews/creep_clamp_fix_12650

Fix for clamp bug in power law creep
  • Loading branch information...
permcody committed May 21, 2019
2 parents d322090 + 31fb767 commit 208101ed8a001b3465639ed6b3c3952acb3e42a4
@@ -132,7 +132,7 @@ poly(std::vector<Real> c, const T x, const bool derivative)

template <typename T>
T
clamp(T x, Real lowerlimit, Real upperlimit)
clamp(const T & x, Real lowerlimit, Real upperlimit)
{
if (x < lowerlimit)
return lowerlimit;
@@ -162,4 +162,3 @@ smootherStep(T x, T start, T end, bool derivative = false)
}

} // namespace MathUtils

@@ -214,7 +214,7 @@ ADSingleVariableReturnMappingSolution<compute_stage>::internalSolve(
if (residual_old - _residual != 0.0)
{
ADReal alpha = residual_old / (residual_old - _residual);
MathUtils::clamp(alpha, 1.0e-2, 1.0);
alpha = MathUtils::clamp(alpha, 1.0e-2, 1.0);

if (alpha != 1.0)
{
@@ -214,8 +214,8 @@ SingleVariableReturnMappingSolution::internalSolve(const Real effective_trial_st
{
if (residual_old - _residual != 0.0)
{
const Real alpha = residual_old / (residual_old - _residual);
MathUtils::clamp(alpha, 1.0e-2, 1.0);
Real alpha = residual_old / (residual_old - _residual);
alpha = MathUtils::clamp(alpha, 1.0e-2, 1.0);

if (alpha != 1.0)
{

0 comments on commit 208101e

Please sign in to comment.
You can’t perform that action at this time.