gmsh issueshttps://gitlab.onelab.info/gmsh/gmsh/-/issues2023-03-01T20:43:43Zhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2349GMSH C++ API is missing a variant of `getNodes` that would return node coordi...2023-03-01T20:43:43ZRomin TomasettiGMSH C++ API is missing a variant of `getNodes` that would return node coordinates based on a vector of tagsIf a user has a list of node tags, and wants to retrieve their coordinates, I think there is no straightforward way of doing it. For now, it seems a `for loop` querying `getNode` on the user side is needed. Moreover, `getNodes` does "unn...If a user has a list of node tags, and wants to retrieve their coordinates, I think there is no straightforward way of doing it. For now, it seems a `for loop` querying `getNode` on the user side is needed. Moreover, `getNodes` does "unnecessary" stuff in this case (such as returning the entity it belongs to, returning both parametric and normal coordinates, and so on).
Here is a code snippet.
```c++
/**
* Return the (parametric) coordinates of nodes.
*/
GMSH_API void gmsh::model::mesh::getNodesCoordinates(const std::vector<std::size_t>& nodeTags,
std::vector<double> &coords,
const bool parametric = false)
{
if(!_checkInit()) return;
const short ss = parametric ? 2 : 3;
coords.resize(ss * nodeTags.size());
for(size_t inode = 0; inode < nodeTags.size(); ++inode) {
const MVertex *v = GModel::current()->getMeshVertexByTag(nodeTags.at(inode));
if(!v) {
Msg::Error("Unknown node %d", nodeTag);
return;
}
if(!parametric) {
coord[inode * 3 + 0] = v->x();
coord[inode * 3 + 1] = v->y();
coord[inode * 3 + 2] = v->z();
} else {
double u;
if(v->getParameter(0, u)) parametricCoord.push_back(u);
if(v->getParameter(1, u)) parametricCoord.push_back(u);
}
}
}
```https://gitlab.onelab.info/gmsh/gmsh/-/issues/2348Issue with "AnalyseMeshQuality" -----> OSError: [WinError 541541187] Windows...2023-02-21T14:08:27ZLyndon AlcockIssue with "AnalyseMeshQuality" -----> OSError: [WinError 541541187] Windows Error 0x20474343I hve been trying to use the anaylse mesh quality plugin to calculte the Jacobians, however i find the plugins API very confusing, I found this example code in the API but it does not work on my computer:
https://gitlab.onelab.info/gmsh/...I hve been trying to use the anaylse mesh quality plugin to calculte the Jacobians, however i find the plugins API very confusing, I found this example code in the API but it does not work on my computer:
https://gitlab.onelab.info/gmsh/gmsh/blob/master/examples/api/mesh_quality.py
it throws the error
```
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_10260\182742548.py in <module>
16 gmsh.plugin.setNumber("AnalyseMeshQuality", "ICNMeasure", 1.)
17 gmsh.plugin.setNumber("AnalyseMeshQuality", "CreateView", 1.)
---> 18 t = gmsh.plugin.run("AnalyseMeshQuality")
19 dataType, tags, data, time, numComp = gmsh.view.getModelData(t, 0)
20 print('ICN for element {0} = {1}'.format(tags[0], data[0]))
~\.conda\envs\fbx_sdk\lib\site-packages\gmsh.py in run(name)
9706 api_result_ = lib.gmshPluginRun(
9707 c_char_p(name.encode()),
-> 9708 byref(ierr))
9709 if ierr.value != 0:
9710 raise Exception(logger.getLastError())
OSError: exception: access violation reading 0x000001CC1D00CA08
```
similarly this code:
```
gmsh.plugin.setNumber("AnalyseMeshQuality", "JacobianDeterminant", 1)
gmsh.plugin.setNumber("AnalyseMeshQuality", "DimensionOfElements", 2)
t = gmsh.plugin.run("AnalyseMeshQuality")
dataType, tags, data, time, numComp = gmsh.view.getModelData(t, 0)
```
thows the error
```
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_10260\4041457950.py in <module>
2 gmsh.plugin.setNumber("AnalyseMeshQuality", "DimensionOfElements", 2)
3 t = gmsh.plugin.run("AnalyseMeshQuality")
----> 4 dataType, tags, data, time, numComp = gmsh.view.getModelData(t, 0)
~\.conda\envs\fbx_sdk\lib\site-packages\gmsh.py in getModelData(tag, step)
9036 byref(api_time_),
9037 byref(api_numComponents_),
-> 9038 byref(ierr))
9039 if ierr.value != 0:
9040 raise Exception(logger.getLastError())
OSError: [WinError 541541187] Windows Error 0x20474343
```https://gitlab.onelab.info/gmsh/gmsh/-/issues/2342Getting error in creating 3D mesh from surface stl file2023-07-27T12:26:52ZDeepak GargGetting error in creating 3D mesh from surface stl fileHello,
I am trying to create a 3D mesh from a surface terrain STL file (terrain.stl in attachment). I am using the terrain_stl.py from examples/api (attached here with the name trial.py). I am experiencing the following error:
Warning ...Hello,
I am trying to create a 3D mesh from a surface terrain STL file (terrain.stl in attachment). I am using the terrain_stl.py from examples/api (attached here with the name trial.py). I am experiencing the following error:
Warning : Impossible to recover edge 13 13 (error tag -1)
Error : Unable to recover the edge 324797 (98/98) on curve 6 (on surface 7)
Warning : Aborted 2D meshing
How can I solve this error?
thank you in advance,
Deepak
[terrain.stl](/uploads/1425a24dd041d72c01a53383cc093319/terrain.stl)
[trial.py](/uploads/c50d0d63013e0733e33762c17e5b047f/trial.py)Christophe GeuzaineChristophe Geuzainehttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2341Boundary Layer Functionality2023-07-27T07:31:50ZRobert SarosiBoundary Layer FunctionalityHello,
I am trying to model the boundary layer in 2D over a fairly simple surface. Please correct me if I am wrong but from my understanding, the only way to change the number of layers in a prism mesh BL is only by changing total thick...Hello,
I am trying to model the boundary layer in 2D over a fairly simple surface. Please correct me if I am wrong but from my understanding, the only way to change the number of layers in a prism mesh BL is only by changing total thickness, size of first layer and ratio. Correct?
There is no way of enforcing a fixed number of layers and then for Gmsh to calculate the other parameters?
thank you in advancehttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2338Hope an example to generate mesh for cardiovascular2023-07-27T07:36:31Zqiang zhangHope an example to generate mesh for cardiovascularI find a paper: https://gmsh.info/doc/preprints/gmsh_bio2_preprint.pdf
It provide a mesh generation method for cardiovascular. But, I can not find the relative example. Where can I find the example?I find a paper: https://gmsh.info/doc/preprints/gmsh_bio2_preprint.pdf
It provide a mesh generation method for cardiovascular. But, I can not find the relative example. Where can I find the example?https://gitlab.onelab.info/gmsh/gmsh/-/issues/2336Testing gmsh routines2023-02-23T08:55:21ZMiguel Salazar de TroyaTesting gmsh routinesI have several routines using gmsh to generate specific parametrized geometries. I would like to include tests covering them to ensure I am not introducing any bugs when modifying them. What is the best approach to writing tests for gmsh...I have several routines using gmsh to generate specific parametrized geometries. I would like to include tests covering them to ensure I am not introducing any bugs when modifying them. What is the best approach to writing tests for gmsh routines? I have thought of storing the ".geo" files I trust in my repository and comparing the "geo" files generated by the tests against them. I am concerned that this approach is fragile because it involves comparing numbers with decimals. Do you have any other sugestion?
Edit: I just realized that for this approach to be successful, I need to save the options file. How can I save it from the python API?https://gitlab.onelab.info/gmsh/gmsh/-/issues/2334Bad connectivity2023-03-14T14:55:07ZMartin DavidBad connectivityHi all,
I try to mesh a downward facing step but I obtain bad connectivity errors in the preprocessor log. I do not succeed in removing those bad connections, may you help me? I provides all the files that can help below and I removed ...Hi all,
I try to mesh a downward facing step but I obtain bad connectivity errors in the preprocessor log. I do not succeed in removing those bad connections, may you help me? I provides all the files that can help below and I removed all the lines that can be removed to simplify the debugging.
My mesh that consists into 2 zones:
- the first one is made of structured hexa cells (meshed with the file DWFS.geo).
- the second one is the refinement zone and is made of tetra cells (meshed with a background field with the python API - maillage_auto_forum.py).
The four following files have to be placed in the same directory to make it works:
[DWFS.geo](/uploads/75c74fec3a3b0d319dc9977b3a831bff/DWFS.geo)
[maillage_auto_forum.py](/uploads/d457c4ec9071328ff47ec5badf647ac0/maillage_auto_forum.py)
[in.csv](/uploads/3ca15dc3864fe9416ed6bb43d9cbbe0d/in.csv)
[out.csv](/uploads/950e98cae1812baa02e4073f4bf3361d/out.csv)
The obtained error is detailed in the preprocessor.log:
[preprocessor.log](/uploads/d7b36512b4fc2b3d4d85c17ddf33de2d/preprocessor.log)
The setup file is given here:
[setup.xml](/uploads/4d587030fb3f34883a53696df6ce8820/setup.xml)
A view of the obtained mesh is given below.
![mesh_insight](/uploads/de53570d5244d765b7ea31e790632424/mesh_insight.png)
A visualization of the bad connectivity cells with Paraview is below. Note that several bad connections occur at the location (0,0,0).
![erreur_connectivite](/uploads/97bb275a64789399f60f289b720de17b/erreur_connectivite.png)
I already tried to change the 3D algorithms but as I have both tetra and hexa cells some of them do not work. The MMG3D permits avoiding the bad connectivity issues but it does not take into account my background field in the range `0<z<1`. Furthermore, it works with tetras and I prefer to have pyramids at the interface between the structured and the non structured regions to ensure the mesh conformity.
I also tried to modify the number of cells in the spanwise direction as well as the desired cell sizes in 2 regions but the bad connections remain.
Thanks a lot for your help,
Sincerelyhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2327How to force surface mesh in 3D on curved shapes2023-02-23T11:01:00ZSonja KaiserHow to force surface mesh in 3D on curved shapesHej dear gmsh people,
how can I adjust a surface mesh in 3D to lie e.g. on a cylinder mantle?
I tried quite some, e.g. with adding additional points, e.g. varying parameter d in the attached test file testSurface.geo and the option Usi...Hej dear gmsh people,
how can I adjust a surface mesh in 3D to lie e.g. on a cylinder mantle?
I tried quite some, e.g. with adding additional points, e.g. varying parameter d in the attached test file testSurface.geo and the option Using Point, but the results are not satisfying. Can you tell me the trick?
Thanks a lot,
Sonja
Original mesh issue figure:
![unwanted_curvature1](/uploads/c0c5de2d143dd6fd758796b186e5410a/unwanted_curvature1.png)
Test mesh issue figure:
![unwanted_curvature2](/uploads/f6b5c4fcf195cc3adef15b9cefc63ea8/unwanted_curvature2.png)
Test file:
[testSurface.geo](/uploads/06c1eb80f3264cdd7dee952e8e8ad563/testSurface.geo)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2322C++ API: add more flexibility to `getPhysicalGroups` and `getEntities`2023-03-09T07:35:51ZRomin TomasettiC++ API: add more flexibility to `getPhysicalGroups` and `getEntities`It would be nice that getters of the C++ API like `getPhysicalGroups` or `getEntities` could also return all objects *up to* a dimension at once, to avoid a user-side for loop over dimensions.
An embryo of the changes is available there...It would be nice that getters of the C++ API like `getPhysicalGroups` or `getEntities` could also return all objects *up to* a dimension at once, to avoid a user-side for loop over dimensions.
An embryo of the changes is available there:
* https://gitlab.onelab.info/romin.tomasetti/gmsh/-/commit/20856524917d17665f5de6f4e8b9511d2a883fc8https://gitlab.onelab.info/gmsh/gmsh/-/issues/2320Graphical interaction is very very slow on windows 11 with intel UHD7302023-09-05T11:28:48Zhui liuGraphical interaction is very very slow on windows 11 with intel UHD730Hello everyone,
I meet a problem with the graphic interaction using GUI.
On Windows 11 with only integrated graphics UHD730 (i3 12100 + UHD 730), if I run a small model on gmsh, the graphics interaction is instantaneous and very fast....Hello everyone,
I meet a problem with the graphic interaction using GUI.
On Windows 11 with only integrated graphics UHD730 (i3 12100 + UHD 730), if I run a small model on gmsh, the graphics interaction is instantaneous and very fast. But if I run a slightly larger model, the graphics interaction is very very slow on this PC, Clicking on graphics with the mouse responds very very slowly.
But if I run the same large model on a Macbook with a discrete graphics card (i7 9700H + AMD 5300M), the graphics interaction is very fast.
In addition, if I run the model on the PC and uncheck "points, curves, surfaces" in the geometry options, the speed of graphics interaction will increase. I don't know if it has something to do with the version of OpenGL. The version of OpenGL on my computer is 4.6.
I also have tried the stable version and development version of Gmsh. The problem still exists.
I want to know if this problem is related to my computer hardware. Is the problem caused by not having a discrete graphics card or another reason?
This is .geo file of the large model ( I think it is not very large...)
Could you have a look at this problem? Thank you in advance.
[900-fractures-3-well.geo](/uploads/fd3482b0a4af732632372bc4b11c5f99/900-fractures-3-well.geo)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2314Create SU2 Zones in GMSH2023-07-22T08:22:23ZAfshawn LotfiCreate SU2 Zones in GMSHIs it possible to create multiple SU2 zones in GMSH. Whenever I define a physical surface the SU2 export just labels the SU2 markers for that surface but not identifying a new SU2 zone.Is it possible to create multiple SU2 zones in GMSH. Whenever I define a physical surface the SU2 export just labels the SU2 markers for that surface but not identifying a new SU2 zone.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2313removePhysicalName suspected in bugged state after OCC removeAllDuplicates2023-02-08T11:01:02ZTyson JonesremovePhysicalName suspected in bugged state after OCC removeAllDuplicatesI may have encountered a suspected bug in `gmsh.model.removePhysicalName` of the Python API, whereby in certain conditions, it does *not* remove the specified name from the model. I _believe_ it occurs when `removePhysicalName(name)` is ...I may have encountered a suspected bug in `gmsh.model.removePhysicalName` of the Python API, whereby in certain conditions, it does *not* remove the specified name from the model. I _believe_ it occurs when `removePhysicalName(name)` is called after some OCC entities in the model have changed; but not necessarily those within the physical group with name `name`. This means subsequent calling of `setPhysicalName()` with the same `name` will "collide" and do nothing.
Consider the below straightforward convenience functions:
```Python
import gmsh
gmsh.initialize()
_FACTORY = gmsh.model.occ
def add_simple_polygon_to_mesh(xy, z, mesh_size):
if xy[-1] != xy[0]:
xy.append(xy[0])
point_tags = [_FACTORY.add_point(x,y,z, mesh_size) for x,y in xy]
line_tags = [_FACTORY.add_line(point_tags[i], point_tags[i+1]) for i in range(len(point_tags)-1)]
face_tag = _FACTORY.add_plane_surface([_FACTORY.add_curve_loop(line_tags)])
return face_tag
def extrude_simple_polygon(xy, z0, z1, mesh_size):
face_tag = add_simple_polygon_to_mesh(xy, z0, mesh_size)
object_tags = _FACTORY.extrude([(2,face_tag)], 0,0, z1-z0)
volume_tags = [obj for obj in object_tags if obj[0]==3]
_FACTORY.synchronize()
return volume_tags[0]
def make_group(tags, name):
group_tag = gmsh.model.addPhysicalGroup(3, [t[1] for t in tags])
gmsh.model.setPhysicalName(3, group_tag, name)
_FACTORY.synchronize()
def clear_groups():
print('[clearing groups]')
for dim, tag in gmsh.model.getPhysicalGroups():
name = gmsh.model.getPhysicalName(dim, tag)
gmsh.model.removePhysicalName(name)
gmsh.model.removePhysicalGroups()
def remake_groups(name_tag_map):
clear_groups()
print('[making groups]')
for name, tags in name_tag_map.items():
make_group(tags, name)
def print_all_entities_and_groups():
print("all volume entities:")
print('\t', [e for e in _FACTORY.getEntities() if e[0]==3])
print("all surface entities")
print('\t', [e for e in _FACTORY.getEntities() if e[0]==2])
print("known groups:")
groups = gmsh.model.getPhysicalGroups()
if len(groups) == 0:
print('\t(none)')
else:
for dim_tag in groups:
name = gmsh.model.getPhysicalName(*dim_tag)
print(dim_tag, f"name: '{name}'")
print('')
def make_conformal():
print("[removing duplicates]\n")
_FACTORY.removeAllDuplicates()
_FACTORY.synchronize()
```
As an example, we make four cuboids which overlap along their surfaces:
```Python
v1 = extrude_simple_polygon([(0,0), (0,1), (1,1), (1,0)], 0, 1, .1)
v2 = extrude_simple_polygon([(2,0), (2,1), (3,1), (3,0)], 0, 1, .1)
v3 = extrude_simple_polygon([(0,1), (0,2), (1,2), (1,1)], 0, 1, .1)
v4 = extrude_simple_polygon([(2,1), (2,2), (3,2), (3,1)], 0, 1, .1)
```
Consider the below verbatim code, which does _not_ demonstrate the bug, because the scene does not change between invocations of `remake_groups`:
```Python
remake_groups({'a':[v1, v2], 'b':[v3, v4]})
print_all_entities_and_groups()
# if below is uncommented...
# - subsequent group name clearing will fail(?)
# - ergo the above names will persist in the model
# - ergo the remade groups will name-collide and default to ''
# make_conformal()
remake_groups({'a':[v1, v2], 'b':[v3, v4]})
print_all_entities_and_groups()
```
Running the above prints:
```
[clearing groups]
[making groups]
all volume entities:
[(3, 1), (3, 2), (3, 3), (3, 4)]
all surface entities
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
known groups:
(3, 1) name: 'a'
(3, 2) name: 'b'
[clearing groups]
[making groups]
all volume entities:
[(3, 1), (3, 2), (3, 3), (3, 4)]
all surface entities
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
known groups:
(3, 3) name: 'a'
(3, 4) name: 'b'
```
However, we now uncomment `make_conformal()` in the above code and re-run. This invokes `gmsh.model.occ.removeAllDuplicates()` which deletes the overlapping shared surfaces of `v1`,`v2`,`v3`,`v4`, but should not change or remove the volume entities. Indeed, their tags are not changed. The code now outputs:
```Python
[clearing groups]
[making groups]
all volume entities:
[(3, 1), (3, 2), (3, 3), (3, 4)]
all surface entities
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
known groups:
(3, 1) name: 'a'
(3, 2) name: 'b'
[removing duplicates]
[clearing groups]
[making groups]
all volume entities:
[(3, 1), (3, 2), (3, 3), (3, 4)]
all surface entities
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
known groups:
(3, 3) name: ''
(3, 4) name: ''
```
We see the physical groups `(3,3)` and `(3,4)` have lost their names, erroneously.
The invocation of `removeAllDuplicates()` has meant that the subsequent calling of `setPhysicalName()` with names `a` and `b` (previously known to the model) has failed - and the remade groups have defaulted to names `''`. I suspect this is due to the `removePhysicalName` invocation preceding it failing.
This occurs with gmsh `4.11.0` in python `3.8.13` on Windows 11.https://gitlab.onelab.info/gmsh/gmsh/-/issues/2302Curve loop is not closed with overlapping lines2023-07-31T11:23:01ZEduardo BehrCurve loop is not closed with overlapping linesI'm trying to convert an SVG filled path into a mesh with the Python API.
The surface is defined in red exemplified on the first picture below.
The **second picture** has a simpler equivalent shape, which shows what I'm trying to accomp...I'm trying to convert an SVG filled path into a mesh with the Python API.
The surface is defined in red exemplified on the first picture below.
The **second picture** has a simpler equivalent shape, which shows what I'm trying to accomplish. It's basically a single line loop that encloses the surface area and goes in and out to make a triangular hole, causing an overlap of lines (lines 6 and 10).
When I try to make a curve loop, following exception occurs.
```
Error : Curve loop is not closed
Traceback (most recent call last):
File "~/Documents/Kicad_parsing/misc/test_zone_surface.py", line 99, in <module>
line_loop = kernel.add_curve_loop(lines_to_loop)
File "~/.local/lib/python3.10/site-packages/gmsh.py", line 6955, in addCurveLoop
raise Exception(logger.getLastError())
Exception: Curve loop is not closed
```
Is there a way to automatically accomplish the same effect in Gmsh as the SVG without deleting the overlapping lines?
If not, can someone give a suggestion to deal with those lines?
![image](/uploads/853186e09fdec8ab0f2b17462b77ea76/image.png)
![image](/uploads/dc238c6c33a4137f4446700229afbefa/image.png)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2299Non conformal mesh2023-02-07T11:02:43ZMartin DavidNon conformal meshHi,
I try to perform a computation of a downward facing step. The mesh is 3D and composed of structured hexa cells in most of the domain (Zone S) and I want to refine it in a given area (Zone R) with a background field (mesh with non s...Hi,
I try to perform a computation of a downward facing step. The mesh is 3D and composed of structured hexa cells in most of the domain (Zone S) and I want to refine it in a given area (Zone R) with a background field (mesh with non structured cells).
The obtained mesh is not conformal at the interface between the structured (S) and the transition (T) zones (see picture below). Is there any option that I can specify to ensure the conformity?
I use the python API. I tried to use the following option to ensure the conformity:
`gmsh.option.setNumber("Mesh.Recombine3DConformity",2)` but it does not work.
The picture gives a glimpse of the obtained mesh (only 2D edges are represented).
![non_conformal_mesh_interface](/uploads/76db59e3e04f1e6be91c75f73afb6f33/non_conformal_mesh_interface.png)
Thanks a lot for your helphttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2294Hex Dominant Meshing2023-01-29T17:30:44ZSvenHex Dominant MeshingHi everyone,
I know that automatic hex meshing is state of research, but I would still be interested if it is possible to create hex-dominant meshes with gmsh. Some interesting hex-dominant meshing methods on hextreme.eu seem to be impl...Hi everyone,
I know that automatic hex meshing is state of research, but I would still be interested if it is possible to create hex-dominant meshes with gmsh. Some interesting hex-dominant meshing methods on hextreme.eu seem to be implemented using gmsh. Are any of these methods published and usable in gmsh?
I have tried the following, but I get an error "Mesh is not conforming (1607 hanging faces)!" if I generate 3D elements.
```
import gmsh
gmsh.initialize()
opt = gmsh.option
model = gmsh.model
occ = model.occ
mesh = model.mesh
b = occ.addBox(-1, -1, -1, 2, 2, 2)
s = occ.addSphere(1, 1, 1, 1)
occ.cut([(3,b)], [(3,s)])
occ.synchronize()
opt.setNumber("Mesh.MeshSizeMax", 0.25)
opt.setNumber("Mesh.Algorithm", 9)
opt.setNumber("Mesh.Algorithm3D", 9)
opt.setNumber("Mesh.Optimize", 1)
opt.setNumber("Mesh.Recombine3DAll", 1)
opt.setNumber("Mesh.Smoothing", 1)
#mesh.generate(3)
gmsh.fltk.run()
gmsh.finalize()
```Jean-François RemacleJean-François Remaclehttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2293Python rendering crashes if pyvista previously used2023-02-01T17:49:03ZTyson JonesPython rendering crashes if pyvista previously usedIf a user's python program explicitly invokes `pyvista` plotting, then subsequent calling of `gmsh.fltk.run()` to render a scene or mesh will crash with error:
```python
File "gmsh.py", line 9825, in run
lib.gmshFltkRun(
OSError: ex...If a user's python program explicitly invokes `pyvista` plotting, then subsequent calling of `gmsh.fltk.run()` to render a scene or mesh will crash with error:
```python
File "gmsh.py", line 9825, in run
lib.gmshFltkRun(
OSError: exception: access violation reading 0x00000000000000B4
```
Here is a simple minimum working example:
```python
import pyvista
import gmsh
# draw something in pyvista
pt = pyvista.Plotter()
pt.add_mesh(pyvista.Cylinder())
pt.show()
# create gmsh scene
gmsh.initialize()
gmsh.model.occ.add_point(0,0,0)
# attempt to view; crashes
gmsh.fltk.run()
```
This code runs fine if `pt.show()` is excluded, but nothing else is changed (i.e. `pyvista.Plotter()` is still called).
This error occurs for me on Windows 11, Python 3.8.13, PyVista 0.37.0 (latest), and python gmsh 4.11.0.
I suspect it may be caused by gmsh using pyvista (or related sub-library) and attempting to reinitialise something already initialised, but I can't find the relevant code in this repo.
In my application, it is necessary to use pyvista directly for plotting 3D geometries, which are subsequently meshed and necessarily visualised with gmsh.
Thanks,
Tysonhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2292Errors with transfinite surface algorithm2023-01-26T22:08:59ZFrancesco Mario D'AfieroErrors with transfinite surface algorithmDear @geuzaine
I'm encountering the following error when trying to generate structured meshes with transfinite surface
The error I get is:
`Surface 5 cannot be meshed using the transfinite algo (divisions 18 != 18 or 38 != 18)`
but i...Dear @geuzaine
I'm encountering the following error when trying to generate structured meshes with transfinite surface
The error I get is:
`Surface 5 cannot be meshed using the transfinite algo (divisions 18 != 18 or 38 != 18)`
but if I adjust the number of point on that curve to match the divisions which are expected (i.e. 18 in both cases) the meshing process works fine and I correctly get a structured mesh. But this is not what I've intended to do, I want to specify the number of points on a transfinite curve myself, not being imposed by the algorithm.
I've noticed this is related to the meshsize constraint when I add points in the mesh, changing that constraint I get a different requirement in terms of divisions.
(Removing the meshsize constraint when adding a point did not solve the issue)
Any idea on how to solve?https://gitlab.onelab.info/gmsh/gmsh/-/issues/2290Best practice for generating conformal mesh of large CAD models2023-07-31T11:23:17ZDaniel KozmaBest practice for generating conformal mesh of large CAD modelsDear developers,
At first, thank you for developing this awesome mesh generator tool.
I'm trying to mesh large CAD models -- using the GMSH Python API -- to prepare STEP format models and perform calculations on the generated conformal...Dear developers,
At first, thank you for developing this awesome mesh generator tool.
I'm trying to mesh large CAD models -- using the GMSH Python API -- to prepare STEP format models and perform calculations on the generated conformal mesh. (At first with fixed mesh size.)
As I experienced, the most time-consuming step is ensuring model conformity with calling ```gmsh.model.occ.fragment``` function for the set of elements. (Omitting this function results in double layered surfaces in the generated mesh.)
Processing time is a problem, but given enough time a large model can be meshed, however, the size of memory seems a hard constraint (I have 16Gb Gb of RAM). So, I've managed to process small models only. Maybe extending virtual memory could overcome this limitation, but I think maybe this would not be the most appropriate way to solve the problem.
I wouldn't outsource my task, but it would be a big help if you could give me some hint and guideline what would be the best practice to process large models, e.g.:
- https://github.com/openmsr/are/blob/main/step_files/ARE_rods_20.step
- https://github.com/openmsr/zpre/blob/main/step_files/zpre.step
Thank you for your help in advance!
Best regards,
Danielhttps://gitlab.onelab.info/gmsh/gmsh/-/issues/2289Physical Group names not propagated during STEP file export2023-12-07T16:19:22ZGiannis NikiteasPhysical Group names not propagated during STEP file exportWhen exporting Physical Entities defined via the OCC kernel to a `STEP` file I am having trouble seeing the tagged surfaces with their given name. Instead, it seems that Gmsh uses the Elementary Entities (or a subgroup of them) and some ...When exporting Physical Entities defined via the OCC kernel to a `STEP` file I am having trouble seeing the tagged surfaces with their given name. Instead, it seems that Gmsh uses the Elementary Entities (or a subgroup of them) and some auto-generated name. Is that intentional, am I doing something wrong or is this a bug?
## MWE
```python
import gmsh
gmsh.initialize()
gmsh.model.add("MWE")
lc = 0.1
pts = []
pts.append(gmsh.model.occ.addPoint(0, 0, 0, meshSize=lc))
pts.append(gmsh.model.occ.addPoint(0, 1, 0, meshSize=lc))
pts.append(gmsh.model.occ.addPoint(1, 1, 0, meshSize=lc))
pts.append(gmsh.model.occ.addPoint(1, 0, 0, meshSize=lc))
pts.append(pts[0]) # make periodic
curve = gmsh.model.occ.addBSpline(pts)
curve_l = gmsh.model.occ.addCurveLoop([curve])
gmsh.model.occ.addPlaneSurface([curve_l])
gmsh.model.occ.synchronize()
for i, (dim, tag) in enumerate(gmsh.model.getEntities(2)):
gmsh.model.addPhysicalGroup(dim, [tag], name=f"Surf{i}")
gmsh.model.mesh.generate(2)
gmsh.write("labeled.stp")
# gmsh.fltk.run()
gmsh.finalize()
```
![image](/uploads/0628aa0bcb7bf9f5b362c8760a529bc5/image.png)https://gitlab.onelab.info/gmsh/gmsh/-/issues/2287Is there a way to click on a point on a mesh and read x,y,z co-ordinates?2023-07-27T12:35:14Zgaby pellIs there a way to click on a point on a mesh and read x,y,z co-ordinates?Is there a way to click on any point in a mesh and read off the corresponding co-ordinates?
I saw a solution on a forum where a view is created and MathEval plugin used to display the x,y,z at each point - but this is obviously not for...Is there a way to click on any point in a mesh and read off the corresponding co-ordinates?
I saw a solution on a forum where a view is created and MathEval plugin used to display the x,y,z at each point - but this is obviously not for large meshes.
So far, I have been using the clipping tool to find the coordinate of the slice in which the point lies, but this is not ideal.