Questions tagged [gmsh]

60 questions
0
votes
0 answers

How can I set the gmsh mesh size using the python API?

I am using gmsh to generate tetrahedral meshes via a python script. In the current documentation, the setSize function to set the size of the mesh only supports entities of dimension 0 (e.g. points). Is there an alternative set of commands I can use…
Crook
  • 733
  • 1
  • 6
  • 9
0
votes
0 answers

gmsh get attribute python API

I am trying to use the method "get attribute" in Python to have information about the class of a certain gmsh entity. However, even though I follow the suggestion, a sintax error appears, as shown in Do you know the error?
0
votes
1 answer

Installing gmsh module in virtual enviroment python

I am using a virtual environment for my python code. I installed the gmsh module inside the folder project\venv\lib\site-packages, and apparently, it is done properly since when I create the "requirement.txt" it appears within the required modules.…
0
votes
1 answer

How to extrude along a spline in the gmsh python module? what is the syntax for it?

I am working on a research project where I need to create meshes of fiber models to test some stuff later. For that, I'm trying to make an extrusion along a spline in gmsh python module and I don't what is the syntax for that to write the code. Is…
Harsha 21
  • 1
  • 1
0
votes
0 answers

How to execute a gmsh mesh script from python + sudo

What are the common ways to execute a gmsh mesh script from a python spyder window? The only way I have found so far is the following, but I would like to know if some other possibilities might be: subprocess.call(['sudo', 'gmsh', 'script.py']) By…
OlM
  • 47
  • 5
0
votes
1 answer

Access mesh imported with gmsh

I think I have a very common problem. Can you help me out? I want to examine a 3D-mesh with python. I want to use trimesh in order to examine the mesh but the mesh comes with the .STEP Format. I use gmsh to load the mesh but I have no idea how I can…
VeryStoic
  • 1
  • 3
0
votes
1 answer

How do I find the element by coordinate in VTK?

I have a mesh file generate by Gmsh(*.vtu), the mesh is a cube area and consist of tetrahedrons. Then I have a point (given by coordinate) in the cube, I want to find which tetrahedron contains the point, how did I do? with pygmsh.occ.Geometry() as…
0
votes
1 answer

Write GMSH mesh as binary file with Python API

I am trying to use the Python API to Gmsh to generate a VTK mesh file in binary format. Here is a MnWE : import gmsh as g # Initialize gmsh: g.initialize() # square points: lc = 1e-2 point1 = g.model.geo.add_point(0, 0, 0, lc) point2 =…
Not a chance
  • 165
  • 9
0
votes
1 answer

Unable to use gmsh from Visual Studio C++

I downloaded the sdk and ran the Windows related commands described here. Then I created a new VC++ project and copied the contents of a tutorial file included with that sdk (t1.cpp). There were compile time errors, which I fixed by including the…
DKS
  • 188
  • 10
0
votes
1 answer

Using gmsh API in python messes with matplotlib latex

I have been struggling quite some time with this now, and I think I narrowed down the cause of the following problem: Using a virtual python 3.8 environment in Spyder through Anaconda, I was able to plot everything I wanted; extensive and complex…
0
votes
1 answer

Using GMSH python API to mesh a step file and save the resulting msh file to disk

I have a large number of step files from which I want to extract the mesh information using GMSH's python API. I am following this tutorial to load and manipulate a STEP file in the official documentation page of gmsh but it makes slices before…
Aman Savaria
  • 164
  • 1
  • 1
  • 11
0
votes
1 answer

How to keep Gmsh mesh in the bounding curves?

i am quite a beginner in Gmsh and am trying to create a mesh for hydrodynamic simulation from coastlines. I used splines for the complex coastline for simplicity, but the produced mesh crossed over the coastlines. What should i do to make the mesh…
0
votes
1 answer

Create an executable from Python code with gmsh import

I'm trying to package up my Python package into an executable using pyinstaller. The script name is called "run-jointbuilder.py" The package has a number of dependancies (such as numpy), but importantly gmsh. When using pyinstaller to compile my…
billda
  • 1
0
votes
1 answer

gmsh, how to generate serendipity elements

For Finite-Element simulations I need higher order meshes. For sake of efficiency I want to use serendipity elements, i.e. elements without interior nodes. The setOrder() function of gmsh was easy to find, it generates Lagrangian elements. How can I…
Dominik Kern
  • 146
  • 8
-1
votes
0 answers

Combining several 3D closed volumes into 1 closed volume using gmsh

enter image description here Hello Everyone, I am trying to combine these two closed 3D volumes into one closed volume using gmsh. They do not share edges. only the surfaces of the two volumes are touching. Could you please help me resolve the…
1 2 3
4