Questions tagged [gmsh]

60 questions
2
votes
2 answers

How to load and inspect a gmsh mesh (*.msh file)

I want to programmatically inspect *.msh files (get a number of nodes and elements, possibly also edges and faces). How can I do this with either gmsh or pygmsh module? All tutorials I have found so far focus mostly on mesh generation. I can not…
abukaj
  • 2,582
  • 1
  • 22
  • 45
2
votes
1 answer

python - Can't use gmsh after installing via pip and conda

I installed gmsh but I can not use it in spyder. I used the following: pip install gmsh conda install -c conda-forge gmsh but when I run the following code: import gmsh gmsh.initialize() I get the following error: No module named 'gmsh' I'm using…
2
votes
1 answer

How to extract the normal vectors at the boundary nodes in gmsh?

I have a geo file for gmsh and mesh it. Then I would like to extract the normal vectors at the nodes of a selected surface. How is this possible? Below is my gmsh geo file. //Construct a cube in GMSH //Build a line Point(1) = {0, 0, 0,…
Marc Frei
  • 21
  • 2
1
vote
1 answer

Combine two extruded volumes where one has a hole

I have tried to combine two volumes where one has a cylindrical hole. Both volumes were extruded from a surface. I'm using pygmsh and the code looks like this: import pygmsh L = 3 W = 3 c1 = [W/2, L/2, 0] r = 0.075 resolution1 = 0.11 resolution2…
Bodo Lipp
  • 21
  • 3
1
vote
0 answers

Extrude profile along path in GMSH

I have this gmsh script to create a spiral and a cross-sectional profile: SetFactory("OpenCASCADE"); // Profile Dimensions l = 0.005; angle = 5; dx = Atan(angle*Pi/180)*l; // Mesh Point(1) = {-l/2, -l/2, 0, 1.0}; Point(2) = {l/2, -l/2, 0,…
user20995624
1
vote
0 answers

Is there a python GMSH function that can transform a 2.2 .msh file to a 4.1 .msh file?

Because of the software used in my project, I would need to 'translate' a GMSH .msh file generated in version 2.2 into a version 4.1 .msh file using the Python GMSH library. I tried merging the 2.2 msh file into a gmsh model, then setting the…
Kajitrim
  • 19
  • 4
1
vote
1 answer

Gmsh structured mesh (Hexahedron mesh) gets imported in unstructured way (tetrahedron) into Itasca PFC software using Fipy

I'm trying to import a 3D cylindrical CFD mesh into Itasca PFC7-3D software from Gmsh using Fipy. The mesh created in Gmsh environment is fully structured(hexahedron cells). However when I tried to import the mesh into Itasca I realized it is…
1
vote
1 answer

Why Gmsh create more surfaces than expected when I use "gmhs.model.occ.cut()" command?

I am trying to create a volume in Gmsh (using Python API) by cutting some small cylinders from a bigger one. When I do that, I expect to have one surface for each cutted region, instead, I get the result in the figure. I have highlighted in red the…
Rbocce
  • 15
  • 3
1
vote
1 answer

Finite Element Analysis with Gridap.jl; how to define external forces?

I'm following this tutorial in order to try and do an FEA of a model.msh that I have to see how it would deform given different external forces in different places. There they define the weak form as a(u,v) = ∫( ε(v) ⊙ (σ∘ε(u)) )*dΩ l(v) = 0 and…
guin0x
  • 337
  • 2
  • 10
1
vote
1 answer

How can I optimize mesh in gmsh? (for the intersection between entities)

I have a geometry composed of four walls, a slab, and beams. geometry image: I am using gmsh for meshing it, starting from a step file. I would like to know how to guarantee the continuity between elements in the area of the next figure. I am using…
1
vote
1 answer

ubuntu linux gmsh gives "sh: 1: python: not found" error

I try to run a Gmsh python script from the command line (or from PyCharm or Spyder) gmsh script.py but I get the following error: sh: 1: python: not found also in the Gmsh console there is this error: Done - 1 error : Abnormal server termination…
OlM
  • 47
  • 5
1
vote
1 answer

How to make a diffusion from the center of the circle to the edge on gmsh? [python]

I am trying to simulate the diffusion of a nutrient in a tumor as a function of space and time on python using the gmsh tool. So I need the initial concentration to be in the center, then diffusivity to spread it outward. Here is the complete code,…
1
vote
1 answer

Problem when importing a mesh with Gmsh3D in Fipy

I am trying to import to Fipy a 3D mesh previously generated with Gmsh using the Gmsh3D function, like this: mesh = Gmsh3D(join(output,'case_1.msh'),communicator=serialComm) I get the same error as other similar posts, but the proposed solutions do…
1
vote
3 answers

How to ensure node points in gmsh?

I am trying to build a quite simple mesh. I have a box: box_size = 50; lb = 10.; Point(1) = {-box_size/2, -box_size/2, -box_size/2, lb}; Point(2) = {box_size/2, -box_size/2, -box_size/2, lb}; Point(3) = {box_size/2, box_size/2, -box_size/2,…
Julius
  • 735
  • 2
  • 6
  • 17
0
votes
0 answers

pygmsh mesh from paths with orientations

I'd like to take multiple paths, and using pygmsh, convert them using their orientations to a mesh. I'm testing with these paths: path1 = [[-2, 0], [-2, 2], [2, 2], [2, 0], [-2, 0]] path2 = [[-1.5,0.5], [1.5,0.5], [1.5,1.5], [-1.5,1.5],…
1
2 3 4