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 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 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( real64 const & time_n, 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  DomainPartition & domain );
127 
128  void computeUnknowns( real64 const & time_n,
129  real64 const & dt,
130  DomainPartition & domain,
131  MeshLevel & mesh,
132  arrayView1d< string const > const & regionNames );
133 
134  void synchronizeUnknowns( real64 const & time_n,
135  real64 const & dt,
136  DomainPartition & domain,
137  MeshLevel & mesh,
138  arrayView1d< string const > const & regionNames );
139 
140  void prepareNextTimestep( MeshLevel & mesh );
141 
142 protected:
143 
144  virtual void postInputInitialization() override final;
145 
146  virtual void initializePostInitialConditionsPreSubGroups() override final;
147 
148 private:
149 
156  virtual void precomputeSourceAndReceiverTerm( MeshLevel & baseMesh, MeshLevel & mesh, arrayView1d< string const > const & regionNames ) override;
157 
163  virtual void applyFreeSurfaceBC( real64 const time, DomainPartition & domain ) override;
164 
170  virtual void applyPML( real64 const time, DomainPartition & domain ) override;
171 
173  array2d< real32 > m_pressureNp1AtReceivers;
174 
175 };
176 
177 } /* namespace geos */
178 
179 #endif /* GEOS_PHYSICSSOLVERS_WAVEPROPAGATION_ACOUSTICWAVEEQUATIONSEM_HPP_ */
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 initializePML() override
Initialize Perfectly Matched Layer (PML) information.
real64 explicitStepInternal(real64 const &time_n, real64 const &dt, DomainPartition &domain)
virtual void addSourceToRightHandSide(real64 const &time_n, arrayView1d< real32 > const rhs)
Multiply the precomputed term by the Ricker and add to the right-hand side.
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