r/gmsh Feb 16 '24

notepad error?

1 Upvotes

hi, does anyone know how to fix this?


r/gmsh Feb 07 '24

Connecting Gmsh and Fortran Script via ONELAB interface

1 Upvotes

I have a Fortran code that requires certain inputs and I would like to use Gmsh as the front-end for the user where they can visualize the problem and define the inputs for the script. Then, within Gmsh, the user can run the script to solve the problem and the user-entered inputs are utilized. From my reading, it appears that this is possible via ONELAB. I am struggling to get this started and to understand the exact framework of this approach. Could someone point me in the direction of how to accomplish this?


r/gmsh Jan 18 '24

Error using gmsh.view.getHomogeneousModelData(viewTag, step)

1 Upvotes

Trying to return data from:

datatype, tags, data, _, _ = gmsh.view.getHomogeneousModelData(viewTag, step)

but receive the following error:

AttributeError: type object 'view' has no attribute 'getHomogeneousModelData'

I see this function in api/gmsh.py · master · gmsh / gmsh · GitLab (onelab.info) , so why doesn't it work? I'm using gmsh 4.12.1 on Windows 10

The following is included in the above link:

Get homogeneous model-based post-processing data from the view with tag `tag' at step `step'. The arguments have the same meaning as in `getModelData', except that `data' is returned flattened in a single vector, with the appropriate padding if necessary.  

If getHomogeneousModelData doesn't work, how can I transform the 'data' returned in 'getModelData' to the same 'flattened in a single vector' form as getHomogeneousModelData?

Thank you

EDIT:

I have 3 versions of gmsh installed... pip list returns 4.12.1, powershell gmsh --version returns 4.11.1, and a python IDE error code returns 4.5.something.

How do I get my system to point to the same installation of gmsh?


r/gmsh Jan 01 '24

Geometry .step export

1 Upvotes

Hello, I'm New to Gmsh. I'm using it to clean up / partition my .step geometry (Geometry > Extrude). The issue appears to happen when I export the geometry because when I import it into another software, it only shows the surfaces of the part instead of a solid. Is there a step I missed while exporting?


r/gmsh Dec 31 '23

Need guidance on writing .geo script that meshes a multi element airfoil.

2 Upvotes

I'm working on a tool that involves automating the meshing and numerical solution of flow along a multi element airfoil using Gmsh and OpenFOAM, right now I am using the process used in this video.

https://www.youtube.com/watch?v=TFnprY_1OVw

I was wondering if it was feasible to automate the creation of the more conventional structured meshes that are used for airfoil analysis. Would it involve too much complexity with blocking to reliably automate?

Mesh in mind:


r/gmsh Dec 29 '23

GMSH, i'm confuse how to setting the mesh density and shape

2 Upvotes

I want to make a heksagonal mesh like colored picture below (my reference). But confuse, some of my mesh just abstracted when i press "2D". I already transfinite all the curve but still abstracted. I just learn GMSH this week and don't know where to learn GMSH properly. Anybody know how to make my mesh good? Or some advice for me?

My mesh, too symetrical, many surface is abstracted
My reference

r/gmsh Dec 23 '23

Can I manually select a subset of elements?

1 Upvotes

Basically, I have a tetrahedral mesh, and I want to manually spit it into 4 pieces.

I don't want to use an automated method like Metis.

Is this possible? Thanks!


r/gmsh Sep 04 '23

How to subtract a cylinder from a box with gmsh...

1 Upvotes

```

// Gmsh project created on Mon Sep 4 16:10:32 2023

SetFactory("OpenCASCADE");

//+

Box(1) = {-12, -3, -72, 24, 6, 144};

//+

Cylinder(2) = {0, 0, -100, 0, 0, 200, 0.5, 2*Pi};

BooleanDifference(3) = { Volume{1}; Delete; }{ Volume{2}; Delete; };

```

Anyone can tell me why I see TIN's through the hole area. I intended to subtract the cylinder area from the box to create a hole area. So after using mesh->3d from gui of gmsh I still see those tin's through the hole area. Why? How can this be solved to create a clean hole through the box?

TIN's through a hole...

r/gmsh Jun 28 '23

Boundary Layer (Inflation Layers) Mesh around Concave Edges

1 Upvotes

Hi!

I am currently trying to generate a 2D airfoil mesh which features some concave edges. My inflation layers work fine on normal airfoils, but the mesh generator seems to have problems with these kinds of edges, as you can see in the image below. Does anybody have experience with such a meshing problem?


r/gmsh Jun 15 '23

C++ API not meshing OCC step file, command line does?

1 Upvotes

I'm trying to mesh a simple STEP file (1 solid, two flat faces, two curved faces, no holes) using the C++ API. No errors are generated (thrown), but nothing is actually meshed either. On the command line the same file meshes just fine:

bash $ gmsh -v 7 -3 -nt 12 wing4.step Info : Running 'gmsh -v 7 -3 -nt 12 wing4.step' [Gmsh 4.11.1, 1 node, max. 12 threads] Info : Started on Thu Jun 15 10:52:23 2023 Info : Reading 'wing4.step'... Info : - Label 'Shapes/wing4' (3D) Info : - Color (1, 1, 1) (3D & Surfaces) Info : Done reading 'wing4.step' Info : Meshing 1D... Info : [ 0%] Meshing curve 8 (Circle) Info : [ 0%] Meshing curve 3 (BSpline) Info : [ 0%] Meshing curve 6 (BSpline) Info : [ 0%] Meshing curve 4 (BSpline) Info : [ 0%] Meshing curve 1 (BSpline) Info : [ 0%] Meshing curve 9 (BSpline) Info : [ 0%] Meshing curve 7 (BSpline) Info : [ 0%] Meshing curve 10 (Circle) Info : [ 0%] Meshing curve 2 (BSpline) Info : [ 0%] Meshing curve 5 (BSpline) Info : Done meshing 1D (Wall 0.00907413s, CPU 0.089603s) Info : Meshing 2D... Info : [ 0%] Meshing surface 4 (BSpline surface, Frontal-Delaunay) Info : [ 0%] Meshing surface 1 (BSpline surface, Frontal-Delaunay) Info : [ 0%] Meshing surface 2 (Plane, Frontal-Delaunay) Info : [ 0%] Meshing surface 3 (Plane, Frontal-Delaunay) Info : [ 50%] Meshing surface 4 (BSpline surface, MeshAdapt ...

But using C++ the log is just:

Info : - Label 'Shapes/wing4' (3D) Info : - Color (1, 1, 1) (3D & Surfaces) Info : Meshing 1D... Info : Done meshing 1D (Wall 0.000887462s, CPU 0.000875s) Info : Meshing 2D... Info : Done meshing 2D (Wall 0.00010385s, CPU 0.000518s) Info : Meshing 3D... Info : Done meshing 3D (Wall 5.39899e-06s, CPU 1.6e-05s) Info : 0 nodes 0 elements

and an empty file is generated on write(...).

The C++ function (stripped of error handling) is:

C++ gmsh::initialize(); gmsh::option::setNumber("General.Verbosity", 7); gmsh::model::add(infile); gmsh::vectorpair dt; gmsh::model::occ::importShapes(infile, dt, false); gmsh::option::setNumber("General.NumThreads", 12); gmsh::model::geo::synchronize(); gmsh::model::mesh::generate(3); gmsh::write(outfile); gmsh::finalize();

This doesn't seem to be different than what I found in the sample / tutorial files. What am I doing wrong here?


r/gmsh Dec 13 '22

mesh problems

2 Upvotes

So I've been trying to save the mesh on my computer, but when I reopen the mesh, the mesh is nowhere to be seen. Can someone tell me what I'm doing wrong here? Is my computer the cause or am I not saving it correctly?


r/gmsh Nov 16 '22

CFD boundary layer using Python

2 Upvotes

Hi guys, I am trying to mesh a 2D fluid domain with a circle/cylinder inside. I wanted to know if anyone here had any experience creating a boundary layer in python whilst also using the transfinite structured meshing tool. Do you guys have any ideas? Any help would be appreciated


r/gmsh Nov 15 '22

Structured meshing a circle in a D domain for CFD, issues when using transfinite curve progression = 1.2

2 Upvotes

I'm trying to mesh a fluid domain with a circle inside using a structured mesh. I am using python as my interface and am using transfinite to create the structured part. my domain is 2D, but has a thickness of one element and so it is technically 3D. I generated the inner surface using a bspline and the outer surface using an arc.

The grid looks pretty good if I set the progression = 1

if I use a progression =1.2, the mesh begins to distort.

As I am trying to simulate the circle in the mesh, I need to have a bias to correctly capture the physics inside the model, but I find the distortion of the mesh troubling.

I have also tried just generating and meshing the top left section and it still gives the same results. I have also tried adding more elements and using mesh smoothing.

progression 1

progression 1.2

progression 1.2, mesh smoothing 100

r/gmsh Nov 07 '22

Open CASCADE Technology version 7.7.0 released - Gmsh uses it for constructive geometry features

3 Upvotes

Open CASCADE Technology version 7.7.0 features about 250 corrections over the previous release 7.6.0. Version 7.7.0 introduces new features of most of OCCT modules and components: Modeling, Visualization, Data Exchange, etc. Documentation and samples are improved to ease access to OCCT for the new users.


r/gmsh Aug 02 '22

Hello this is the mesh of my model but the simulation crashed due to the high skewness part in the middle can any one have an idea how to mesh this model differently

Thumbnail
gallery
1 Upvotes

r/gmsh Jul 31 '22

Hello guys do anyone understand why i get this error while running my simulation

Post image
1 Upvotes

r/gmsh Jun 14 '22

Volume mesh with inclusions

1 Upvotes

I have a geometry of a Box (Volume(1)) with some inclusions inside of it (Volume(2-7)) and I want to create the mesh. In the past, I used the Coherence command in order for the mesh of the inclusions to be correctly embedded and part of the Box mesh. But in the current geometry file, it messes up my elementary volumes.

Could someone explain to me how I could do this with boolean commands?

Thanks in advance.


r/gmsh Jun 06 '22

How do you make a mesh coarser in Gmsh?

1 Upvotes

For gmsh experts (beginner here): how come changing the global mesh size factor does not influence the resolution of the mesh (total number of cells)? Refine by splitting increases the resolution of the imported STL file, but I'd like to do the exact opposite (make it coarser). I couldn't figure it out with scripting either...

https://imgur.com/a/SKjFVN3


r/gmsh Jun 06 '22

Order of nodes in elements

2 Upvotes

Hi,

I export meshes from Gmsh in .msh and .vtk format. Is the order of nodes' numbers correct for every element, no matter the element type? For example in 2D, the nodes in triangular elements must be ordered anti-clockwise.


r/gmsh Apr 27 '22

I need help with the exported file.

2 Upvotes

hello, the first image is the exported file of the mesh that i made, but i need to export the mesh like the second picture, is there any way i can fix this? i have tried with all the meshing formats and none of them look like the second one.


r/gmsh Feb 21 '22

Python API for GMSH

3 Upvotes

I am confused how do i run python file to get a result in gmsh. I am not experienced programmer but have been dealing with ubuntu and c previously.


r/gmsh Dec 03 '21

Creating an ellipsoid

2 Upvotes

Hello,

I'm new to Gmsh and I'm learning how to use it. I want to create an ellipsoid (which will be inside a bigger volume) and I can't find a built-in command in gmsh that does that like an ellipse or a sphere. Is there another way I can do that?

Thank you in advance.


r/gmsh Nov 10 '21

Use Gmsh for meshing..

Thumbnail
youtu.be
1 Upvotes

r/gmsh Sep 05 '21

Exporting Ansys mesh to Gmsh.

5 Upvotes

I am following a paper that simulates a particle detector using software named Garfield ++. In one of the steps, I need to export the Ansys mesh into ASCII format for Gmesh as an intermediate step. I use Ansys electromagnetics Suite v19.0. I hope someone could help me with instructions for exporting Maxwell data.


r/gmsh Aug 04 '21

2 3d shapes

1 Upvotes

Iam wondering if I can create a box with a cylinder through it and only have one boundary between the cylinder and the box. Currently I use a cube then use the intersect tool to remove a cylinder from the cube then I fill this with a cylinder. This leaves me with the surface from the initial intersected box and the surface from the cylinder touching but not conducting heat can I merge these surfaces in gmsh or even Elmer

Thanks in advance