Skip to content

Commit

Permalink
Added Topography files and fixed meshfem compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit-Kakodkar committed Jan 5, 2024
1 parent 85060b5 commit 923957d
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 30 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ debug.sh
output.log
results/
timing.sh
*.dat
examples/*/*_config.yaml
tests/regression-tests/*.yaml
tests/regression-tests/*/cpu/*.yaml
Expand Down
38 changes: 38 additions & 0 deletions docs/examples/fluid-solid-interface/interfaces_fluid_flat.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# number of interfaces
#
3
#
# 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
6400 0
#
# interface number 2 (ocean bottom)
#
2
0 2400
6400 2400
#
# interface number 3 (topography, top of the mesh)
#
2
0 4800
6400 4800
#
# for each layer, we give the number of spectral elements in the vertical direction
#
#
# layer number 1 (bottom layer)
#
## DK DK the original 2000 Geophysics paper used nz = 90 but NGLLZ = 6
## DK DK here I rescale it to nz = 108 and NGLLZ = 5 because nowadays we almost always use NGLLZ = 5
54
#
# layer number 2 (top layer)
#
54
25 changes: 25 additions & 0 deletions docs/examples/homogeneous-medium-flat-topography/topography.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# 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)
#
60
2 changes: 1 addition & 1 deletion examples/fluid-solid-interface/Par_File.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing th
#-----------------------------------------------------------

# file containing interfaces for internal mesh
interfacesfile = @CMAKE_SOURCE_DIR@/examples/fluid-solid-interface/interfaces_fluid_flat.dat
interfacesfile = @CMAKE_SOURCE_DIR@/examples/fluid-solid-interface/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
Expand Down
38 changes: 38 additions & 0 deletions examples/fluid-solid-interface/topography.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# number of interfaces
#
3
#
# 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
6400 0
#
# interface number 2 (ocean bottom)
#
2
0 2400
6400 2400
#
# interface number 3 (topography, top of the mesh)
#
2
0 4800
6400 4800
#
# for each layer, we give the number of spectral elements in the vertical direction
#
#
# layer number 1 (bottom layer)
#
## DK DK the original 2000 Geophysics paper used nz = 90 but NGLLZ = 6
## DK DK here I rescale it to nz = 108 and NGLLZ = 5 because nowadays we almost always use NGLLZ = 5
54
#
# layer number 2 (top layer)
#
54
25 changes: 25 additions & 0 deletions examples/homogeneous-medium-flat-topography/topography.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# 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)
#
60
56 changes: 28 additions & 28 deletions meshfem2d/force_ftz.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,37 +57,37 @@
(since it calls some low-level system routines) just suppress all the lines below (i.e. make it an empty file)
and comment out the call to force_ftz() in the main SPECFEM program */

#include "config.h"
// #include "config.h"

#define FTZ_BIT 15
#define UNDERFLOW_EXCEPTION_MASK 11
// #define FTZ_BIT 15
// #define UNDERFLOW_EXCEPTION_MASK 11

#ifdef __GNUC__ // only use these features on gnu compiler
#ifdef HAVE_XMMINTRIN
#define FORCE_FTZ
#include <xmmintrin.h>
#elif HAVE_EMMINTRIN
#include <emmintrin.h>
#define FORCE_FTZ
#endif
#endif // __GNUC__
// #ifdef __GNUC__ // only use these features on gnu compiler
// #ifdef HAVE_XMMINTRIN
// #define FORCE_FTZ
// #include <xmmintrin.h>
// #elif HAVE_EMMINTRIN
// #include <emmintrin.h>
// #define FORCE_FTZ
// #endif
// #endif // __GNUC__

void
FC_FUNC_(force_ftz,FORCE_FTZ)()
{
// void
// FC_FUNC_(force_ftz,FORCE_FTZ)()
// {

// DK DK Nov 2018: uncomment this if you have any problem compiling this file
//#undef FORCE_FTZ
// // DK DK Nov 2018: uncomment this if you have any problem compiling this file
// // #undef FORCE_FTZ

#ifdef __GNUC__
#ifdef FORCE_FTZ
unsigned int x;
// #ifdef __GNUC__
// #ifdef FORCE_FTZ
// unsigned int x;

/* force FTZ by setting bits 11 and 15 to one */
x = _mm_getcsr();
x |= (1 << FTZ_BIT);
x |= (1 << UNDERFLOW_EXCEPTION_MASK);
_mm_setcsr(x);
#endif
#endif // __GNUC__
}
// /* force FTZ by setting bits 11 and 15 to one */
// x = _mm_getcsr();
// x |= (1 << FTZ_BIT);
// x |= (1 << UNDERFLOW_EXCEPTION_MASK);
// _mm_setcsr(x);
// #endif
// #endif // __GNUC__
// }

0 comments on commit 923957d

Please sign in to comment.