Package: fc-oogmsh
Thefc_oogmshPython package make it possible to generate mesh files from.geofile by usinggmshwhich must be installed. It’s also possible
with theooGmsh2orooGmsh4class to read the mesh file and to store its contains in more user-friendly form.
This package must be regarded as a very simple interface between gmsh files and Python.
So you are free to create any objects you want from anooGmsh2orooGmsh4object.
TheooGmsh2is used to read MSH files stored with format version ‘2.2’  and theooGmsh4class is used for formats version ‘4.0’ and ‘4.1’Package test onSystemPythongmshCentOS 7.62,7.16, 3.5.7, 3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6Debian 9.92,7.16, 3.5.7, 3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6Fedora 292,7.16, 3.5.7, 3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6OpenSuse 15.03.5.7, 3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6Ubuntu 18.042,7.16, 3.5.7, 3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6Windows 10 (1809)3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6MacOS Mojave (10.14.4)3.5.4, 3.6.8, 3.7.3 (python)4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6Documentation is available onfc-oogmshdedicated web page.Installation:Thefc_oogmshPython package is available from the Python Package Index, so to install/upgrade simply typepip install fc_oogmsh -UConfiguration:One have to configure the package for using withgmsh.
For the default configuration we run under Python:importfc_oogmshfc_oogmsh.configure()The functionfc_oogmsh.configure()try to guess where is thegmshbinary.
If this command failed or if we want to specify thegmshbinary location, one can use thegmshoption to specify thegmshbinary file with full path.For example, under Linux:importfc_oogmshfc_oogmsh.configure(gmsh='/usr/local/GMSH/gmsh-4.2.0-Linux/bin/gmsh')For example,  under Windows:importfc_oogmshfc_oogmsh.configure(gmsh=r'C:\Users\toto\GMSH\gmsh-4.2.0-Windows\gmsh.exe')For example,  under MacOS:importfc_oogmshfc_oogmsh.configure(gmsh='/Users/toto/GMSH/4.2.0/Gmsh.app/Contents/MacOS/gmsh')Now, it’s possible to run one of the demo functionsimportfc_oogmshfc_oogmsh.demo02()The output of thedemo02()function under Linux is:***********************
Running demo02 function
***********************
*** Build mesh file
[fc_oogmsh] Using input file: /home/cuvelier/Travail/Recherch/python/fc-oogmsh/src/fc_oogmsh/geodir/2d/condenser11.geo
[fc_oogmsh] Overwritting mesh file /home/cuvelier/.local/share/fc_oogmsh/meshes/condenser11-25.msh
[fc_oogmsh] Use option verbose=3 to see gmsh output
*** Read mesh file
*** Print oGh ->
ooGmsh4 object
    dim : 2
      d : 2
  types : [1 2]
    nq : 3483
      q : ndarray object[float64], size (2, 3483)
toGlobal: ndarray object[int32], size (3483,)
Entities:<class 'fc_oogmsh.msh.Entities'>
Nodes   :<class 'fc_oogmsh.msh.Nodes'>
Elements:<class 'fc_oogmsh.msh.Elements'>Examples usage:We use the geometry filecondenser11.geogiven with the package to generate a 2D mesh filemeshfile=fc_oogmsh.buildmesh2d('condenser11',25,force=True)The output of this command is:fc_oogmsh] Using input file: /home/cuvelier/Travail/Recherch/python/fc-oogmsh/src/fc_oogmsh/geodir/2d/condenser11.geo
[fc_oogmsh] Overwritting mesh file /home/cuvelier/.local/share/fc_oogmsh/meshes/condenser11-25.msh
[fc_oogmsh] Use option verbose=3 to see gmsh outputThereafter one can read the mesh file by using theooGmsh4object constructor and print some
informationsoGh=fc_oogmsh.ooGmsh4(meshfile)print('*** Print oGh ->')print(oGh)The output of these commands are:*** Print oGh ->
ooGmsh4 object
    dim : 2
      d : 2
  types : [1 2]
    nq : 3483
      q : ndarray object[float64], size (2, 3483)
toGlobal: ndarray object[int32], size (3483,)
Entities:<class 'fc_oogmsh.msh.Entities'>
Nodes   :<class 'fc_oogmsh.msh.Nodes'>
Elements:<class 'fc_oogmsh.msh.Elements'>