# CAD & Mesh-Tools
CAD and meshing software installed on **viz**, **amp** and both cluster nodes (**green** and **gray**).
## FreeCAD
---
An easy to use open-source CAD software, that can use Gmsh or Netgen for meshing. It can also serve as a frontend for CalculiX and [ElmerFEM](/engineering/elmerfem.md), thus providing similar functionality as SolidWorks.
(Please don't run simulations on **viz**) FreeCAD is best used within a [VNC session](../visualization/vnc.md).
See separate page on [visualization](../visualization.md).
On the **green** nodes use a SPACK module:
module load green-spack
module load openfoam
### How to cite:
FreeCAD available from: [https://www.freecadweb.org](https://www.freecadweb.org).
## Gmsh
---
Gmsh meshes can be used with [ElmerFEM](/engineering/elmerfem.md) and [OpenFOAM](/engineering/openfoam.md). For OpenFOAM, make sure it is saved as version 2 and ASCII format. The GUI is available on **viz**, large meshes can be done as batch jobs on the cluster nodes **green** and **gray**, on the command-line run
gmsh -3 -format msh2 -o outfilename.msh infilename.geo
this creates a volume mesh and saves as version 2 format suitable for OpenFOAM.
On the **green** nodes use a SPACK module:
module load green-spack
module load gmsh
### How to cite:
If you use Gmsh please cite [C. Geuzaine and J.-F. Remacle. Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities. Int. J. Numer. Methods Eng., 79(11), pp. 1309-1331, 2009](https://gmsh.info/doc/preprints/gmsh_paper_preprint.pdf). You can also cite additional [references](https://gmsh.info/#References) for specific features and algorithms.
## Salome
---
Salome is installed on the cluster nodes **green** and **gray**.
module load green/all
module load salome
Salome has a python interface, so the meshing can be done as a batch-job on the cluster nodes.
The current state can be dumped into a script from the GUI by `CTRL+D`, the script can then be executed on the command-line by `salome -t scriptname.py`. It is therefore possible to prepare the geometry on your workstation or **viz**, dump the script, add the meshing command and run the script on the cluster in batch-mode.
On **viz** there is no module for Salome, just run `salome` or `mesa_salome` on the command-line, this is best done within a [VNC session](../visualization/vnc.md) session (or [X2GO](../visualization/x2go.md) session, here use `vglrun salome`).
See separate page on [visualization](../visualization.md).
### How to cite:
Salome can be cited as [DOI:10.13140/RG.2.2.12107.08485](https://www.researchgate.net/publication/318531878_SALOME_an_Open-Source_simulation_platform_integrating_ParaView?channel=doi&linkId=596f5f25458515d5ff64e0c6&showFulltext=true).
## Netgen (NGsolve)
---
[Netgen](https://ngsolve.org/) is a part of the NGsolve suite. Netgen is a automatic 3d tetrahedral mesh generator containing modules for mesh optimization and hierarchical mesh refinement. It accepts input from constructive solid geometry `.csg` or boundary representation (BRep) from `.stl` files, but also handles `.brep`, `.step` and `.iges` formats. Those meshes generated can be exported in several formats (e.g. neutral, Abaqus, Fluent, [ElmerFEM](/engineering/elmerfem.md) Gmsh and [OpenFOAM](/engineering/openfoam.md)). Netgen has a GUI (e.g. use a [X2GO](../visualization/x2go.md) session on **viz**), but can also be used through its Python interface.
A Python example using the OpenCASCADE kernel:
from netgen.NgOCC import *
geo = LoadOCCGeometry('screw.step')
geo.Heal()
mesh = geo.GenerateMesh()
# mesh.Save('screw.vol')
mesh.Export("export.msh","Gmsh Format")
from ngsolve import *
Draw(Mesh(mesh))
A Python example using the netgen STL:
import netgen.stl as stl
geo2 = stl.LoadSTLGeometry("input.stl")
m2 = geo2.GenerateMesh (maxh=0.05)
m2.Export("export.msh","Gmsh2 Format")
You can get a list of export formats from the GUI.
### How to cite:
Netgen - [J. Schöberl. NETGEN An advancing front 2D/3D-mesh generator based on abstract rules. Comput. Vis. Sci., 1(1):41–52, 1997](https://link.springer.com/article/10.1007/s007910050004).
Netgen/NGSolve is open source and available at [www.ngsolve.org](www.ngsolve.org).