Skip to content

Issue 1982 - Phase 2, StiffnessAssembler#2002

Open
lsawade wants to merge 1 commit into
issue-1982from
issue-1982-phase-2
Open

Issue 1982 - Phase 2, StiffnessAssembler#2002
lsawade wants to merge 1 commit into
issue-1982from
issue-1982-phase-2

Conversation

@lsawade

@lsawade lsawade commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

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.

  • I ran the code through pre-commit to check style
  • THE DOCUMENTATION BUILDS WITHOUT WARNINGS/ERRORS
  • I have added labels to the PR (see right hand side of the PR page)
  • My code passes all the integration tests
  • I have added sufficient unittests to test my changes
  • I have added/updated documentation for the changes I am proposing
  • I have updated CMakeLists to ensure my code builds
  • My code builds across all platforms

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::DofMap to map (iglob, icomp) DOFs to Tpetra global IDs (serial-only for now).
  • Implements specfem::linear_system::StiffnessAssembler to assemble a Tpetra::CrsMatrix from 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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants