Open FariborzDaneshvar-NOAA opened 1 year ago
I also encounter a different error Negative elem. areas
when running BEST track Florence
case using the mesh generated from the new ocsmesh
. The workflow crashed at the model spinup stage due to the Negative elem. areas
error.
In the error log file, it indicated AQUIRE_HGRID: negative area at 1491512
(see the figure below, the red circle indicates that tiny element; the file is located here: /lustre/hurricanes/florence_2018_nowave_noriver/setup/ensemble.dir/spinup/outputs/nonfatal_000029).
Linking issue: https://github.com/noaa-ocs-modeling/SurgeTeamCoordination/issues/108
The Harvey issue seems to be due to triangulation of the buffer region, for some reason the triangulation function also triangulates a "hole" in the buffer zones which causes conflict with existing high-res section of the mesh.
This needs further inspection of the triangulation function to figure out why this happens.
Further investigation shows that the feature in previous comment is actually two polygons in a multipolygon that are touching at two points. it's not a single hole touching the sides of a single polygon. This is still valid in shapely, but it causes problem for triangle
triangulation package:
The main issue seems to be addressed now in the branch (https://github.com/noaa-ocs-modeling/OCSMesh/commit/132e1141be6f9f702faaf0ec2227530908fc62f1 and https://github.com/noaa-ocs-modeling/OCSMesh/commit/6dbd530033a420f539d39faf858d3183151da7cc), but now I see some strange triangulations like:
This used to work fine, at least partially!
@FariborzDaneshvar-NOAA the original issue is resolved. Please test and let me know if you still run into errors. The new issue with strange mesh patches is something I'm still investigating
For some reason some of the buffer patches do not have hfun defined!
The issue looks to be related to how jigsaw meshes the input! Specifically at: https://github.com/noaa-ocs-modeling/OCSMesh/blob/6dbd530033a420f539d39faf858d3183151da7cc/ocsmesh/cli/subset_n_combine.py#L289-L293
The geometry looks like this:
And the hfun like:
But the mesh ends up ignoring the patches:
Note that this mesh was generated in a separate iPython session too (from the saved domain and hfun) and still has this issue. The mesh was generated using ocsmesh
's JigsawDriver
, maybe let's try to also directly use Jigsaw and see if it differs!
After further investigation, by trying to modify the buffer geom by buffer
operation, etc. I still get similar issues. This should be something related to how jigsaw handles separate input polygons.
It doesn't make any sense! For the buffer zone polygons (like above) I have this issue with Jigsaw that it doesn't mesh some of them. If I send a subset of these polygons, I get different set of them unmeshed! I also thought it might be that shapes are too complicated and cause truncation errors, so I buffer
ed the shapes by 10000
meters and simplify
d the shapes by tolerance of 5000
meters, but I still get similar issue. I even tried using a background mesh as size function (so that I know the issue is not the size function):
Then I thought it's just Jigsaw cannot handle multiple polygons with holes, but then trying buffered points for polygon it meshes fine (I used the same background mesh as size function):
m_lo = ocsmesh.Mesh.open('path/to/bg/mesh.2dm', crs=4326)
mlo_hfun = ocsmesh.Hfun(m_lo)
mlo_hfun.size_from_mesh()
pts = points([[-92+i, 20] for i in range(10)])
geom = ocsmesh.Geom(MultiPoint(pts).buffer(0.35).difference(MultiPoint(pts).buffer(0.05)), crs=4326)
dr = ocsmesh.driver.JigsawDriver(geom=geom, hfun=mlo_hfun)
m = dr.run(sieve=0)
m.write('multicircle.2dm', format='2dm', overwrite=True)
Not addressed as a part of the merge!
Note added by @SorooshMani-NOAA: This issue occurs on the
enhance/subset_triangle
branch@SorooshMani-NOAA this is the error I'm getting during the mesh generation step for the
BEST
track ofharvey
:working directory on NHC_COLAB_2:
/lustre/hurricanes/harvey_2017_7515c27c-22f2-49e4-b369-ec7fb89e1ee8
Here is the windswath file for this run. windswath.zip