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

1D2D grid generation overview #782

Open
Tracked by #497
veenstrajelmer opened this issue Feb 14, 2024 · 0 comments
Open
Tracked by #497

1D2D grid generation overview #782

veenstrajelmer opened this issue Feb 14, 2024 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Feb 14, 2024

Compute contact points between mesh1d and mesh2d:

import matplotlib.pyplot as plt
import xugrid as xu
from meshkernel import MeshKernel, ProjectionType

file_nc = r'p:\1230882-emodnet_hrsm\GTSMv5.0\SO_NHrivGTSM\UGgtsm_snipbd_v2_withriv_cellinfo_net.nc'
uds = xu.open_dataset(file_nc)
fig,ax = plt.subplots()
uds.grids[0].plot(ax=ax, edgecolor='crimson')
uds.grids[1].plot(ax=ax)
ax.set_ylim(None,uds.grids[0].bounds[-1])

mk = MeshKernel(projection=ProjectionType.SPHERICAL)

mk.mesh1d_set(uds.grids[0].meshkernel.mesh1d_get())
mk.mesh2d_set(uds.grids[1].meshkernel.mesh2d_get())

mk.contacts_compute_boundary(node_mask=None, polygons=None, search_radius=0.2)
# TODO: mk.contacts_compute_boundary() requires 'node_mask', 'polygons', and 'search_radius', alternative?

Request to make the arguments optional: Deltares/MeshKernelPy#81

1D2D grid generation:

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

No branches or pull requests

1 participant