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
{{ message }}
Repository navigation
Mesh converter uses the wrong law-of-cosines term for triangleAngleQuality #761
MpasMeshConverter.x has a typo in the law of cosines it uses for the angles of each dual triangle in buildMeshQualities(), so triangleAngleQuality is wrong and obtuseTriangle can be too.
angle1 and angle3 are correct. The legacy converter in mesh_conversion_tools/mpas_mesh_converter.cpp (line 2317) has the same line, but that version isn't built into the conda package.
The error goes away when b_len == c_len, so it doesn't show up on uniform planar hex meshes. On mesh_tools/mesh_conversion_tools/test/mesh.QU.1920km.151026.nc after MpasMeshConverter.x:
The stored triangleAngleQuality matches the formula with the typo, and it differs from the value with the correct formula at 204 of 320 vertices, by up to 0.07.
The three angles per triangle add up to between 3.037 and 3.227 instead of π.
obtuseTriangle (and the "Mesh contains: N obtuse triangles" count) uses the same maxAngle, so it can be wrong on meshes near 90°. It happens to be 0 either way on this mesh.
Activity