You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
accessFVCOM() returns values at points - nodes for scalars, element
centroids for velocities. That is what matchData() needs and it is not the
grid: an FVCOM mesh is a triangulation, and which nodes form each triangle
lives in a connectivity array a point fetch never reads. Plotting what came
back therefore showed a scatter of dots where the model has cells, with no
way to draw a boundary, shade a cell, or see where the mesh refines - which
is most of why anyone looks at an unstructured model.
fvcom_mesh() reads that array and returns the triangles as POLYGONs with a
DEPTH per cell, carrying no time dimension because it is the grid rather
than anything measured on it. what = "nodes" and "elements" return the two
point sets alone.
plot_mesh() draws it, bare or shaded, and does the join when given a fetch.
That join is the part worth automating: a fetch is subset to the bounding
box, so its row order says nothing about the mesh's own element numbering,
and joining by position would mislabel every cell without complaining.
Two things only came out by trying it. Node-centred values sit at triangle
*corners*, shared between the cells meeting there - and st_contains
excludes boundaries, so a node join returned nothing whatsoever. It tests
intersection instead, which catches corners and centroids alike. And
plot.sf wants a palette function it can call with the number of breaks it
chose, not a vector of colours; a vector fails with "must have one more
break than colour".
A triangle is kept when any vertex falls inside the box, so the mesh covers
what was asked for rather than stopping short, and the edge is ragged by
design - which is also why an element join leaves the outermost triangles
NA rather than borrowing a neighbour's value. GOM7 remeshes between months,
so date says which month's mesh to read.
Also describes the five access functions up front in the README, which had
been listed in a table but never actually explained, and adds the mesh
plotting to it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments