GEOSX
ExplicitSmallStrain.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_EXPLICITSMALLSTRAIN_HPP_
20 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_EXPLICITSMALLSTRAIN_HPP_
21 
24 
25 
26 namespace geos
27 {
28 
30 namespace solidMechanicsLagrangianFEMKernels
31 {
32 
38 #define UPDATE_STRESS 2
39 
58 template< typename SUBREGION_TYPE,
59  typename CONSTITUTIVE_TYPE,
60  typename FE_TYPE >
61 class ExplicitSmallStrain : public finiteElement::KernelBase< SUBREGION_TYPE,
62  CONSTITUTIVE_TYPE,
63  FE_TYPE,
64  3,
65  3 >
66 {
67 public:
68 
70  using Base = finiteElement::KernelBase< SUBREGION_TYPE,
71  CONSTITUTIVE_TYPE,
72  FE_TYPE,
73  3,
74  3 >;
75 
80 
87 
88 //*****************************************************************************
100  ExplicitSmallStrain( NodeManager & nodeManager,
101  EdgeManager const & edgeManager,
102  FaceManager const & faceManager,
103  localIndex const targetRegionIndex,
104  SUBREGION_TYPE const & elementSubRegion,
105  FE_TYPE const & finiteElementSpace,
106  CONSTITUTIVE_TYPE & inputConstitutiveType,
107  real64 const dt,
108  string const elementListName );
109 
110  //*****************************************************************************
117  struct StackVariables : Base::StackVariables
118  {
119 public:
121  StackVariables():
122  fLocal{ { 0.0} },
123  varLocal{ {0.0} },
124  xLocal()
125  {}
126 
129 
132 
133 #if !defined(CALC_FEM_SHAPE_IN_KERNEL)
135  int xLocal;
136 #else
138  real64 xLocal[ numNodesPerElem ][ 3 ];
139 #endif
140  };
141  //***************************************************************************
142 
143 
150  void setup( localIndex const k,
151  StackVariables & stack ) const;
152 
163  void quadraturePointKernel( localIndex const k,
164  localIndex const q,
165  StackVariables & stack ) const;
166 
174  real64 complete( localIndex const k,
175  StackVariables const & stack ) const;
176 
184  template< typename POLICY,
185  typename KERNEL_TYPE >
186  static real64
187  kernelLaunch( localIndex const numElems,
188  KERNEL_TYPE const & kernelComponent );
189 
190 
191 protected:
194 
197 
200 
204 
206  real64 const m_dt;
207 
210 
211 
212 };
213 
214 
215 
218  real64,
219  string const >;
220 
221 
222 
223 } // namespace solidMechanicsLagrangianFEMKernels
224 
225 } // namespace geos
226 
227 #endif //GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_EXPLICITSMALLSTRAIN_HPP_
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:48
This class provides an interface to ObjectManagerBase in order to manage edge data.
Definition: EdgeManager.hpp:42
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:43
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Definition: NodeManager.hpp:45
Define the base interface for finite element kernels.
Definition: KernelBase.hpp:86
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
Definition: KernelBase.hpp:256
arrayView1d< integer const > const m_elemGhostRank
The element ghost rank array.
Definition: KernelBase.hpp:259
Used to forward arguments to a class that implements the KernelBase interface.
Definition: KernelBase.hpp:281
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:139
LvArray::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
Definition: DataTypes.hpp:311
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:236
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
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.