Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Compiled object files
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Static libraries
*.lib
*.a

# Compiled Dynamic libraries
*.dll
*.so
*.dylib

# Executables
*.exe
*.out
*.app

# Fortran module files
*.mod
*.smod

# Debug files
*.dSYM/
*.stackdump

# Build directories
/build/
/bin/
/lib/
/CMakeFiles/
/cmake-build-*/

/EXAMPLES/*/OUTPUT_FILES/

# CMake generated files
CMakeCache.txt
CMakeFiles/
Makefile
cmake_install.cmake
CTestTestfile.cmake
install_manifest.txt

# IDE files
*.swp
*.swo
*.user
*.workspace
*.project
*.idea/
.vscode/

# Logs
*.log

# OS generated files
.DS_Store
Thumbs.db
8 changes: 4 additions & 4 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"configurations": [
{
"name": "LINUX",
"name": "macOS",
"includePath": [
"${workspaceFolder}/**",
"~/software/eigen-3.4.0",
"/opt/homebrew/Cellar/open-mpi/5.0.7/include",
"/Users/nqdu/software/miniconda3/include/python3.11",
"/Users/nqdu/software/miniconda3/lib/python3.11/site-packages/pybind11/include"
"/opt/homebrew/Cellar/open-mpi/5.0.8/include",
"/Users/nqdu/software/miniconda3/include/python3.12",
"/Users/nqdu/software/miniconda3/lib/python3.12/site-packages/pybind11/include"
],
"compilerPath": "/usr/bin/g++",
"cStandard": "gnu17",
Expand Down
27 changes: 15 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python + LLDB",
"type":"debugpy",
"request": "launch",
"program": "${workspaceFolder}/example/love1/step0_database.py",
"args": ["model.txt",
"1", "1", "1", "0"],
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/surfani",
"args": ["model.txt","0.01","0.5","100","0"],
"cwd": "${workspaceFolder}/example/orthorhombic",
"stopAtEntry": false,
// "program": "${workspaceFolder}/a.out",
// "cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb"
}

"cwd": "${workspaceFolder}/example/love1",
"stopOnEntry": false
}
]
}

}
20 changes: 0 additions & 20 deletions .vscode/launch1.json

This file was deleted.

14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_SOURCE_DIR}/build/obj)

################# cmake setup #################
set(CMAKE_CXX_FLAGS "-g -Wall")
set(CMAKE_CXX_FLAGS "-g -Wall -DEIGEN_DONT_PARALLELIZE")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")
Expand All @@ -53,9 +53,6 @@ endif()
set(CMAKE_VERBOSE_MAKEFILE on)

################# find packages #################
# path of *.cmake files
#set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/include/cmake)

# eigen
include_directories(${EIGEN_INC})

Expand All @@ -65,6 +62,13 @@ find_package(LAPACK REQUIRED)
find_package(LAPACKE REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DEIGEN_USE_LAPACKE")

#find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
include_directories(${OpenMP_CXX_INCLUDE_DIRS})
endif()

################# include paths #################
include_directories(${PROJECT_SOURCE_DIR}/src)
#include_directories(${PROJECT_SOURCE_DIR}/include)
Expand All @@ -73,7 +77,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/shared)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/mesh)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/vti)
# add_subdirectory(${PROJECT_SOURCE_DIR}/src/tti)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/aniso)
# add_subdirectory(${PROJECT_SOURCE_DIR}/src/multiphysics)

# check build libraries
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SpecSWD
**SpecSWD** is a software to compute surface wave dispersions and do sensitivity analysis for 1-D fully anisotropic, wealy anelastic media. It utilizes spectral element method and quadratic eigenvalue solver to handle multiphysics (elastic-acoustic coupling), strong anisotropy and discontinuities inside the study region.

**SpecSWD** also provides high-level sensitivity analysis framework (adjoint methods) for any user-defined quantities.
**SpecSWD** is a software designed to compute surface wave dispersions and perform sensitivity analysis for 1-D fully anisotropic, weakly anelastic media. It utilizes the spectral element method and a quadratic eigenvalue solver to effectively handle multiphysics (elastic-acoustic coupling), strong anisotropy, and discontinuities within the study region.

For installation, user manual, please refer to [docs](https://nqdu.github.io/SpecSWD/).
SpecSWD also offers a high-level sensitivity analysis framework (using adjoint methods) for any user-defined quantities.

For installation instructions and the user manual, please refer to the [documentation](https://nqdu.github.io/SpecSWD/).

For theoretical background and implementation details, please refer to this [EarthArXiv link](https://doi.org/10.31223/X57J37).
Binary file modified bin/surflove
Binary file not shown.
Binary file modified bin/surfrayl
Binary file not shown.
21 changes: 14 additions & 7 deletions code_gen/aniso_code_gen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -130,7 +130,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -142,7 +142,7 @@
"-2*U*c11*k*cos(phi)**2*conjugate(U) - 2*U*c12*k*sin(phi)*cos(phi)*conjugate(W) + I*U*c13*cos(phi)*conjugate(Vdot) - 2*U*c14*k*sin(phi)*cos(phi)*conjugate(V) + I*U*c14*cos(phi)*conjugate(Wdot) - 2*U*c15*k*cos(phi)**2*conjugate(V) + I*U*c15*cos(phi)*conjugate(Udot) - 4*U*c16*k*sin(phi)*cos(phi)*conjugate(U) - 2*U*c16*k*cos(phi)**2*conjugate(W) - 2*U*c26*k*sin(phi)**2*conjugate(W) + I*U*c36*sin(phi)*conjugate(Vdot) - 2*U*c46*k*sin(phi)**2*conjugate(V) + I*U*c46*sin(phi)*conjugate(Wdot) - 2*U*c56*k*sin(phi)*cos(phi)*conjugate(V) + I*U*c56*sin(phi)*conjugate(Udot) - 2*U*c66*k*sin(phi)**2*conjugate(U) - 2*U*c66*k*sin(phi)*cos(phi)*conjugate(W) - I*Udot*c15*cos(phi)*conjugate(U) - I*Udot*c25*sin(phi)*conjugate(W) - I*Udot*c45*sin(phi)*conjugate(V) - I*Udot*c55*cos(phi)*conjugate(V) - I*Udot*c56*sin(phi)*conjugate(U) - I*Udot*c56*cos(phi)*conjugate(W) - 2*V*c14*k*sin(phi)*cos(phi)*conjugate(U) - 2*V*c15*k*cos(phi)**2*conjugate(U) - 2*V*c24*k*sin(phi)**2*conjugate(W) - 2*V*c25*k*sin(phi)*cos(phi)*conjugate(W) + I*V*c34*sin(phi)*conjugate(Vdot) + I*V*c35*cos(phi)*conjugate(Vdot) - 2*V*c44*k*sin(phi)**2*conjugate(V) + I*V*c44*sin(phi)*conjugate(Wdot) - 4*V*c45*k*sin(phi)*cos(phi)*conjugate(V) + I*V*c45*sin(phi)*conjugate(Udot) + I*V*c45*cos(phi)*conjugate(Wdot) - 2*V*c46*k*sin(phi)**2*conjugate(U) - 2*V*c46*k*sin(phi)*cos(phi)*conjugate(W) - 2*V*c55*k*cos(phi)**2*conjugate(V) + I*V*c55*cos(phi)*conjugate(Udot) - 2*V*c56*k*sin(phi)*cos(phi)*conjugate(U) - 2*V*c56*k*cos(phi)**2*conjugate(W) - I*Vdot*c13*cos(phi)*conjugate(U) - I*Vdot*c23*sin(phi)*conjugate(W) - I*Vdot*c34*sin(phi)*conjugate(V) - I*Vdot*c35*cos(phi)*conjugate(V) - I*Vdot*c36*sin(phi)*conjugate(U) - I*Vdot*c36*cos(phi)*conjugate(W) - 2*W*c12*k*sin(phi)*cos(phi)*conjugate(U) - 2*W*c16*k*cos(phi)**2*conjugate(U) - 2*W*c22*k*sin(phi)**2*conjugate(W) + I*W*c23*sin(phi)*conjugate(Vdot) - 2*W*c24*k*sin(phi)**2*conjugate(V) + I*W*c24*sin(phi)*conjugate(Wdot) - 2*W*c25*k*sin(phi)*cos(phi)*conjugate(V) + I*W*c25*sin(phi)*conjugate(Udot) - 2*W*c26*k*sin(phi)**2*conjugate(U) - 4*W*c26*k*sin(phi)*cos(phi)*conjugate(W) + I*W*c36*cos(phi)*conjugate(Vdot) - 2*W*c46*k*sin(phi)*cos(phi)*conjugate(V) + I*W*c46*cos(phi)*conjugate(Wdot) - 2*W*c56*k*cos(phi)**2*conjugate(V) + I*W*c56*cos(phi)*conjugate(Udot) - 2*W*c66*k*sin(phi)*cos(phi)*conjugate(U) - 2*W*c66*k*cos(phi)**2*conjugate(W) - I*Wdot*c14*cos(phi)*conjugate(U) - I*Wdot*c24*sin(phi)*conjugate(W) - I*Wdot*c44*sin(phi)*conjugate(V) - I*Wdot*c45*cos(phi)*conjugate(V) - I*Wdot*c46*sin(phi)*conjugate(U) - I*Wdot*c46*cos(phi)*conjugate(W)"
]
},
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -153,7 +153,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -230,7 +230,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -443,6 +443,13 @@
"fileid.close()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -453,7 +460,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "base",
"language": "python",
"name": "python3"
},
Expand All @@ -467,7 +474,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.11.8"
}
},
"nbformat": 4,
Expand Down
Loading