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"
28 
29 namespace geos
30 {
31 
33 {
34 public:
35 
36  using EXEC_POLICY = parallelDevicePolicy< >;
37  using ATOMIC_POLICY = AtomicPolicy< EXEC_POLICY >;
38 
40  Group * const parent );
41 
42  virtual ~AcousticWaveEquationSEM() override;
43 
44  AcousticWaveEquationSEM() = delete;
47 
48  AcousticWaveEquationSEM & operator=( AcousticWaveEquationSEM const & ) = delete;
49  AcousticWaveEquationSEM & operator=( AcousticWaveEquationSEM && ) = delete;
50 
52  static string coupledSolverAttributePrefix() { return "acoustic"; }
53 
54  static string catalogName() { return "AcousticSEM"; }
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;
82 
90  virtual void addSourceToRightHandSide( integer const & cycleNumber, arrayView1d< real32 > const rhs );
91 
92 
96  virtual void initializePML() override;
97 
100  virtual real64 computeTimeStep( real64 & dtOut ) override;
101 
102 
103 
107  virtual void cleanup( real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition & domain ) override;
108 
110  {
111  static constexpr char const * pressureNp1AtReceiversString() { return "pressureNp1AtReceivers"; }
112 
113  } waveEquationViewKeys;
114 
115 
125  real64 const & dt,
126  integer const & cycleNumber,
127  DomainPartition & domain );
128 
129  void computeUnknowns( real64 const & time_n,
130  real64 const & dt,
131  integer const & cycleNumber,
132  DomainPartition & domain,
133  MeshLevel & mesh,
134  string_array const & regionNames );
135 
136  void synchronizeUnknowns( real64 const & time_n,
137  real64 const & dt,
138  DomainPartition & domain,
139  MeshLevel & mesh,
140  string_array const & regionNames );
141 
142  void prepareNextTimestep( MeshLevel & mesh );
143 
144 protected:
145 
146  virtual void postInputInitialization() override final;
147 
148  virtual void initializePostInitialConditionsPreSubGroups() override final;
149 
150 private:
151 
158  virtual void precomputeSourceAndReceiverTerm( MeshLevel & baseMesh, MeshLevel & mesh, string_array const & regionNames ) override;
159 
165  virtual void applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) override;
166 
172  virtual void applyPML( real64 const time, DomainPartition & domain ) override;
173 
175  array2d< real32 > m_pressureNp1AtReceivers;
176 
177 };
178 
179 } /* namespace geos */
180 
181 #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 explicitStepBackward(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain, bool const computeGradient) override
Perform backward explicit step.
virtual real64 explicitStepForward(real64 const &time_n, real64 const &dt, integer const cycleNumber, DomainPartition &domain, bool const computeGradient) override
Perform forward 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
std::vector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:393