Skip to content

Commit

Permalink
Merge pull request #133 from PrincetonUniversity/devel
Browse files Browse the repository at this point in the history
SPECFEM++ 0.2.0 Release
  • Loading branch information
Rohit-Kakodkar authored Nov 5, 2024
2 parents 3c9fffb + b7082e0 commit f54b50f
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 55 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/docs.yml

This file was deleted.

5 changes: 3 additions & 2 deletions docs/cookbooks/example_02.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Parameter file
~~~~~~~~~~~~~

.. code-block:: bash
:caption: Par_File
#-----------------------------------------------------------
#
Expand Down Expand Up @@ -199,6 +200,7 @@ Defining the topography of the domain
We define the topography of the domain using the following topography file

.. code-block:: bash
:caption: topography_file.dat
#
# number of interfaces
Expand Down Expand Up @@ -260,7 +262,7 @@ Defining the source
We define the source location and the source time function in the source file.

.. code-block:: yaml
:linenos:
:caption: single_source.yaml
number-of-sources: 1
sources:
Expand All @@ -282,7 +284,6 @@ Running the simulation
To run the solver, we first need to define a configuration file ``specfem_config.yaml``.

.. code-block:: yaml
:linenos:
:caption: specfem_config.yaml
parameters:
Expand Down
6 changes: 3 additions & 3 deletions docs/cookbooks/example_03.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ With the above input files, we can run the mesher to generate the mesh database.

.. code:: bash
xmeshfem2D -p Par_file
xmeshfem2D -p Par_File
Running the forward simulation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -321,7 +321,7 @@ With the above input files, we can run the forward simulation.
Generating adjoint sources
--------------------------

The next step is to generate the adjoint sources. We can generate the adjoint sources using ``./xadj_seismogram`` utility which models Eq. 45 of `Tromp et al. 2005 <https://doi.org/10.1111/j.1365-246X.2004.02453.x>`_. The utility requires synthetic seismograms and does not depend on the observed data.
The next step is to generate the adjoint sources. In this example, we are computing sensitivity kernels for travel-time measurements. The adjoint source required for this kernel is defined by Eq. 45 of `Tromp et al. 2005 <https://doi.org/10.1111/j.1365-246X.2004.02453.x>`_, and relies only the synthetic velocity seismogram. Here we use the utility ``xadj_seismogram``, which computes this adjoint source from the displacement synthetics computed during forward run i.e. by numerically differentiating the displacements.

.. code:: bash
Expand Down Expand Up @@ -483,7 +483,7 @@ Lastly if the kernels are stored in ASCII format, we can use numpy to read the k

.. note::

An python code for reading ASCII kernels and plotting them is provided `here <https://github.com/PrincetonUniversity/SPECFEMPP/blob/latest/examples/Tromp_2005/plot.py>`_.
An python code for reading ASCII kernels and plotting them is provided `here <https://github.com/PrincetonUniversity/SPECFEMPP/blob/main/examples/Tromp_2005/plot.py>`_.

.. figure:: ../../examples/Tromp_2005/Reference_Kernels/Kernels.png
:alt: Kernels
Expand Down
10 changes: 6 additions & 4 deletions docs/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ SPECFEM++ inherits several architecure specific cmake configuration keywords fro
.. code-block:: bash
# cd into SPECFEM root directory
cmake3 -S . -B build -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=ON -D Kokkos_ENABLE_CUDA=ON -D Kokkos_ARCH_<architecture>=ON -D BUILD_EXAMPLES=ON
cmake3 -S . -B build -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=ON -D Kokkos_ENABLE_CUDA=ON -D Kokkos_ARCH_<architecture>=ON
cmake --build build
.. note::
Expand All @@ -127,11 +127,11 @@ SPECFEM++ inherits several architecure specific cmake configuration keywords fro
Adding SPECFEM to PATH
----------------------

Finally, once compiled you could run SPECFEM++ from inside the build directory, by running the executible ``./specfem``. However, we recommend you add SPECFEM++ build directory to your ``PATH`` using
Finally, once compiled you could run SPECFEM++ from inside the build directory, by running the executible ``./specfem2d``. However, we recommend you add SPECFEM++ build directory to your ``PATH`` using

.. code-block:: bash
export $PATH=$(pwd)/build:$PATH
export PATH=$(pwd)/build:$PATH
Running the solver
------------------
Expand All @@ -145,12 +145,14 @@ Lets run a simple example to test the installation. We will use the ``example\ho
.. code-block:: bash
cd examples/homogeneous-medium-flat-topography
xmeshfem2D -p Par_file
mkdir -p OUTPUT_FILES
xmeshfem2D -p Par_File
This will generate the mesh files. Next, we will run the solver using

.. code-block:: bash
mkdir -p OUTPUT_FILES/results
specfem2d -p specfem_config.yaml
This will run the solver and generate synthetic seismograms at the receiver locations specified in ``STATIONS`` file.
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ Table below shows various features available and tested in this package on vario
-
-

* - displacement
* - Displacement
- ✔
- ✔
- ✔
-

* - velocity
* - Velocity
- ✔
- ✔
- ✔
-

* - acceleration
* - Acceleration
- ✔
- ✔
- ✔
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion examples/Tromp_2005/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5)

configure_file(Snakefile.in ${CMAKE_SOURCE_DIR}/examples/Tromp_2005/Snakefile)
configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/examples/Tromp_2005/Par_File)
configure_file(CMakeFiles/Snakefile.in ${CMAKE_SOURCE_DIR}/examples/Tromp_2005/Snakefile)
2 changes: 1 addition & 1 deletion examples/Tromp_2005/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wave propagation through homogeneous medium with no interfaces

This example reproduces the results from Fig 9 of [Tromp et al. 2005](https://doi.org/10.1111/j.1365-246X.2004.02453.x).
This example reproduces the results from Fig 9 of [Tromp et al. 2005](https://doi.org/10.1111/j.1365-246X.2004.02453.x). For a step-by-step guide on this example, please refer to the [documentation](https://specfem2d-kokkos.readthedocs.io/en/latest/cookbooks/example_03.html).

## Running the examples

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions examples/fluid-solid-interface/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5)

configure_file(specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-interface/specfem_config.yaml)
configure_file(Par_File.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-interface/Par_File)
configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-interface/specfem_config.yaml)
configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-interface/Par_File)
2 changes: 1 addition & 1 deletion examples/fluid-solid-interface/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wave propagration through fluid-solid interface

This example creates the fluid-solid example with flat ocean bottom from [Komatitsch et. al.](https://doi.org/10.1190/1.1444758).
This example creates the fluid-solid example with flat ocean bottom from [Komatitsch et. al.](https://doi.org/10.1190/1.1444758). For a step-by-step guide on this example, please refer to the [documentation](https://specfem2d-kokkos.readthedocs.io/en/latest/cookbooks/example_02.html).

## Running the examples

Expand Down
4 changes: 2 additions & 2 deletions examples/homogeneous-medium-flat-topography/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5)

configure_file(Par_File.in ${CMAKE_SOURCE_DIR}/examples/homogeneous-medium-flat-topography/Par_File)
configure_file(specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/examples/homogeneous-medium-flat-topography/specfem_config.yaml)
configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/examples/homogeneous-medium-flat-topography/Par_File)
configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/examples/homogeneous-medium-flat-topography/specfem_config.yaml)
2 changes: 1 addition & 1 deletion examples/homogeneous-medium-flat-topography/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wave propagation through homogeneous medium with no interfaces

In this example we simulate wave propagation through a 2-dimensional homogeneous medium.
In this example we simulate wave propagation through a 2-dimensional homogeneous medium. For a step-by-step guide on this example, please refer to the [documentation](https://specfem2d-kokkos.readthedocs.io/en/latest/cookbooks/example_01.html).

## Running the examples

Expand Down
3 changes: 2 additions & 1 deletion meshfem2d/adj_seismogram.f90
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ program adj_seismogram

! user output
print *,'*************************'
print *,'The input files (AA.S****.BXX/BXY/BXZ.adj) needed to run the adjoint simulation are in folder SEM/'
print *, 'The input files (AA.S****.BXX/BXY/BXZ.adj) needed to run the adjoint simulation are in folder ',&
trim(adjoint_sources_folder)
print *,'*************************'

end program adj_seismogram

0 comments on commit f54b50f

Please sign in to comment.