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 Total, S.A
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 
35  SolidMechanicsLagrangeContact( const string & name,
36  Group * const parent );
37 
39 
44  static string catalogName()
45  {
46  return "SolidMechanicsLagrangeContact";
47  }
51  string getCatalogName() const override { return catalogName(); }
52 
53  virtual void initializePreSubGroups() override;
54 
55  virtual void registerDataOnMesh( Group & MeshBodies ) override final;
56 
57  virtual void
58  setupDofs( DomainPartition const & domain,
59  DofManager & dofManager ) const override;
60 
61  virtual void
63  DofManager & dofManager,
65  ParallelVector & rhs,
66  ParallelVector & solution,
67  bool const setSparsity = true ) override final;
68 
69  virtual void
70  implicitStepSetup( real64 const & time_n,
71  real64 const & dt,
72  DomainPartition & domain ) override final;
73 
74  virtual void
75  implicitStepComplete( real64 const & time_n,
76  real64 const & dt,
77  DomainPartition & domain ) override final;
78 
79  virtual void
80  assembleSystem( real64 const time,
81  real64 const dt,
82  DomainPartition & domain,
83  DofManager const & dofManager,
84  CRSMatrixView< real64, globalIndex const > const & localMatrix,
85  arrayView1d< real64 > const & localRhs ) override;
86 
87  virtual real64
89  real64 const & dt,
90  DomainPartition const & domain,
91  DofManager const & dofManager,
92  arrayView1d< real64 const > const & localRhs ) override;
93 
94  virtual void
95  applySystemSolution( DofManager const & dofManager,
96  arrayView1d< real64 const > const & localSolution,
97  real64 const scalingFactor,
98  real64 const dt,
99  DomainPartition & domain ) override;
100 
101  virtual void
103 
104  virtual real64
105  setNextDt( real64 const & currentDt,
106  DomainPartition & domain ) override;
107 
108  void updateState( DomainPartition & domain ) override final;
109 
110  void assembleContact( DomainPartition & domain,
111  DofManager const & dofManager,
112  CRSMatrixView< real64, globalIndex const > const & localMatrix,
113  arrayView1d< real64 > const & localRhs );
114 
115  void assembleForceResidualDerivativeWrtTraction( MeshLevel const & mesh,
116  arrayView1d< string const > const & regionNames,
117  DofManager const & dofManager,
118  CRSMatrixView< real64, globalIndex const > const & localMatrix,
119  arrayView1d< real64 > const & localRhs );
120 
121  void assembleTractionResidualDerivativeWrtDisplacementAndTraction( MeshLevel const & mesh,
122  arrayView1d< string const > const & regionNames,
123  DofManager const & dofManager,
124  CRSMatrixView< real64, globalIndex const > const & localMatrix,
125  arrayView1d< real64 > const & localRhs );
126 
127  void assembleForceResidualPressureContribution( MeshLevel const & mesh,
128  arrayView1d< string const > const & regionNames,
129  DofManager const & dofManager,
130  CRSMatrixView< real64, globalIndex const > const & localMatrix,
131  arrayView1d< real64 > const & localRhs );
132 
133  void assembleStabilization( MeshLevel const & mesh,
134  NumericalMethodsManager const & numericalMethodManager,
135  DofManager const & dofManager,
136  CRSMatrixView< real64, globalIndex const > const & localMatrix,
137  arrayView1d< real64 > const & localRhs );
138 
139  bool resetConfigurationToDefault( DomainPartition & domain ) const override final;
140 
141  bool updateConfiguration( DomainPartition & domain ) override final;
142 
143  bool isFractureAllInStickCondition( DomainPartition const & domain ) const;
144 
145  void computeRotationMatrices( DomainPartition & domain ) const;
146 
147  void computeTolerances( DomainPartition & domain ) const;
148 
149  void computeFaceNodalArea( localIndex const kf0,
150  arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const & nodePosition,
151  ArrayOfArraysView< localIndex const > const & faceToNodeMap,
152  ArrayOfArraysView< localIndex const > const & faceToEdgeMap,
153  arrayView2d< localIndex const > const & edgeToNodeMap,
154  arrayView2d< real64 const > const faceCenters,
155  arrayView2d< real64 const > const faceNormals,
156  arrayView1d< real64 const > const faceAreas,
157  stackArray1d< real64, FaceManager::maxFaceNodes() > & nodalArea ) const;
158 
159  void computeFaceIntegrals( arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const & nodesCoords,
160  localIndex const (&faceToNodes)[11],
161  localIndex const (&faceToEdges)[11],
162  localIndex const & numFaceVertices,
163  real64 const & faceArea,
164  real64 const (&faceCenter)[3],
165  real64 const (&faceNormal)[3],
166  arrayView2d< localIndex const > const & edgeToNodes,
167  real64 const & invCellDiameter,
168  real64 const (&cellCenter)[3],
169  stackArray1d< real64, FaceManager::maxFaceNodes() > & basisIntegrals,
170  real64 ( &threeDMonomialIntegrals )[3] ) const;
171 
172  real64 const machinePrecision = std::numeric_limits< real64 >::epsilon();
173 
174  string getStabilizationName() const { return m_stabilizationName; }
175 
176 protected:
177 
178  real64 calculateContactResidualNorm( DomainPartition const & domain,
179  DofManager const & dofManager,
180  arrayView1d< real64 const > const & localRhs );
181 
182 private:
183  string m_stabilizationName;
184 
185  real64 const m_slidingCheckTolerance = 0.05;
186 
187  real64 m_stabilitzationScalingCoefficient = 1.0;
188 
189  static const localIndex m_maxFaceNodes; // Maximum number of nodes on a contact face
190 
191  void createPreconditioner( DomainPartition const & domain );
192 
193  void computeFaceDisplacementJump( DomainPartition & domain );
194 
195  struct viewKeyStruct : ContactSolverBase::viewKeyStruct
196  {
197  constexpr static char const * stabilizationNameString() { return "stabilizationName"; }
198 
199  constexpr static char const * rotationMatrixString() { return "rotationMatrix"; }
200 
201  constexpr static char const * normalDisplacementToleranceString() { return "normalDisplacementTolerance"; }
202 
203  constexpr static char const * normalTractionToleranceString() { return "normalTractionTolerance"; }
204 
205  constexpr static char const * slidingToleranceString() { return "slidingTolerance"; }
206 
207  constexpr static char const * transMultiplierString() { return "penaltyStiffnessTransMultiplier"; }
208 
209  constexpr static char const * stabilizationScalingCoefficientString() { return "stabilizationScalingCoefficient"; }
210  };
211 
212 };
213 
214 } /* namespace geos */
215 
216 #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 real64 setNextDt(real64 const &currentDt, DomainPartition &domain) override
function to set the next time step size
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 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.