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 "SmallDeformationElasticityModel.h" 6 : #include "SmallDeformationPlasticityModel.h" 7 : 8 : InputParameters 9 236 : SmallDeformationElasticityModel::validParams() 10 : { 11 236 : InputParameters params = Material::validParams(); 12 236 : params += BaseNameInterface::validParams(); 13 : 14 236 : params.set<bool>("compute") = false; 15 236 : params.suppressParameter<bool>("compute"); 16 : 17 236 : return params; 18 0 : } 19 : 20 75 : SmallDeformationElasticityModel::SmallDeformationElasticityModel(const InputParameters & parameters) 21 : : Material(parameters), 22 : BaseNameInterface(parameters), 23 75 : _plasticity_model(nullptr), 24 75 : _elastic_strain(declareADProperty<RankTwoTensor>(prependBaseName("elastic_strain"))) 25 : { 26 75 : } 27 : 28 : void 29 13163372 : SmallDeformationElasticityModel::setQp(unsigned int qp) 30 : { 31 13163372 : _qp = qp; 32 13163372 : if (_plasticity_model) 33 139608 : _plasticity_model->setQp(qp); 34 13163372 : } 35 : 36 : void 37 6 : SmallDeformationElasticityModel::setPlasticityModel( 38 : SmallDeformationPlasticityModel * plasticity_model) 39 : { 40 6 : _plasticity_model = plasticity_model; 41 6 : _plasticity_model->setElasticityModel(this); 42 6 : } 43 : 44 : void 45 0 : SmallDeformationElasticityModel::initQpStatefulProperties() 46 : { 47 0 : _elastic_strain[_qp].zero(); 48 0 : } 49 : 50 : void 51 13163372 : SmallDeformationElasticityModel::updateState(const ADRankTwoTensor & mechanical_strain, 52 : ADRankTwoTensor & stress) 53 : { 54 13163372 : _elastic_strain[_qp] = mechanical_strain; 55 : 56 13163372 : if (_plasticity_model) 57 139608 : _plasticity_model->updateState(stress, _elastic_strain[_qp]); 58 : else 59 26047528 : stress = computeStress(_elastic_strain[_qp]); 60 13163372 : }