Issue 1982 - First stiffness matrix computation#1998
Open
lsawade wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements first pass of explicit stiffness-kernel extraction for SPECFEM++ linear systems (specfem::linear_system) by probing the existing matrix-free element operator to build dense per-element stiffness blocks, with scope validation and accompanying unit tests/docs.
Changes:
- Add
compute_element_stiffness(NGLL-dispatched) andvalidate_stiffness_scopefor 3D elastic isotropic, attenuation-none, natural-boundary meshes. - Introduce a Kokkos probe kernel that applies gradient → stress → divergence to unit local DOFs to populate dense element blocks.
- Add a unit test that checks symmetry/nullspace properties and matches against the production matrix-free stiffness operator; expose the new API in Sphinx/Doxygen docs.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit-tests/serial.cmake |
Adds the new element_stiffness_tests target to the serial unit-test suite. |
tests/unit-tests/linear_system/element_stiffness_tests.cpp |
New tests validating stiffness-block properties and agreement with matrix-free operator. |
docs/sections/api/specfem/linear_system/index.rst |
New API doc entry for specfem::linear_system. |
docs/sections/api/specfem/index.rst |
Adds linear_system to the top-level API index. |
core/specfem/linear_system/impl/stiffness_probe_kernel.hpp |
New Kokkos kernel to probe the element stiffness operator into dense blocks. |
core/specfem/linear_system/element_stiffness.hpp |
Declares local DOF ordering helper, scope validator, and stiffness-block computation APIs. |
core/specfem/linear_system/element_stiffness.tpp |
Implements the NGLL-specific stiffness probe execution and buffer validation. |
core/specfem/linear_system/element_stiffness.cpp |
Implements runtime NGLL dispatcher + scope validation and provides explicit instantiations. |
cmake/trilinos.cmake |
Adjusts macOS rpath handling for Trilinos shared libraries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const auto &element_types = assembly.element_types; | ||
| const auto elements = element_types.get_elements_on_host(Tags::medium_tag); | ||
|
|
||
| for (int i = 0; i < elements.size(); ++i) { |
Comment on lines
+48
to
+53
| if(APPLE) | ||
| get_filename_component(SPECFEM_TRILINOS_LIBRARY_DIR | ||
| "${Trilinos_DIR}/../.." ABSOLUTE) | ||
| list(APPEND CMAKE_BUILD_RPATH "${SPECFEM_TRILINOS_LIBRARY_DIR}") | ||
| list(APPEND CMAKE_INSTALL_RPATH "${SPECFEM_TRILINOS_LIBRARY_DIR}") | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This implements the computation of the stiffness kernel in linear systems
Issue Number
Closes #1982
Checklist
Please make sure to check developer documentation on specfem docs.