Skip to content

Commit

Permalink
Dual Mesh Construction (#859)
Browse files Browse the repository at this point in the history
* Added dual mesh initial support

* Updated Mesh Construction Method

* Removed Old Files

* Updated API added comprehensive test

* Fixed pre-commit

* optimize code

* update dual mesh construction and duplicate node validation

* progress on migrating implementation to Grid

* Testing Notebook

* Update Untitled.ipynb

* Updated Notebook

* Update dual-mesh.ipynb

* Update Notebook

* Update docs

* Update dual-mesh.ipynb

* Updated Merge Duplicate Nodes and cleaned up code

* Added Duplicate Nodes Test

* Duplicate nodes error, updated index, fix codecov,

* Fixed pre-commit

* fixed duplicate check

* Moved to dual.py remove duplication merge

* Updated API and Benchmarks

* Updated face construction and ordering

* Optimization and clean up

* Update dual-mesh.ipynb

* Updated userguide.rst

* Fixed pre-commit

* Update docs/userguide.rst

Co-authored-by: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com>

* Added docstrings

* Update dual.py

* Added dual mesh support of DataArrays

* Fixed asv config file

* Added name to data array

* Fixed constructed node face connectivity error

* Updated user guide

* Fixed docs

* Removed method parameter

* Added support for UxDatasets

* Update dual user guide

* Update index.rst

* Updated Test Cases

* Update test_grid.py

* Updated colormaps

* pre-commit fix

* Notebook Update

* Update dual-mesh.ipynb

* Update dual-mesh.ipynb

* Fixed Dimension Bug

* Fixed pre-commit

* Update mpas_ocean.py

* Added warnings

* Fixed test failures

* Updated notebook and jit

* Merge pre-commit fix

* Updated notebook

* Update Dual Notebook

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated docstrings, benchmarks, and errors

* update notebook to use updated plotting api

---------

Co-authored-by: Philip Chmielowiec <67855069+philipc2@users.noreply.github.com>
Co-authored-by: Philip Chmielowiec <philipchmielowiec@gmail.com>
Co-authored-by: Rajeev Jain <rajeeja@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Oct 9, 2024
1 parent 8a29d96 commit d6e26e9
Show file tree
Hide file tree
Showing 14 changed files with 876 additions and 49 deletions.
7 changes: 7 additions & 0 deletions benchmarks/mpas_ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def time_dataarray_to_polycollection(self, resolution, periodic_elements):


class ConstructTreeStructures(DatasetBenchmark):

def time_kd_tree(self, resolution):
self.uxds.uxgrid.get_kd_tree()

Expand Down Expand Up @@ -137,13 +138,19 @@ class HoleEdgeIndices(DatasetBenchmark):
def time_construct_hole_edge_indices(self, resolution):
ux.grid.geometry._construct_hole_edge_indices(self.uxds.uxgrid.edge_face_connectivity)


class DualMesh(DatasetBenchmark):
def time_dual_mesh_construction(self, resolution):
self.uxds.uxgrid.get_dual()

class ConstructFaceLatLon(GridBenchmark):
def time_welzl(self, resolution):
self.uxgrid.construct_face_centers(method='welzl')

def time_cartesian_averaging(self, resolution):
self.uxgrid.construct_face_centers(method='cartesian average')


class CheckNorm:
param_names = ['resolution']
params = ['480km', '120km']
Expand Down
19 changes: 19 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ Mathematical Operators
UxDataArray.gradient
UxDataArray.difference


Dual Mesh Construction
----------------------
.. autosummary::
:toctree: generated/

Grid.get_dual
UxDataArray.get_dual
UxDataset.get_dual

Aggregations
------------

Expand Down Expand Up @@ -362,6 +372,15 @@ on each face.



Intersections
~~~~~~~~~~~~~

.. autosummary::
:toctree: generated/

grid.intersections.gca_gca_intersection
grid.intersections.gca_const_lat_intersection


Spherical Geometry
------------------
Expand Down
3 changes: 3 additions & 0 deletions docs/internal_api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ Validation
grid.validation._check_connectivity
grid.validation._check_duplicate_nodes
grid.validation._check_area
grid.validation._check_duplicate_nodes_indices
grid.validation._find_duplicate_nodes


Accurate Computing Utils
------------------------
Expand Down
Loading

0 comments on commit d6e26e9

Please sign in to comment.