Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.mooseframework.org 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "HEVPLinearHardening.h" 11 : 12 : registerMooseObject("TensorMechanicsApp", HEVPLinearHardening); 13 : 14 : InputParameters 15 6 : HEVPLinearHardening::validParams() 16 : { 17 6 : InputParameters params = HEVPStrengthUOBase::validParams(); 18 12 : params.addParam<Real>("yield_stress", "Yield strength"); 19 12 : params.addParam<Real>("slope", "Linear hardening slope"); 20 6 : params.addClassDescription("User Object for linear hardening"); 21 6 : return params; 22 0 : } 23 : 24 3 : HEVPLinearHardening::HEVPLinearHardening(const InputParameters & parameters) 25 : : HEVPStrengthUOBase(parameters), 26 3 : _sig0(getParam<Real>("yield_stress")), 27 9 : _slope(getParam<Real>("slope")) 28 : { 29 3 : } 30 : 31 : bool 32 107344 : HEVPLinearHardening::computeValue(unsigned int qp, Real & val) const 33 : { 34 107344 : val = _sig0 + _slope * _intvar[qp]; 35 107344 : return true; 36 : } 37 : 38 : bool 39 89296 : HEVPLinearHardening::computeDerivative(unsigned int /*qp*/, 40 : const std::string & coupled_var_name, 41 : Real & val) const 42 : { 43 89296 : val = 0; 44 : 45 89296 : if (_intvar_prop_name == coupled_var_name) 46 89296 : val = _slope; 47 : 48 89296 : return true; 49 : }