Skip to content

WIP: Update ownership model to work in general forests and show tri-valent singular node fixup #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

lroberts36
Copy link
Collaborator

@lroberts36 lroberts36 commented May 8, 2025

PR Summary

Previously, the ownership model for shared elements was not updated to deal with general forests and non-trivial logical coordinate transformations between neighboring blocks. This PR inserts the necessary transformations to the ownership array so that everything is consistent.

Additionally, in the boundary communication example, we implement the fixup/internal boundary condition for nodal fields at tri-valent singular nodes in the forest as shown in the diagram below in the routine FixTrivalentNodes2D.

Screenshot 2025-05-08 at 4 01 57 PM

This seems to give reasonable results for communicating boundary coordinates on this box mesh:
grid_explosion.pdf

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

Comment on lines +92 to +101
for (int point = 0; point < 2 * nblocks; ++point) {
nodes[point] = Node::create(point, {-std::sin(point * M_PI / nblocks) + xoffset,
-std::cos(point * M_PI / nblocks) + yoffset});
}

using edge_t = parthenon::forest::Edge;
for (int point = 0; point < 2 * nblocks; ++point) {
forest_def.AddBC(
edge_t({nodes[point % (2 * nblocks)], nodes[(point + 1) % (2 * nblocks)]}));
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are both nodes and edges required to define the forest? Or are you using nodes to define the edges?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The forest is defined by a set of nodes, faces defined by an ordered set of four nodes, and boundary conditions on edges defined by a set of two nodes.

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