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 "CZMInterfaceKernelTotalLagrangian.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", CZMInterfaceKernelTotalLagrangian); 13 : 14 : InputParameters 15 590 : CZMInterfaceKernelTotalLagrangian::validParams() 16 : { 17 590 : InputParameters params = CZMInterfaceKernelBase::validParams(); 18 590 : params.addClassDescription("Calculate residual contribution for balancing the traction across an " 19 : "interface (used in the cohesive zone method)."); 20 590 : params.set<std::string>("traction_global_name") = "PK1traction"; 21 590 : return params; 22 0 : } 23 : 24 189 : CZMInterfaceKernelTotalLagrangian::CZMInterfaceKernelTotalLagrangian( 25 189 : const InputParameters & parameters) 26 : : CZMInterfaceKernelBase(parameters), 27 378 : _dPK1traction_dF(getMaterialPropertyByName<RankThreeTensor>(_base_name + "dPK1traction_dF")) 28 : { 29 189 : } 30 : 31 : Real 32 40022112 : CZMInterfaceKernelTotalLagrangian::computeDResidualDDisplacement( 33 : const unsigned int & component_j, const Moose::DGJacobianType & type) const 34 : { 35 40022112 : Real jacsd = _dtraction_djump_global[_qp](_component, component_j); 36 : Real jac = 0; 37 : 38 40022112 : switch (type) 39 : { 40 10005528 : case Moose::ElementElement: // Residual_sign -1 ddeltaU_ddisp sign -1; 41 10005528 : jac += _test[_i][_qp] * jacsd * _vars[component_j]->phiFace()[_j][_qp]; 42 10005528 : jac -= _test[_i][_qp] * JacLD(component_j, /*neighbor=*/false); 43 10005528 : break; 44 10005528 : case Moose::ElementNeighbor: // Residual_sign -1 ddeltaU_ddisp sign 1; 45 10005528 : jac -= _test[_i][_qp] * jacsd * _vars[component_j]->phiFaceNeighbor()[_j][_qp]; 46 10005528 : jac -= _test[_i][_qp] * JacLD(component_j, /*neighbor=*/true); 47 10005528 : break; 48 10005528 : case Moose::NeighborElement: // Residual_sign 1 ddeltaU_ddisp sign -1; 49 10005528 : jac -= _test_neighbor[_i][_qp] * jacsd * _vars[component_j]->phiFace()[_j][_qp]; 50 10005528 : jac += _test_neighbor[_i][_qp] * JacLD(component_j, /*neighbor=*/false); 51 10005528 : break; 52 10005528 : case Moose::NeighborNeighbor: // Residual_sign 1 ddeltaU_ddisp sign 1; 53 10005528 : jac += _test_neighbor[_i][_qp] * jacsd * _vars[component_j]->phiFaceNeighbor()[_j][_qp]; 54 10005528 : jac += _test_neighbor[_i][_qp] * JacLD(component_j, /*neighbor=*/true); 55 10005528 : break; 56 : } 57 : 58 40022112 : return jac; 59 : } 60 : 61 : Real 62 40022112 : CZMInterfaceKernelTotalLagrangian::JacLD(const unsigned int cc, const bool neighbor) const 63 : { 64 : Real jacld = 0; 65 : RealVectorValue phi; 66 40022112 : if (neighbor) 67 20011056 : phi = 0.5 * _vars[cc]->gradPhiFaceNeighbor()[_j][_qp]; 68 : else 69 20011056 : phi = 0.5 * _vars[cc]->gradPhiFace()[_j][_qp]; 70 : 71 160088448 : for (unsigned int j = 0; j < 3; j++) 72 120066336 : jacld += _dPK1traction_dF[_qp](_component, cc, j) * phi(j); 73 : 74 : mooseAssert(std::isfinite(jacld), "CZMInterfaceKernelTotalLagrangian JacLD is not finite"); 75 40022112 : return jacld; 76 : }