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 "TensorMechanicsHardeningConstant.h" 11 : 12 : registerMooseObject("TensorMechanicsApp", TensorMechanicsHardeningConstant); 13 : 14 : InputParameters 15 4262 : TensorMechanicsHardeningConstant::validParams() 16 : { 17 4262 : InputParameters params = TensorMechanicsHardeningModel::validParams(); 18 8524 : params.addParam<Real>("value", 19 8524 : 1.0, 20 : "The value of the parameter for all internal parameter. " 21 : "This is perfect plasticity - there is no hardening."); 22 8524 : params.addParam<bool>("convert_to_radians", 23 8524 : false, 24 : "If true, the value you entered will be " 25 : "multiplied by Pi/180 before passing to the " 26 : "Plasticity algorithms"); 27 4262 : params.addClassDescription( 28 : "No hardening - the parameter is independent of the internal parameter(s)"); 29 4262 : return params; 30 0 : } 31 : 32 2131 : TensorMechanicsHardeningConstant::TensorMechanicsHardeningConstant( 33 2131 : const InputParameters & parameters) 34 : : TensorMechanicsHardeningModel(parameters), 35 6393 : _val(getParam<bool>("convert_to_radians") ? getParam<Real>("value") * libMesh::pi / 180.0 36 7774 : : getParam<Real>("value")) 37 : { 38 2131 : } 39 : 40 14437281 : Real TensorMechanicsHardeningConstant::value(Real /*intnl*/) const { return _val; } 41 : 42 5533756 : Real TensorMechanicsHardeningConstant::derivative(Real /*intnl*/) const { return 0.0; } 43 : 44 : std::string 45 15973 : TensorMechanicsHardeningConstant::modelName() const 46 : { 47 15973 : return "Constant"; 48 : }