GEOS
ImplicitSmallStrainQuasiStatic.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 
20 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINQUASISTATIC_HPP_
21 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINQUASISTATIC_HPP_
22 
25 
26 namespace geos
27 {
28 
29 namespace solidMechanicsLagrangianFEMKernels
30 {
31 
56 template< typename SUBREGION_TYPE,
57  typename CONSTITUTIVE_TYPE,
58  typename FE_TYPE >
60  public finiteElement::ImplicitKernelBase< SUBREGION_TYPE,
61  CONSTITUTIVE_TYPE,
62  FE_TYPE,
63  3,
64  3 >
65 {
66 public:
68  using Base = finiteElement::ImplicitKernelBase< SUBREGION_TYPE,
69  CONSTITUTIVE_TYPE,
70  FE_TYPE,
71  3,
72  3 >;
73 
80  using Base::m_dofNumber;
82  using Base::m_matrix;
83  using Base::m_rhs;
87  using Base::m_meshData;
88  using Base::m_dt;
89 
95  ImplicitSmallStrainQuasiStatic( NodeManager const & nodeManager,
96  EdgeManager const & edgeManager,
97  FaceManager const & faceManager,
98  localIndex const targetRegionIndex,
99  SUBREGION_TYPE const & elementSubRegion,
100  FE_TYPE const & finiteElementSpace,
101  CONSTITUTIVE_TYPE & inputConstitutiveType,
102  arrayView1d< globalIndex const > const inputDofNumber,
103  globalIndex const rankOffset,
105  arrayView1d< real64 > const inputRhs,
106  real64 const inputDt,
107  real64 const (&inputGravityVector)[3] );
108 
109  //*****************************************************************************
118  {
119 public:
120 
124  Base::StackVariables(),
125  xLocal(),
126  u_local(),
127  uhat_local(),
129  {}
130 
131 #if !defined(CALC_FEM_SHAPE_IN_KERNEL)
133  int xLocal;
134 #else
136  real64 xLocal[ numNodesPerElem ][ 3 ];
137 #endif
138 
141 
144 
147  };
148  //*****************************************************************************
149 
159  void setup( localIndex const k,
160  StackVariables & stack ) const;
161 
162 
169  {
176  GEOS_HOST_DEVICE inline constexpr
177  void operator() ( localIndex const a, localIndex const b )
178  {
179  GEOS_UNUSED_VAR( a );
180  GEOS_UNUSED_VAR( b );
181  }
182 
188  GEOS_HOST_DEVICE inline constexpr
189  void operator() ( real64 (& stress)[6] )
190  {
191  GEOS_UNUSED_VAR( stress );
192  }
193  };
194 
205  template< typename STRESS_MODIFIER = NoOpFunctors >
208  localIndex const q,
209  StackVariables & stack,
210  STRESS_MODIFIER && stressModifier = NoOpFunctors{} ) const;
211 
216  inline
217  real64 complete( localIndex const k,
218  StackVariables & stack ) const;
219 
223  template< typename POLICY,
224  typename KERNEL_TYPE >
225  static real64
226  kernelLaunch( localIndex const numElems,
227  KERNEL_TYPE const & kernelComponent );
228 
229 protected:
232 
235 
238 
241 
244 
252  inline
254  {
255  // TODO: generalize this to other constitutive models (currently we assume linear elasticity).
256  return 2.0 * m_constitutiveUpdate.getShearModulus( k );
257  }
258 };
259 
263  globalIndex,
265  arrayView1d< real64 > const,
266  real64 const,
267  real64 const (&)[3] >;
268 
269 } // namespace solidMechanicsLagrangianFEMKernels
270 
271 } // namespace geos
272 
274 
275 #endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITSMALLSTRAINQUASISTATIC_HPP_
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
#define GEOS_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:84
This class provides an interface to ObjectManagerBase in order to manage edge data.
Definition: EdgeManager.hpp:43
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:44
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Definition: NodeManager.hpp:46
Define the base interface for implicit finite element kernels.
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
Definition: KernelBase.hpp:257
CRSMatrixView< real64, globalIndex const > const m_matrix
The global Jacobian matrix.
FE_TYPE::template MeshData< SUBREGION_TYPE > m_meshData
Data structure containing mesh data used to setup the finite element.
arrayView1d< globalIndex const > const m_dofNumber
The global degree of freedom number.
CONSTITUTIVE_TYPE::KernelWrapper const m_constitutiveUpdate
Definition: KernelBase.hpp:264
Used to forward arguments to a class that implements the KernelBase interface.
Definition: KernelBase.hpp:282
arrayView2d< real64 const, nodes::INCR_DISPLACEMENT_USD > const m_uhat
The rank-global incremental displacement array.
static real64 kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Kernel Launcher.
GEOS_HOST_DEVICE void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables &stack, STRESS_MODIFIER &&stressModifier=NoOpFunctors{}) const
Performs a state update at a quadrature point.
arrayView2d< real64 const, nodes::TOTAL_DISPLACEMENT_USD > const m_disp
The rank-global displacement array.
ImplicitSmallStrainQuasiStatic(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType, arrayView1d< globalIndex const > const inputDofNumber, globalIndex const rankOffset, CRSMatrixView< real64, globalIndex const > const inputMatrix, arrayView1d< real64 > const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3])
Constructor.
GEOS_HOST_DEVICE real64 complete(localIndex const k, StackVariables &stack) const
Performs the complete phase for the kernel.
GEOS_HOST_DEVICE real64 computeStabilizationScaling(localIndex const k) const
Get a parameter representative of the stiffness, used as physical scaling for the stabilization matri...
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Copy global values from primary field to a local stack array.
arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const m_X
The array containing the nodal position array.
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
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
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
Kernel variables allocated on the stack.
Definition: KernelBase.hpp:137
Internal struct to provide no-op defaults used in the inclusion of lambda functions into kernel compo...
constexpr GEOS_HOST_DEVICE void operator()(localIndex const a, localIndex const b)
operator() no-op used for adding an additional dynamics term inside the jacobian assembly loop.
real64 uhat_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the element local nodal incremental displacement.
real64 u_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the element local nodal displacement.
real64 constitutiveStiffness[6][6]
Stack storage for the constitutive stiffness at a quadrature point.