GEOS
ExplicitSmallStrain.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_EXPLICITSMALLSTRAIN_HPP_
21 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_EXPLICITSMALLSTRAIN_HPP_
22 
25 
26 
27 namespace geos
28 {
29 
31 namespace solidMechanicsLagrangianFEMKernels
32 {
33 
39 #define UPDATE_STRESS 2
40 
59 template< typename SUBREGION_TYPE,
60  typename CONSTITUTIVE_TYPE,
61  typename FE_TYPE >
62 class ExplicitSmallStrain : public finiteElement::KernelBase< SUBREGION_TYPE,
63  CONSTITUTIVE_TYPE,
64  FE_TYPE,
65  3,
66  3 >
67 {
68 public:
69 
71  using Base = finiteElement::KernelBase< SUBREGION_TYPE,
72  CONSTITUTIVE_TYPE,
73  FE_TYPE,
74  3,
75  3 >;
76 
81 
88 
89 //*****************************************************************************
101  ExplicitSmallStrain( NodeManager & nodeManager,
102  EdgeManager const & edgeManager,
103  FaceManager const & faceManager,
104  localIndex const targetRegionIndex,
105  SUBREGION_TYPE const & elementSubRegion,
106  FE_TYPE const & finiteElementSpace,
107  CONSTITUTIVE_TYPE & inputConstitutiveType,
108  real64 const dt,
109  string const elementListName );
110 
111  //*****************************************************************************
118  struct StackVariables : Base::StackVariables
119  {
120 public:
122  StackVariables():
123  fLocal{ { 0.0} },
124  varLocal{ {0.0} },
125  xLocal()
126  {}
127 
130 
133 
134 #if !defined(CALC_FEM_SHAPE_IN_KERNEL)
136  int xLocal;
137 #else
139  real64 xLocal[ numNodesPerElem ][ 3 ];
140 #endif
141  };
142  //***************************************************************************
143 
144 
151  void setup( localIndex const k,
152  StackVariables & stack ) const;
153 
164  void quadraturePointKernel( localIndex const k,
165  localIndex const q,
166  StackVariables & stack ) const;
167 
175  real64 complete( localIndex const k,
176  StackVariables const & stack ) const;
177 
185  template< typename POLICY,
186  typename KERNEL_TYPE >
187  static real64
188  kernelLaunch( localIndex const numElems,
189  KERNEL_TYPE const & kernelComponent );
190 
191 
192 protected:
195 
198 
201 
205 
207  real64 const m_dt;
208 
211 
212 
213 };
214 
215 
216 
219  real64,
220  string const >;
221 
222 
223 
224 } // namespace solidMechanicsLagrangianFEMKernels
225 
226 } // namespace geos
227 
228 #endif //GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_EXPLICITSMALLSTRAIN_HPP_
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
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 finite element kernels.
Definition: KernelBase.hpp:87
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
Definition: KernelBase.hpp:257
arrayView1d< integer const > const m_elemGhostRank
The element ghost rank array.
Definition: KernelBase.hpp:260
Used to forward arguments to a class that implements the KernelBase interface.
Definition: KernelBase.hpp:282
Implements kernels for solving the equations of motion using the explicit Newmark method under the sm...
arrayView2d< real64 const, nodes::VELOCITY_USD > const m_vel
The array containing the nodal velocity array.
SortedArrayView< localIndex const > const m_elementList
TODO: Consider moving to finite element kernel base?
static real64 kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Kernel Launcher.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Performs the setup phase for the kernel.
ExplicitSmallStrain(NodeManager &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType, real64 const dt, string const elementListName)
Constructor.
GEOS_HOST_DEVICE void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables &stack) const
Performs a state update at a quadrature point.
arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const m_X
The array containing the nodal position array.
real64 const m_dt
The time increment for this time integration step.
GEOS_HOST_DEVICE real64 complete(localIndex const k, StackVariables const &stack) const
Performs the complete phase for the kernel.
arrayView2d< real64, nodes::ACCELERATION_USD > const m_acc
arrayView2d< real64 const, nodes::TOTAL_DISPLACEMENT_USD > const m_u
The array containing the nodal displacement array.
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::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
Definition: DataTypes.hpp:271
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
real64 varLocal[numNodesPerElem][numDofPerTestSupportPoint]
C-array stack storage for element local primary variable values.
real64 fLocal[numNodesPerElem][numDofPerTrialSupportPoint]
C-array stack storage for the element local force.