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"
28 
29 namespace geos
30 {
31 
33 {
34 public:
35 
36  using EXEC_POLICY = parallelDevicePolicy< >;
37  using ATOMIC_POLICY = parallelDeviceAtomic;
38 
39  ElasticWaveEquationSEM( const std::string & name,
40  Group * const parent );
41 
42  virtual ~ElasticWaveEquationSEM() override;
43 
44  ElasticWaveEquationSEM() = delete;
47 
48  ElasticWaveEquationSEM & operator=( ElasticWaveEquationSEM const & ) = delete;
49  ElasticWaveEquationSEM & operator=( ElasticWaveEquationSEM && ) = delete;
50 
52  static string coupledSolverAttributePrefix() { return "elastic"; }
53 
54  static string catalogName() { return "ElasticSEM"; }
58  string getCatalogName() const override { return catalogName(); }
59 
60  virtual void initializePreSubGroups() override;
61 
62  virtual void registerDataOnMesh( Group & meshBodies ) override final;
63 
64 
71  virtual real64 explicitStepForward( real64 const & time_n,
72  real64 const & dt,
73  integer const cycleNumber,
74  DomainPartition & domain,
75  integer const computeGradient ) override;
76 
77  virtual real64 explicitStepBackward( real64 const & time_n,
78  real64 const & dt,
79  integer const cycleNumber,
80  DomainPartition & domain,
81  integer const computeGradient ) override;
91  void addSourceToRightHandSide( real64 const & time_n, arrayView1d< real32 > const rhsx, arrayView1d< real32 > const rhsy, arrayView1d< real32 > const rhsz );
92 
101  void computeDAS( arrayView2d< real32 > const xCompRcv,
102  arrayView2d< real32 > const yCompRcv,
103  arrayView2d< real32 > const zCompRcv );
104 
105  virtual real64 computeTimeStep( real64 & dtOut ) override;
106 
107 
111  virtual void cleanup( real64 const time_n,
112  integer const cycleNumber,
113  integer const eventCounter,
114  real64 const eventProgress,
115  DomainPartition & domain ) override;
116 
118  {
119  static constexpr char const * displacementXNp1AtReceiversString() { return "displacementXNp1AtReceivers"; }
120  static constexpr char const * displacementYNp1AtReceiversString() { return "displacementYNp1AtReceivers"; }
121  static constexpr char const * displacementZNp1AtReceiversString() { return "displacementZNp1AtReceivers"; }
122 
123  static constexpr char const * dasSignalNp1AtReceiversString() { return "dasSignalNp1AtReceivers"; }
124 
125  static constexpr char const * sourceForceString() { return "sourceForce"; }
126  static constexpr char const * sourceMomentString() { return "sourceMoment"; }
127 
128  static constexpr char const * useVtiString() { return "useVTI"; }
129 
130  static constexpr char const * useTtiString() { return "useTTI"; }
131 
132  } waveEquationViewKeys;
133 
134 
145  real64 const & dt,
146  DomainPartition & domain );
147 
148  void computeUnknowns( real64 const & time_n,
149  real64 const & dt,
150  DomainPartition & domain,
151  MeshLevel & mesh,
152  string_array const & regionNames );
153 
154  void synchronizeUnknowns( real64 const & time_n,
155  real64 const & dt,
156  DomainPartition & domain,
157  MeshLevel & mesh,
158  string_array const & regionNames );
159 
160  void prepareNextTimestep( MeshLevel & mesh );
161 
162 protected:
163 
164  virtual void postInputInitialization() override final;
165 
166  virtual void initializePostInitialConditionsPreSubGroups() override final;
167 
168 private:
169 
177  virtual void precomputeSourceAndReceiverTerm( MeshLevel & baseMesh, MeshLevel & mesh, string_array const & regionNames ) override;
178 
184  virtual void applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) override;
185 
189  virtual void initializePML() override;
190 
196  virtual void applyPML( real64 const time, DomainPartition & domain ) override;
197 
199  array2d< real64 > m_sourceConstantsx;
200 
202  array2d< real64 > m_sourceConstantsy;
203 
205  array2d< real64 > m_sourceConstantsz;
206 
208  array2d< real32 > m_displacementXNp1AtReceivers;
209 
211  array2d< real32 > m_displacementYNp1AtReceivers;
212 
214  array2d< real32 > m_displacementZNp1AtReceivers;
215 
217  array2d< real32 > m_dasSignalNp1AtReceivers;
218 
220  R1Tensor m_sourceForce;
221 
223  R2SymTensor m_sourceMoment;
224 
226  integer m_useVTI;
227 
229  integer m_useTTI;
230 
231  real64 m_rotationMatrix[ 3 ][ 3 ]{};
232 
233 
234 };
235 
236 } /* namespace geos */
237 
238 #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
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:188
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:401
float real32
32-bit floating point type.
Definition: DataTypes.hpp:96
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:200
std::string string
String type.
Definition: DataTypes.hpp:90
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:81
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:204