Line data Source code
1 : //* This file is part of the RACCOON application 2 : //* being developed at Dolbow lab at Duke University 3 : //* http://dolbow.pratt.duke.edu 4 : 5 : #include "SmallDeformationPlasticityModel.h" 6 : #include "SmallDeformationElasticityModel.h" 7 : 8 : InputParameters 9 146 : SmallDeformationPlasticityModel::validParams() 10 : { 11 146 : InputParameters params = Material::validParams(); 12 146 : params += ADSingleVariableReturnMappingSolution::validParams(); 13 146 : params += BaseNameInterface::validParams(); 14 : 15 292 : params.addRequiredParam<MaterialName>("hardening_model", "Name of the plastic hardening model"); 16 : 17 146 : params.set<bool>("compute") = false; 18 146 : params.suppressParameter<bool>("compute"); 19 : 20 146 : return params; 21 0 : } 22 : 23 6 : SmallDeformationPlasticityModel::SmallDeformationPlasticityModel(const InputParameters & parameters) 24 : : Material(parameters), 25 : ADSingleVariableReturnMappingSolution(parameters), 26 : BaseNameInterface(parameters), 27 12 : _plastic_strain(declareADProperty<RankTwoTensor>(prependBaseName("plastic_strain"))), 28 6 : _plastic_strain_old( 29 12 : getMaterialPropertyOldByName<RankTwoTensor>(prependBaseName("plastic_strain"))), 30 12 : _ep(declareADProperty<Real>(prependBaseName("effective_plastic_strain"))), 31 18 : _ep_old(getMaterialPropertyOldByName<Real>(prependBaseName("effective_plastic_strain"))), 32 12 : _Np(declareADProperty<RankTwoTensor>(prependBaseName("flow_direction"))) 33 : { 34 6 : } 35 : 36 : void 37 6 : SmallDeformationPlasticityModel::initialSetup() 38 : { 39 6 : _hardening_model = dynamic_cast<PlasticHardeningModel *>(&getMaterial("hardening_model")); 40 6 : if (!_hardening_model) 41 0 : paramError("hardening_model", 42 0 : "Plastic hardening model " + getParam<MaterialName>("hardening_model") + 43 0 : " is not compatible with " + name()); 44 6 : } 45 : 46 : void 47 139608 : SmallDeformationPlasticityModel::setQp(unsigned int qp) 48 : { 49 139608 : _qp = qp; 50 139608 : _hardening_model->setQp(qp); 51 139608 : } 52 : 53 : void 54 6 : SmallDeformationPlasticityModel::setElasticityModel( 55 : SmallDeformationElasticityModel * elasticity_model) 56 : { 57 6 : _elasticity_model = elasticity_model; 58 6 : } 59 : 60 : void 61 11508 : SmallDeformationPlasticityModel::initQpStatefulProperties() 62 : { 63 11508 : _plastic_strain[_qp].zero(); 64 11508 : _ep[_qp] = 0; 65 11508 : }