From 5039c1397ca87d1832c7ea2443edb7e4524c3686 Mon Sep 17 00:00:00 2001 From: Lucas Sawade Date: Wed, 15 Jan 2025 11:28:51 -0500 Subject: [PATCH 1/2] Fixed installables for the python installation --- CMakeLists.txt | 5 +- fortran/meshfem2d/CMakeLists.txt | 4 +- .../generate_databases/CMakeLists.txt | 1 - poetry.lock | 130 ++++++++++++++---- 4 files changed, 113 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54c483aa..e6c53cca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -674,7 +674,10 @@ endif (DOXYGEN_FOUND) if (SPECFEMPP_USE_SKBUILD AND EXISTS ${SKBUILD_SCRIPTS_DIR}) install(TARGETS specfem2d DESTINATION ${SKBUILD_SCRIPTS_DIR}) - install(FILES ${CMAKE_BINARY_DIR}/xmeshfem2D DESTINATION ${SKBUILD_SCRIPTS_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + install(FILES ${CMAKE_BINARY_DIR}/bin/xmeshfem2D DESTINATION ${SKBUILD_SCRIPTS_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + install(FILES ${CMAKE_BINARY_DIR}/bin/xmeshfem3D DESTINATION ${SKBUILD_SCRIPTS_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + install(FILES ${CMAKE_BINARY_DIR}/bin/xgenerate_databases DESTINATION ${SKBUILD_SCRIPTS_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + install(FILES ${CMAKE_BINARY_DIR}/bin/xadj_seismogram DESTINATION ${SKBUILD_SCRIPTS_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) endif () if (SPECFEMPP_BINDING_PYTHON) diff --git a/fortran/meshfem2d/CMakeLists.txt b/fortran/meshfem2d/CMakeLists.txt index f942658d..0ae663fe 100644 --- a/fortran/meshfem2d/CMakeLists.txt +++ b/fortran/meshfem2d/CMakeLists.txt @@ -207,12 +207,12 @@ add_custom_target(meshfem_mesh ALL ) set( meshfem2D_PREPROCESSOR_OBJECTS - decompose_mesh.mesh.o + decompose_mesh.mesh.o metis_partitioning.mesh.o part_unstruct.mesh.o read_external_mesh_files.mesh.o read_mesh_files.mesh.o - scotch_partitioning.mesh.o + scotch_partitioning.mesh.o meshfem2D.mesh.o ) diff --git a/fortran/meshfem3d/generate_databases/CMakeLists.txt b/fortran/meshfem3d/generate_databases/CMakeLists.txt index df7ed207..217e9b10 100644 --- a/fortran/meshfem3d/generate_databases/CMakeLists.txt +++ b/fortran/meshfem3d/generate_databases/CMakeLists.txt @@ -17,7 +17,6 @@ set(MESHFEM3D_GENERATE_DATABASES_MODULE create_regions_mesh.f90 fault_generate_databases.f90 finalize_databases.f90 - generate_databases_par.F90 generate_databases.f90 get_absorbing_boundary.F90 get_coupling_surfaces.f90 diff --git a/poetry.lock b/poetry.lock index ed20bba1..aa52d2f4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand. [[package]] name = "alabaster" @@ -6,6 +6,7 @@ version = "0.7.16" description = "A light, configurable Sphinx theme" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "alabaster-0.7.16-py3-none-any.whl", hash = "sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92"}, {file = "alabaster-0.7.16.tar.gz", hash = "sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65"}, @@ -17,6 +18,7 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, @@ -28,6 +30,7 @@ version = "2.16.0" description = "Internationalization utilities" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "babel-2.16.0-py3-none-any.whl", hash = "sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b"}, {file = "babel-2.16.0.tar.gz", hash = "sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316"}, @@ -42,6 +45,7 @@ version = "4.12.3" description = "Screen-scraping library" optional = false python-versions = ">=3.6.0" +groups = ["main"] files = [ {file = "beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed"}, {file = "beautifulsoup4-4.12.3.tar.gz", hash = "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"}, @@ -63,6 +67,7 @@ version = "4.35.0" description = "Sphinx Doxygen renderer" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "breathe-4.35.0-py3-none-any.whl", hash = "sha256:52c581f42ca4310737f9e435e3851c3d1f15446205a85fbc272f1f97ed74f5be"}, {file = "breathe-4.35.0.tar.gz", hash = "sha256:5165541c3c67b6c7adde8b3ecfe895c6f7844783c4076b6d8d287e4f33d62386"}, @@ -78,6 +83,7 @@ version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, @@ -89,6 +95,7 @@ version = "3.4.0" description = "Validate configuration and produce human readable error messages." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9"}, {file = "cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560"}, @@ -100,6 +107,7 @@ version = "3.4.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" +groups = ["main"] files = [ {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, @@ -210,20 +218,20 @@ files = [ [[package]] name = "clang-format" -version = "14.0.6" +version = "15.0.7" description = "Clang-Format is an LLVM-based code formatting tool" optional = false python-versions = "*" +groups = ["main"] files = [ - {file = "clang-format-14.0.6.tar.gz", hash = "sha256:d5c96b500d7f8b5d2db5b75ac035be387512850ad589cdc3019666b861382136"}, - {file = "clang_format-14.0.6-py2.py3-none-macosx_10_9_universal2.whl", hash = "sha256:bd400c47665dd19afc03f98e747f78ed828abab99c6a1b07e137b35c1cd3cc26"}, - {file = "clang_format-14.0.6-py2.py3-none-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:13f2d6d4a2af004a783c65f0921afa8f0384bffcdaf500b6c2cb542edeb0b4a5"}, - {file = "clang_format-14.0.6-py2.py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d7c1c5e404c58e55f0170f01b3c5611dce6c119e62b5d1020347e0ad97d5a047"}, - {file = "clang_format-14.0.6-py2.py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dbfd60528eb3bb7d7cfe8576faa70845fbf93601f815ef75163d36606e87f388"}, - {file = "clang_format-14.0.6-py2.py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c93580945f75de7e01996f1fb3cf67e4dc424f1c864e237c85614fb99a48c7a4"}, - {file = "clang_format-14.0.6-py2.py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aaf4edecc46a24f0b572b82cf5827e292ad1c137903427627c4d5f671668cc2b"}, - {file = "clang_format-14.0.6-py2.py3-none-win32.whl", hash = "sha256:810c649ab97d208cd418c897d50ab6e958eb8d96854527edd80d0dd21a75e914"}, - {file = "clang_format-14.0.6-py2.py3-none-win_amd64.whl", hash = "sha256:d780c04334bca80f2b60d25bf53c37bd0618520ee295a7888a11f25bde114ac4"}, + {file = "clang-format-15.0.7.tar.gz", hash = "sha256:60954c571394354200912e72ce10454b96016af879771df39d09d605ceaec035"}, + {file = "clang_format-15.0.7-py2.py3-none-macosx_10_9_universal2.whl", hash = "sha256:0983aa108920a84a84358a1a045537311ad77c3fcb60fdec2af0aad71d53bd1d"}, + {file = "clang_format-15.0.7-py2.py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6bb879288a08cf646e2930f1f69b197bae90003a6c6abacd7beabed340a9752f"}, + {file = "clang_format-15.0.7-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5a7815754c48cd9ffb14b2f306690f08b8ad8050cc7735c05c6caba046faee3"}, + {file = "clang_format-15.0.7-py2.py3-none-musllinux_1_1_i686.whl", hash = "sha256:a81115f042e59a042e6600d034d15a75dbd2830fae98eb806830380054f49fe7"}, + {file = "clang_format-15.0.7-py2.py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:0343cd5f0cf33c3d552ebacbd2604e1a1342163ed7e5cb750c0a1495aae96340"}, + {file = "clang_format-15.0.7-py2.py3-none-win32.whl", hash = "sha256:c5fa1420c08f6293c6dfa90ca137e6e7ac5ee8838e151522816da43f375bc93f"}, + {file = "clang_format-15.0.7-py2.py3-none-win_amd64.whl", hash = "sha256:3a2712fc3a252aec5196958a97642f2cf637fee34058352e6acfe0d2d3be1965"}, ] [[package]] @@ -232,6 +240,7 @@ version = "8.1.7" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, @@ -246,6 +255,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main"] +markers = "sys_platform == \"win32\" or platform_system == \"Windows\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -257,6 +268,7 @@ version = "0.3.9" description = "Distribution utilities" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, @@ -268,6 +280,7 @@ version = "0.11.2" description = "Style checker for Sphinx (or other) RST documentation" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "doc8-0.11.2-py3-none-any.whl", hash = "sha256:9187da8c9f115254bbe34f74e2bbbdd3eaa1b9e92efd19ccac7461e347b5055c"}, {file = "doc8-0.11.2.tar.gz", hash = "sha256:c35a231f88f15c204659154ed3d499fa4d402d7e63d41cba7b54cf5e646123ab"}, @@ -285,6 +298,7 @@ version = "0.18.1" description = "Docutils -- Python Documentation Utilities" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["main"] files = [ {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, @@ -296,6 +310,7 @@ version = "3.16.1" description = "A platform independent file lock." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, @@ -312,6 +327,7 @@ version = "2024.8.6" description = "A clean customisable Sphinx documentation theme." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "furo-2024.8.6-py3-none-any.whl", hash = "sha256:6cd97c58b47813d3619e63e9081169880fbe331f0ca883c871ff1f3f11814f5c"}, {file = "furo-2024.8.6.tar.gz", hash = "sha256:b63e4cee8abfc3136d3bc03a3d45a76a850bada4d6374d24c1716b0e01394a01"}, @@ -329,6 +345,7 @@ version = "2.6.3" description = "File identification library for Python" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "identify-2.6.3-py2.py3-none-any.whl", hash = "sha256:9edba65473324c2ea9684b1f944fe3191db3345e50b6d04571d10ed164f8d7bd"}, {file = "identify-2.6.3.tar.gz", hash = "sha256:62f5dae9b5fef52c84cc188514e9ea4f3f636b1d8799ab5ebc475471f9e47a02"}, @@ -343,6 +360,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -357,6 +375,7 @@ version = "1.4.1" description = "Getting image size from png/jpeg/jpeg2000/gif file" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["main"] files = [ {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, @@ -368,6 +387,7 @@ version = "3.1.4" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, @@ -385,6 +405,7 @@ version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"}, {file = "markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1"}, @@ -409,6 +430,7 @@ version = "3.0.2" description = "Safely add untrusted strings to HTML/XML markup." optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7e94c425039cde14257288fd61dcfb01963e658efbc0ff54f5306b06054700f8"}, {file = "MarkupSafe-3.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9e2d922824181480953426608b81967de705c3cef4d1af983af849d7bd619158"}, @@ -479,6 +501,7 @@ version = "0.1.2" description = "Markdown URL utilities" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, @@ -490,6 +513,7 @@ version = "1.9.1" description = "Node.js virtual environment builder" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["main"] files = [ {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, @@ -501,6 +525,7 @@ version = "24.2" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, @@ -512,6 +537,7 @@ version = "6.1.0" description = "Python Build Reasonableness" optional = false python-versions = ">=2.6" +groups = ["main"] files = [ {file = "pbr-6.1.0-py2.py3-none-any.whl", hash = "sha256:a776ae228892d8013649c0aeccbb3d5f99ee15e005a4cbb7e61d55a067b28a2a"}, {file = "pbr-6.1.0.tar.gz", hash = "sha256:788183e382e3d1d7707db08978239965e8b9e4e5ed42669bf4758186734d5f24"}, @@ -523,6 +549,7 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -535,13 +562,14 @@ type = ["mypy (>=1.11.2)"] [[package]] name = "pre-commit" -version = "2.21.0" +version = "2.19.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ - {file = "pre_commit-2.21.0-py2.py3-none-any.whl", hash = "sha256:e2f91727039fc39a92f58a588a25b87f936de6567eed4f0e673e0507edc75bad"}, - {file = "pre_commit-2.21.0.tar.gz", hash = "sha256:31ef31af7e474a8d8995027fefdfcf509b5c913ff31f2015b4ec4beb26a6f658"}, + {file = "pre_commit-2.19.0-py2.py3-none-any.whl", hash = "sha256:10c62741aa5704faea2ad69cb550ca78082efe5697d6f04e5710c3c229afdd10"}, + {file = "pre_commit-2.19.0.tar.gz", hash = "sha256:4233a1e38621c87d9dda9808c6606d7e7ba0e087cd56d3fe03202a01d2919615"}, ] [package.dependencies] @@ -549,7 +577,8 @@ cfgv = ">=2.0.0" identify = ">=1.0.0" nodeenv = ">=0.11.1" pyyaml = ">=5.1" -virtualenv = ">=20.10.0" +toml = "*" +virtualenv = ">=20.0.8" [[package]] name = "pydantic" @@ -557,6 +586,7 @@ version = "2.10.3" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, @@ -577,6 +607,7 @@ version = "2.27.1" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a"}, {file = "pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b"}, @@ -689,6 +720,7 @@ version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, @@ -703,6 +735,7 @@ version = "6.0.2" description = "YAML parser and emitter for Python" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, @@ -765,6 +798,7 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -786,6 +820,7 @@ version = "1.4.0" description = "reStructuredText linter" optional = false python-versions = "*" +groups = ["main"] files = [ {file = "restructuredtext_lint-1.4.0.tar.gz", hash = "sha256:1b235c0c922341ab6c530390892eb9e92f90b9b75046063e047cacfb0f050c45"}, ] @@ -799,6 +834,7 @@ version = "13.9.4" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" optional = false python-versions = ">=3.8.0" +groups = ["main"] files = [ {file = "rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90"}, {file = "rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098"}, @@ -817,6 +853,7 @@ version = "6.2.4" description = "Checks syntax of reStructuredText and code blocks nested within it" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "rstcheck-6.2.4-py3-none-any.whl", hash = "sha256:23de2575ba0af1adcddea87a20d69187f0fb9dd8270f59eb98d63461c95375a7"}, {file = "rstcheck-6.2.4.tar.gz", hash = "sha256:384942563dfbfcc85903a587ecf050447217c46b51e266ed3fe51371bc599015"}, @@ -840,6 +877,7 @@ version = "1.2.1" description = "Checks syntax of reStructuredText and code blocks nested within it" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "rstcheck-core-1.2.1.tar.gz", hash = "sha256:9b330020d912e2864f23f332c1a0569463ca3b06b8fee7b7bdd201b055f7f831"}, {file = "rstcheck_core-1.2.1-py3-none-any.whl", hash = "sha256:1c100de418b6c9e14d9cf6558644d0ab103fdc447f891313882d02df3a3c52ba"}, @@ -864,6 +902,7 @@ version = "0.8.2" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "ruff-0.8.2-py3-none-linux_armv6l.whl", hash = "sha256:c49ab4da37e7c457105aadfd2725e24305ff9bc908487a9bf8d548c6dad8bb3d"}, {file = "ruff-0.8.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ec016beb69ac16be416c435828be702ee694c0d722505f9c1f35e1b9c0cc1bf5"}, @@ -891,17 +930,31 @@ version = "1.5.4" description = "Tool to Detect Surrounding Shell" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"}, {file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"}, ] +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + [[package]] name = "snowballstemmer" version = "2.2.0" description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." optional = false python-versions = "*" +groups = ["main"] files = [ {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, @@ -913,6 +966,7 @@ version = "2.6" description = "A modern CSS selector implementation for Beautiful Soup." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "soupsieve-2.6-py3-none-any.whl", hash = "sha256:e72c4ff06e4fb6e4b5a9f0f55fe6e81514581fca1515028625d0f299c602ccc9"}, {file = "soupsieve-2.6.tar.gz", hash = "sha256:e2e68417777af359ec65daac1057404a3c8a5455bb8abc36f1a9866ab1a51abb"}, @@ -924,6 +978,7 @@ version = "7.3.7" description = "Python documentation generator" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "sphinx-7.3.7-py3-none-any.whl", hash = "sha256:413f75440be4cacf328f580b4274ada4565fb2187d696a84970c23f77b64d8c3"}, {file = "sphinx-7.3.7.tar.gz", hash = "sha256:a4a7db75ed37531c05002d56ed6948d4c42f473a36f46e1382b0bd76ca9627bc"}, @@ -958,6 +1013,7 @@ version = "1.0.0b2" description = "A modern skeleton for Sphinx themes." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sphinx_basic_ng-1.0.0b2-py3-none-any.whl", hash = "sha256:eb09aedbabfb650607e9b4b68c9d240b90b1e1be221d6ad71d61c52e29f7932b"}, {file = "sphinx_basic_ng-1.0.0b2.tar.gz", hash = "sha256:9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9"}, @@ -975,6 +1031,7 @@ version = "0.4.0" description = "Add a copy button to each of your code cells." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "sphinx-copybutton-0.4.0.tar.gz", hash = "sha256:8daed13a87afd5013c3a9af3575cc4d5bec052075ccd3db243f895c07a689386"}, {file = "sphinx_copybutton-0.4.0-py3-none-any.whl", hash = "sha256:4340d33c169dac6dd82dce2c83333412aa786a42dd01a81a8decac3b130dc8b0"}, @@ -993,6 +1050,7 @@ version = "1.3.0" description = "Read the Docs theme for Sphinx" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" +groups = ["main"] files = [ {file = "sphinx_rtd_theme-1.3.0-py2.py3-none-any.whl", hash = "sha256:46ddef89cc2416a81ecfbeaceab1881948c014b1b6e4450b815311a89fb977b0"}, {file = "sphinx_rtd_theme-1.3.0.tar.gz", hash = "sha256:590b030c7abb9cf038ec053b95e5380b5c70d61591eb0b552063fbe7c41f0931"}, @@ -1008,27 +1066,26 @@ dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client", "wheel"] [[package]] name = "sphinx-sitemap" -version = "2.6.0" +version = "2.2.1" description = "Sitemap generator for Sphinx" optional = false python-versions = "*" +groups = ["main"] files = [ - {file = "sphinx_sitemap-2.6.0-py3-none-any.whl", hash = "sha256:7478e417d141f99c9af27ccd635f44c03a471a08b20e778a0f9daef7ace1d30b"}, - {file = "sphinx_sitemap-2.6.0.tar.gz", hash = "sha256:5e0c66b9f2e371ede80c659866a9eaad337d46ab02802f9c7e5f7bc5893c28d2"}, + {file = "sphinx-sitemap-2.2.1.tar.gz", hash = "sha256:f1f2149c8013b6d68cc48e6b5bd90f088658cd4584c0220224e72ca85d07b92b"}, ] [package.dependencies] +six = "*" sphinx = ">=1.2" -[package.extras] -dev = ["build", "flake8", "pre-commit", "pytest", "sphinx", "tox"] - [[package]] name = "sphinxcontrib-applehelp" version = "2.0.0" description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "sphinxcontrib_applehelp-2.0.0-py3-none-any.whl", hash = "sha256:4cd3f0ec4ac5dd9c17ec65e9ab272c9b867ea77425228e68ecf08d6b28ddbdb5"}, {file = "sphinxcontrib_applehelp-2.0.0.tar.gz", hash = "sha256:2f29ef331735ce958efa4734873f084941970894c6090408b079c61b2e1c06d1"}, @@ -1045,6 +1102,7 @@ version = "2.0.0" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "sphinxcontrib_devhelp-2.0.0-py3-none-any.whl", hash = "sha256:aefb8b83854e4b0998877524d1029fd3e6879210422ee3780459e28a1f03a8a2"}, {file = "sphinxcontrib_devhelp-2.0.0.tar.gz", hash = "sha256:411f5d96d445d1d73bb5d52133377b4248ec79db5c793ce7dbe59e074b4dd1ad"}, @@ -1061,6 +1119,7 @@ version = "2.1.0" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "sphinxcontrib_htmlhelp-2.1.0-py3-none-any.whl", hash = "sha256:166759820b47002d22914d64a075ce08f4c46818e17cfc9470a9786b759b19f8"}, {file = "sphinxcontrib_htmlhelp-2.1.0.tar.gz", hash = "sha256:c9e2916ace8aad64cc13a0d233ee22317f2b9025b9cf3295249fa985cc7082e9"}, @@ -1077,6 +1136,7 @@ version = "4.1" description = "Extension to include jQuery on newer Sphinx releases" optional = false python-versions = ">=2.7" +groups = ["main"] files = [ {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, @@ -1091,6 +1151,7 @@ version = "1.0.1" description = "A sphinx extension which renders display math in HTML via JavaScript" optional = false python-versions = ">=3.5" +groups = ["main"] files = [ {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, @@ -1105,6 +1166,7 @@ version = "2.0.0" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "sphinxcontrib_qthelp-2.0.0-py3-none-any.whl", hash = "sha256:b18a828cdba941ccd6ee8445dbe72ffa3ef8cbe7505d8cd1fa0d42d3f2d5f3eb"}, {file = "sphinxcontrib_qthelp-2.0.0.tar.gz", hash = "sha256:4fe7d0ac8fc171045be623aba3e2a8f613f8682731f9153bb2e40ece16b9bbab"}, @@ -1121,6 +1183,7 @@ version = "2.0.0" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "sphinxcontrib_serializinghtml-2.0.0-py3-none-any.whl", hash = "sha256:6e2cb0eef194e10c27ec0023bfeb25badbbb5868244cf5bc5bdc04e4464bf331"}, {file = "sphinxcontrib_serializinghtml-2.0.0.tar.gz", hash = "sha256:e9d912827f872c029017a53f0ef2180b327c3f7fd23c87229f7a8e8b70031d4d"}, @@ -1137,6 +1200,7 @@ version = "5.4.0" description = "Manage dynamic plugins for Python applications" optional = false python-versions = ">=3.9" +groups = ["main"] files = [ {file = "stevedore-5.4.0-py3-none-any.whl", hash = "sha256:b0be3c4748b3ea7b854b265dcb4caa891015e442416422be16f8b31756107857"}, {file = "stevedore-5.4.0.tar.gz", hash = "sha256:79e92235ecb828fe952b6b8b0c6c87863248631922c8e8e0fa5b17b232c4514d"}, @@ -1145,12 +1209,25 @@ files = [ [package.dependencies] pbr = ">=2.0.0" +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["main"] +files = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] + [[package]] name = "typer" version = "0.15.1" description = "Typer, build great CLIs. Easy to code. Based on Python type hints." optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "typer-0.15.1-py3-none-any.whl", hash = "sha256:7994fb7b8155b64d3402518560648446072864beefd44aa2dc36972a5972e847"}, {file = "typer-0.15.1.tar.gz", hash = "sha256:a0588c0a7fa68a1978a069818657778f86abe6ff5ea6abf472f940a08bfe4f0a"}, @@ -1168,6 +1245,7 @@ version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, @@ -1179,6 +1257,7 @@ version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, @@ -1196,6 +1275,7 @@ version = "20.28.0" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "virtualenv-20.28.0-py3-none-any.whl", hash = "sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0"}, {file = "virtualenv-20.28.0.tar.gz", hash = "sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa"}, @@ -1210,7 +1290,11 @@ platformdirs = ">=3.9.1,<5" docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] +[extras] +dev = ["clang-format", "pre-commit", "ruff"] +docs = ["breathe", "doc8", "furo", "restructuredtext-lint", "rstcheck", "sphinx-copybutton", "sphinx-rtd-theme", "sphinx-sitemap"] + [metadata] -lock-version = "2.0" +lock-version = "2.1" python-versions = ">=3.12,<4.0" -content-hash = "710e6ce7851c9b3c21c7ad0002ec55e56e4ee5b3124f92ca36b28493907b9394" +content-hash = "eab453f18f64e89468baec39c83607c1004b9ab2efe3babbe74842442ad65909" From 9e22d7536c2dd61f4caedd22c2f53c979f943f98 Mon Sep 17 00:00:00 2001 From: Lucas Sawade Date: Wed, 15 Jan 2025 15:48:36 -0500 Subject: [PATCH 2/2] this adds capability to add a source into the yaml tree --- .../database_configuration.hpp | 8 +++++ include/parameter_parser/setup.hpp | 24 ++++++++++---- include/parameter_parser/sources.hpp | 32 +++++++++++++++++++ pyproject.toml | 2 +- .../database_configuration.cpp | 16 ++++++++-- src/parameter_parser/setup.cpp | 12 +++++++ src/specfem2d.cpp | 5 +-- .../Newmark/acoustic/newmark_tests.cpp | 3 +- .../Newmark/elastic/newmark_tests.cpp | 3 +- .../Newmark/newmark_tests.cpp | 5 +-- .../domain/acoustic/rmass_inverse_tests.cpp | 3 +- .../domain/elastic/rmass_inverse_tests.cpp | 3 +- 12 files changed, 97 insertions(+), 19 deletions(-) create mode 100644 include/parameter_parser/sources.hpp diff --git a/include/parameter_parser/database_configuration.hpp b/include/parameter_parser/database_configuration.hpp index f581034d..3b9fb372 100644 --- a/include/parameter_parser/database_configuration.hpp +++ b/include/parameter_parser/database_configuration.hpp @@ -24,6 +24,14 @@ class database_configuration { database_configuration(std::string fortran_database, std::string source_database) : fortran_database(fortran_database), source_database(source_database){}; + /** + * @brief Construct a new database configuration object + * + * @param fortran_database location of fortran database + * @param source_node location of source file + */ + database_configuration(std::string fortran_database, YAML::Node source_node) + : fortran_database(fortran_database), source_database(""){}; /** * @brief Construct a new run setup object * diff --git a/include/parameter_parser/setup.hpp b/include/parameter_parser/setup.hpp index 243a253b..febc3175 100644 --- a/include/parameter_parser/setup.hpp +++ b/include/parameter_parser/setup.hpp @@ -1,13 +1,14 @@ #ifndef _PARAMETER_SETUP_HPP #define _PARAMETER_SETUP_HPP +#include "IO/reader.hpp" #include "database_configuration.hpp" #include "header.hpp" #include "parameter_parser/solver/interface.hpp" #include "quadrature.hpp" -#include "IO/reader.hpp" #include "receivers.hpp" #include "run_setup.hpp" +#include "sources.hpp" #include "specfem_setup.hpp" #include "time_scheme/interface.hpp" #include "writer/kernel.hpp" @@ -105,6 +106,13 @@ class setup { return databases->get_databases(); } + /** + * @brief Get the sources YAML object + * + * @return YAML::Node YAML node describing the sources + */ + YAML::Node get_sources() const { return this->sources->get_sources(); } + /** * @brief Get the path to stations file * @@ -140,8 +148,7 @@ class setup { * @return specfem::IO::writer* Pointer to an instantiated writer object */ - std::shared_ptr - instantiate_seismogram_writer() const { + std::shared_ptr instantiate_seismogram_writer() const { if (this->seismogram) { return this->seismogram->instantiate_seismogram_writer( this->time_scheme->get_dt(), this->time_scheme->get_t0(), @@ -151,8 +158,7 @@ class setup { } } - std::shared_ptr - instantiate_wavefield_writer() const { + std::shared_ptr instantiate_wavefield_writer() const { if (this->wavefield) { return this->wavefield->instantiate_wavefield_writer(); } else { @@ -160,8 +166,7 @@ class setup { } } - std::shared_ptr - instantiate_wavefield_reader() const { + std::shared_ptr instantiate_wavefield_reader() const { if (this->wavefield) { return this->wavefield->instantiate_wavefield_reader(); } else { @@ -234,6 +239,11 @@ class setup { ///< quadrature object std::unique_ptr receivers; ///< Pointer to receivers object + std::unique_ptr + sources; ///< Pointer + ///< to + ///< receivers + ///< object std::unique_ptr seismogram; ///< Pointer to ///< seismogram object diff --git a/include/parameter_parser/sources.hpp b/include/parameter_parser/sources.hpp new file mode 100644 index 00000000..b1c2697a --- /dev/null +++ b/include/parameter_parser/sources.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "enumerations/specfem_enums.hpp" +#include "yaml-cpp/yaml.h" +#include + +namespace specfem { +namespace runtime_configuration { +/** + * @brief class to read source information + * + */ +class sources { +public: + sources(const std::string sources_file) { + source_node = YAML::LoadFile(sources_file); + }; + + sources(const YAML::Node &Node) { source_node = Node; }; + + /** + * @brief Get the sources + * + * @return YAML::Node describing the sources + */ + YAML::Node get_sources() const { return source_node; } + +protected: + YAML::Node source_node; /// Node that contains sources information +}; +} // namespace runtime_configuration +} // namespace specfem diff --git a/pyproject.toml b/pyproject.toml index c538dd32..e1c99596 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ docs = [ cmake.define.CMAKE_BUILD_TYPE = "Release" cmake.define.BUILD_TESTS = "ON" cmake.define.SPECFEMPP_USE_SKBUILD = "ON" -cmake.define.SPECFEMPP_ENABLE_PYTHON = "ON" +cmake.define.SPECFEMPP_BINDING_PYTHON = "ON" build-dir = "./build" [tool.poetry] diff --git a/src/parameter_parser/database_configuration.cpp b/src/parameter_parser/database_configuration.cpp index 056e35d2..2f38b128 100644 --- a/src/parameter_parser/database_configuration.cpp +++ b/src/parameter_parser/database_configuration.cpp @@ -5,10 +5,20 @@ specfem::runtime_configuration::database_configuration::database_configuration( const YAML::Node &Node) { try { - *this = specfem::runtime_configuration::database_configuration( - Node["mesh-database"].as(), - Node["source-file"].as()); + if (const YAML::Node &source_node = Node["source-file"]) { + *this = specfem::runtime_configuration::database_configuration( + Node["mesh-database"].as(), + source_node.as()); + } else if (const YAML::Node &source_node = Node["source-dict"]) { + *this = specfem::runtime_configuration::database_configuration( + Node["mesh-database"].as(), source_node); + } else { + throw std::runtime_error("Error reading database configuration source " + "field not recognized. \n"); + } + } catch (YAML::ParserException &e) { + std::ostringstream message; message << "Error reading database configuration. \n" << e.what(); diff --git a/src/parameter_parser/setup.cpp b/src/parameter_parser/setup.cpp index 1bffbddb..e9516a18 100644 --- a/src/parameter_parser/setup.cpp +++ b/src/parameter_parser/setup.cpp @@ -45,6 +45,17 @@ specfem::runtime_configuration::setup::setup(const YAML::Node ¶meter_dict, throw std::runtime_error(message.str()); } + // Get source info + if (const YAML::Node &source_node = n_databases["source-dict"]) { + this->sources = + std::make_unique(source_node); + } else if (const YAML::Node &source_node = n_databases["source-file"]) { + this->sources = std::make_unique( + source_node.as()); + } else { + throw std::runtime_error("Error reading specfem source configuration."); + } + if (const YAML::Node &n_quadrature = simulation_setup["quadrature"]) { this->quadrature = std::make_unique( @@ -90,6 +101,7 @@ specfem::runtime_configuration::setup::setup(const YAML::Node ¶meter_dict, this->property = nullptr; } + // Get receiver info try { this->receivers = std::make_unique( diff --git a/src/specfem2d.cpp b/src/specfem2d.cpp index 828b57e7..332fab44 100644 --- a/src/specfem2d.cpp +++ b/src/specfem2d.cpp @@ -113,8 +113,9 @@ void execute(const YAML::Node ¶meter_dict, const YAML::Node &default_dict, // -------------------------------------------------------------- const int nsteps = setup.get_nsteps(); const specfem::simulation::type simulation_type = setup.get_simulation_type(); - auto [sources, t0] = specfem::IO::read_sources( - source_filename, nsteps, setup.get_t0(), setup.get_dt(), simulation_type); + auto [sources, t0] = + specfem::IO::read_sources(setup.get_sources(), nsteps, setup.get_t0(), + setup.get_dt(), simulation_type); setup.update_t0(t0); // Update t0 in case it was changed const auto stations_filename = setup.get_stations_file(); diff --git a/tests/unit-tests/displacement_tests/Newmark/acoustic/newmark_tests.cpp b/tests/unit-tests/displacement_tests/Newmark/acoustic/newmark_tests.cpp index 9c869c62..35a6263e 100644 --- a/tests/unit-tests/displacement_tests/Newmark/acoustic/newmark_tests.cpp +++ b/tests/unit-tests/displacement_tests/Newmark/acoustic/newmark_tests.cpp @@ -56,6 +56,7 @@ TEST(DISPLACEMENT_TESTS, newmark_scheme_tests) { specfem::runtime_configuration::setup setup(parameter_file, __default_file__); const auto [database_file, sources_file] = setup.get_databases(); + const auto source_node = setup.get_sources(); // mpi->cout(setup.print_header()); // Set up GLL quadrature points @@ -69,7 +70,7 @@ TEST(DISPLACEMENT_TESTS, newmark_scheme_tests) { // if start time is not explicitly specified then t0 is determined using // source frequencies and time shift auto [sources, t0] = - specfem::IO::read_sources(sources_file, setup.get_dt(), mpi); + specfem::IO::read_sources(source_node, setup.get_dt(), mpi); // Generate compute structs to be used by the solver specfem::compute::compute compute(mesh.coorg, mesh.material_ind.knods, gllx, diff --git a/tests/unit-tests/displacement_tests/Newmark/elastic/newmark_tests.cpp b/tests/unit-tests/displacement_tests/Newmark/elastic/newmark_tests.cpp index 2a07eced..5724834e 100644 --- a/tests/unit-tests/displacement_tests/Newmark/elastic/newmark_tests.cpp +++ b/tests/unit-tests/displacement_tests/Newmark/elastic/newmark_tests.cpp @@ -56,6 +56,7 @@ TEST(DISPLACEMENT_TESTS, newmark_scheme_tests) { specfem::runtime_configuration::setup setup(parameter_file, __default_file__); const auto [database_file, sources_file] = setup.get_databases(); + const auto source_node = setup.get_sources(); // mpi->cout(setup.print_header()); // Set up GLL quadrature points @@ -69,7 +70,7 @@ TEST(DISPLACEMENT_TESTS, newmark_scheme_tests) { // if start time is not explicitly specified then t0 is determined using // source frequencies and time shift auto [sources, t0] = - specfem::IO::read_sources(sources_file, setup.get_dt(), mpi); + specfem::IO::read_sources(source_node, setup.get_dt(), mpi); // Generate compute structs to be used by the solver specfem::compute::compute compute(mesh.coorg, mesh.material_ind.knods, gllx, diff --git a/tests/unit-tests/displacement_tests/Newmark/newmark_tests.cpp b/tests/unit-tests/displacement_tests/Newmark/newmark_tests.cpp index 451466ba..349b4b0e 100644 --- a/tests/unit-tests/displacement_tests/Newmark/newmark_tests.cpp +++ b/tests/unit-tests/displacement_tests/Newmark/newmark_tests.cpp @@ -2,13 +2,13 @@ #include "../../MPI_environment.hpp" #include "../../utilities/include/interface.hpp" #include "IO/interface.hpp" +#include "IO/seismogram/reader.hpp" #include "compute/interface.hpp" #include "constants.hpp" #include "domain/domain.hpp" #include "mesh/mesh.hpp" #include "parameter_parser/interface.hpp" #include "quadrature/interface.hpp" -#include "IO/seismogram/reader.hpp" #include "solver/solver.hpp" #include "timescheme/timescheme.hpp" #include "yaml-cpp/yaml.h" @@ -170,6 +170,7 @@ TEST(DISPLACEMENT_TESTS, newmark_scheme_tests) { __default_file__); const auto [database_file, sources_file] = setup.get_databases(); + const auto source_node = setup.get_sources(); // Set up GLL quadrature points const auto quadratures = setup.instantiate_quadrature(); @@ -183,7 +184,7 @@ TEST(DISPLACEMENT_TESTS, newmark_scheme_tests) { // if start time is not explicitly specified then t0 is determined using // source frequencies and time shift auto [sources, t0] = specfem::IO::read_sources( - sources_file, nsteps, setup.get_t0(), dt, setup.get_simulation_type()); + source_node, nsteps, setup.get_t0(), dt, setup.get_simulation_type()); for (auto &source : sources) { if (mpi->main_proc()) diff --git a/tests/unit-tests/domain/acoustic/rmass_inverse_tests.cpp b/tests/unit-tests/domain/acoustic/rmass_inverse_tests.cpp index b71cb1a6..1f358484 100644 --- a/tests/unit-tests/domain/acoustic/rmass_inverse_tests.cpp +++ b/tests/unit-tests/domain/acoustic/rmass_inverse_tests.cpp @@ -54,6 +54,7 @@ TEST(DOMAIN_TESTS, rmass_inverse_elastic_test) { specfem::runtime_configuration::setup setup(parameter_file, __default_file__); const auto [database_file, sources_file] = setup.get_databases(); + const auto source_node = setup.get_sources(); // Set up GLL quadrature points auto [gllx, gllz] = setup.instantiate_quadrature(); @@ -65,7 +66,7 @@ TEST(DOMAIN_TESTS, rmass_inverse_elastic_test) { // Read sources // if start time is not explicitly specified then t0 is determined using // source frequencies and time shift - auto [sources, t0] = specfem::IO::read_sources(sources_file, 1e-5, mpi); + auto [sources, t0] = specfem::IO::read_sources(source_node, 1e-5, mpi); // Generate compute structs to be used by the solver specfem::compute::compute compute(mesh.coorg, mesh.material_ind.knods, gllx, diff --git a/tests/unit-tests/domain/elastic/rmass_inverse_tests.cpp b/tests/unit-tests/domain/elastic/rmass_inverse_tests.cpp index 0464a65b..56309d80 100644 --- a/tests/unit-tests/domain/elastic/rmass_inverse_tests.cpp +++ b/tests/unit-tests/domain/elastic/rmass_inverse_tests.cpp @@ -54,6 +54,7 @@ TEST(DOMAIN_TESTS, rmass_inverse_elastic_test) { specfem::runtime_configuration::setup setup(parameter_file, __default_file__); const auto [database_file, sources_file] = setup.get_databases(); + const auto source_node = setup.get_sources(); // Set up GLL quadrature points auto [gllx, gllz] = setup.instantiate_quadrature(); @@ -65,7 +66,7 @@ TEST(DOMAIN_TESTS, rmass_inverse_elastic_test) { // Read sources // if start time is not explicitly specified then t0 is determined using // source frequencies and time shift - auto [sources, t0] = specfem::IO::read_sources(sources_file, 1e-5, mpi); + auto [sources, t0] = specfem::IO::read_sources(source_node, 1e-5, mpi); // Generate compute structs to be used by the solver specfem::compute::compute compute(mesh.coorg, mesh.material_ind.knods, gllx,