Skip to content

Commit d6e26e9

Browse files
aaronzedwickphilipc2rajeejapre-commit-ci[bot]
authored
Dual Mesh Construction (#859)
* 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 <[email protected]> * 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 <[email protected]> Co-authored-by: Philip Chmielowiec <[email protected]> Co-authored-by: Rajeev Jain <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8a29d96 commit d6e26e9

File tree

14 files changed

+876
-49
lines changed

14 files changed

+876
-49
lines changed

benchmarks/mpas_ocean.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def time_dataarray_to_polycollection(self, resolution, periodic_elements):
9595

9696

9797
class ConstructTreeStructures(DatasetBenchmark):
98+
9899
def time_kd_tree(self, resolution):
99100
self.uxds.uxgrid.get_kd_tree()
100101

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

141+
142+
class DualMesh(DatasetBenchmark):
143+
def time_dual_mesh_construction(self, resolution):
144+
self.uxds.uxgrid.get_dual()
145+
140146
class ConstructFaceLatLon(GridBenchmark):
141147
def time_welzl(self, resolution):
142148
self.uxgrid.construct_face_centers(method='welzl')
143149

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

153+
147154
class CheckNorm:
148155
param_names = ['resolution']
149156
params = ['480km', '120km']

docs/api.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,16 @@ Mathematical Operators
331331
UxDataArray.gradient
332332
UxDataArray.difference
333333

334+
335+
Dual Mesh Construction
336+
----------------------
337+
.. autosummary::
338+
:toctree: generated/
339+
340+
Grid.get_dual
341+
UxDataArray.get_dual
342+
UxDataset.get_dual
343+
334344
Aggregations
335345
------------
336346

@@ -362,6 +372,15 @@ on each face.
362372

363373

364374

375+
Intersections
376+
~~~~~~~~~~~~~
377+
378+
.. autosummary::
379+
:toctree: generated/
380+
381+
grid.intersections.gca_gca_intersection
382+
grid.intersections.gca_const_lat_intersection
383+
365384

366385
Spherical Geometry
367386
------------------

docs/internal_api/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ Validation
200200
grid.validation._check_connectivity
201201
grid.validation._check_duplicate_nodes
202202
grid.validation._check_area
203+
grid.validation._check_duplicate_nodes_indices
204+
grid.validation._find_duplicate_nodes
205+
203206

204207
Accurate Computing Utils
205208
------------------------

0 commit comments

Comments
 (0)