gmsh issueshttps://gitlab.onelab.info/gmsh/gmsh/-/issues2024-03-19T02:12:58Zhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2846merge a STL surface with volumeric domain2024-03-19T02:12:58ZDuo Limerge a STL surface with volumeric domainHello GMSH,
I need some help with my model. I have a fault surface with curvature along both directions, which is in STL format. I first build a large box domain, and then merge this STL into GMSH, using gmsh.merge(stlFile). This STL sh...Hello GMSH,
I need some help with my model. I have a fault surface with curvature along both directions, which is in STL format. I first build a large box domain, and then merge this STL into GMSH, using gmsh.merge(stlFile). This STL should be an internal cut into the box. I am not sure how to do it. I used the following lines:
# Step 2: Load the STL surface file
gmsh.merge(stlFile)
gmsh.model.mesh.classifySurfaces(math.pi, curveAngle=math.pi)
# create a geometry for the discrete curves and surfaces
gmsh.model.mesh.createGeometry()
but I got error saying: Error : Wrong topology of boundary mesh for parametrization
for the createGeometry().
Any idea or suggestion would be appreciated:-)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2845Problem with getting normals with pré-created MSH file.2024-03-19T03:09:54ZPedro AugustoProblem with getting normals with pré-created MSH file.I'm trying to get normals at surface using getNormals, and inpired by 'x5.py' tutorial, i'm using gmsh.model.mesh.getNodes() to get the nodes parametric coordinates of each surface, but i'm getting an empty array for parametrics coordina...I'm trying to get normals at surface using getNormals, and inpired by 'x5.py' tutorial, i'm using gmsh.model.mesh.getNodes() to get the nodes parametric coordinates of each surface, but i'm getting an empty array for parametrics coordinates and therefore, getNormals() is returning another empty array. Here is a minimal code to replicate my issue:
```
import gmsh
gmsh.initialize()
gmsh.open('slab_3D.msh')
for e in gmsh.model.getEntities(2):
s = e[1]
tags, coord, param = gmsh.model.mesh.getNodes(2, s, True)
norm = gmsh.model.getNormal(s, param)
```
I'm attaching the .msh file i'm using. It is called 'slab_3D.msh' and it is a cube with 4 hexahedrons as elements.[slab_3D.msh](/uploads/6eb552ad0c57d92862275c0a79c264a6/slab_3D.msh)
What is causing this behavior? Do i need to use getNormals soon after i create my geometry and mesh?
Also, i'm create internal faces using another tutorial (x7.py) and i'm getting the same issue: parametric coordinates array is returned empty.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2844Retrieve the tags after fuse command2024-03-16T12:53:04ZGuido VallifuocoRetrieve the tags after fuse commandGood morning
through the process described in the following script, I do not get any outDimTagsMap from the fuse command. is there a method by which I can retrieve the tags of the child surfaces?
```python
# we have to obtain a wather...Good morning
through the process described in the following script, I do not get any outDimTagsMap from the fuse command. is there a method by which I can retrieve the tags of the child surfaces?
```python
# we have to obtain a wathertight volume
cut_map1, cut_map2 = gmsh.model.occ.cut(wings_volume_dimtags, fuselage_volume_dimtags, -1, True,False)
gmsh.model.occ.synchronize()
children_map3, children_map4 = gmsh.model.occ.fuse(wings_volume_dimtags, fuselage_volume_dimtags, -1, True, True)
gmsh.model.occ.synchronize()
```
if I used surfaces instead of volumes could anything change?https://gitlab.onelab.info/gmsh/gmsh/-/issues/2843Missing labels in conda-forge gmsh UI installation2024-03-14T21:00:59ZDavid NippaMissing labels in conda-forge gmsh UI installationI’m trying to run an instance of the gmsh graphical user interface installed from the conda-forge channel. The problem is textual information is not being printed in the main graphics window. For example, the x, y, z coordinate axis la...I’m trying to run an instance of the gmsh graphical user interface installed from the conda-forge channel. The problem is textual information is not being printed in the main graphics window. For example, the x, y, z coordinate axis labels do not appear. In addition, information such as point, surface labels do not appear in the graphics window when enabled in Tools/Options/Geometry. Another clue is that the menu and other text appears to have a different (thinner) font style than usual. I’m using gmsh in a Docker container running Ubuntu 20.04 with the libfltk1.3-dev installed. The gmsh installation from pypi.org works fine in the same environment.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2842[API] Access entity parametrization when reading a .msh2024-03-18T07:23:58ZMaxime Bouyges[API] Access entity parametrization when reading a .mshHi,
When using the (python or julia) API to build a mesh, I can access the parametrization of the current model entities (`gmsh.model.getValue` etc) and everything works fine. However, when reading a `.msh` file (containing the `Entitie...Hi,
When using the (python or julia) API to build a mesh, I can access the parametrization of the current model entities (`gmsh.model.getValue` etc) and everything works fine. However, when reading a `.msh` file (containing the `Entities` block), the function `gmsh.model.getValue` doesn't return the expected results. Is this expected? Am I doing something wrong? Here is a MWE.
In julia:
```julia
# Step 1: build cad/mesh
gmsh.initialize()
gmsh.model.add("mwe")
A = gmsh.model.geo.addPoint(1.0, 0.0, 0.0)
B = gmsh.model.geo.addPoint(0.0, 1.0, 0.0)
O = gmsh.model.geo.addPoint(0.0, 0, 0.0)
AOB = gmsh.model.geo.addCircleArc(A, O, B)
gmsh.model.geo.synchronize()
@show gmsh.model.getValue(1, AOB, [0.0]) # -> [1.0, 0.0, 0.0]
@show gmsh.model.getValue(1, AOB, [1.0]) # -> [6.123233995736766e-17, 1.0, 0.0]
gmsh.model.mesh.generate(1)
gmsh.write("mesh.msh")
gmsh.finalize()
# Step 2: read cad/mesh
gmsh.initialize()
gmsh.open("mesh.msh")
entities = gmsh.model.getEntities(1)
_, AOB = entities[1]
@show gmsh.model.getValue(1, AOB, [0.0]) # -> [0.0, 0.0, 0.0]
@show gmsh.model.getValue(1, AOB, [1.0]) # -> [0.0, 0.0, 0.0]
gmsh.finalize()
```
In python:
```python
# Step 1: build cad/mesh
gmsh.initialize()
gmsh.model.add("mwe")
A = gmsh.model.geo.addPoint(1.0, 0.0, 0.0)
B = gmsh.model.geo.addPoint(0.0, 1.0, 0.0)
O = gmsh.model.geo.addPoint(0.0, 0, 0.0)
AOB = gmsh.model.geo.addCircleArc(A, O, B)
gmsh.model.geo.synchronize()
print(gmsh.model.getValue(1, AOB, [0.0])) # -> [1. 0. 0.]
print(gmsh.model.getValue(1, AOB, [1.0])) # -> [6.123234e-17 1.000000e+00 0.000000e+00]
gmsh.model.mesh.generate(1)
gmsh.write("mesh.msh")
gmsh.finalize()
# Step 2: read cad/mesh
gmsh.initialize()
gmsh.open("mesh.msh")
entities = gmsh.model.getEntities(1)
_, AOB = entities[0]
print(gmsh.model.getValue(1, AOB, [0.0])) # -> [0. 0. 0.]
print(gmsh.model.getValue(1, AOB, [1.0])) # -> [0. 0. 0.]
gmsh.finalize()
```https://gitlab.onelab.info/gmsh/gmsh/-/issues/2841Periodic Mesh: Impossible to mesh periodic surface 22024-03-15T08:03:09ZRaffael CasagrandePeriodic Mesh: Impossible to mesh periodic surface 2I try to create a mesh with the following .geo file:
```
SetFactory("OpenCASCADE");
Torus(1) = {0, -0, 0, 0.5, 0.2, 2*Pi};
// Create slice of cake:
Point(10) = {0,0,-2.5,1};
Point(11) = {5,0,-2.5,1};
Point(12) = {5/Sqrt(2),5/Sqrt(2),-2....I try to create a mesh with the following .geo file:
```
SetFactory("OpenCASCADE");
Torus(1) = {0, -0, 0, 0.5, 0.2, 2*Pi};
// Create slice of cake:
Point(10) = {0,0,-2.5,1};
Point(11) = {5,0,-2.5,1};
Point(12) = {5/Sqrt(2),5/Sqrt(2),-2.5,1};
Line(3) = {11, 10};
Line(4) = {10, 12};
Circle(5) = {11, 10, 12};
Curve Loop(2) = {5, -4, -3};
Plane Surface(2) = {2};
Extrude {0, 0, 5} {
Surface{2};
}
BooleanIntersection{ Volume{2}; Delete;}{ Volume{1}; Delete; }
a = 1./Sqrt(2);
Periodic Surface {3} = {1} Affine {a,-a,0,0, a,a,0,0, 0,0,1,0, 0,0,0,1};
```
I tried the `Automatic`, `Delauny` and `Frontal-Delauny Algorithm`, but I always get the error "Impossible to mesh periodic surface 2" plus a few more errors.
Any ideas?https://gitlab.onelab.info/gmsh/gmsh/-/issues/28403D meshing problem2024-03-12T22:00:10ZGiovanni Pedicini3D meshing problemI cannot understand why I have obtained this error ![Screenshot_2024-03-12_alle_22.47.58](/uploads/c64cfec4344078df40199c1c87c92d3c/Screenshot_2024-03-12_alle_22.47.58.png)
I attached the file[prova.geo](/uploads/200b9e02540d51ff543ca869...I cannot understand why I have obtained this error ![Screenshot_2024-03-12_alle_22.47.58](/uploads/c64cfec4344078df40199c1c87c92d3c/Screenshot_2024-03-12_alle_22.47.58.png)
I attached the file[prova.geo](/uploads/200b9e02540d51ff543ca869b75624da/prova.geo)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2839independent meshes from the same file2024-03-14T16:13:28ZAndrea Vigliottiindependent meshes from the same fileI have a volume with _matrix_ material with some _inclusions_. Since they have very different typical length and properties I would like to have two separate meshes with very different mesh size and later deal with the interpolation betw...I have a volume with _matrix_ material with some _inclusions_. Since they have very different typical length and properties I would like to have two separate meshes with very different mesh size and later deal with the interpolation between the nodes that lie on the same surface on common boundaries.
One way to do that would be to have two separate script that produce the same model, one will mesh and produce an input file for the _matrix_ only, the other for the _inclusions_ only, and be careful about assigning labels to the surfaces in order to be able to match the nodes ion the two models that lie on common surfaces
I was wondering if there is a way to do this in one go, from the same model produce different meshes for different regions each with its own nodes on the same surface, belonging to the same set
this will also make it very easy to deal with numbering of the nodes and the elements,
thanks,
Andreahttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2838Projection of geometric pattern onto a curved surface2024-03-13T15:02:52ZAxel ThomasProjection of geometric pattern onto a curved surfaceHello everyone,
I would like to project a sensor pattern (to keep it simple let's just take a circle) onto the surface of a cylinder, see figure below. I'm trying to find out how to do this using the Gmsh Python API. As soon as I change...Hello everyone,
I would like to project a sensor pattern (to keep it simple let's just take a circle) onto the surface of a cylinder, see figure below. I'm trying to find out how to do this using the Gmsh Python API. As soon as I change the position of the points along the z axis (as shown in the following code), I can't no longer create a circleArc. How can I get round this problem? Should I use splines? The final purpose is to add the sensor to the cylinder surface, not just to project point.
Thanks in advance,
Axel
```
gmsh.model.occ.synchronize()
points = gmsh.model.getEntities(0)
coords = []
[coords.append(gmsh.model.getValue(dim, tag, parametricCoord=[])) for dim, tag in points]
coords = np.array(coords)
phi = abs(sensor_position[0] - coords[:, 0]) / cylinder_radius
z = cylinder_radius * np.cos(phi)
[self._set_coordinates(dim, tag, (coords[idx, 0], coords[idx, 1], z[idx])) for idx, (dim, tag) in enumerate(points)]
gmsh.model.occ.synchronize()
def _set_coordinates(self, dim, tag, new_coords):
gmsh.model.occ.remove(dimTags=[(dim, tag)])
gmsh.model.occ.addPoint(x=new_coords[0], y=new_coords[1], z=new_coords[2], tag=tag)
```
![cylinderwithprojectedcircle.png](/uploads/b83a1ec22626c854a2444c0e4deb6032/cylinderwithprojectedcircle.png)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2837Relation between mesh size and number of node points2024-03-14T14:52:26ZKleiton SchneiderRelation between mesh size and number of node points
Whats is the relation between the number of node points of the mesh and the characteristic size mesh? I use setSizeCallBack. I would like to build a unstructured Tetrahedral mesh, for example, with 500.000 nodes, then a mesh of 1.000.00...
Whats is the relation between the number of node points of the mesh and the characteristic size mesh? I use setSizeCallBack. I would like to build a unstructured Tetrahedral mesh, for example, with 500.000 nodes, then a mesh of 1.000.000 nodes.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2836How to mesh several parts and export them in one mesh file2024-03-14T15:28:21ZJohannes ACKVAHow to mesh several parts and export them in one mesh filehello,
i wonder how to mesh several parts and export them in ONE mesh file.
I would like to create them in several models, thus
gmsh.model.add("model_1")
..
gmsh.model.add("model_2")
..
but when i export with
gmsh.write('trial_mesh.med')...hello,
i wonder how to mesh several parts and export them in ONE mesh file.
I would like to create them in several models, thus
gmsh.model.add("model_1")
..
gmsh.model.add("model_2")
..
but when i export with
gmsh.write('trial_mesh.med')
only the mesh of the actual model is exported.
What must i do in addition?
thank you
Johannes_ACKVAhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2835Ho to use convertToNURBS2024-03-12T16:34:59ZAndrea VigliottiHo to use convertToNURBSHi,
since rel 4.9.4 it is available the function convertToNURBS, but the manual does not mention how to use it and what it does return (or I couldn't find it)
in my application I have several objects, some of them I will mesh with tetr...Hi,
since rel 4.9.4 it is available the function convertToNURBS, but the manual does not mention how to use it and what it does return (or I couldn't find it)
in my application I have several objects, some of them I will mesh with tetrahedra, others I would like to treat differently and it would helpful if I could get their NURBS representation, possibly one per each object,
is there any place in documentation where I could find this information?
I tried to make a sphere, convert to NURBS, and export to STEP, but the STEP file represent it as follows
`#22 = SPHERICAL_SURFACE('',#23,1.);`
and not as a NURBS (I would expect a set of bsplines objects and coefficients)
many thanks in advance, Andreahttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2834Extracting connectivities of the reference element2024-03-14T13:51:32ZIgor KuszczakExtracting connectivities of the reference elementHello,
I am trying to recreate the `basix.cell.sub_entity_connectivity` functionality from `fenics-basix` in Gmsh. The function returns the connectivities of a reference element type. Is this possible to using Gmsh Python API? I imagine ...Hello,
I am trying to recreate the `basix.cell.sub_entity_connectivity` functionality from `fenics-basix` in Gmsh. The function returns the connectivities of a reference element type. Is this possible to using Gmsh Python API? I imagine that this could be hardcoded quite easily too but I don't understand the convention used for face numbering.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2833Polar Extrusion2024-03-15T12:00:30ZAxel ThomasPolar ExtrusionHi,
I have a question about geometry extrusion. I have a cylindrical surface on which I would like to add particular patterns (representing sensors) and then like to form a 3D hexahedral mesh from this geometry. Is it possible to extrud...Hi,
I have a question about geometry extrusion. I have a cylindrical surface on which I would like to add particular patterns (representing sensors) and then like to form a 3D hexahedral mesh from this geometry. Is it possible to extrude 2D geometry in the (r, theta) plane?
Thanks in advance,
Axel
![pipe_with_embeded_sensor\_.png](/uploads/9a2e28fe4a653bd7d87589d398cd6b67/pipe_with_embeded_sensor_.png)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2832Commands are recognized in Printf strings2024-03-12T07:31:04ZMatthias LangCommands are recognized in Printf stringsThe keyword "If" in a printf string is recognized as a command. For example run the following code lines in gmsh as \*.geo file:
```
///////////////////////////////////////////////////////////
If ( 1 ) //\<-- change this value to 0 and...The keyword "If" in a printf string is recognized as a command. For example run the following code lines in gmsh as \*.geo file:
```
///////////////////////////////////////////////////////////
If ( 1 ) //\<-- change this value to 0 and enjoy
Printf("if the condition above is not fulfilled...");
Printf("this -\> If \<- will create an error message: Unexpected end of file");
Printf("By the way: --\> if \<-- is innocent");
Printf("But you can easily fix this by uncomment the following line:");
//Printf("EndIf");
Else
Printf("This is the best bug I have ever seen :-)");
EndIf
//////////////////////////////////////////////////////////////////
```
The If Else condition is messed up only, if the first condition above is NOT fulfilled (tricky)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2831Intel-based Mac - MPICH - linking fails for libgmsh.dylib, missing _ompi_mpi_...2024-03-11T20:21:34ZTidbit SoftwareIntel-based Mac - MPICH - linking fails for libgmsh.dylib, missing _ompi_mpi_* symbolsI've successfully compiled/configured Gmsh for a number of platforms. I updated today from version 4.10.5 to 4.12.2. I am compiling on an Intel-based Mac running the latest version of macOS, using MPICH as provided by PETSc. Everything c...I've successfully compiled/configured Gmsh for a number of platforms. I updated today from version 4.10.5 to 4.12.2. I am compiling on an Intel-based Mac running the latest version of macOS, using MPICH as provided by PETSc. Everything compiles, but at linktime I get,
```
[ 94%] Linking CXX shared library libgmsh.dylib
ld: warning: -commons use_dylibs is no longer supported, using error treatment instead
Undefined symbols for architecture x86_64:
"_ompi_mpi_char", referenced from:
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
GmshRemote() in GmshRemote.cpp.o
...
```
and so on for many `_opmi` symbols. At configure time, MPICH libs and binaries were found, OpenMPI was not (which is expected, and good). I assume there's some section in the configuration that's broken, causing a conditional that makes GmshRemote.cpp use the OpenMPI implementation in every case or by mistake (given that MPICH was detected). I haven't started digging yet, but thought it was worth a bug report anyhow.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2830Facets are overlapping(python)2024-03-06T11:26:35ZJOHN PSYCHFacets are overlapping(python)I tried to 3D mesh the goemtry but the following error occurs:
"Invalid boundary mesh (overlapping facets) on surface 8 surface 8"
I tried to use "coherence" as explained in other issues but it didn't work.
[Kelvin_cell_one_body_v2.txt]...I tried to 3D mesh the goemtry but the following error occurs:
"Invalid boundary mesh (overlapping facets) on surface 8 surface 8"
I tried to use "coherence" as explained in other issues but it didn't work.
[Kelvin_cell_one_body_v2.txt](/uploads/9e2082cd9b422ca6ce50d52473f9fd59/Kelvin_cell_one_body_v2.txt)
```
import gmsh
import sys
gmsh.initialize()
gmsh.open("c:\GMSH\Kelvin_cell_one_body v[Kelvin_cell_one_body_v2.txt]
gmsh.model.geo.synchronize()
# Generate mesh:
gmsh.model.mesh.generate(3)
gmsh.model.coherence
# Write mesh data:
gmsh.write("GFG.msh")
gmsh.model.geo.synchronize()
gmsh.model.coherence()
gmsh.fltk.run()
gmsh.finalize()
```https://gitlab.onelab.info/gmsh/gmsh/-/issues/2829FUSE with no overlap (CPP API)2024-03-04T08:28:33ZLars NielsenFUSE with no overlap (CPP API)# GMSH FUSE
Dear GMSH board
I have a task which I would like to solve using gmsh and the cpp API. I have two volumes and I would like to union them and use the output from the stl-file. For this I use the FUSE command. When there is an...# GMSH FUSE
Dear GMSH board
I have a task which I would like to solve using gmsh and the cpp API. I have two volumes and I would like to union them and use the output from the stl-file. For this I use the FUSE command. When there is an overlap between the two volumes the cpp routine works fine. When the two volumes share a surface, my stl-file is empty. Can you help me making the union when the two volumes share a surface?
I have made two boxes and a FUSE in the GUI and that works fine. What am I doing wrong when using the API?
I have uploaded an example.
[Test.cpp](/uploads/2d433a1868b94dae44e74a87c2824781/Test.cpp)
Kind regards N_Bohrhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/28283D Boundary Layer intersects itself2024-03-12T14:47:48ZOle Albers3D Boundary Layer intersects itselfHi, I'm trying to create a 3D Boundary Layer for an aircraft in a farfield.
But when the Boundary Layer is to thick, I get an Error meshing them im 3D (PLC Error: A segment and a facet intersect at point). In the Fltk it looks like this...Hi, I'm trying to create a 3D Boundary Layer for an aircraft in a farfield.
But when the Boundary Layer is to thick, I get an Error meshing them im 3D (PLC Error: A segment and a facet intersect at point). In the Fltk it looks like this happens where the wing and fuselage intersect and the Boundary Layer extrusion intersects itself.
I create the Boundary Layer like in the naca_boundary_layer_3d.py (#2812 (different aircraft this time))
In my case, when I choose 1e-6 as the thickness of the first layer I'll get the Error, when I chose 1e-7 I won't.
I attached both meshes in 2D. Is there anything I can do to prevent this from happening when meshing them 3D?
[BoundaryLayer_1e-6.msh](/uploads/1a2cc2785ce399c3cc8edff32cdf0a97/BoundaryLayer_1e-6.msh)
[BoundaryLayer_1e-7.msh](/uploads/c7fa477f8e723bb1c2901708f1cb3db9/BoundaryLayer_1e-7.msh)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2827How to reset curve transfinition to default state in gmshApi.2024-03-01T10:53:42ZAlex HillHow to reset curve transfinition to default state in gmshApi.Hello dear Christophe and community. Can I reset the number of points on a curve to its default state? For example, I called gmshModelMeshSetTransfiniteCurve with a number of points of 20, can I reset the curve with gmsh automatically se...Hello dear Christophe and community. Can I reset the number of points on a curve to its default state? For example, I called gmshModelMeshSetTransfiniteCurve with a number of points of 20, can I reset the curve with gmsh automatically selecting the number of points? I tried calling gmshModelMeshSetTransfiniteAutomatic, but it seems to me that it only works for surfaces, after calling gmshGenerate I get the same number of points.