-
Notifications
You must be signed in to change notification settings - Fork 53
Workflow ‐ FreeCAD Geometry to t8code mesh
The integration of FreeCAD geometries with t8code facilitates the transition from CAD modeling to mesh generation and mesh management for various computational applications. This article outlines a systematic workflow for utilizing FreeCAD-generated geometries within t8code. Example files for the presented workflow can be viewed and tested here: https://github.com/DLR-AMR/t8data/tree/main/freecad_to_t8code.
1. CAD Modeling in FreeCAD
Begin by creating the desired geometry using FreeCAD's comprehensive CAD tools. Ensure that each distinct volume within the geometry is represented by a separate body within the FreeCAD project file (.FCStd).
2. Selection and Export
With the geometry adequately modeled, select all bodies that collectively form the final geometry. Hold the 'Ctrl' key while selecting to choose multiple bodies simultaneously. Once the desired bodies are selected, export them as a single geometry file in BREP format (.brep). This can typically be done through the 'File' menu in FreeCAD.
3. Mesh Generation with Gmsh
Utilize Gmsh to convert the exported BREP file into an initial mesh. Open the BREP file in Gmsh and configure the meshing parameters as required for your specific application.
4. Overcoming Gmsh`s Numbering Issue
After the mesh is generated, re-export the BREP file, overwriting the initial file. This step is necessary to address a numbering problem that may arise within Gmsh during the meshing process.
5. Export Mesh File
Export the generated mesh in MSH format (.msh) from Gmsh. Make sure to tick the box "Save parametric coordinates" while exporting. This file contains the mesh data and together with the BREP file, geometry information can be associated with each mesh vertex.
6. Standardized File Naming for t8code
To seamlessly integrate the generated files with the t8code mesh management library, it is crucial to adhere to a standardized naming convention. Ensure that both the BREP and MSH files are named identically, differing only in their file extensions. For example, name the files as 'airfoil.brep' and 'airfoil.msh' to signify the geometry and mesh data of an airfoil, respectively.
Example Files in t8data Repo (https://github.com/DLR-AMR/t8data/tree/main/freecad_to_t8code)
FreeCAD geometry (FCStd-File) Geometry opened in Gmsh (BREP-FIle) Geometry meshed in Gmesh (MSH-File)
Installation Guide
Configure Options
Setup t8code on JUWELS and other Slurm based systems
Setup t8code for VTK
General
Step 0 Hello World
Step 1 Creating a coarse mesh
Step 2 Creating a uniform forest
Step 3 Adapting a forest
Step 4 Partition,-Balance,-Ghost
Step 5 Store element data
Step 6 Computing stencils
Step 7 Interpolation
Features
Documentation
Tree Indexing
Element Indexing
Running on JUWELS using Slurm
Overview of the most used API functions
Known issues
Workflow - FreeCAD to t8code
Reproducing Scaling Resluts
Coding Guidelines
Tips
Debugging with gdb
Debugging with valgrind
Test driven development
Testing with GoogleTest
Writing C interface code