How to Export FreeCAD FEM Mesh to External Solvers

FreeCAD's Finite Element Method (FEM) Workbench allows users to model, mesh, and apply boundary conditions to physical designs before solving. While FreeCAD has built-in integration for solvers like CalculiX and Elmer, users often need to export either raw mesh data or full simulation decks to run in external software such as Abaqus, ANSYS, Nastran, or OpenFOAM. This guide outlines the exact steps to export standalone FEM meshes and complete analysis data files directly from FreeCAD.

Method 1: Exporting Standalone FEM Mesh Data

If you only need the discrete mesh nodes and elements without materials or constraints, you can export the mesh directly to common mesh exchange formats such as UNV, MED, VTK, or Abaqus INP.

  1. Switch to the FEM Workbench in FreeCAD.
  2. In the Tree View, select the generated mesh object (for example, FEMMeshGmsh or FEMMeshNetgen).
  3. Click on the top menu and select File > Export.
  4. In the file dialogue, click the Files of type dropdown and select your target format:
    • FEM mesh formats (*.unv, *.med, *.dat, *.inp): Ideal for Nastran, ANSYS, Abaqus, or Salome.
    • VTK format (*.vtk, *.vtu): Ideal for post-processors like ParaView.
  5. Enter a file name, choose your destination folder, and click Save.

Alternatively, you can select the mesh, go to the top menu, click FEM > Export FEM mesh to file, and select from the supported file filters.

Method 2: Exporting Complete Analysis Input Decks

When you need to export constraints, boundary conditions, loads, materials, and mesh definitions together, export the solver input file directly from the analysis container.

Exporting for CalculiX (.inp)

CalculiX input decks use standard Abaqus .inp syntax, making them compatible with CalculiX, Abaqus, and many third-party structural solvers.

  1. In the Tree View, expand the Analysis container.
  2. Double-click the SolverCalculiX object to open its task panel.
  3. In the task panel, locate the CalculiX Input File section.
  4. Click Write .inp file.
  5. FreeCAD writes the complete input deck to your active working directory. To change or locate the file, review the path displayed in the status window or modify the working directory under Edit > Preferences > FEM > General.
  6. You can also click Edit .inp file to view, edit, or copy the generated text deck directly within FreeCAD.

Exporting for Elmer (.sif and Mesh Directory)

Elmer requires a solver input file (case.sif) alongside a dedicated mesh directory containing node and element tables.

  1. Ensure the SolverElmer object exists inside your active Analysis container.
  2. Double-click the SolverElmer object in the Tree View to open the task panel.
  3. Click the Write button under the solver configuration.
  4. FreeCAD generates the Elmer mesh format (mesh.header, mesh.nodes, mesh.elements, mesh.boundary) and the corresponding .sif configuration file inside the designated FEM working directory.

Exporting for Z88

  1. Select the SolverZ88 object within your active Analysis container.
  2. Double-click the solver to display the control panel in the Combo View.
  3. Click Write to generate the Z88 input files (z88structure.txt, z88sets.txt) into the simulation working folder.

Best Practices for External Solver Export

  • Element Types: Ensure your target solver supports the element formulations created by FreeCAD. Second-order tetrahedral elements (C3D10) generated via Gmsh or Netgen generally transfer cleanly across .inp and .unv formats.
  • Unit Consistency: FreeCAD converts geometric dimensions to the internal units specified by the solver. Verify that mechanical units (such as MPa vs. Pa, or mm vs. m) match the expected input units of your external solver.
  • Working Directory Setup: Before exporting, set a permanent, accessible directory in Edit > Preferences > FEM > General > Working Directory to easily locate all automatically written decks and coordinate files.