3

I need to produce simulation data for randomly generated cantilever beams, and save their maximum deflection given a load, and/or perform frequency-response analysis. To do this the body needs to be meshed as an FEM mesh. Hence, I would like to write a script that generates a mesh file (.msh) from that single-body .step file.

Desired Pipeline: Input: single-body .step file of a cantilever beam with an arbitrary cross-section Output: .msh file of the meshed body

avgJoe
  • 832
  • 7
  • 24
  • I found a way using . However, I realized that this is only half of my problem. Now I have to figure out how to automate the CalculiX analysis. – avgJoe Jul 01 '19 at 19:49

2 Answers2

1

See the solution below:

Merge "test.step";

Mesh.Algorithm3D = 1;
// 1=Delaunay, 4=Frontal, 5=Frontal Delaunay, 6=Frontal Hex, 7=MMG3D, 9=R-tree
// default = 1

//Mesh  2;  // surface
Mesh  3;  // volume

Mesh.Format = 2;
// 1=msh, 2=unv, 10=automatic, 19=vrml, 27=stl, 30=mesh, 31=bdf, 32=cgns, 33=med, 40=ply2
// default = 10

Mesh.SaveAll = 1;
// Ignore Physical definitions and save all elements

Save "mymesh.msh";
avgJoe
  • 832
  • 7
  • 24
0

Do not use gmsh for this.

Use the CalculiX pre- and postprocessor cgx to generate the geometry and the mesh. It can relatively easily generate second order hex elements which yield very good results with relatively few elements.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94