Skip to content
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

Implement general 2D forest meshes #1047

Merged
merged 106 commits into from
Jul 10, 2024

Conversation

lroberts36
Copy link
Collaborator

@lroberts36 lroberts36 commented Apr 11, 2024

PR Summary

This PR implements the minimum necessary technology for defining meshes based on generally connected forests of octrees. I have left details of coordinates to a future PR, so for now each tree must cover a hyper-rectangular domain defined by $\vec{x}_\text{min}$ and $\Delta \vec{x}$. Some rough notes about my implementation are in ForestOfOctreesNotes.pdf, which is now also included in doc/latex/main.pdf.

The four major things this PR accomplishes:

  • Add forest::Node, forest::Edge, and forest::Face for defining the forest mesh topology. forest::Face contains routines for finding neighbors and then calculating the correct logical coordinate transformations to those neighbors. For now, I have stuck to defining 2D forests but the mechanisms used here should generalize to 3D relatively easily in a future PR.
  • Add forest::Forest::Make2D that builds a Forest from a forest::ForestDefinition. ForestDefinition contains a set of Faces, boundary conditions defined on forest::Edges, RegionSizes associated with each block, and a set of initial LogicalLocations to refine.
  • Add Mesh constructor as well as ParthenonManager::ParthenonInitPackagesAndMesh that takes a forest::ForestDefinition and constructs a mesh based on a general 2D forest.
  • Thread logical coordinate transformations through boundary communication routines so that neighbor blocks that are non-simply oriented can communicate boundaries.

Smaller things also included in the PR:

  • Rename RelativeOrientation -> LogicalLocationCoordinateTransformation for clarity.
  • Move MeshBndryFnctn to Mesh::forest::trees instead of Mesh and add appropriate registration routines.
  • Adds an example and associated regression test that communicates gids and other information through boundaries to ensure that neighbor communication is occurring correctly. The gold file has just been verified by hand.
  • Adds a unit test that performs refinement on non-simply connected forests.

Things this PR does not do (but maybe a future PR should):

  • Deal with physical coordinates on trees beyond the simplest choice.
  • Implement periodic boundary conditions for general forests.
  • Allow for 3D meshes.
  • Allow for 6+ valent points in the macro-mesh.
  • Deal with corner communication for 5-valent corners or generally store information about valence of corners and edges in MeshBlock.
  • Make a better interface for users to define general forests.

Some examples of properly nested refinement near singular mesh points (this mesh configuration is tested in the newly added unit test):
Screen Shot 2024-04-30 at 9 41 34 AM

Boundaries filled with neighbor gids in a 2x2 forest where the lower left tree coordinates are rotated by 90 degrees relative to the other trees (results of the boundary communication regression test):
Screenshot 2024-05-07 at 1 10 27 PM

PR Checklist

@lroberts36 lroberts36 changed the title WIP: Thread relative block orientation through communication routines WIP: Include relative block orientation transformations in communication routines Apr 11, 2024
@lroberts36 lroberts36 changed the base branch from lroberts36/add-forest-block-orientation to lroberts36/refactor-mesh-constructors April 17, 2024 19:26
Copy link
Collaborator

@adamdempsey90 adamdempsey90 left a comment

Choose a reason for hiding this comment

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

Our 2 downstream codes run fine without modification.

@lroberts36 lroberts36 disabled auto-merge July 9, 2024 00:01
@lroberts36 lroberts36 enabled auto-merge July 9, 2024 00:01
@lroberts36 lroberts36 disabled auto-merge July 10, 2024 02:31
@lroberts36 lroberts36 merged commit 8db87fb into develop Jul 10, 2024
53 checks passed
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.

3 participants