From 3054ad8979342f6245c4b871b5d6b388ee9f1e47 Mon Sep 17 00:00:00 2001 From: Rohit Kakodkar Date: Sun, 24 Nov 2024 11:42:41 -0500 Subject: [PATCH] Added CMake templates for SPECFEM++ run --- examples/fluid-solid-bathymetry/.gitignore | 3 +++ .../{Par_File => CMakeFiles/Par_File.in} | 10 +++++----- .../specfem_config.yaml.in} | 8 ++++---- examples/fluid-solid-bathymetry/CMakeLists.txt | 5 +++++ 4 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 examples/fluid-solid-bathymetry/.gitignore rename examples/fluid-solid-bathymetry/{Par_File => CMakeFiles/Par_File.in} (94%) rename examples/fluid-solid-bathymetry/{specfem_config.yaml => CMakeFiles/specfem_config.yaml.in} (77%) create mode 100644 examples/fluid-solid-bathymetry/CMakeLists.txt diff --git a/examples/fluid-solid-bathymetry/.gitignore b/examples/fluid-solid-bathymetry/.gitignore new file mode 100644 index 00000000..26302ef0 --- /dev/null +++ b/examples/fluid-solid-bathymetry/.gitignore @@ -0,0 +1,3 @@ +line_sources.yaml +specfem_config.yaml +Par_File diff --git a/examples/fluid-solid-bathymetry/Par_File b/examples/fluid-solid-bathymetry/CMakeFiles/Par_File.in similarity index 94% rename from examples/fluid-solid-bathymetry/Par_File rename to examples/fluid-solid-bathymetry/CMakeFiles/Par_File.in index d9d94496..bc40d8d0 100644 --- a/examples/fluid-solid-bathymetry/Par_File +++ b/examples/fluid-solid-bathymetry/CMakeFiles/Par_File.in @@ -11,7 +11,7 @@ title = fluid-solid-bathymetry NPROC = 1 # number of processes # Output folder to store mesh related files -OUTPUT_FILES = OUTPUT_FILES +OUTPUT_FILES = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES #----------------------------------------------------------- # @@ -26,7 +26,7 @@ PARTITIONING_TYPE = 3 # SCOTCH = 3, ascending order ( NGNOD = 9 # location to store the mesh -database_filename = OUTPUT_FILES/database.bin +database_filename = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/database.bin #----------------------------------------------------------- # @@ -62,7 +62,7 @@ zfin = 5.472d+03 # last receiver z in meters (ig record_at_surface_same_vertical = .false. # receivers inside the medium or at the surface # filename to store stations file -stations_filename = OUTPUT_FILES/STATIONS +stations_filename = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/STATIONS #----------------------------------------------------------- # @@ -112,7 +112,7 @@ tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing th #----------------------------------------------------------- # file containing interfaces for internal mesh -interfacesfile = topography_file.dat +interfacesfile = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/topography.dat # geometry of the model (origin lower-left corner = 0,0) and mesh description xmin = 0.d0 # abscissa of left side of the model @@ -140,4 +140,4 @@ nbregions = 2 # then set below the different # meshing output output_grid_Gnuplot = .false. # generate a GNUPLOT file containing the grid, and a script to plot it -output_grid_ASCII = .false. # dump the grid in an ASCII text file consisting of a set of X,Y,Z points or not \ No newline at end of file +output_grid_ASCII = .false. # dump the grid in an ASCII text file consisting of a set of X,Y,Z points or not diff --git a/examples/fluid-solid-bathymetry/specfem_config.yaml b/examples/fluid-solid-bathymetry/CMakeFiles/specfem_config.yaml.in similarity index 77% rename from examples/fluid-solid-bathymetry/specfem_config.yaml rename to examples/fluid-solid-bathymetry/CMakeFiles/specfem_config.yaml.in index 505136f5..4136e1ea 100644 --- a/examples/fluid-solid-bathymetry/specfem_config.yaml +++ b/examples/fluid-solid-bathymetry/CMakeFiles/specfem_config.yaml.in @@ -31,10 +31,10 @@ parameters: writer: seismogram: format: ascii - directory: OUTPUT_FILES/seismograms + directory: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/seismograms receivers: - stations-file: OUTPUT_FILES/STATIONS + stations-file: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/STATIONS angle: 0.0 seismogram-type: - displacement @@ -48,5 +48,5 @@ parameters: ## databases databases: - mesh-database: OUTPUT_FILES/database.bin - source-file: line_sources.yaml + mesh-database: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/database.bin + source-file: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/line_sources.yaml diff --git a/examples/fluid-solid-bathymetry/CMakeLists.txt b/examples/fluid-solid-bathymetry/CMakeLists.txt new file mode 100644 index 00000000..dde43a17 --- /dev/null +++ b/examples/fluid-solid-bathymetry/CMakeLists.txt @@ -0,0 +1,5 @@ + +CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5) + +configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-bathymetry/specfem_config.yaml) +configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-bathymetry/Par_File)