Cleans up log output of Receivers/Sources/Source Time functions and adds LocationResult debug printing#1964
Cleans up log output of Receivers/Sources/Source Time functions and adds LocationResult debug printing#1964lsawade wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors how sources/receivers are printed and located (including a new transient assembly::LocationResult debug log), expands coordinate parsing to support geographic + depth-based inputs with assembly-time resolution against the free surface, and updates tests/docs to match the unified specfem CLI.
Changes:
- Add
assembly::LocationResult+ deterministic, rank-gathered debug printing for source/receiver location results; extend coordinate resolution to project depth-based points onto the free surface. - Extend 3D source/receiver I/O to accept geographic coordinates and depth-based cartesian inputs; update unit tests and add new CMTSOLUTION/FORCESOLUTION fixtures.
- Update docs and build/test wiring (including removal of
specfem2d/specfem3dexecutables) to reflect the unifiedspecfem 2d|3dinvocation and add a “Known Limitations” page for 3D.
Reviewed changes
Copilot reviewed 66 out of 74 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit-tests/serial.cmake | Registers new surface_elevation_tests target in the serial unit test set. |
| tests/unit-tests/io/sources/test_source_solutions.hpp | Declares additional expected 3D source solutions for geographic/depth cases. |
| tests/unit-tests/io/sources/test_read_sources_yaml.cpp | Adds YAML test cases for geographic and depth-based 3D moment tensors. |
| tests/unit-tests/io/sources/test_read_sources_file.cpp | Adds CMTSOLUTION/FORCESOLUTION file-based tests for geographic sources. |
| tests/unit-tests/io/sources/data/dim3/single_moment_tensor_geographic.CMTSOLUTION | New geographic CMTSOLUTION fixture. |
| tests/unit-tests/io/sources/data/dim3/single_force_geographic.FORCESOLUTION | New geographic FORCESOLUTION fixture. |
| tests/unit-tests/io/receivers/test_receiver_solutions.cpp | Updates expected 3D receivers to compare via stored read_coordinates_ objects. |
| tests/unit-tests/io/receivers/test_read_stations_file.cpp | Adds a unit test for geographic STATIONS parsing (geographic=true). |
| tests/unit-tests/io/receivers/data/dim3/single_station_geographic_3d.txt | New STATIONS fixture for geographic receiver parsing. |
| tests/unit-tests/data/dim2/cosserat_isotropic_homogeneous/provenance/Snakefile | Updates provenance workflow to invoke unified specfem 2d. |
| tests/unit-tests/data/dim2/cosserat_isotropic_homogeneous/provenance/README.md | Updates provenance docs to invoke unified specfem 2d. |
| tests/unit-tests/assembly/resolve_coordinates/test_resolve_coordinates.cpp | Updates resolve-coordinate tests for new CoordinateResolutionResult + surface parameter. |
| src/specfem3d.cpp | Removes legacy specfem3d wrapper executable source. |
| src/specfem2d.cpp | Removes legacy specfem2d wrapper executable source. |
| docs/sections/known_limitations.rst | Adds a new “Known Limitations” page (3D unimplemented features). |
| docs/sections/getting_started/presets.rst | Updates executable references to unified specfem. |
| docs/sections/getting_started/index.rst | Updates getting-started commands to unified specfem invocations. |
| docs/sections/examples/homogeneous-medium-flat-topography/topography.dat | Removes outdated example artifact. |
| docs/sections/examples/homogeneous-medium-flat-topography/STATIONS | Removes outdated example artifact. |
| docs/sections/examples/homogeneous-medium-flat-topography/specfem_config.yaml.in | Removes outdated example config template. |
| docs/sections/examples/homogeneous-medium-flat-topography/specfem_config.yaml | Removes outdated example config. |
| docs/sections/examples/homogeneous-medium-flat-topography/source.yaml | Removes outdated example source file. |
| docs/sections/examples/homogeneous-medium-flat-topography/README.md | Removes outdated example README. |
| docs/sections/examples/homogeneous-medium-flat-topography/Par_File.in | Removes outdated example Par_File template. |
| docs/sections/examples/homogeneous-medium-flat-topography/Par_File | Removes outdated example Par_File. |
| docs/sections/examples/homogeneous-medium-flat-topography/CMakeLists.txt | Removes example-specific CMake wiring. |
| docs/sections/examples/fluid-solid-interface/specfem_config.yaml.in | Removes outdated example config template. |
| docs/sections/examples/fluid-solid-interface/specfem_config.yaml | Removes outdated example config. |
| docs/sections/examples/fluid-solid-interface/sources.yaml | Removes outdated example source file. |
| docs/sections/examples/fluid-solid-interface/README.md | Removes outdated example README. |
| docs/sections/examples/fluid-solid-interface/Par_File.in | Removes outdated example Par_File template. |
| docs/sections/examples/fluid-solid-interface/Par_File | Removes outdated example Par_File. |
| docs/sections/examples/fluid-solid-interface/interfaces_fluid_flat.dat | Removes outdated example interfaces file. |
| docs/sections/examples/fluid-solid-interface/CMakeLists.txt | Removes example-specific CMake wiring. |
| docs/sections/examples/CMakeLists.txt | Removes docs examples subdirectory wiring. |
| docs/sections/cookbooks/wavepropagation/dim3/index.rst | Adds warning and links to known limitations for 3D runs. |
| docs/sections/cookbooks/wavepropagation/dim3/homogeneous-isotropic-force/index.rst | Updates which/run commands to unified specfem 3d and links limitations. |
| docs/sections/cookbooks/wavepropagation/dim3/Gmsh/index.rst | Updates references from specfem3d to unified specfem 3d and links limitations. |
| docs/sections/cookbooks/wavepropagation/dim2/translate_specfem2d_fortran_example/index.rst | Updates run command to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/solid-solid-interface/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/marmousi/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/homogeneous-medium/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/fluid-solid-nonconforming/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/fluid-solid-interface/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/fluid-solid-bathymetry/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/wavepropagation/dim2/anisotropic-crystal/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/cookbooks/kernels/dim2/tromp-2005/index.rst | Updates run commands to unified specfem 2d. |
| docs/sections/api/specfem/utilities/strings.rst | Restructures string-utility API docs headings. |
| docs/sections/api/specfem/units/conversions.rst | Restructures unit-conversion API docs headings. |
| docs/sections/api/specfem/tag_dispatch/index.rst | Adds doxygennamespace block for specfem::tag_dispatch. |
| docs/sections/api/specfem/io/backends/index.rst | Updates backend namespace documentation to specfem::io_backends. |
| docs/sections/api/specfem/index.rst | Adds API index entries for chunk_face and constants. |
| docs/sections/api/specfem/constants/index.rst | New API docs page for specfem::constants. |
| docs/sections/api/specfem/chunk_face/index.rst | New API docs index page for specfem::chunk_face. |
| docs/sections/api/specfem/chunk_face/acceleration.rst | New API docs for specfem::chunk_face::acceleration. |
| docs/sections/api/specfem/chunk_face/velocity.rst | New API docs for specfem::chunk_face::velocity. |
| docs/sections/api/specfem/chunk_face/displacement.rst | New API docs for specfem::chunk_face::displacement. |
| docs/sections/api/specfem/chunk_face/chunk_face_index.rst | New API docs for specfem::chunk_face::Index. |
| docs/sections/api/specfem/chunk_face/nonconforming_interface.rst | New API docs for nonconforming chunk-face types. |
| docs/sections/api/specfem/algorithms/locate_point.rst | Documents new surface projection API (projection, project_onto_surface). |
| docs/index.rst | Links the new known-limitations page from the main docs index. |
| core/specfem/source/source.tpp | Moves source::print() implementation to .tpp and adjusts formatting. |
| core/specfem/source/source.hpp | Replaces inline print() with a declaration. |
| core/specfem/source/dim3/vector_source/force_source.cpp | Changes force-source print_details() formatting. |
| core/specfem/source/dim3/vector_source/adjoint_source.hpp | Adds concise print_details() for adjoint sources. |
| core/specfem/source/dim3/tensor_source/moment_tensor_source.cpp | Changes moment-tensor print_details() formatting. |
| core/specfem/source/dim3/source.tpp | Adds geographic + depth-based parsing for 3D YAML sources. |
| core/specfem/source/dim2/vector_source/force_source.hpp | Declares print_details() override for 2D force sources. |
| core/specfem/source/dim2/vector_source/force_source.cpp | Implements new 2D force-source print_details(). |
| core/specfem/source/dim2/vector_source/cosserat_force_source.cpp | Adjusts Cosserat force print_details() formatting. |
| core/specfem/source/dim2/vector_source/adjoint_source.hpp | Adds concise print_details() for adjoint sources. |
| core/specfem/source/dim2/tensor_source/moment_tensor_source.cpp | Adjusts 2D moment tensor print_details() formatting. |
| core/specfem/source_time_functions/ricker.cpp | Refactors STF print format and adds <format> include. |
| core/specfem/source_time_functions/heaviside.hpp | Stores derived denominator separately and exposes it via accessor. |
| core/specfem/source_time_functions/heaviside.cpp | Uses derived denominator for evaluation and refactors print format. |
| core/specfem/source_time_functions/gaussianhdur.cpp | Refactors STF print format and adds <format> include. |
| core/specfem/source_time_functions/gaussian.cpp | Refactors STF print format and adds <format> include. |
| core/specfem/source_time_functions/external.cpp | Refactors STF print format and adds <format> include. |
| core/specfem/source_time_functions/dirac.cpp | Refactors STF print format and adds <format> include. |
| core/specfem/source_time_functions/dgaussian.cpp | Refactors STF print format and adds <format> include. |
| core/specfem/receivers/dim3/receiver.cpp | Simplifies receiver print() output. |
| core/specfem/receivers/dim2/receiver.cpp | Simplifies receiver print() output. |
| core/specfem/program/dim3/program.cpp | Logs sources/receivers before assembly and passes geographic flag for STATIONS. |
| core/specfem/program/dim2/program.cpp | Splits logging into “Input Source” and “Input Receiver” blocks; tweaks assembly banner. |
| core/specfem/program.tpp | Adds extra newline after program header separator. |
| core/specfem/point/local_coordinates.hpp | Adds print() helper for local-coordinate debugging. |
| core/specfem/point/global_coordinates.hpp | Adds print() helper for global-coordinate debugging. |
| core/specfem/io/sources/impl/solution_format_helpers.hpp | Adds get_double() helper for higher-precision coordinate parsing. |
| core/specfem/io/sources/impl/dim3/forcesolution.cpp | Adds geographic coordinate support and uses get_double() for coords. |
| core/specfem/io/sources/impl/dim3/cmtsolution.cpp | Adds geographic coordinate support and switches STF used for CMTSOLUTION parsing. |
| core/specfem/io/receivers/dim3/read_receivers.cpp | Adds geographic/depth-based receiver parsing via polymorphic coordinates. |
| core/specfem/io.hpp | Extends read_3d_receivers API with geographic flag and updated docs. |
| core/specfem/coordinate_systems/geographic.cpp | Adjusts coordinate print() label casing. |
| core/specfem/coordinate_systems/geocentric.cpp | Adjusts coordinate print() label casing. |
| core/specfem/coordinate_systems/cartesian.cpp | Adjusts coordinate print() label casing. |
| core/specfem/assembly/sources/impl/locate_sources.tpp | Adds LocationResult capture/logging and uses new coordinate resolution result. |
| core/specfem/assembly/sources/impl/locate_sources.hpp | Adds surface parameter for depth/topography-aware source location. |
| core/specfem/assembly/sources.hpp | Passes raw mesh into sources assembly for UTM/surface context. |
| core/specfem/assembly/sources.cpp | Plumbs UTM config + free surface into source location. |
| core/specfem/assembly/resolve_coordinates.hpp | Introduces CoordinateResolutionResult and adds free-surface parameter. |
| core/specfem/assembly/resolve_coordinates.cpp | Projects depth-based points onto free surface (dim3) and returns topography info. |
| core/specfem/assembly/receivers/dim3/receivers.hpp | Switches receiver assembly ctor to accept raw mesh (not tags). |
| core/specfem/assembly/receivers/dim3/receivers.cpp | Adds LocationResult capture/logging and resolves coordinates using surface/UTM. |
| core/specfem/assembly/receivers/dim2/receivers.cpp | Adds deterministic per-index debug logging via LocationResult. |
| core/specfem/assembly/mesh/dim3/mesh.tpp | Tracks per-element medium tags for assembly-time connectivity decisions. |
| core/specfem/assembly/mesh/dim3/impl/points.tpp | Prevents point-sharing across medium boundaries in dim3 by checking medium tags. |
| core/specfem/assembly/mesh/dim3/impl/points.hpp | Extends points ctor to accept per-element medium tags. |
| core/specfem/assembly/mesh/dim2/mesh.tpp | Adds medium-tag view and passes it into assemble(). |
| core/specfem/assembly/mesh/dim2/mesh.hpp | Updates assemble() signature to accept medium tags. |
| core/specfem/assembly/mesh/dim2/impl/assemble.tpp | Prevents point-sharing across medium boundaries in dim2 by checking medium tags. |
| core/specfem/assembly/location_result.hpp | New transient diagnostic record + MPI-gathered deterministic debug printing. |
| core/specfem/assembly/impl/value_containers.hpp | Replaces base-offset mapping with ElementIndexRange mapping for maintainability. |
| core/specfem/assembly/impl/domain_properties.tpp | Stores ElementIndexRange rather than a base index. |
| core/specfem/assembly/impl/domain_properties.hpp | Updates docs/types to use ElementIndexRange. |
| core/specfem/assembly/impl/domain_kernels.hpp | Updates kernels container to store ElementIndexRange. |
| core/specfem/assembly/fields/impl/field_impl.tpp | Removes unused constructor and cleans include list. |
| core/specfem/assembly/fields/impl/field_impl.hpp | Removes unused constructor declaration/docs. |
| core/specfem/assembly/fields/impl/assign_assembly_index_mapping.hpp | Refactors index remap API into dim2+dim3 overloads with dedup + base offset. |
| core/specfem/assembly/fields/impl/assign_assembly_index_mapping.cpp | Implements in-place per-medium DOF compaction with dedup and base offsets. |
| core/specfem/assembly/fields/dim3/simulation_field.tpp | Reworks DOF mapping to use in-place remap + per-medium ElementIndexRange. |
| core/specfem/assembly/fields/dim3/simulation_field.hpp | Removes old assembly-index views; uses dof_ranges offsets instead. |
| core/specfem/assembly/fields/dim2/simulation_field.tpp | Same as dim3: in-place remap + per-medium ElementIndexRange. |
| core/specfem/assembly/fields/dim2/simulation_field.hpp | Same as dim3: replace assembly-index views with dof_ranges. |
| core/specfem/assembly/attenuation/impl/attenuation_medium/dim3/constant_isotropic.tpp | Switches attenuation indexing to ElementIndexRange. |
| core/specfem/assembly/attenuation/impl/attenuation_medium/dim2/constant_isotropic.tpp | Switches attenuation indexing to ElementIndexRange. |
| core/specfem/assembly/assembly/dim3/assembly.cpp | Plumbs raw mesh into sources/receivers assembly and tweaks print banner. |
| core/specfem/assembly/assembly/dim2/assembly.cpp | Plumbs raw mesh into sources assembly and tweaks print banner. |
| core/specfem/algorithms/locate_point/dim3/project_onto_surface.cpp | Adds vertical projection onto the free surface (topography lookup). |
| core/specfem/algorithms/locate_point.hpp | Declares projection enum + project_onto_surface() API. |
| core/specfem/algorithms/CMakeLists.txt | Links algorithms library against specfem::mpi for MPI reductions. |
| CMakeLists.txt | Removes legacy specfem2d/specfem3d executables and updates install dependencies. |
| cmake/metis.cmake | Makes GKlib optional for METIS and links it only when available. |
| benchmarks/src/dim3/homogeneous_halfspace/CMakeFiles/specfem_config.yaml.in | Adjusts benchmark timestep count. |
| benchmarks/src/dim3/homogeneous_halfspace/CMakeFiles/Mesh_Par_file.in | Enables Stacey + top free surface for benchmark mesh. |
| benchmarks/src/dim3/homogeneous_halfspace/CMakeFiles/Mesh_Par_file_mpi.in | Enables Stacey + top free surface for MPI benchmark mesh. |
| benchmarks/src/dim3/homogeneous_acoustic_kernel/CMakeFiles/Mesh_Par_file.in | Enables top free surface for benchmark mesh. |
| benchmarks/src/CMakeLists.txt | Registers Mount St. Helens benchmark only when MPI is enabled. |
| .agents/rules/documentation.md | Clarifies @param guidance for documentation style rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| specfem::element::dimension_tag::dim2>::print_details() const { | ||
| std::ostringstream message; | ||
| message << " Source Angle: " << type_real(this->angle) << "\n" | ||
| << " Source f: " << type_real(this->f) << "\n" | ||
| << " Source fc: " << type_real(this->fc) << "\n"; | ||
| auto format = [](type_real value, int precision) { | ||
| return std::format("{:.{}e}", value, precision); | ||
| }; |
|
I added collapsed sample outputs to the PR descriptions. |
…o fix format not found issue which was missing in gcc 11 which intel compiler used
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Rohit-Kakodkar
left a comment
There was a problem hiding this comment.
If what you care about is the distance between target and found, would it be simpler to log the distance between target and found within sources? We can then print the distance within from source->print function.
|
@icui removing you because this needs refactor |
Description
assembly::LocationResultthat lives only within the constructors of receivers and sources for cleaner debuggingInput Source & receiver log
Assembly Source & receiver debug log
Issue Number
-/-
Checklist
Please make sure to check developer documentation on specfem docs.