lutraconsulting / MDAL

Mesh Data Abstraction Library
http://www.mdal.xyz/
MIT License
160 stars 50 forks source link

Support 2DM's E6T element (triangle with 6 nodes) #218

Closed Brent-Edwards closed 3 years ago

Brent-Edwards commented 4 years ago

I tried to create the simplest possible example for test purposes - see http://forum.aquaveo.com/topic/3426-working-example-of-a-2dm-mesh-file-with-e6t-elements-six-node-quadratic-triangles/

Unfortunately, I haven't received any responses from the SMS forum.

In QGIS, the file seems to read fine, but doesn't render: image

Crayfish exports the nodes, but produces an empty (nodata) raster and empty polygon for the face (expression used to create the "wkt" virtual field - geom_to_wkt( $geometry) ) : image

QGIS version info:

QGIS version
3.10.2-A Coruña
QGIS code revision
d4cd3cfe5a
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
3.0.3
Running against GDAL/OGR
3.0.3
Compiled against GEOS
3.8.0-CAPI-1.13.1
Running against GEOS
3.8.0-CAPI-1.13.1 
Compiled against SQLite
3.29.0
Running against SQLite
3.29.0
PostgreSQL Client Version
11.5
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
6.3.0
Running against PROJ
Rel. 6.3.0, January 1st, 2020
OS Version
Windows 10 (10.0)
Active python plugins
changeDataSource; 
crayfish; 
gmsh; 
latlontools; 
Mergin; 
mmqgis; 
profiletool; 
QMetaTiles; 
quick_map_services; 
shapetools; 
splitmultipart; 
SVG2ColoR; 
timemanager; 
valuetool; 
VectorMCDA; 
VoGisProfilTool; 
db_manager; 
MetaSearch; 
processing
wonder-sk commented 4 years ago

MDAL currently does not support E6T elements. Only E3T and E4Q elements are supported.

I am unable to download the 2DM file with E6T elements attached in that forum thread, so it is difficult how hard it would be to support it...

Brent-Edwards commented 4 years ago

MDAL currently does not support E6T elements. Only E3T and E4Q elements are supported.

I am unable to download the 2DM file with E6T elements attached in that forum thread, so it is difficult how hard it would be to support it...

Ok, thanks for the info regarding the 2DM element types that are supported. Is this documented?

Here's the sample E6T file (I added .txt to the extension to bypass the github attachment restrictions): test_2dm_e6t_single_element.2dm.txt

PeterPetrik commented 4 years ago

we can add E6T element quite easily to the supported elements, but question is that why you would need it? I understand that you tried to create and example of your own, do you have some test case where you need to use it instead of E3T?

Brent-Edwards commented 4 years ago

we can add E6T element quite easily to the supported elements, but question is that why you would need it? I understand that you tried to create and example of your own, do you have some test case where you need to use it instead of E3T?

I am a neophyte when it comes to finite element meshes and analysis. In my use case E6T elements are used in models that require quadratic elements to model non linear relationships ex. flow velocity, friction etc. The extra nodes are used to better estimate the interpolated surface for the aforementioned non linear variables.

PeterPetrik commented 4 years ago

Do you have testcases @Brent-Edwards also with E8Q and E9Q nodes?

PeterPetrik commented 4 years ago

As we do not have any real-world examples of such files and for example it is not 100% clear what is the order of the intermediate nodes (e.g. for E9Q, which node is in centre, or for E6T, which nodes are in the middle and which on vertices?), we will start implementation when we have such data.

Also for E6T/E8Q elements, the ear clipping algorithm in QGIS would produce not optimal triangular mesh, since ideally we should use method for triangulation with the extra node in the triangle centre.

Brent-Edwards commented 4 years ago

Do you have testcases @Brent-Edwards also with E8Q and E9Q nodes?

No, I only have examples of files with E6T elements.

Brent-Edwards commented 4 years ago

As we do not have any real-world examples of such files and for example it is not 100% clear what is the order of the intermediate nodes (e.g. for E9Q, which node is in centre, or for E6T, which nodes are in the middle and which on vertices?), we will start implementation when we have such data.

Also for E6T/E8Q elements, the ear clipping algorithm in QGIS would produce not optimal triangular mesh, since ideally we should use method for triangulation with the extra node in the triangle centre.

Could you please clarify? E6T elements do not have nodes in the center of the triangle. They are composed of six nodes: 3 for the vertices of the triangle and 3 "extra" nodes at the midpoints of the three edges. The nodal indices of the element are ordered counterclockwise starting at a corner node.

Is the "won't fix" relative to E8Q/E9Q support or does it also include E6T?

Please let me know what information would be required to implement support for E6T elements.

PeterPetrik commented 4 years ago

Do you have a complete example of the e6t file, which means a few hundred triangles , plus a dataset with data on this mesh? (all less < 3MB)

Brent-Edwards commented 4 years ago

Do you have a complete example of the e6t file, which means a few hundred triangles , plus a dataset with data on this mesh? (all less < 3MB)

I should be able to put something together next week. MDAL for the win!

Brent-Edwards commented 4 years ago

UPDATE - I finally got a response to my post on the SMS forum regarding 2DM E6T structure - forum.aquaveo.com/topic/3426-working-example-of-a-2dm-mesh-file-with-e6t-elements-six-node-quadratic-triangles/?tab=comments#comment-9636.

Please find the attached sample file from the SMS forum post.

Testgrid.2dm.txt