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 : #pragma once 11 : 12 : #include "TwoVector.h" 13 : #include "PenaltyWeightedGapUserObject.h" 14 : #include "WeightedVelocitiesUserObject.h" 15 : #include "AugmentedLagrangeInterface.h" 16 : 17 : /** 18 : * Base class for mortar-based cohesive zone model. 19 : */ 20 : class CohesiveZoneModelBase : virtual public PenaltyWeightedGapUserObject, 21 : virtual public WeightedVelocitiesUserObject 22 : { 23 : public: 24 : static InputParameters validParams(); 25 : 26 : CohesiveZoneModelBase(const InputParameters & parameters); 27 : 28 : virtual const ADVariableValue & contactTangentialPressureDirOne() const override; 29 : virtual const ADVariableValue & contactTangentialPressureDirTwo() const override; 30 : 31 : virtual void initialize() override; 32 : virtual void finalize() override; 33 : virtual void reinit() override; 34 : virtual void timestepSetup() override; 35 : virtual const ADVariableValue & czmGlobalTraction(unsigned int i) const; 36 : 37 : protected: 38 : virtual void computeQpProperties() override; 39 : virtual void computeQpIProperties() override; 40 : 41 : virtual const VariableTestValue & test() const override; 42 0 : virtual bool constrainedByOwner() const override { return false; } 43 : 44 : // Compute CZM kinematics. 45 : virtual void prepareJumpKinematicQuantities(); 46 : virtual void computeFandR(const Node * const node); 47 : 48 : /// Encapsulate the CZM constitutive behavior. 49 : virtual void computeCZMTraction(const Node * const /*node*/) = 0; 50 : 51 : virtual void computeDamage(const Node * const /*node*/) = 0; 52 : 53 : /// Compute global traction for mortar application. 54 : virtual void computeGlobalTraction(const Node * const node); 55 : 56 : /// Normalize mortar quantities (remove mortar integral scaling) 57 : template <class T> 58 322632 : T normalizeQuantity(const std::unordered_map<const DofObject *, T> & map, const Node * const node) 59 : { 60 322632 : return libmesh_map_find(map, node) / _dof_to_weighted_gap[node].second; 61 : } 62 : 63 : /// Number of displacement components 64 : const unsigned int _ndisp; 65 : 66 : /// Coupled displacement gradients 67 : std::vector<const GenericVariableGradient<true> *> _grad_disp; 68 : 69 : /// Coupled displacement and neighbor displacement gradient 70 : std::vector<const GenericVariableGradient<true> *> _grad_disp_neighbor; 71 : 72 : /// *** Kinematics/displacement jump quantities *** 73 : /// Map from degree of freedom to rotation matrix 74 : std::unordered_map<const DofObject *, ADRankTwoTensor> _dof_to_rotation_matrix; 75 : 76 : /// Map from degree of freedom to local displacement jump 77 : std::unordered_map<const DofObject *, ADRealVectorValue> _dof_to_interface_displacement_jump; 78 : 79 : /// Deformation gradient for interpolation 80 : ADRankTwoTensor _F_interpolation; 81 : 82 : /// Deformation gradient for interpolation of the neighbor projection 83 : ADRankTwoTensor _F_neighbor_interpolation; 84 : 85 : /// Map from degree of freedom to secondary, interpolated deformation gradient tensor 86 : std::unordered_map<const DofObject *, ADRankTwoTensor> _dof_to_F; 87 : 88 : /// Map from degree of freedom to neighbor, interpolated deformation gradient tensor 89 : std::unordered_map<const DofObject *, ADRankTwoTensor> _dof_to_F_neighbor; 90 : 91 : /// Map from degree of freedom to interface deformation gradient tensor 92 : std::unordered_map<const DofObject *, ADRankTwoTensor> _dof_to_interface_F; 93 : 94 : /// Map from degree of freedom to interface rotation tensor 95 : std::unordered_map<const DofObject *, ADRankTwoTensor> _dof_to_interface_R; 96 : 97 : /// The global traction 98 : std::vector<ADVariableValue> _czm_interpolated_traction; 99 : 100 : /// The penalty factor for the frictional constraints 101 : const Real _penalty_friction; 102 : 103 : /// The friction coefficient 104 : const Real _friction_coefficient; 105 : 106 : /// Map from degree of freedom to current and old AD iteration step slip 107 : std::unordered_map<const DofObject *, std::pair<ADTwoVector, TwoVector>> _dof_to_step_slip; 108 : 109 : /// Map from degree of freedom to current and old accumulated slip 110 : std::unordered_map<dof_id_type, std::pair<ADTwoVector, TwoVector>> & _dof_to_accumulated_slip; 111 : 112 : // Map from degree of freedom to current and old tangential traction 113 : std::unordered_map<dof_id_type, std::pair<ADTwoVector, TwoVector>> & _dof_to_tangential_traction; 114 : 115 : /// The first frictional contact pressure on the mortar segment quadrature points 116 : ADVariableValue _frictional_contact_traction_one; 117 : 118 : /// The second frictional contact pressure on the mortar segment quadrature points 119 : ADVariableValue _frictional_contact_traction_two; 120 : 121 : /// Map from degree of freedom to augmented lagrange multiplier 122 : std::unordered_map<const DofObject *, TwoVector> _dof_to_frictional_lagrange_multipliers; 123 : 124 : /// Map from degree of freedom to local friction penalty value 125 : std::unordered_map<const DofObject *, Real> _dof_to_local_penalty_friction; 126 : 127 : /// Tolerance to avoid NaN/Inf in automatic differentiation operations. 128 : const Real _epsilon_tolerance; 129 : 130 : /// Total Lagrangian stress to be applied on CZM interface 131 : std::unordered_map<const DofObject *, ADRealVectorValue> _dof_to_czm_traction; 132 : 133 : /// Displacement jump on CZM interface 134 : std::unordered_map<const DofObject *, ADRealVectorValue> _dof_to_displacement_jump; 135 : 136 : /// Damage values (pair of current and old) on CZM interface 137 : std::unordered_map<dof_id_type, std::pair<ADReal, Real>> & _dof_to_damage; 138 : };