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 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 
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  bool const computeGradient ) override;
76 
77  virtual real64 explicitStepBackward( real64 const & time_n,
78  real64 const & dt,
79  integer const cycleNumber,
80  DomainPartition & domain,
81  bool 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  } waveEquationViewKeys;
131 
132 
143  real64 const & dt,
144  DomainPartition & domain );
145 
146  void computeUnknowns( real64 const & time_n,
147  real64 const & dt,
148  DomainPartition & domain,
149  MeshLevel & mesh,
150  arrayView1d< string const > const & regionNames );
151 
152  void synchronizeUnknowns( real64 const & time_n,
153  real64 const & dt,
154  DomainPartition & domain,
155  MeshLevel & mesh,
156  arrayView1d< string const > const & regionNames );
157 
158  void prepareNextTimestep( MeshLevel & mesh );
159 
165 
166 protected:
167 
168  virtual void postInputInitialization() override final;
169 
170  virtual void initializePostInitialConditionsPreSubGroups() override final;
171 
172 private:
173 
181  virtual void precomputeSourceAndReceiverTerm( MeshLevel & baseMesh, MeshLevel & mesh, arrayView1d< string const > const & regionNames ) override;
182 
188  virtual void applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) override;
189 
193  virtual void initializePML() override;
194 
200  virtual void applyPML( real64 const time, DomainPartition & domain ) override;
201 
203  array2d< real64 > m_sourceConstantsx;
204 
206  array2d< real64 > m_sourceConstantsy;
207 
209  array2d< real64 > m_sourceConstantsz;
210 
212  array2d< real32 > m_displacementXNp1AtReceivers;
213 
215  array2d< real32 > m_displacementYNp1AtReceivers;
216 
218  array2d< real32 > m_displacementZNp1AtReceivers;
219 
221  array2d< real32 > m_dasSignalNp1AtReceivers;
222 
224  R1Tensor m_sourceForce;
225 
227  R2SymTensor m_sourceMoment;
228 
230  integer m_useVTI;
231 
232 };
233 
234 } /* namespace geos */
235 
236 #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
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, bool const computeGradient) override
Perform forward explicit step.
virtual real64 explicitStepBackward(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain, bool const computeGradient) override
Perform backward explicit step.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
float real32
32-bit floating point type.
Definition: DataTypes.hpp:97
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192
std::string string
String type.
Definition: DataTypes.hpp:91
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196