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