Setting up using python
Edit me

Installation

I recommend using conda to install the Python GMSH API

To install, first create a new conda env (assuming you have Conda installed)

conda create --name gmsh
conda activate gmsh

Now install the API

conda install conda-forge::python-gmsh 

Usage

It recommened to read the tutorials found on the GMSH manual. The python implementation of each tutorial can be found by clicking the python link under each tutorials name. pylink

Examples

In general your scripts will always start/end with

import gmsh
import os
import sys

gmsh.initialize()
gmsh.model.add("modelname")

# Code goes here

gmsh.write(
    "filename"
)


if "-nopopup" not in sys.argv:
    gmsh.fltk.run()

gmsh.finalize()

Important concepts