GEOS
ElasticWaveEquationSEM.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 
16 
21 #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_WAVEPROPAGATION_ELASTICWAVEEQUATIONSEM_HPP_
22 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_WAVEPROPAGATION_ELASTICWAVEEQUATIONSEM_HPP_
23 
25 #include "mesh/MeshFields.hpp"
29 
30 namespace geos
31 {
32 
34 {
35 public:
36 
37  using EXEC_POLICY = parallelDevicePolicy< >;
38  using ATOMIC_POLICY = parallelDeviceAtomic;
39 
40  ElasticWaveEquationSEM( const std::string & name,
41  Group * const parent );
42 
43  virtual ~ElasticWaveEquationSEM() override;
44 
45  ElasticWaveEquationSEM() = delete;
48 
49  ElasticWaveEquationSEM & operator=( ElasticWaveEquationSEM const & ) = delete;
50  ElasticWaveEquationSEM & operator=( ElasticWaveEquationSEM && ) = delete;
51 
53  static string coupledSolverAttributePrefix() { return "elastic"; }
54 
55  static string catalogName() { return "ElasticSEM"; }
59  string getCatalogName() const override { return catalogName(); }
60 
61  virtual void initializePreSubGroups() override;
62 
63  virtual void registerDataOnMesh( Group & meshBodies ) override final;
64 
65 
72  virtual real64 explicitStepForward( real64 const & time_n,
73  real64 const & dt,
74  integer const cycleNumber,
75  DomainPartition & domain,
76  integer const computeGradient ) override;
77 
78  virtual real64 explicitStepBackward( real64 const & time_n,
79  real64 const & dt,
80  integer const cycleNumber,
81  DomainPartition & domain,
82  integer const computeGradient ) override;
92  void addSourceToRightHandSide( real64 const & time_n, arrayView1d< real32 > const rhsx, arrayView1d< real32 > const rhsy, arrayView1d< real32 > const rhsz );
93 
102  void computeDAS( arrayView2d< real32 > const xCompRcv,
103  arrayView2d< real32 > const yCompRcv,
104  arrayView2d< real32 > const zCompRcv );
105 
106  virtual real64 computeTimeStep( real64 & dtOut ) override;
107 
108 
112  virtual void cleanup( real64 const time_n,
113  integer const cycleNumber,
114  integer const eventCounter,
115  real64 const eventProgress,
116  DomainPartition & domain ) override;
117 
119  {
120  static constexpr char const * displacementXNp1AtReceiversString() { return "displacementXNp1AtReceivers"; }
121  static constexpr char const * displacementYNp1AtReceiversString() { return "displacementYNp1AtReceivers"; }
122  static constexpr char const * displacementZNp1AtReceiversString() { return "displacementZNp1AtReceivers"; }
123 
124  static constexpr char const * dasSignalNp1AtReceiversString() { return "dasSignalNp1AtReceivers"; }
125 
126  static constexpr char const * sourceForceString() { return "sourceForce"; }
127  static constexpr char const * sourceMomentString() { return "sourceMoment"; }
128 
129  static constexpr char const * useVtiString() { return "useVTI"; }
130 
131  static constexpr char const * useTtiString() { return "useTTI"; }
132 
133  } waveEquationViewKeys;
134 
135 
146  real64 const & dt,
147  DomainPartition & domain );
148 
149  void computeUnknowns( real64 const & time_n,
150  real64 const & dt,
151  DomainPartition & domain,
152  MeshLevel & mesh,
153  string_array const & regionNames );
154 
155  void synchronizeUnknowns( real64 const & time_n,
156  real64 const & dt,
157  DomainPartition & domain,
158  MeshLevel & mesh,
159  string_array const & regionNames );
160 
161  void prepareNextTimestep( MeshLevel & mesh );
162 
166  virtual real32 getGlobalMinWavespeed( MeshLevel & mesh, string_array const & regionNames ) override;
167 
173 
174 protected:
175 
176  virtual void postInputInitialization() override final;
177 
178  virtual void initializePostInitialConditionsPreSubGroups() override final;
179 
180 private:
181 
189  virtual void precomputeSourceAndReceiverTerm( MeshLevel & baseMesh, MeshLevel & mesh, string_array const & regionNames ) override;
190 
196  virtual void applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) override;
197 
201  virtual void initializePML() override;
202 
208  virtual void applyPML( real64 const time, DomainPartition & domain ) override;
209 
211  array2d< real64 > m_sourceConstantsx;
212 
214  array2d< real64 > m_sourceConstantsy;
215 
217  array2d< real64 > m_sourceConstantsz;
218 
220  array2d< real32 > m_displacementXNp1AtReceivers;
221 
223  array2d< real32 > m_displacementYNp1AtReceivers;
224 
226  array2d< real32 > m_displacementZNp1AtReceivers;
227 
229  array2d< real32 > m_dasSignalNp1AtReceivers;
230 
232  R1Tensor m_sourceForce;
233 
235  R2SymTensor m_sourceMoment;
236 
238  integer m_useVTI;
239 
241  integer m_useTTI;
242 
243  real64 m_rotationMatrix[ 3 ][ 3 ]{};
244 
245 
246 };
247 
248 } /* namespace geos */
249 
250 #endif /* SRC_CORECOMPONENTS_PHYSICSSOLVERS_WAVEPROPAGATION_ELASSTICWAVEEQUATIONSEM_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
static string coupledSolverAttributePrefix()
String used to form the solverName used to register solvers in CoupledSolver.
virtual void registerDataOnMesh(Group &meshBodies) override final
Register wrappers that contain data on the mesh objects.
virtual void cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Overridden from ExecutableGroup. Used to write last seismogram if needed.
real64 explicitStepInternal(real64 const &time_n, real64 const &dt, DomainPartition &domain)
string getCatalogName() const override
virtual void initializePostInitialConditionsPreSubGroups() override final
Called by InitializePostInitialConditions() prior to initializing sub-Groups.
void addSourceToRightHandSide(real64 const &time_n, arrayView1d< real32 > const rhsx, arrayView1d< real32 > const rhsy, arrayView1d< real32 > const rhsz)
Multiply the precomputed term by the Ricker and add to the right-hand side.
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
void computeDAS(arrayView2d< real32 > const xCompRcv, arrayView2d< real32 > const yCompRcv, arrayView2d< real32 > const zCompRcv)
Compute DAS data as a difference of the field at two points, from the appropriate three-component rec...
virtual void postInputInitialization() override final
virtual real32 getGlobalMinWavespeed(MeshLevel &mesh, string_array const &regionNames) override
Get the minimum wavespeed on a mesh (S-wavespeed in the elastic case)
real32 computeGlobalMinQFactor()
Computes the minimum attenuation quality factor over all the mesh. This is useful for computing anela...
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
virtual real64 explicitStepForward(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain, integer const computeGradient) override
Perform forward explicit step.
virtual real64 explicitStepBackward(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain, integer const computeGradient) override
Perform backward explicit step.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:361
float real32
32-bit floating point type.
Definition: DataTypes.hpp:96
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:191
std::string string
String type.
Definition: DataTypes.hpp:90
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:195
int integer
Signed integer type.
Definition: DataTypes.hpp:81