diff --git a/CMakeLists.txt b/CMakeLists.txt index ae0430789..81204d037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -642,10 +642,6 @@ add_executable( benchmarks/main.cpp ) -add_subdirectory(benchmarks/data) -add_subdirectory(benchmarks/data_iso) -add_subdirectory(benchmarks/data_aniso) - target_link_libraries( specfem2d-benchmark execute @@ -653,9 +649,9 @@ target_link_libraries( target_compile_definitions( specfem2d-benchmark - PRIVATE __benchmark_acoustic__="${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/data/specfem_config.yaml" PRIVATE __benchmark_iso__="${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/data_iso/specfem_config.yaml" - PRIVATE __benchmark_aniso__="${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/data_aniso/specfem_config.yaml" + PRIVATE __benchmark_eiso__="${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/data_eiso/specfem_config.yaml" + PRIVATE __benchmark_eani__="${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/data_eani/specfem_config.yaml" ) # Include tests diff --git a/benchmarks/.gitignore b/benchmarks/.gitignore new file mode 100644 index 000000000..b110612fc --- /dev/null +++ b/benchmarks/.gitignore @@ -0,0 +1,3 @@ +data_iso +data_eiso +data_eani diff --git a/benchmarks/data/.gitignore b/benchmarks/data/.gitignore deleted file mode 100644 index e7e74c223..000000000 --- a/benchmarks/data/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Par_file -specfem_config.yaml diff --git a/benchmarks/data/CMakeFiles/Par_File.in b/benchmarks/data/CMakeFiles/Par_File.in deleted file mode 100644 index cf9d0b2c0..000000000 --- a/benchmarks/data/CMakeFiles/Par_File.in +++ /dev/null @@ -1,154 +0,0 @@ -#----------------------------------------------------------- -# -# Simulation input parameters -# -#----------------------------------------------------------- - -# title of job -title = Elastic Simulation with point source - -# parameters concerning partitioning -NPROC = 1 # number of processes - -# Output folder to store mesh related files -OUTPUT_FILES = @CMAKE_SOURCE_DIR@/benchmarks/data/OUTPUT_FILES - - -#----------------------------------------------------------- -# -# Mesh -# -#----------------------------------------------------------- - -# Partitioning algorithm for decompose_mesh -PARTITIONING_TYPE = 3 # SCOTCH = 3, ascending order (very bad idea) = 1 - -# number of control nodes per element (4 or 9) -NGNOD = 9 - -# location to store the mesh -database_filename = @CMAKE_SOURCE_DIR@/benchmarks/data/OUTPUT_FILES/database.bin - -#----------------------------------------------------------- -# -# Receivers -# -#----------------------------------------------------------- - -# use an existing STATION file found in ./DATA or create a new one from the receiver positions below in this Par_file -use_existing_STATIONS = .false. - -# number of receiver sets (i.e. number of receiver lines to create below) -nreceiversets = 2 - -# orientation -anglerec = 0.d0 # angle to rotate components at receivers -rec_normal_to_surface = .false. # base anglerec normal to surface (external mesh and curve file needed) - -# first receiver set (repeat these 6 lines and adjust nreceiversets accordingly) -nrec = 3 # number of receivers -xdeb = 2200. # first receiver x in meters -zdeb = 2200. # first receiver z in meters -xfin = 2800. # last receiver x in meters (ignored if only one receiver) -zfin = 2200. # last receiver z in meters (ignored if only one receiver) -record_at_surface_same_vertical = .true. # receivers inside the medium or at the surface (z values are ignored if this is set to true, they are replaced with the topography height) - -# second receiver set -nrec = 3 # number of receivers -xdeb = 2500. # first receiver x in meters -zdeb = 2500. # first receiver z in meters -xfin = 2500. # last receiver x in meters (ignored if only one receiver) -zfin = 1900. # last receiver z in meters (ignored if only one receiver) -record_at_surface_same_vertical = .false. # receivers inside the medium or at the surface (z values are ignored if this is set to true, they are replaced with the topography height) - -# filename to store stations file -stations_filename = @CMAKE_SOURCE_DIR@/benchmarks/data/OUTPUT_FILES/STATIONS - -#----------------------------------------------------------- -# -# Velocity and density models -# -#----------------------------------------------------------- - -# number of model materials -nbmodels = 1 -# available material types (see user manual for more information) -# acoustic: model_number 1 rho Vp 0 0 0 QKappa 9999 0 0 0 0 0 0 (for QKappa use 9999 to ignore it) -# elastic: model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0 (for QKappa and Qmu use 9999 to ignore them) -# anisotropic: model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 0 QKappa Qmu -# anisotropic in AXISYM: model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 c22 QKappa Qmu -# poroelastic: model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu -# tomo: model_number -1 0 0 A 0 0 0 0 0 0 0 0 0 0 -# -# note: When viscoelasticity or viscoacousticity is turned on, -# the Vp and Vs values that are read here are the UNRELAXED ones i.e. the values at infinite frequency -# unless the READ_VELOCITIES_AT_f0 parameter above is set to true, in which case they are the values at frequency f0. -# -# Please also note that Qmu is always equal to Qs, but Qkappa is in general not equal to Qp. -# To convert one to the other see doc/Qkappa_Qmu_versus_Qp_Qs_relationship_in_2D_plane_strain.pdf and -# utils/attenuation/conversion_from_Qkappa_Qmu_to_Qp_Qs_from_Dahlen_Tromp_959_960.f90. -1 1 2700.d0 3000.d0 0 0 0 9999 9999 0 0 0 0 0 0 -# 2 1 2500.d0 2700.d0 1443.375d0 0 0 9999 9999 0 0 0 0 0 0 -# 3 1 2200.d0 2500.d0 1443.375d0 0 0 9999 9999 0 0 0 0 0 0 -# 4 1 2200.d0 2200.d0 1343.375d0 0 0 9999 9999 0 0 0 0 0 0 - -# external tomography file -TOMOGRAPHY_FILE = ./DATA/tomo_file.xyz - -# use an external mesh created by an external meshing tool or use the internal mesher -read_external_mesh = .false. - -#----------------------------------------------------------- -# -# PARAMETERS FOR EXTERNAL MESHING -# -#----------------------------------------------------------- - -# data concerning mesh, when generated using third-party app (more info in README) -# (see also absorbing_conditions above) -mesh_file = ./DATA/mesh_file # file containing the mesh -nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates -materials_file = ./DATA/materials_file # file containing the material number for each element -free_surface_file = ./DATA/free_surface_file # file containing the free surface -axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true -absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface -acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface -absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers -tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model - -#----------------------------------------------------------- -# -# PARAMETERS FOR INTERNAL MESHING -# -#----------------------------------------------------------- - -# file containing interfaces for internal mesh -interfacesfile = @CMAKE_SOURCE_DIR@/benchmarks/data/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 -xmax = 4000.d0 # abscissa of right side of the model -nx = 1800 # number of elements along X - -STACEY_ABSORBING_CONDITIONS = .false. - -# absorbing boundary parameters (see absorbing_conditions above) -absorbbottom = .false. -absorbright = .false. -absorbtop = .false. -absorbleft = .false. - -# define the different regions of the model in the (nx,nz) spectral-element mesh -nbregions = 1 # then set below the different regions and model number for each region -# format of each line: nxmin nxmax nzmin nzmax material_number -1 1800 1 600 1 - -#----------------------------------------------------------- -# -# DISPLAY PARAMETERS -# -#----------------------------------------------------------- - -# 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 diff --git a/benchmarks/data/CMakeLists.txt b/benchmarks/data/CMakeLists.txt deleted file mode 100644 index 92e092581..000000000 --- a/benchmarks/data/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5) - -configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/benchmarks/data/Par_File) -configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/benchmarks/data/specfem_config.yaml) diff --git a/benchmarks/data/CMakeFiles/specfem_config.yaml.in b/benchmarks/data/specfem_config.yaml similarity index 67% rename from benchmarks/data/CMakeFiles/specfem_config.yaml.in rename to benchmarks/data/specfem_config.yaml index b20a9653e..bdb2fbcf2 100644 --- a/benchmarks/data/CMakeFiles/specfem_config.yaml.in +++ b/benchmarks/data/specfem_config.yaml @@ -2,10 +2,10 @@ parameters: header: ## Header information is used for logging. It is good practice to give your simulations explicit names - title: Isotropic Elastic simulation # name for your simulation + title: ${title} # name for your simulation # A detailed description for your simulation description: | - Material systems : Elastic domain (1) + Material systems : ${title} Interfaces : None Sources : Force source (1) Boundary conditions : Neumann BCs on all edges @@ -28,10 +28,10 @@ parameters: writer: seismogram: format: "ascii" - directory: "@CMAKE_SOURCE_DIR@/benchmarks/data/OUTPUT_FILES/results" + directory: "${cwd}/OUTPUT_FILES" receivers: - stations: "@CMAKE_SOURCE_DIR@/benchmarks/data/OUTPUT_FILES/STATIONS" + stations: "${cwd}/OUTPUT_FILES/STATIONS" angle: 0.0 seismogram-type: - velocity @@ -44,7 +44,7 @@ parameters: ## databases databases: - mesh-database: "@CMAKE_SOURCE_DIR@/benchmarks/data/OUTPUT_FILES/database.bin" + mesh-database: "${cwd}/OUTPUT_FILES/database.bin" ## sources - sources: "@CMAKE_SOURCE_DIR@/benchmarks/data/source.yaml" + sources: "${cwd}/source.yaml" diff --git a/benchmarks/data/topography.dat b/benchmarks/data/topography.dat index 9d1df59df..c8a116b7e 100644 --- a/benchmarks/data/topography.dat +++ b/benchmarks/data/topography.dat @@ -22,4 +22,4 @@ # # layer number 1 (bottom layer) # - 600 + ${nz} diff --git a/benchmarks/data_aniso/.gitignore b/benchmarks/data_aniso/.gitignore deleted file mode 100644 index e7e74c223..000000000 --- a/benchmarks/data_aniso/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Par_file -specfem_config.yaml diff --git a/benchmarks/data_aniso/CMakeFiles/Par_File.in b/benchmarks/data_aniso/CMakeFiles/Par_File.in deleted file mode 100644 index 079ac4774..000000000 --- a/benchmarks/data_aniso/CMakeFiles/Par_File.in +++ /dev/null @@ -1,135 +0,0 @@ -#----------------------------------------------------------- -# -# Simulation input parameters -# -#----------------------------------------------------------- - -# title of job -title = Anisotropic Crystal -# parameters concerning partitioning -NPROC = 1 # number of processes - -# Output folder to store mesh related files -OUTPUT_FILES = @CMAKE_SOURCE_DIR@/benchmarks/data_aniso/OUTPUT_FILES - -#----------------------------------------------------------- -# -# Mesh -# -#----------------------------------------------------------- - -# Partitioning algorithm for decompose_mesh -PARTITIONING_TYPE = 3 # SCOTCH = 3, ascending order (very bad idea) = 1 - -# number of control nodes per element (4 or 9) -NGNOD = 9 - -# location to store the mesh -database_filename = @CMAKE_SOURCE_DIR@/benchmarks/data_aniso/OUTPUT_FILES/database.bin - -#----------------------------------------------------------- -# -# Receivers -# -#----------------------------------------------------------- - - - -# use an existing STATION file found in ./DATA or create a new one from the receiver positions below in this Par_file -use_existing_STATIONS = .false. - -# number of receiver sets (i.e. number of receiver lines to create below) -nreceiversets = 1 - -# orientation -anglerec = 0.d0 # angle to rotate components at receivers -rec_normal_to_surface = .false. # base anglerec normal to surface (external mesh and curve file needed) - -# first receiver set (repeat these 6 lines and adjust nreceiversets accordingly) -nrec = 50 # number of receivers -xdeb = 0.05 # first receiver x in meters -zdeb = 0.2640 # first receiver z in meters -xfin = 0.28 # last receiver x in meters (ignored if only one receiver) -zfin = 0.2640 # last receiver z in meters (ignored if only one receiver) -record_at_surface_same_vertical = .false. # receivers inside the medium or at the surface - -# filename to store stations file -stations_filename = @CMAKE_SOURCE_DIR@/benchmarks/data_aniso/OUTPUT_FILES/STATIONS - -#----------------------------------------------------------- -# -# Velocity and density models -# -#----------------------------------------------------------- - -# number of model materials -nbmodels = 1 -# available material types (see user manual for more information) -# acoustic: model_number 1 rho Vp 0 0 0 QKappa Qmu 0 0 0 0 0 0 -# elastic: model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0 -# anistoropic: model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 0 0 0 -# poroelastic: model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu -# tomo: model_number -1 0 9999 9999 A 0 0 9999 9999 0 0 0 0 0 -1 2 7100. 16.5d10 5.d10 0 6.2d10 0 3.96d10 0 0 0 0 0 0 - -# external tomography file -TOMOGRAPHY_FILE = ./DATA/tomo_file.xyz - -# use an external mesh created by an external meshing tool or use the internal mesher -read_external_mesh = .false. - -#----------------------------------------------------------- -# -# PARAMETERS FOR EXTERNAL MESHING -# -#----------------------------------------------------------- - -# data concerning mesh, when generated using third-party app (more info in README) -# (see also absorbing_conditions above) -mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh -nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates -materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element -free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface -axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true -absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface -acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface -absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers -tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model - -#----------------------------------------------------------- -# -# PARAMETERS FOR INTERNAL MESHING -# -#----------------------------------------------------------- - -# file containing interfaces for internal mesh -interfacesfile = @CMAKE_SOURCE_DIR@/benchmarks/data_aniso/topoaniso.dat - -# geometry of the model (origin lower-left corner = 0,0) and mesh description -xmin = 0.d0 # abscissa of left side of the model -xmax = 0.33 # abscissa of right side of the model -nx = 1200 # number of elements along X - -# Stacey ABC -STACEY_ABSORBING_CONDITIONS = .false. - -# absorbing boundary parameters (see absorbing_conditions above) -absorbbottom = .false. -absorbright = .false. -absorbtop = .false. -absorbleft = .false. - -# define the different regions of the model in the (nx,nz) spectral-element mesh -nbregions = 1 # then set below the different regions and model number for each region -# format of each line: nxmin nxmax nzmin nzmax material_number -1 1200 1 400 1 - -#----------------------------------------------------------- -# -# Display parameters -# -#----------------------------------------------------------- - -# 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 diff --git a/benchmarks/data_aniso/CMakeFiles/specfem_config.yaml.in b/benchmarks/data_aniso/CMakeFiles/specfem_config.yaml.in deleted file mode 100644 index 0502ce1b7..000000000 --- a/benchmarks/data_aniso/CMakeFiles/specfem_config.yaml.in +++ /dev/null @@ -1,55 +0,0 @@ -## Coupling interfaces have code flow that is dependent on orientation of the interface. -## This test is to check the code flow for horizontal acoustic-elastic interface with acoustic domain on top. - -parameters: - - header: - ## Header information is used for logging. It is good practice to give your simulations explicit names - title: Heterogeneous acoustic-elastic medium with 1 acoustic-elastic interface (orientation horizontal) # name for your simulation - # A detailed description for your simulation - description: | - Material systems : Elastic domain (1), Acoustic domain (1) - Interfaces : Acoustic-elastic interface (1) (orientation horizontal with acoustic domain on top) - Sources : Force source (1) - Boundary conditions : Neumann BCs on all edges - Debugging comments: This tests checks coupling acoustic-elastic interface implementation. - The orientation of the interface is horizontal with acoustic domain on top. - - simulation-setup: - ## quadrature setup - quadrature: - quadrature-type: GLL4 - - ## Solver setup - solver: - time-marching: - type-of-simulation: forward - time-scheme: - type: Newmark - dt: 55.e-9 - nstep: 1600 - - simulation-mode: - forward: - writer: - seismogram: - format: ascii - directory: "@CMAKE_SOURCE_DIR@/benchmarks/data_aniso/OUTPUT_FILES/results" - - receivers: - stations: "@CMAKE_SOURCE_DIR@/benchmarks/data_aniso/OUTPUT_FILES/STATIONS" - angle: 0.0 - seismogram-type: - - displacement - nstep_between_samples: 1 - - ## Runtime setup - run-setup: - number-of-processors: 1 - number-of-runs: 1 - - ## databases - databases: - mesh-database: "@CMAKE_SOURCE_DIR@/benchmarks/data_aniso/OUTPUT_FILES/database.bin" - - sources: "@CMAKE_SOURCE_DIR@/benchmarks/data_aniso/sources.yaml" diff --git a/benchmarks/data_aniso/CMakeLists.txt b/benchmarks/data_aniso/CMakeLists.txt deleted file mode 100644 index f7413194c..000000000 --- a/benchmarks/data_aniso/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5) - -configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/benchmarks/data_aniso/Par_File) -configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/benchmarks/data_aniso/specfem_config.yaml) diff --git a/benchmarks/data_aniso/sources.yaml b/benchmarks/data_aniso/sources.yaml deleted file mode 100644 index 2f3c7785a..000000000 --- a/benchmarks/data_aniso/sources.yaml +++ /dev/null @@ -1,13 +0,0 @@ -number-of-sources: 1 -sources: - - force: - x : 0.165 - z : 0.165 - source_surf: false - angle : 0.0 - vx : 0.0 - vz : 0.0 - Ricker: - factor: 1e10 - tshift: 0.0 - f0: 170000.0 diff --git a/benchmarks/data_aniso/topoaniso.dat b/benchmarks/data_aniso/topoaniso.dat deleted file mode 100644 index b193c461d..000000000 --- a/benchmarks/data_aniso/topoaniso.dat +++ /dev/null @@ -1,26 +0,0 @@ -# -# number of interfaces -# - 2 -# -# for each interface below, we give the number of points and then x,z for each point -# -# -# interface number 1 (bottom of the mesh) -# - 2 - 0 0 - 0.33 0 -# -# interface number 2 (topography, top of the mesh) -# - 2 - 0 0.33 - 0.33 0.33 -# -# for each layer, we give the number of spectral elements in the vertical direction -# -# -# layer number 1 (bottom layer) -# - 600 diff --git a/benchmarks/data_iso/.gitignore b/benchmarks/data_iso/.gitignore deleted file mode 100644 index e7e74c223..000000000 --- a/benchmarks/data_iso/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Par_file -specfem_config.yaml diff --git a/benchmarks/data_iso/CMakeFiles/Par_File.in b/benchmarks/data_iso/CMakeFiles/Par_File.in deleted file mode 100644 index 66695079b..000000000 --- a/benchmarks/data_iso/CMakeFiles/Par_File.in +++ /dev/null @@ -1,154 +0,0 @@ -#----------------------------------------------------------- -# -# Simulation input parameters -# -#----------------------------------------------------------- - -# title of job -title = Elastic Simulation with point source - -# parameters concerning partitioning -NPROC = 1 # number of processes - -# Output folder to store mesh related files -OUTPUT_FILES = @CMAKE_SOURCE_DIR@/benchmarks/data_iso/OUTPUT_FILES - - -#----------------------------------------------------------- -# -# Mesh -# -#----------------------------------------------------------- - -# Partitioning algorithm for decompose_mesh -PARTITIONING_TYPE = 3 # SCOTCH = 3, ascending order (very bad idea) = 1 - -# number of control nodes per element (4 or 9) -NGNOD = 9 - -# location to store the mesh -database_filename = @CMAKE_SOURCE_DIR@/benchmarks/data_iso/OUTPUT_FILES/database.bin - -#----------------------------------------------------------- -# -# Receivers -# -#----------------------------------------------------------- - -# use an existing STATION file found in ./DATA or create a new one from the receiver positions below in this Par_file -use_existing_STATIONS = .false. - -# number of receiver sets (i.e. number of receiver lines to create below) -nreceiversets = 2 - -# orientation -anglerec = 0.d0 # angle to rotate components at receivers -rec_normal_to_surface = .false. # base anglerec normal to surface (external mesh and curve file needed) - -# first receiver set (repeat these 6 lines and adjust nreceiversets accordingly) -nrec = 3 # number of receivers -xdeb = 2200. # first receiver x in meters -zdeb = 2200. # first receiver z in meters -xfin = 2800. # last receiver x in meters (ignored if only one receiver) -zfin = 2200. # last receiver z in meters (ignored if only one receiver) -record_at_surface_same_vertical = .true. # receivers inside the medium or at the surface (z values are ignored if this is set to true, they are replaced with the topography height) - -# second receiver set -nrec = 3 # number of receivers -xdeb = 2500. # first receiver x in meters -zdeb = 2500. # first receiver z in meters -xfin = 2500. # last receiver x in meters (ignored if only one receiver) -zfin = 1900. # last receiver z in meters (ignored if only one receiver) -record_at_surface_same_vertical = .false. # receivers inside the medium or at the surface (z values are ignored if this is set to true, they are replaced with the topography height) - -# filename to store stations file -stations_filename = @CMAKE_SOURCE_DIR@/benchmarks/data_iso/OUTPUT_FILES/STATIONS - -#----------------------------------------------------------- -# -# Velocity and density models -# -#----------------------------------------------------------- - -# number of model materials -nbmodels = 1 -# available material types (see user manual for more information) -# acoustic: model_number 1 rho Vp 0 0 0 QKappa 9999 0 0 0 0 0 0 (for QKappa use 9999 to ignore it) -# elastic: model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0 (for QKappa and Qmu use 9999 to ignore them) -# anisotropic: model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 0 QKappa Qmu -# anisotropic in AXISYM: model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 c22 QKappa Qmu -# poroelastic: model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu -# tomo: model_number -1 0 0 A 0 0 0 0 0 0 0 0 0 0 -# -# note: When viscoelasticity or viscoacousticity is turned on, -# the Vp and Vs values that are read here are the UNRELAXED ones i.e. the values at infinite frequency -# unless the READ_VELOCITIES_AT_f0 parameter above is set to true, in which case they are the values at frequency f0. -# -# Please also note that Qmu is always equal to Qs, but Qkappa is in general not equal to Qp. -# To convert one to the other see doc/Qkappa_Qmu_versus_Qp_Qs_relationship_in_2D_plane_strain.pdf and -# utils/attenuation/conversion_from_Qkappa_Qmu_to_Qp_Qs_from_Dahlen_Tromp_959_960.f90. -1 1 2700.d0 3000.d0 1732.051d0 0 0 9999 9999 0 0 0 0 0 0 -# 2 1 2500.d0 2700.d0 1443.375d0 0 0 9999 9999 0 0 0 0 0 0 -# 3 1 2200.d0 2500.d0 1443.375d0 0 0 9999 9999 0 0 0 0 0 0 -# 4 1 2200.d0 2200.d0 1343.375d0 0 0 9999 9999 0 0 0 0 0 0 - -# external tomography file -TOMOGRAPHY_FILE = ./DATA/tomo_file.xyz - -# use an external mesh created by an external meshing tool or use the internal mesher -read_external_mesh = .false. - -#----------------------------------------------------------- -# -# PARAMETERS FOR EXTERNAL MESHING -# -#----------------------------------------------------------- - -# data concerning mesh, when generated using third-party app (more info in README) -# (see also absorbing_conditions above) -mesh_file = ./DATA/mesh_file # file containing the mesh -nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates -materials_file = ./DATA/materials_file # file containing the material number for each element -free_surface_file = ./DATA/free_surface_file # file containing the free surface -axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true -absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface -acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface -absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers -tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model - -#----------------------------------------------------------- -# -# PARAMETERS FOR INTERNAL MESHING -# -#----------------------------------------------------------- - -# file containing interfaces for internal mesh -interfacesfile = @CMAKE_SOURCE_DIR@/benchmarks/data_iso/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 -xmax = 4000.d0 # abscissa of right side of the model -nx = 1800 # number of elements along X - -STACEY_ABSORBING_CONDITIONS = .false. - -# absorbing boundary parameters (see absorbing_conditions above) -absorbbottom = .false. -absorbright = .false. -absorbtop = .false. -absorbleft = .false. - -# define the different regions of the model in the (nx,nz) spectral-element mesh -nbregions = 1 # then set below the different regions and model number for each region -# format of each line: nxmin nxmax nzmin nzmax material_number -1 1800 1 600 1 - -#----------------------------------------------------------- -# -# DISPLAY PARAMETERS -# -#----------------------------------------------------------- - -# 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 diff --git a/benchmarks/data_iso/CMakeFiles/specfem_config.yaml.in b/benchmarks/data_iso/CMakeFiles/specfem_config.yaml.in deleted file mode 100644 index 74101ca79..000000000 --- a/benchmarks/data_iso/CMakeFiles/specfem_config.yaml.in +++ /dev/null @@ -1,50 +0,0 @@ -parameters: - - header: - ## Header information is used for logging. It is good practice to give your simulations explicit names - title: Isotropic Elastic simulation # name for your simulation - # A detailed description for your simulation - description: | - Material systems : Elastic domain (1) - Interfaces : None - Sources : Force source (1) - Boundary conditions : Neumann BCs on all edges - - simulation-setup: - ## quadrature setup - quadrature: - quadrature-type: GLL4 - - ## Solver setup - solver: - time-marching: - time-scheme: - type: Newmark - dt: 1.1e-3 - nstep: 1600 - - simulation-mode: - forward: - writer: - seismogram: - format: "ascii" - directory: "@CMAKE_SOURCE_DIR@/benchmarks/data_iso/OUTPUT_FILES/results" - - receivers: - stations: "@CMAKE_SOURCE_DIR@/benchmarks/data_iso/OUTPUT_FILES/STATIONS" - angle: 0.0 - seismogram-type: - - velocity - nstep_between_samples: 1 - - ## Runtime setup - run-setup: - number-of-processors: 1 - number-of-runs: 1 - - ## databases - databases: - mesh-database: "@CMAKE_SOURCE_DIR@/benchmarks/data_iso/OUTPUT_FILES/database.bin" - - ## sources - sources: "@CMAKE_SOURCE_DIR@/benchmarks/data_iso/source.yaml" diff --git a/benchmarks/data_iso/CMakeLists.txt b/benchmarks/data_iso/CMakeLists.txt deleted file mode 100644 index c823230ae..000000000 --- a/benchmarks/data_iso/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ - -CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5) - -configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/benchmarks/data_iso/Par_File) -configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/benchmarks/data_iso/specfem_config.yaml) diff --git a/benchmarks/data_iso/source.yaml b/benchmarks/data_iso/source.yaml deleted file mode 100644 index 2a674e3dc..000000000 --- a/benchmarks/data_iso/source.yaml +++ /dev/null @@ -1,13 +0,0 @@ -number-of-sources: 1 -sources: - - force: - x : 2500.0 - z : 2500.0 - source_surf: false - angle : 0.0 - vx : 0.0 - vz : 0.0 - Ricker: - factor: 1e10 - tshift: 0.0 - f0: 10.0 diff --git a/benchmarks/data_iso/topography.dat b/benchmarks/data_iso/topography.dat deleted file mode 100644 index 9d1df59df..000000000 --- a/benchmarks/data_iso/topography.dat +++ /dev/null @@ -1,25 +0,0 @@ -# -# number of interfaces -# - 2 -# -# for each interface below, we give the number of points and then x,z for each point -# -# -# interface number 1 (bottom of the mesh) -# - 2 - 0 0 - 5000 0 -# interface number 2 (topography, top of the mesh) -# - 2 - 0 3000 - 5000 3000 -# -# for each layer, we give the number of spectral elements in the vertical direction -# -# -# layer number 1 (bottom layer) -# - 600 diff --git a/benchmarks/generate_data.py b/benchmarks/generate_data.py new file mode 100644 index 000000000..da04f80ae --- /dev/null +++ b/benchmarks/generate_data.py @@ -0,0 +1,33 @@ +from os import getcwd +from subprocess import check_call + +nx = 80 +nz = 60 + +mediums = { + "iso": "1 1 2700.d0 3000.d0 0 0 0 9999 9999 0 0 0 0 0 0", + "eiso": "1 1 2700.d0 3000.d0 1732.051d0 0 0 9999 9999 0 0 0 0 0 0", + "eani": "1 2 7100. 16.5d10 5.d10 0 6.2d10 0 3.96d10 0 0 0 0 0 0", +} + +files = "Par_file", "source.yaml", "specfem_config.yaml", "topography.dat" + +for medium in mediums: + cwd = f"{getcwd()}/data_{medium}" + check_call(f"rm -rf {cwd} && mkdir {cwd}", shell=True) + + for file in files: + with open(f"data/{file}") as f: + content = ( + f.read() + .replace("${cwd}", cwd) + .replace("${medium}", mediums[medium]) + .replace("${nx}", str(nx)) + .replace("${nz}", str(nz)) + .replace("${title}", f"{medium}_{nx}x{nz}") + ) + + with open(f"{cwd}/{file}", "w") as f: + f.write(content) + + check_call("xmeshfem2D -p Par_file", cwd=cwd, shell=True) diff --git a/benchmarks/generate_mesh.sh b/benchmarks/generate_mesh.sh deleted file mode 100755 index 48fb91822..000000000 --- a/benchmarks/generate_mesh.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd data -mkdir -p OUTPUT_FILES/results -xmeshfem2D -p Par_file -cd ../data_iso -mkdir -p OUTPUT_FILES/results -xmeshfem2D -p Par_file -cd ../data_aniso -mkdir -p OUTPUT_FILES/results -xmeshfem2D -p Par_file diff --git a/benchmarks/main.cpp b/benchmarks/main.cpp index 8bef3f069..956765f5c 100644 --- a/benchmarks/main.cpp +++ b/benchmarks/main.cpp @@ -85,7 +85,7 @@ void run_benchmark(const YAML::Node ¶meter_dict, std::cout << " " << solver_time.count() << "s\n" << std::endl; } -} // namespace kokkos_kernels +} // namespace benchmarks } // namespace specfem int main(int argc, char **argv) { @@ -97,11 +97,14 @@ int main(int argc, char **argv) { const std::string default_file = __default_file__; const YAML::Node default_dict = YAML::LoadFile(default_file); std::cout << "Acoustic:"; - specfem::benchmarks::run_benchmark(YAML::LoadFile(__benchmark_acoustic__), default_dict, mpi); + specfem::benchmarks::run_benchmark(YAML::LoadFile(__benchmark_iso__), + default_dict, mpi); std::cout << "Elastic isotropic:"; - specfem::benchmarks::run_benchmark(YAML::LoadFile(__benchmark_iso__), default_dict, mpi); + specfem::benchmarks::run_benchmark(YAML::LoadFile(__benchmark_eiso__), + default_dict, mpi); std::cout << "Elastic anisotropic:"; - specfem::benchmarks::run_benchmark(YAML::LoadFile(__benchmark_aniso__), default_dict, mpi); + specfem::benchmarks::run_benchmark(YAML::LoadFile(__benchmark_eani__), + default_dict, mpi); } // Finalize Kokkos Kokkos::finalize();