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 "ADPFFPressure.h" 6 : 7 : registerMooseObject("raccoonApp", ADPFFPressure); 8 : 9 : InputParameters 10 142 : ADPFFPressure::validParams() 11 : { 12 142 : InputParameters params = ADKernelGrad::validParams(); 13 142 : params += BaseNameInterface::validParams(); 14 142 : params.addClassDescription( 15 : "This class computes the pressure term in the phase-field evolution equation for pressurized " 16 : "crack. The weak form is $\\grad w, p \\bfu$."); 17 : 18 284 : params.addRequiredParam<MaterialPropertyName>("pressure", "Material property name for pressure"); 19 284 : params.addRequiredCoupledVar( 20 : "displacements", 21 : "The displacements appropriate for the simulation geometry and coordinate system"); 22 284 : params.addParam<MaterialPropertyName>("indicator_function", 23 : "I" 24 : "The indicator function"); 25 142 : return params; 26 0 : } 27 : 28 2 : ADPFFPressure::ADPFFPressure(const InputParameters & parameters) 29 : : ADKernelGrad(parameters), 30 : BaseNameInterface(parameters), 31 : DerivativeMaterialPropertyNameInterface(), 32 4 : _p(getADMaterialProperty<Real>(prependBaseName("pressure", true))), 33 2 : _ndisp(coupledComponents("displacements")), 34 2 : _disp(3), 35 6 : _dI_dd(getADMaterialProperty<Real>(derivativePropertyNameFirst( 36 4 : getParam<MaterialPropertyName>("indicator_function"), _var.name()))) 37 : { 38 : // fetch coupled variables and gradients (as stateful properties if necessary) 39 6 : for (unsigned int i = 0; i < _ndisp; ++i) 40 4 : _disp[i] = &adCoupledValue("displacements", i); 41 : // set unused dimensions to zero 42 4 : for (unsigned i = _ndisp; i < 3; ++i) 43 2 : _disp[i] = &_ad_zero; 44 2 : } 45 : 46 : ADRealVectorValue 47 85600 : ADPFFPressure::precomputeQpResidual() 48 : { 49 85600 : ADRealVectorValue u((*_disp[0])[_qp], (*_disp[1])[_qp], (*_disp[2])[_qp]); 50 171200 : return _p[_qp] * u * _dI_dd[_qp]; 51 : }