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 "CrackFrontNonlocalStress.h" 11 : #include "RankTwoScalarTools.h" 12 : 13 : registerMooseObject("SolidMechanicsApp", CrackFrontNonlocalStress); 14 : 15 : InputParameters 16 12 : CrackFrontNonlocalStress::validParams() 17 : { 18 12 : InputParameters params = CrackFrontNonlocalMaterialBase::validParams(); 19 12 : params.addClassDescription("Computes the average stress normal to the crack face."); 20 24 : params.addRequiredParam<MaterialPropertyName>( 21 : "stress_name", "Get name of stress tensor to compute at crack front"); 22 12 : return params; 23 0 : } 24 : 25 6 : CrackFrontNonlocalStress::CrackFrontNonlocalStress(const InputParameters & parameters) 26 6 : : CrackFrontNonlocalMaterialBase(parameters, parameters.get<MaterialPropertyName>("stress_name")), 27 12 : _stress(getMaterialProperty<RankTwoTensor>(_base_name + _property_name)) 28 : { 29 6 : } 30 : 31 : Real 32 660 : CrackFrontNonlocalStress::getQPCrackFrontScalar(const unsigned int qp, 33 : const Point crack_face_normal) const 34 : { 35 660 : return RankTwoScalarTools::directionValueTensor(_stress[qp], crack_face_normal); 36 : }