NEDAS.models.nextsim.v1.gmshlib module
- class NEDAS.models.nextsim.v1.gmshlib.MeshPhysicalName(name, ident, topodim)[source]
Bases:
objectClass used to distinguish coastal or open boundaries
MeshPhysicalName(name,ident,topodim)
Parameters:
- namestring
eg ‘coast’ or ‘open’
- identint
eg edge number
- topodimint
eg 2 (2D space) or 3 (3D space)
- class NEDAS.models.nextsim.v1.gmshlib.MeshElement(ident, eltype, tags, node_ids, node_indices)[source]
Bases:
objectClass used for both individual triangles and edges
- class NEDAS.models.nextsim.v1.gmshlib.GmshBoundary(exterior, islands=None, open_boundaries=None, coastal_boundaries=None)[source]
Bases:
objectClass for handling mesh boundaries
- static points_in_polygon(poly, coords)[source]
Test if coords are inside a polygon
- Parameters:
poly (shapely.geometry.Polygon)
coords (numpy.ndarray) – shape (num_points, 2) with x in 1st column and y in 2nd
- Returns:
inside – length is num_points
- Return type:
numpy.ndarray(bool)
- iswet(x, y)[source]
use matplotlib.path to test if multiple points are contained inside the polygon self.exterior_polygon
- Parameters:
x (numpy.ndarray) – x coordinates to test
y (numpy.ndarray) – y coordinates to test
- Returns:
wet – mask of same shape as x and y; True if the point is inside the mesh (inside external polygon but outside island polygons), False otherwise.
- Return type:
numpy.ndarray