Skip to main content
http://www.math.univ-paris13.fr/~cuvelier/software/codes/Python/fc-oogmsh/pyfc-oogmsh_400.png

The fc_oogmsh Python package make it possible to generate mesh files from .geo file by using gmsh which must be installed. It’s also possible with the ooGmsh2 or ooGmsh4 class 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 an ooGmsh2 or ooGmsh4 object. The ooGmsh2 is used to read MSH files stored with format version ‘2.2’ and the ooGmsh4 class is used for formats version ‘4.0’ and ‘4.1’

Package test on

System

Python

gmsh

CentOS 7.6

2,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.6

Debian 9.9

2,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.6

Fedora 29

2,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.6

OpenSuse 15.0

3.5.7, 3.6.8, 3.7.3 (python)

4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6

Ubuntu 18.04

2,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.6

Windows 10 (1809)

3.6.8, 3.7.3 (python)

4.3.0, 4.2.3, 4.1.5, 4.0.7, 3.0.6

MacOS 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.6

Documentation is available on fc-oogmsh dedicated web page.

Installation:

The fc_oogmsh Python package is available from the Python Package Index, so to install/upgrade simply type

pip install fc_oogmsh -U

Configuration:

One have to configure the package for using with gmsh. For the default configuration we run under Python:

import fc_oogmsh
fc_oogmsh.configure()

The function fc_oogmsh.configure() try to guess where is the gmsh binary. If this command failed or if we want to specify the gmsh binary location, one can use the gmsh option to specify the gmsh binary file with full path.

  • For example, under Linux:

    import fc_oogmsh
    fc_oogmsh.configure(gmsh='/usr/local/GMSH/gmsh-4.2.0-Linux/bin/gmsh')
  • For example, under Windows:

    import fc_oogmsh
    fc_oogmsh.configure(gmsh=r'C:\Users\toto\GMSH\gmsh-4.2.0-Windows\gmsh.exe')
  • For example, under MacOS:

    import fc_oogmsh
    fc_oogmsh.configure(gmsh='/Users/toto/GMSH/4.2.0/Gmsh.app/Contents/MacOS/gmsh')

Now, it’s possible to run one of the demo functions

import fc_oogmsh
fc_oogmsh.demo02()

The output of the demo02() 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 file condenser11.geo given with the package to generate a 2D mesh file

    meshfile=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 output

    Thereafter one can read the mesh file by using the ooGmsh4 object constructor and print some informations

    oGh=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'>

Metadata

Release files for fc-oogmsh 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fc-oogmsh 0.1.0
File Size Uploaded Provenance Actions
fc_oogmsh-0.1.0.tar.gz 28.9 kB Without provenance Details for fc_oogmsh-0.1.0.tar.gz

Release files / fc_oogmsh-0.1.0.tar.gz

Download URL fc_oogmsh-0.1.0.tar.gz
Size 28.9 kB
Tags Source
SHA-256 checksum
How to use checksums
797cc6f130aa88ae9b58db9655c5c051a098a802e86a1e3f4e0a8fb0c0608dd9
BLAKE2b-256 checksum
How to use checksums
9a7f68ca424f20ee92d906844c7b736f36f3560c78d9a835e9db2540d950b040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Security for fc-oogmsh 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page