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 "ComputeEigenstrainBeamBase.h" 11 : 12 : InputParameters 13 25 : ComputeEigenstrainBeamBase::validParams() 14 : { 15 25 : InputParameters params = Material::validParams(); 16 50 : params.addRequiredParam<std::string>("eigenstrain_name", 17 : "Material property name for the eigenstrain vector computed " 18 : "by this model. IMPORTANT: The name of this property must " 19 : "also be provided to the strain calculator."); 20 25 : return params; 21 0 : } 22 : 23 19 : ComputeEigenstrainBeamBase::ComputeEigenstrainBeamBase(const InputParameters & parameters) 24 : : Material(parameters), 25 19 : _eigenstrain_name(getParam<std::string>("eigenstrain_name")), 26 19 : _disp_eigenstrain(declareProperty<RealVectorValue>("disp_" + _eigenstrain_name)), 27 19 : _rot_eigenstrain(declareProperty<RealVectorValue>("rot_" + _eigenstrain_name)), 28 57 : _step_zero(declareRestartableData<bool>("step_zero", true)) 29 : { 30 19 : } 31 : 32 : void 33 160 : ComputeEigenstrainBeamBase::initQpStatefulProperties() 34 : { 35 : // This property can be promoted to be stateful by other models that use it, 36 : // so it needs to be initalized. 37 : RealVectorValue a; 38 160 : _disp_eigenstrain[_qp] = a; 39 160 : _rot_eigenstrain[_qp] = a; 40 160 : } 41 : 42 : void 43 480 : ComputeEigenstrainBeamBase::computeQpProperties() 44 : { 45 480 : if (_t_step >= 1) 46 480 : _step_zero = false; 47 : 48 : // Skip the eigenstrain calculation in step zero because no solution is computed during 49 : // the zeroth step, hence computing the eigenstrain in the zeroth step would result in 50 : // an incorrect calculation of mechanical_strain, which is stateful. 51 480 : if (!_step_zero) 52 480 : computeQpEigenstrain(); 53 480 : }