Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 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 "ComputeExtraStressConstant.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", ComputeExtraStressConstant); 13 : 14 : InputParameters 15 96 : ComputeExtraStressConstant::validParams() 16 : { 17 96 : InputParameters params = ComputeExtraStressBase::validParams(); 18 96 : params.addClassDescription("Computes a constant extra stress that is added to the stress " 19 : "calculated by the constitutive model"); 20 192 : params.addRequiredParam<std::vector<Real>>("extra_stress_tensor", 21 : "Vector of values defining the constant extra stress " 22 : "to add, in order 11, 22, 33, 23, 13, 12"); 23 192 : params.addParam<MaterialPropertyName>( 24 192 : "prefactor", 1.0, "Name of material property defining additional constant prefactor"); 25 96 : return params; 26 0 : } 27 : 28 72 : ComputeExtraStressConstant::ComputeExtraStressConstant(const InputParameters & parameters) 29 144 : : ComputeExtraStressBase(parameters), _prefactor(getMaterialProperty<Real>("prefactor")) 30 : { 31 144 : _extra_stress_tensor.fillFromInputVector(getParam<std::vector<Real>>("extra_stress_tensor")); 32 72 : } 33 : 34 : void 35 53888 : ComputeExtraStressConstant::computeQpExtraStress() 36 : { 37 53888 : _extra_stress[_qp] = _extra_stress_tensor * _prefactor[_qp]; 38 53888 : }