-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FacetBasis outward normal vectors are false #1158
Comments
Is it fixed by 10.0.1 bugfix or a different issue? |
This is the release from few days ago: [10.0.1] - 2024-08-06 Fixed: Mesh.load returned incorrect orientation for some Gmsh meshes with tagged interfaces |
Before this is solved, in this case the workaround is the following: mesh = MeshTri.load('Anneau01.msh', ignore_orientation=True) which avoids the orientation of the boundaries according to the Gmsh logic. There is another logic in native scikit-fem meshes which assures that on exterior boundaries normal vector is always correct. |
Thanks, |
Yes, it seems that The value of the variable is inferred incorrectly while reading your example mesh, and I will need to study in detail why this happens. There was a clear bug in |
I have not been able to find Gmsh documentation on the topic of normal vectors so I am just finding many of these so-called "conventions" related to the orientation of normal vectors by trial-and-error. |
Alright, I think there is actually no remaining bug in |
Thanks for the report, this has been fixed in #1159. The fix will be included in the next release. |
Hello
I am new user, and I began with 8.1 version, I encountered the following issue.
FacetBasis didn't work well since upgrading to 10.0.0-3, the outward normal vectors at boundary are sometimes false.
Here an example in order to show this issue, using an annular domain, there are 2 boundaries 'Int' and 'Ext'.
In G_Vh normal vectors are OK on two boundary 'Int' and 'Ext'
In Gm_Vh normal vectors are OK on boundary 'Ext'
In Gu_Vh normal vectors are not OK on boundary 'Int', this could be shown on the figure only two vectors are given on the circular boundary (red points) and in Gu_Vh.normals.value there are only two normal vectors.
array([[[ 0.89926879, 0.89926879],
[-0.89926879, -0.89926879],
........
[ 0.89926879, 0.89926879],
[-0.89926879, -0.89926879]],
Here attached the mesh file created with gmsh
Anneau01.zip
import os
print(os.environ['PATH'])
from pathlib import Path
import numpy as np
from skfem import *
from skfem.helpers import dot, grad
from skfem.io import from_meshio
import matplotlib.pyplot as plt
mesh = Mesh.load('Anneau01.msh')
element = ElementTriP1()
Vh = Basis(mesh, element)
G_Vh = FacetBasis(mesh, element)
Gm_Vh = FacetBasis(mesh, element, facets=mesh.boundaries['Ext'])
Gu_Vh = FacetBasis(mesh, element, facets=mesh.boundaries['Int'])
plt.figure(1)
plt.plot(G_Vh.normals.value[0],G_Vh.normals.value[1],'',color='blue')
plt.plot(Gm_Vh.normals.value[0],Gm_Vh.normals.value[1],'',color='green')
plt.plot(Gu_Vh.normals.value[0],Gu_Vh.normals.value[1],'*',color='red')
plt.show()
The text was updated successfully, but these errors were encountered: