What mesh generation software do you use?

Mesh generators, CAD programs, and other tools

What mesh generation software do you use with Elmer?

ElmerGUI (netgen or tetgen plugins)
12
9%
Gmsh
61
44%
Netgen
13
9%
ElmerGrid (native .grd format)
11
8%
GiD
1
1%
Ansys
3
2%
Gambit
0
No votes
Comsol Multiphysics
2
1%
Salome
29
21%
Something else (please specify)
7
5%
 
Total votes: 139

kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: What mesh generation software do you use?

Post by kevinarden »

I renumbered starting from 1 instead of 0. There is a junk line at the bottom of the poly file I deleted.
ElmerGrid did not throw any errors but did not write a mesh file.

I modified a copy of ElmerGrid and deleted the entire section that reads the poly file.
The modified ElmerGrid did write out an elmer mesh, but with no boundary elements, just triangles.
ElmerGUI crashed (core dump) when trying to load this mesh.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: What mesh generation software do you use?

Post by kevinarden »

I forgot to change the node indices in the element file when I renumber the nodes. The mesh converted and loaded into GUI with no defined boundary elements. GUI made 1 boundary when imported.
converted.png
(175.96 KiB) Not downloaded yet
mesh.zip
(280.72 KiB) Downloaded 48 times
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: What mesh generation software do you use?

Post by Rich_B »

There is a slightly newer version of Triangle here:

https://github.com/wo80/Triangle

It doesn't seem to help with the conversion from poly to elmer mesh.

BTW, the Triangle help text says
Vertices, segments, holes, and regions must be numbered consecutively, starting from one or zero. (The choice to begin the numbering from one or zero must be consistent across all objects.)
Also, regarding the junk line at the end of the file which is this:
# -pPq33.000000eAazQIj
The help text says
Blank lines and comments prefixed by `#' may be placed anywhere.
so the last line is a comment and should be ignored.

Rich.
gforti
Posts: 71
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: What mesh generation software do you use?

Post by gforti »

I got my to sort of work. But needed to rewrite the indexes.
Still, the body properties were not read properly.

Still going.
Last edited by gforti on 08 Mar 2023, 20:33, edited 1 time in total.
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: What mesh generation software do you use?

Post by Rich_B »

Hello,

Turns out the newer Triangle from 2018 can't handle zero based numbering.

Using the original Triangle and converting trafo_aniso_lin.poly to trafo_aniso_lin.1 works. The changes to Elmergrid worked, and Elmergrid successfully converted trafo_aniso_lin.1 to an Elmer mesh, with 3 boundaries.

See attached.

Rich.
trafo.png
trafo.png (248.55 KiB) Viewed 975 times
Attachments
trafo_mesh.zip
(46.87 KiB) Downloaded 40 times
trafo_1.zip
(49.88 KiB) Downloaded 40 times
gforti
Posts: 71
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: What mesh generation software do you use?

Post by gforti »

Just to clarify, I wanted to use Elmer fem from femm simulations (which has a kind of simple way of creating geometry and mesh).
This is intended to be used for undergrad teaching.

femm does not keep the mesh files but these can be retrieved with xfemm (https://sourceforge.net/p/xfemm/wiki/Home/)

I`ve attached the *.fem file (simpler, for testing purposes).

generating the files:

Code: Select all

fmesher --write-poly teste.fem
I`ve refined the mesh with:
triangle -rcD teste

Than, i moved the first element (0 index) to the final position and renumbered it (and where it is used). Also, I used the poly file.

Other thing. FEMM also generates a .edge file.
Attachments
Capture.PNG
(205.86 KiB) Not downloaded yet
teste.zip
(718 Bytes) Downloaded 52 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: What mesh generation software do you use?

Post by raback »

Hi

So is there still issue with poly file?

The edge files probably just includes all the edges of the mesh. This is not needed in Elmer since it can find the edges by itself.

-Peter
gforti
Posts: 71
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: What mesh generation software do you use?

Post by gforti »

Thing is that FEMM uses poly as a geometry file only.
*.edge -> has info about boundary conditions
*.ele -> has info about bodies
*.node -> also has boundary conditions.
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: What mesh generation software do you use?

Post by Rich_B »

Hello,

Can you post an example poly file that generates the .edge file?

Thanks, Rich.
gforti
Posts: 71
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: What mesh generation software do you use?

Post by gforti »

The model here is the simplest.
What I could figure by the files. The attached files are the ones extracted from FEMM directly. If you refine the mesh, it changes everything.

.poly file show the draw nodes, segments and attributes (material)
here:
36 nodes (but there are duplicates, e.g. 0 0.5 4 / 12 0.50175 4. Nodes 0 a 12.
36 lines, also duplicated.
3 materials.

.node show the nodes in the boundary:
0 0.5 4 -2 (-2 here is the boundary)

.ele show the bodies, three in this example. This is indicate by the value in the last column

.edge show the mesh edges and identifies the boundary too
0 3 17 -2 (-2 here is the boundary)
Attachments
Capture.PNG
Capture.PNG (15.16 KiB) Viewed 907 times
linux.zip
(213.47 KiB) Downloaded 50 times
Post Reply