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

Add Unstructured Grid class #1751

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fluidnumerics-joe
Copy link

@fluidnumerics-joe fluidnumerics-joe commented Nov 5, 2024

Properties and procedures that are common to unstructured grids and structured grids are defined in the BaseGrid class. This includes lon,lat, time, time_origin, and mesh properties.

The Grid class is now defined as a type extension of BaseGrid. This configuration is compatible with the previous commit of Parcels (all existing tests pass). The _zonal_periodic, _zonal_halo, _meridional_halo, and _lat_flipped properties are seen as attributes specific to the structured grid Grid class.

The UGrid class is defined as a type extension of the BaseGrid. This child class adds the face_node_connectivity property that relates vertices to the 2-D lateral grid faces. The lon and lat attributes refer to the node_lon and node_lat that are defined in the uxarray.Grid structure; these are the corner node vertices. Note that there are other possible nodes, including the edge vertices (centers of the edges), and face_vertices that define the element centroids; these are currently not defined.

Properties and procedures that are common to unstructured grids and
structured grids are defined in the BaseGrid class. This includes
lon, lat, time, time_origin, and mesh properties.

The Grid class is now defined as a type extension of BaseGrid. This
configuration is compatible with the previous commit of Parcels (all
existing tests pass). The _zonal_periodic, _zonal_halo,
_meridional_halo, and _lat_flipped properties are seen as attributes
specific to the structured grid.

The UGrid class is defined as a type extension of the BaseGrid. This
child class adds the `face_node_connectivity` property that relates vertices to the
2-D lateral grid faces. The lon and lat attributes refer to the `node_lon` and
`node_lat` that are defined in the uxarray.Grid structure; these are the
corner node vertices. Note that there are other possible nodes,
including the edge vertices (centers of the edges), and `face_vertices`
that define the element centroids; these are currently not defined.
@fluidnumerics-joe
Copy link
Author

@erikvansebille @VeckoTheGecko
I'm using this PR to provide visibility to some of the proposed changes to Parcels to support unstructured grids. So far, I've only inserted a BaseGrid class that the Grid and UGrid are child classes of. All of the tests under tests/ pass, which is good.

From the state it's in, I'll need to work on a creategrid method for the UGrid class and I suppose it'd be ideal to sort out how we'll bring in UXArray support for loading the grid.

This PR is meant to go to the ELPHE-WW Fork's main branch so that we have a safe "playground" to explore.

Your comments and feedback are most welcome before further changes are made.

@fluidnumerics-joe fluidnumerics-joe changed the title Draft initial basegrid setup Add Unstructured Grid class Nov 5, 2024
@erikvansebille
Copy link
Member

Thanks @fluidnumerics-joe, for starting this work. Your plan sounds great to me. I quickly went through the code, and that also looks fine. Some issues to fix with the CI obviously, but I don't think these are huge problems

@VeckoTheGecko
Copy link
Contributor

Looks good!

…c for ugrid

In the ufield class, I've sketched out the methods that we need to
define in order to do 2D and 3D interpolation. Once these are in place,
I'll kick off some examples that "regrid" onto structured grid and
interpolate onto random particles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants