Issue 1982 - Phase 2, StiffnessAssembler#2002
Open
lsawade wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the Phase 2 global stiffness-matrix assembly path for issue #1982 by introducing a Trilinos/Tpetra-backed DOF mapping and StiffnessAssembler, plus a new unit test suite validating the assembled operator against the existing matrix-free kernel.
Changes:
- Introduces
specfem::linear_system::DofMapto map(iglob, icomp)DOFs to Tpetra global IDs (serial-only for now). - Implements
specfem::linear_system::StiffnessAssemblerto assemble aTpetra::CrsMatrixfrom dense per-element stiffness blocks. - Adds a new unit test executable to validate dimensions, symmetry/nullspace properties, and agreement with
compute_stiffness_interaction.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit-tests/serial.cmake | Adds stiffness_assembler_tests executable and registers it for serial test discovery. |
| tests/unit-tests/linear_system/stiffness_assembler_tests.cpp | New test suite covering global assembly correctness vs. matrix-free stiffness interaction. |
| docs/sections/api/specfem/linear_system/index.rst | Updates linear system API docs to describe DofMap and StiffnessAssembler behavior and scope. |
| docs/Doxyfile.in | Defines SPECFEM_ENABLE_TRILINOS for Doxygen preprocessing so Trilinos-gated APIs appear in docs. |
| core/specfem/linear_system/tpetra_assembler.hpp | Declares StiffnessAssembler API and assembly pipeline. |
| core/specfem/linear_system/tpetra_assembler.cpp | Implements graph construction and matrix fill via batched element-block scatter. |
| core/specfem/linear_system/dof_map.hpp | Introduces DofMap and shared typedefs for scalar/ordinal/map types used by assembly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+198
to
+203
| { | ||
| auto view = translation.getLocalViewHost(Tpetra::Access::OverwriteAll); | ||
| for (int iglob = 0; iglob < dof_map.nglob(); ++iglob) { | ||
| view(static_cast<std::size_t>(dof_map.gid(iglob, icomp)), 0) = 1; | ||
| } | ||
| } |
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
Implements a StiffnessAssembler for Tpetra, and tests the stiffness interaction computation against compute_stiffness_interaction
Issue Number
Updates #1982
Checklist
Please make sure to check developer documentation on specfem docs.