GEOS
AcousticWaveEquationSEM.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 GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONSEM_HPP_
22 #define GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONSEM_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 = AtomicPolicy< EXEC_POLICY >;
39 
41  Group * const parent );
42 
43  virtual ~AcousticWaveEquationSEM() override;
44 
45  AcousticWaveEquationSEM() = delete;
48 
49  AcousticWaveEquationSEM & operator=( AcousticWaveEquationSEM const & ) = delete;
50  AcousticWaveEquationSEM & operator=( AcousticWaveEquationSEM && ) = delete;
51 
53  static string coupledSolverAttributePrefix() { return "acoustic"; }
54 
55  static string catalogName() { return "AcousticSEM"; }
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;
83 
87  virtual real32 getGlobalMinWavespeed( MeshLevel & mesh, string_array const & regionNames ) override;
88 
96  virtual void addSourceToRightHandSide( integer const & cycleNumber, arrayView1d< real32 > const rhs );
97 
98 
102  virtual void initializePML() override;
103 
106  virtual real64 computeTimeStep( real64 & dtOut ) override;
107 
108 
109 
113  virtual void cleanup( real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition & domain ) override;
114 
116  {
117  static constexpr char const * pressureNp1AtReceiversString() { return "pressureNp1AtReceivers"; }
118 
119  } waveEquationViewKeys;
120 
121 
131  real64 const & dt,
132  integer const & cycleNumber,
133  DomainPartition & domain );
134 
135  void computeUnknowns( real64 const & time_n,
136  real64 const & dt,
137  integer const & cycleNumber,
138  DomainPartition & domain,
139  MeshLevel & mesh,
140  string_array const & regionNames );
141 
142  void synchronizeUnknowns( real64 const & time_n,
143  real64 const & dt,
144  DomainPartition & domain,
145  MeshLevel & mesh,
146  string_array const & regionNames );
147 
148  void prepareNextTimestep( MeshLevel & mesh );
149 
150 protected:
151 
152  virtual void postInputInitialization() override final;
153 
154  virtual void initializePostInitialConditionsPreSubGroups() override final;
155 
156 private:
157 
164  virtual void precomputeSourceAndReceiverTerm( MeshLevel & baseMesh, MeshLevel & mesh, string_array const & regionNames ) override;
165 
171  virtual void applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) override;
172 
178  virtual void applyPML( real64 const time, DomainPartition & domain ) override;
179 
181  array2d< real32 > m_pressureNp1AtReceivers;
182 
183 };
184 
185 } /* namespace geos */
186 
187 #endif /* GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONSEM_HPP_ */
real64 explicitStepInternal(real64 const &time_n, real64 const &dt, integer const &cycleNumber, DomainPartition &domain)
string getCatalogName() const override
virtual void registerDataOnMesh(Group &meshBodies) override final
Register wrappers that contain data on the mesh objects.
virtual void postInputInitialization() override final
virtual void addSourceToRightHandSide(integer const &cycleNumber, arrayView1d< real32 > const rhs)
Multiply the precomputed term by the Ricker and add to the right-hand side.
virtual void initializePML() override
Initialize Perfectly Matched Layer (PML) information.
virtual void initializePostInitialConditionsPreSubGroups() override final
Called by InitializePostInitialConditions() prior to initializing sub-Groups.
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
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.
static string coupledSolverAttributePrefix()
String used to form the solverName used to register solvers in CoupledSolver.
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
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.
virtual real32 getGlobalMinWavespeed(MeshLevel &mesh, string_array const &regionNames) override
Get the minimum wavespeed on a mesh.
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
int integer
Signed integer type.
Definition: DataTypes.hpp:81