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 "ComputeCrystalPlasticityEigenstrainBase.h" 11 : #include "RankTwoTensor.h" 12 : 13 : InputParameters 14 104 : ComputeCrystalPlasticityEigenstrainBase::validParams() 15 : { 16 104 : InputParameters params = ComputeEigenstrainBase::validParams(); 17 : 18 : // The return stress increment classes are intended to be iterative materials, so must set compute 19 : // = false for all inheriting classes 20 104 : params.set<bool>("compute") = false; 21 104 : params.suppressParameter<bool>("compute"); 22 : 23 208 : params.addRequiredParam<std::string>( 24 : "deformation_gradient_name", 25 : "Material property name for the deformation gradient tensor computed " 26 : "by this model."); 27 104 : return params; 28 0 : } 29 : 30 78 : ComputeCrystalPlasticityEigenstrainBase::ComputeCrystalPlasticityEigenstrainBase( 31 78 : const InputParameters & parameters) 32 : : ComputeEigenstrainBase(parameters), 33 78 : _deformation_gradient_name(_base_name + getParam<std::string>("deformation_gradient_name")), 34 78 : _deformation_gradient(declareProperty<RankTwoTensor>(_deformation_gradient_name)), 35 78 : _deformation_gradient_old(getMaterialPropertyOld<RankTwoTensor>(_deformation_gradient_name)), 36 156 : _crysrot(getMaterialProperty<RankTwoTensor>( 37 78 : "crysrot")) // defined in the elasticity tensor classes for crystal plasticity 38 : { 39 78 : } 40 : 41 : void 42 6464 : ComputeCrystalPlasticityEigenstrainBase::initQpStatefulProperties() 43 : { 44 6464 : ComputeEigenstrainBase::initQpStatefulProperties(); 45 : 46 : // Initialize deformation gradient to be identity 47 6464 : _deformation_gradient[_qp].zero(); 48 6464 : _deformation_gradient[_qp].addIa(1.0); 49 6464 : } 50 : 51 : void 52 387714 : ComputeCrystalPlasticityEigenstrainBase::computeQpEigenstrain() 53 : { 54 : // updates the deformation gradient from the child class 55 387714 : computeQpDeformationGradient(); 56 : // use the updated deformation gradient for the eigenstrain calculation 57 387704 : _eigenstrain[_qp] = 0.5 * (_deformation_gradient[_qp].transpose() * _deformation_gradient[_qp] - 58 387704 : RankTwoTensor::Identity()); 59 387704 : } 60 : 61 : void 62 302730 : ComputeCrystalPlasticityEigenstrainBase::setQp(const unsigned int & qp) 63 : { 64 302730 : _qp = qp; 65 302730 : } 66 : 67 : void 68 387714 : ComputeCrystalPlasticityEigenstrainBase::setSubstepDt(const Real & substep_dt) 69 : { 70 387714 : _substep_dt = substep_dt; 71 387714 : } 72 : 73 : const RankTwoTensor 74 0 : ComputeCrystalPlasticityEigenstrainBase::getDeformationGradient() const 75 : { 76 0 : return _deformation_gradient[_qp]; 77 : } 78 : 79 : const RankTwoTensor 80 387704 : ComputeCrystalPlasticityEigenstrainBase::getDeformationGradientInverse() const 81 : { 82 387704 : return _deformation_gradient[_qp].inverse(); 83 : }