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

Function for periodic global grid to non-periodic #63

Closed
veenstrajelmer opened this issue Mar 17, 2023 · 2 comments · Fixed by #154
Closed

Function for periodic global grid to non-periodic #63

veenstrajelmer opened this issue Mar 17, 2023 · 2 comments · Fixed by #154

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Mar 17, 2023

Copy x=-180 nodes to x=180 and update face/edge topology.

In case of periodic grid, conversion to non-periodic is necessary for:

  • rasterizing
  • interpolation
  • plotting
  • regridding

All these features fail if there are "around the back" cells/faces

Test data is available at p:\1230882-emodnet_hrsm\GTSMv5.0\runs\reference_GTSMv4.1_wiCA_2.23.08_mf4\output_small\

Partition 0005 also goes around the back, so testing with only 1 partition is also possible.

@Huite
Copy link
Collaborator

Huite commented Mar 31, 2023

For plotting: an attribute (or property or something) denoting it's periodic would be useful. In that case, there's no need to create a whole new topology: just special case it for the plotting.

For e.g. plotting in QGIS -- which doesn't support periodic grids -- you'd still need to convert.

@Huite
Copy link
Collaborator

Huite commented Aug 21, 2023

Periodic arguably has a more general meaning that what we describe here: https://en.wikipedia.org/wiki/Periodic_boundary_conditions

Periodic boundary conditions (PBCs) are a set of boundary conditions which are often chosen for approximating a large (infinite) system by using a small part called a unit cell. PBCs are often used in computer simulations and mathematical models. Periodic boundary conditions (PBCs) are a set of boundary conditions which are often chosen for approximating a large (infinite) system by using a small part called a unit cell. PBCs are often used in computer simulations and mathematical models.

However, the logic required to create such a grid is exactly identical to the one required for this global grid. If we have a grid which runs from x=0 to x=5, but we want a periodic simulation to simulate an infinite domain, we would similarly connect the left side to the right by substituting the rightmost face nodes with those on the left.

  • to_periodic would substitute x=5 with x=0.
  • to_nonperiodic would substitute the rightmost x=0 with x=5, given xmax=5.0 as an argument

I think the spherical cases can be reasonably seen as a special case where the domain is finite.

Although to properly implement it, an optional ymax argument should also be introduced, and xmax should be made optional as well.

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 a pull request may close this issue.

2 participants