GEOS
SolidMechanicsLagrangeContact.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
21 #ifndef GEOS_PHYSICSSOLVERS_CONTACT_SOLIDMECHANICSLAGRANGECONTACT_HPP_
22 #define GEOS_PHYSICSSOLVERS_CONTACT_SOLIDMECHANICSLAGRANGECONTACT_HPP_
23 
24 #include "physicsSolvers/contact/ContactSolverBase.hpp"
25 
26 namespace geos
27 {
28 
29 class NumericalMethodsManager;
30 
32 {
33 public:
34  SolidMechanicsLagrangeContact( const string & name,
35  Group * const parent );
36 
38 
43  static string catalogName()
44  {
45  return "SolidMechanicsLagrangeContact";
46  }
50  string getCatalogName() const override { return catalogName(); }
51 
52  virtual void initializePreSubGroups() override;
53 
54  virtual void registerDataOnMesh( Group & MeshBodies ) override final;
55 
56  virtual void
57  setupDofs( DomainPartition const & domain,
58  DofManager & dofManager ) const override;
59 
60  virtual void
62  DofManager & dofManager,
64  ParallelVector & rhs,
65  ParallelVector & solution,
66  bool const setSparsity = true ) override final;
67 
68  virtual void
69  implicitStepSetup( real64 const & time_n,
70  real64 const & dt,
71  DomainPartition & domain ) override final;
72 
73  virtual void
74  implicitStepComplete( real64 const & time_n,
75  real64 const & dt,
76  DomainPartition & domain ) override final;
77 
78  virtual void
79  assembleSystem( real64 const time,
80  real64 const dt,
81  DomainPartition & domain,
82  DofManager const & dofManager,
83  CRSMatrixView< real64, globalIndex const > const & localMatrix,
84  arrayView1d< real64 > const & localRhs ) override;
85 
86  virtual real64
88  real64 const & dt,
89  DomainPartition const & domain,
90  DofManager const & dofManager,
91  arrayView1d< real64 const > const & localRhs ) override;
92 
93  virtual void
94  applySystemSolution( DofManager const & dofManager,
95  arrayView1d< real64 const > const & localSolution,
96  real64 const scalingFactor,
97  real64 const dt,
98  DomainPartition & domain ) override;
99 
100  virtual void
102 
103  void updateState( DomainPartition & domain ) override final;
104 
105  void assembleContact( DomainPartition & domain,
106  DofManager const & dofManager,
107  CRSMatrixView< real64, globalIndex const > const & localMatrix,
108  arrayView1d< real64 > const & localRhs );
109 
110  void assembleForceResidualDerivativeWrtTraction( MeshLevel const & mesh,
111  arrayView1d< string const > const & regionNames,
112  DofManager const & dofManager,
113  CRSMatrixView< real64, globalIndex const > const & localMatrix,
114  arrayView1d< real64 > const & localRhs );
115 
116  void assembleTractionResidualDerivativeWrtDisplacementAndTraction( MeshLevel const & mesh,
117  arrayView1d< string const > const & regionNames,
118  DofManager const & dofManager,
119  CRSMatrixView< real64, globalIndex const > const & localMatrix,
120  arrayView1d< real64 > const & localRhs );
121 
122  void assembleForceResidualPressureContribution( MeshLevel const & mesh,
123  arrayView1d< string const > const & regionNames,
124  DofManager const & dofManager,
125  CRSMatrixView< real64, globalIndex const > const & localMatrix,
126  arrayView1d< real64 > const & localRhs );
127 
128  void assembleStabilization( MeshLevel const & mesh,
129  NumericalMethodsManager const & numericalMethodManager,
130  DofManager const & dofManager,
131  CRSMatrixView< real64, globalIndex const > const & localMatrix,
132  arrayView1d< real64 > const & localRhs );
133 
134  bool resetConfigurationToDefault( DomainPartition & domain ) const override final;
135 
136  bool updateConfiguration( DomainPartition & domain ) override final;
137 
138  bool isFractureAllInStickCondition( DomainPartition const & domain ) const;
139 
140  void computeRotationMatrices( DomainPartition & domain ) const;
141 
142  void computeTolerances( DomainPartition & domain ) const;
143 
144  void computeFaceNodalArea( localIndex const kf0,
145  arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const & nodePosition,
146  ArrayOfArraysView< localIndex const > const & faceToNodeMap,
147  ArrayOfArraysView< localIndex const > const & faceToEdgeMap,
148  arrayView2d< localIndex const > const & edgeToNodeMap,
149  arrayView2d< real64 const > const faceCenters,
150  arrayView2d< real64 const > const faceNormals,
151  arrayView1d< real64 const > const faceAreas,
152  stackArray1d< real64, FaceManager::maxFaceNodes() > & nodalArea ) const;
153 
154  void computeFaceIntegrals( arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const & nodesCoords,
155  localIndex const (&faceToNodes)[11],
156  localIndex const (&faceToEdges)[11],
157  localIndex const & numFaceVertices,
158  real64 const & faceArea,
159  real64 const (&faceCenter)[3],
160  real64 const (&faceNormal)[3],
161  arrayView2d< localIndex const > const & edgeToNodes,
162  real64 const & invCellDiameter,
163  real64 const (&cellCenter)[3],
164  stackArray1d< real64, FaceManager::maxFaceNodes() > & basisIntegrals,
165  real64 ( &threeDMonomialIntegrals )[3] ) const;
166 
167  real64 const machinePrecision = std::numeric_limits< real64 >::epsilon();
168 
169  string getStabilizationName() const { return m_stabilizationName; }
170 
171 protected:
172 
173  real64 calculateContactResidualNorm( DomainPartition const & domain,
174  DofManager const & dofManager,
175  arrayView1d< real64 const > const & localRhs );
176 
177  virtual void postInputInitialization() override final;
178 
179  void setMGRStrategy();
180 
181 private:
182  string m_stabilizationName;
183 
184  real64 const m_slidingCheckTolerance = 0.05;
185 
186  real64 m_stabilitzationScalingCoefficient = 1.0;
187 
188  static const localIndex m_maxFaceNodes; // Maximum number of nodes on a contact face
189 
190  void createPreconditioner( DomainPartition const & domain );
191 
192  void computeFaceDisplacementJump( DomainPartition & domain );
193 
194  struct viewKeyStruct : ContactSolverBase::viewKeyStruct
195  {
196  constexpr static char const * stabilizationNameString() { return "stabilizationName"; }
197 
198  constexpr static char const * rotationMatrixString() { return "rotationMatrix"; }
199 
200  constexpr static char const * normalDisplacementToleranceString() { return "normalDisplacementTolerance"; }
201 
202  constexpr static char const * normalTractionToleranceString() { return "normalTractionTolerance"; }
203 
204  constexpr static char const * slidingToleranceString() { return "slidingTolerance"; }
205 
206  constexpr static char const * transMultiplierString() { return "penaltyStiffnessTransMultiplier"; }
207 
208  constexpr static char const * stabilizationScalingCoefficientString() { return "stabilizationScalingCoefficient"; }
209  };
210 
211 };
212 
213 } /* namespace geos */
214 
215 #endif /* GEOS_PHYSICSSOLVERS_CONTACT_SOLIDMECHANICSLAGRANGECONTACT_HPP_ */
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns,...
Definition: DofManager.hpp:44
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:44
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
virtual void registerDataOnMesh(Group &MeshBodies) override final
Register wrappers that contain data on the mesh objects.
virtual void setupDofs(DomainPartition const &domain, DofManager &dofManager) const override
Populate degree-of-freedom manager with fields relevant to this solver.
virtual void assembleSystem(real64 const time, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
function to assemble the linear system matrix and rhs
virtual void implicitStepSetup(real64 const &time_n, real64 const &dt, DomainPartition &domain) override final
function to perform setup for implicit timestep
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
bool resetConfigurationToDefault(DomainPartition &domain) const override final
resets the configuration to the default value.
virtual void resetStateToBeginningOfStep(DomainPartition &domain) override
reset state of physics back to the beginning of the step.
virtual void postInputInitialization() override final
virtual real64 calculateResidualNorm(real64 const &time, real64 const &dt, DomainPartition const &domain, DofManager const &dofManager, arrayView1d< real64 const > const &localRhs) override
calculate the norm of the global system residual
void updateState(DomainPartition &domain) override final
Recompute all dependent quantities from primary variables (including constitutive models)
virtual void setupSystem(DomainPartition &domain, DofManager &dofManager, CRSMatrix< real64, globalIndex > &localMatrix, ParallelVector &rhs, ParallelVector &solution, bool const setSparsity=true) override final
Set up the linear system (DOF indices and sparsity patterns)
static string catalogName()
name of the node manager in the object catalog
bool updateConfiguration(DomainPartition &domain) override final
updates the configuration (if needed) based on the state after a converged Newton loop.
virtual void implicitStepComplete(real64 const &time_n, real64 const &dt, DomainPartition &domain) override final
perform cleanup for implicit timestep
virtual void applySystemSolution(DofManager const &dofManager, arrayView1d< real64 const > const &localSolution, real64 const scalingFactor, real64 const dt, DomainPartition &domain) override
Function to apply the solution vector to the state.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:310
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:88
StackArray< T, 1, MAXSIZE > stackArray1d
Alias for 1D stack array.
Definition: DataTypes.hpp:188
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
Definition: DataTypes.hpp:286
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
LvArray::CRSMatrix< T, COL_INDEX, localIndex, LvArray::ChaiBuffer > CRSMatrix
Alias for CRS Matrix class.
Definition: DataTypes.hpp:306
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
LAInterface::ParallelVector ParallelVector
Alias for ParallelVector.