1. Open a New document, Use attached marco to make a triangle with Face. Its name in mode tree is Shape. Save it. I saved it as d:/cfdtest/aFace.FCstd
2. Switch to FEA WB, click A icon to active FEA tool
3. Click to select Shape in mode tree, Mesh tool is activated.
4. Cick Mesh tool (the one using gmsh) . On the mesh window, click Apply to mesh. Click OK to close.
5. In Edit/Preferences/FEA/General, I ticked 'Beside .FCStd file, so I can see my mesh saved at d:/cfdtest/aFace/FEMMeshGmsh. It is called Shape_mesh.UNV. I could convert it to Elmer's mesh format with Elmergrid.exe under win 10. the command in terminal is
Code: Select all
elmergrid 8 2 Shape_mesh.UNV
Code: Select all
// save
Mesh.Format = 2;
// Ignore Physical definitions and save all elements;
Mesh.SaveAll = 1;
Save "D:/CFDtest/aFace\FEMMeshGmsh\Shape_Mesh.unv";
Code: Select all
// save
Mesh.Format = 1;
// Ignore Physical definitions and save all elements;
Mesh.SaveAll = 1;
Save "D:/CFDtest/aFace\FEMMeshGmsh\Shape_Mesh.msh";
Code: Select all
elmergrid 14 2 Shape_mesh.msh
Regards,
John
Code: Select all
from FreeCAD import Base
import Part
V1=Base.Vector(0,0,0)
V2=Base.Vector(300,0,0)
V3=Base.Vector(150,150,0)
L1=Part.LineSegment(V1,V2)
L2=Part.LineSegment(V2,V3)
L3=Part.LineSegment(V3,V1)
S=Part.Shape([L1,L2,L3])
W=Part.Wire(S.Edges)
F=Part.Face(W)
Part.show(F)