Skip to content

Conversation

Rohit-Kakodkar
Copy link
Collaborator

Description

  • Adds chunk edge iterator
    • Adds tests for chunk edge iterator
  • Adds edge intersection iterator
    • Adds tests for edge intersection iterator
  • Adds access functions for chunk field

Issue Number

If there is an issue created for these changes, link it here

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

- [x] Adds chunk edge iterator
   - [x] Adds tests for chunk edge iterator
- [x] Adds edge intersection iterator
   - [x] Adds tests for edge intersection iterator
- [x] Adds access functions for chunk field
Base automatically changed from issue-1140 to devel-dg August 29, 2025 16:44
Copy link
Collaborator

@int-ptr-ptr int-ptr-ptr left a comment

Choose a reason for hiding this comment

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

While I think the binary was-everything-hit-exactly-once test is fine for now, I think in the future, we may want to also check hit order -- though, that may be within the scope of tests post-assembly (do x and z match between self and coupled edge, etc.).

Comment on lines 252 to 263
case specfem::mesh_entity::type::bottom:
return { ispec, 0, ipoint };
break;
case specfem::mesh_entity::type::top:
return { ispec, num_points - 1, num_points - 1 - ipoint };
break;
case specfem::mesh_entity::type::left:
return { ispec, ipoint, 0 };
break;
case specfem::mesh_entity::type::right:
return { ispec, num_points - 1 - ipoint, num_points - 1 };
break;
Copy link
Collaborator

Choose a reason for hiding this comment

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

break statement's aren't needed after a return, no?

Also, I guess this type of (edgetype, ipoint) -> (iz, ix) mapping is fine absent weird element orientations since L/R and T/B are switched, but wouldn't you want to stick to strict clockwise or counterclockwise? What we have right now is

   ←
 ┌───┐
↑│ n │↓
 └───┘
   →

which would require no flipping (orientation reversal) for 90 degrees:

   →      ←
 ┌───┐  ┌───┐
↓│ ᴝ │↑↑│ n │↓
 └───┘  └───┘
   ←      →

but 180 will always need to be flipped. If instead we stuck to clockwise or counterclockwise, the coupled iterator could handle the ipoint flipping, since orientation reversal will always occur, killing the need for the edge.reverse_orientation.

Copy link
Collaborator

@lsawade lsawade left a comment

Choose a reason for hiding this comment

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

LGTM, comments are at your own discretion

EdgeIteratorTestParams{ 1024,
"ExactChunkSizeEdgeValues" }));

INSTANTIATE_TEST_SUITE_P(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Beautiful!

"initialize_edges",
Kokkos::RangePolicy<Kokkos::DefaultExecutionSpace>(0, number_of_edges),
KOKKOS_CLASS_LAMBDA(const int i) {
for (int j = 0; j < num_points; ++j)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

@lsawade
Copy link
Collaborator

lsawade commented Sep 2, 2025

#1160 may fix unit-test

@lsawade lsawade added the enhancement New feature or request label Sep 2, 2025
- [x] Added `ENUM_ID` to enable strong type checking when checking tags within `FOR_EACH` macro. The macro `_CHECK_ENUM` performs the strong type checking when comparting 2 enums.
- [x] Added edge definition macros to enable all types of edges
- [x] Updates mesh containers to hold connecting edges
- [x] Adds weakly conforming connection to represent coupled interfaces
- [x] Updates mesh reader
- [x] Adds edge types container to sort edges for kernel computation
Rohit-Kakodkar and others added 4 commits September 9, 2025 09:16
Create edge types to sort all edges with tags
Refactor `FOR_EACH` macro to incorporate interface tags
- [x] Updates coupled interfaces struct
- [x] Adds several new point types (point edge index, point interface index, point coupled interface)
- [x] Adds coupled interfaces 2 container which will replace current coupled interface container
Base automatically changed from devel-dg to devel September 10, 2025 13:11
Rohit-Kakodkar and others added 3 commits September 10, 2025 12:45
- [x] New compute coupling kokkos kernel using ChunkEdgePolicy
- [x] Media specific compute coupling (elastic-acoustic & acoustic-elastic)
- [x] Adds unit-tests
Reimplement coupled interfaces using macros
@Rohit-Kakodkar Rohit-Kakodkar merged commit ca9be18 into devel Sep 19, 2025
8 checks passed
@Rohit-Kakodkar Rohit-Kakodkar deleted the issue-1150 branch September 19, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create access functions for chunk edge fields Create chunk edge field types
4 participants