Can GH import or export FEA mesh (abaqus, lsdyna...)? The meshing function of GH is so good, even better than traditional meshing code

I have been doing FEA for many years and now I find GH is such a good tool for meshing!! It’s even better than traditional meshing tools (ICEM, Hypermesh…)
However, it seems GH can’t import or export FEA mesh directly yet, that’s really a pity thing.
Is there any plug-in for this function?

Thanks!

To be more accurate: just for 2D or shell mesh.
GH now can’t handle 3d mesh.

If you bake the GH mesh into Rhino and then save the Rhino file as .obj, does that solve your problem?

// Rolf

Hi Rolf, thank you for your kind reply.
Until now, I can’t find any way to directly import obj. files into FEA codes.

What formats are supported by your FEA software?

After baking to Rhino you can save (or “Export”) the geometry to any of the output formats supported by Rhino.

// Rolf

You can just write the mesh to a text file which is then executed by the FEA (Ansys, etc.). All you need is to run the FEA programm in batch mode. Else Ansys for example can import .sat Files. For Abaqus you could test COMPAS.

Just out of curiosity, which quad mesher in Grasshopper are you using to generate high quality meshes, which are better (and more robust) than what the FE mesher produces?

Hi Rolf,
Many geometry files are supported by FEA software, however, I need mesh files (the information is simply nodes and elements) created by Rhino/GH.

Which mesh formats?

Rhino supports more formats than .obj.

// Rolf

Thank you for your reply and suggestion, dsonntag!

I have checked the export option of Rhino, however, I can’t find any text file can be mesh file. Could you please provide me more information?
I checked Compas. That’s interesting! I will try it.

As for your question, I tried to generate the shell mesh for vessel bifurcation model using WB (with the help of T-spline), which is so good and fast. However, I can’t export them for FEA use…

Thank you again!

Hi Rolf, thank you for reply.

For example, ABAQUS needs .inp file, and ls-dyna needs .k file. If you want, I can provide some file examples.

If my *.inp are the same as your file it will be quite simple to transform a mesh to inp
#Fichier
#Laurent
3 2 1 0 0
1 0 0 0
2 10 0 10
3 20 0 10
1 1 line 1 2
2 1 line 2 3
1 1
temps, s
1 0
2 2
3 4

Firt line is the count of point, then connectivity, then data on points
there are line, tri, quad …
https://people.sc.fsu.edu/~jburkardt/data/ucd/ucd.html

And from what I remember Paraview can open inp/ucd file
https://www.paraview.org

Hi Laurent, thank you for your reply. abaqus inp files is like this (for nodes and elements)
*NODE
575216, -11.33493 , -0.821534 , 0.65379
575217, -11.34682 , -0.833982 , 0.653576
575218, -11.35477 , -0.84863 , 0.658241
575219, -11.35642 , -0.789054 , 0.692643
575220, -11.37063 , -0.797897 , 0.697171
575221, -11.38011 , -0.809838 , 0.705418
*ELEMENT,TYPE=CPS3,ELSET=example
1, 575217, 575216, 575219
2, 575220, 575217, 575219
3, 575221, 575218, 575220
4, 575218, 575217, 575220
you mean I can use a code to write rhino information as inp file style?

You’ll probably need to cook something yourself in order to make a file for your specific FEA tool and give it the mesh information in the way it’s expecting. Otherwise, most FEA distributions have a way to import mesh files on their own.

You can have a look at this Grasshopper definition I had made to link up to Ansys. https://github.com/louislbnc/ghAnsys I was also calling Ansys and doing the data viz in GH so it may be way overly complicated for what you’re trying to accomplish.

The deconstruct mesh component should have pretty much all you need: a list of vertices and the list of vertices that make up each face.

Thank you, Louis!
I have seen your work for ansys connection, that’s nice!
Thus what I should do now is to write a script to export vertices and the faces according to abaqus’ style, right?

Something like this:

if (!run)
  return;

System.Text.StringBuilder output = new System.Text.StringBuilder();

// Write nodes
output.Append("*NODE \r\n");

for(int i = 0; i < mesh.Vertices.Count; i++)
{
  Point3d vertex = mesh.Vertices[i];
  output.AppendFormat("{0:0}, {1:0.00000}, {2:0.00000}, {3:0.00000} \r\n",
    i + 1, vertex.X, vertex.Y, vertex.Z);
}

// Write elements
output.Append("*ELEMENT,TYPE = CPS3,ELSET = example \r\n");
for (int f = 0; f < mesh.Faces.Count; f++)
{
  var face = mesh.Faces[f];
  output.AppendFormat("{0:0}, {1:0}, {2:0}, {3:0} \r\n",
    f + 1, face.A + 1, face.B + 1, face.C + 1);
}

using (System.IO.StreamWriter sw = new System.IO.StreamWriter(@"D:\test_abaqus.txt", false))
{
  sw.Write(output.ToString());
}

Guess it needs some finetuning for the numbering, and to catch cases with triangles/quads.

Thank you so much, dsonntag!
It is a C# script, right?
I am afraid I don’t know how to use it. The same way as GHpython?
Thanks again!

Yeah, but you can also do the same in a python component. Don’t know exactly which methods there are useful to write textfiles, but the concept should be similar.

Got it, thanks again!
Have a nice weekend!