gmsh-api


Namegmsh-api JSON
Version 4.13.0 PyPI version JSON
download
home_pagehttps://github.com/lepy/gmsh_api
Summarygmsh - API for a great Finite Element Mesher
upload_time2024-04-15 13:20:16
maintainerNone
docs_urlNone
authorLepy
requires_pythonNone
licenseGPL
keywords fem mesh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gmsh_api

simple package to use gmsh via the original gmsh_api 
(https://gitlab.onelab.info/gmsh/gmsh/blob/master/api/gmsh.py, https://gmsh.info/bin/Linux/gmsh-X.Y.Z-Linux64-sdk.tgz).

Christophe Geuzaine is a hero.

## Usage

    # gmsh_api package with some useful classes 
    import gmsh_api
    # original gmsh-api from gmsh package
    import gmsh_api.gmsh as gmsh
    
    gmsh.initialize()
    
    gmsh.option.setNumber("General.Terminal", 1)
    gmsh.option.setNumber("Mesh.Algorithm", 5) # delquad
    gmsh.option.setNumber("Mesh.RecombineAll", 1)
    
    gmsh.model.add("square")
    gmsh.model.geo.addPoint(0, 0, 0, 0.6, 1)
    gmsh.model.geo.addPoint(1, 0, 0, 0.6, 2)
    gmsh.model.geo.addPoint(1, 1, 0, 0.5, 3)
    gmsh.model.geo.addPoint(0, 1, 0, 0.4, 4)
    gmsh.model.geo.addLine(1, 2, 1)
    gmsh.model.geo.addLine(2, 3, 2)
    gmsh.model.geo.addLine(3, 4, 3)
    
    # try automatic assignement of tag
    line4 = gmsh.model.geo.addLine(4, 1)
    gmsh.model.geo.addCurveLoop([1, 2, 3, line4], 1)
    gmsh.model.geo.addPlaneSurface([1], 6)
    gmsh.model.geo.synchronize()
    gmsh.model.mesh.generate(2)
    #gmsh.write("square.unv")
    
    mesh = gmsh_api.Mesh.from_gmsh(gmsh)
    print(mesh.nodes)
    print(mesh.elements)

## Store mesh properties with pandas dataframes!

### mesh.nodes

          nid         x         y    z
     1      1  0         0           0
     2      2  1         0           0
     3      3  1         1           0
     4      4  0         1           0
     5      5  0.5       0           0
     6      6  1         0.522774    0
     7      7  0.728708  1           0
     8      8  0.472136  1           0
     9      9  0.229485  1           0
    10     10  0         0.786636    0
    11     11  0         0.55051     0
    12     12  0         0.289194    0
    13     13  0.267268  0.304987    0
    14     14  0.703727  0.740444    0
    15     15  0.387068  0.62141     0
    16     16  0.637319  0.370788    0
    17     17  0.189356  0.818467    0
    
### mesh.elements

          pid    elid  type      n_nodes  nodes                 nidxs
     0      1      17  shell4          4  [9L, 17L, 15L, 8L]    [9L, 17L, 15L, 8L]
     1      1      18  shell4          4  [15L, 17L, 10L, 11L]  [15L, 17L, 10L, 11L]
     2      1      19  shell4          4  [10L, 17L, 9L, 4L]    [10L, 17L, 9L, 4L]
     3      1      20  shell4          4  [5L, 16L, 15L, 13L]   [5L, 16L, 15L, 13L]
     4      1      21  shell4          4  [6L, 14L, 15L, 16L]   [6L, 14L, 15L, 16L]
     5      1      22  shell4          4  [6L, 16L, 5L, 2L]     [6L, 16L, 5L, 2L]
     6      1      23  shell4          4  [15L, 14L, 7L, 8L]    [15L, 14L, 7L, 8L]
     7      1      24  shell4          4  [15L, 11L, 12L, 13L]  [15L, 11L, 12L, 13L]
     8      1      25  shell4          4  [5L, 13L, 12L, 1L]    [5L, 13L, 12L, 1L]
     9      1      26  shell4          4  [6L, 3L, 7L, 14L]     [6L, 3L, 7L, 14L]


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lepy/gmsh_api",
    "name": "gmsh-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "fem mesh",
    "author": "Lepy",
    "author_email": "lepy@tuta.io",
    "download_url": "https://files.pythonhosted.org/packages/e5/fb/8f6a7514f7b948d52a3a9419202b5492bfd7fd4acca374aa407b7235188c/gmsh_api-4.13.0.tar.gz",
    "platform": null,
    "description": "# gmsh_api\n\nsimple package to use gmsh via the original gmsh_api \n(https://gitlab.onelab.info/gmsh/gmsh/blob/master/api/gmsh.py, https://gmsh.info/bin/Linux/gmsh-X.Y.Z-Linux64-sdk.tgz).\n\nChristophe Geuzaine is a hero.\n\n## Usage\n\n    # gmsh_api package with some useful classes \n    import gmsh_api\n    # original gmsh-api from gmsh package\n    import gmsh_api.gmsh as gmsh\n    \n    gmsh.initialize()\n    \n    gmsh.option.setNumber(\"General.Terminal\", 1)\n    gmsh.option.setNumber(\"Mesh.Algorithm\", 5) # delquad\n    gmsh.option.setNumber(\"Mesh.RecombineAll\", 1)\n    \n    gmsh.model.add(\"square\")\n    gmsh.model.geo.addPoint(0, 0, 0, 0.6, 1)\n    gmsh.model.geo.addPoint(1, 0, 0, 0.6, 2)\n    gmsh.model.geo.addPoint(1, 1, 0, 0.5, 3)\n    gmsh.model.geo.addPoint(0, 1, 0, 0.4, 4)\n    gmsh.model.geo.addLine(1, 2, 1)\n    gmsh.model.geo.addLine(2, 3, 2)\n    gmsh.model.geo.addLine(3, 4, 3)\n    \n    # try automatic assignement of tag\n    line4 = gmsh.model.geo.addLine(4, 1)\n    gmsh.model.geo.addCurveLoop([1, 2, 3, line4], 1)\n    gmsh.model.geo.addPlaneSurface([1], 6)\n    gmsh.model.geo.synchronize()\n    gmsh.model.mesh.generate(2)\n    #gmsh.write(\"square.unv\")\n    \n    mesh = gmsh_api.Mesh.from_gmsh(gmsh)\n    print(mesh.nodes)\n    print(mesh.elements)\n\n## Store mesh properties with pandas dataframes!\n\n### mesh.nodes\n\n          nid         x         y    z\n     1      1  0         0           0\n     2      2  1         0           0\n     3      3  1         1           0\n     4      4  0         1           0\n     5      5  0.5       0           0\n     6      6  1         0.522774    0\n     7      7  0.728708  1           0\n     8      8  0.472136  1           0\n     9      9  0.229485  1           0\n    10     10  0         0.786636    0\n    11     11  0         0.55051     0\n    12     12  0         0.289194    0\n    13     13  0.267268  0.304987    0\n    14     14  0.703727  0.740444    0\n    15     15  0.387068  0.62141     0\n    16     16  0.637319  0.370788    0\n    17     17  0.189356  0.818467    0\n    \n### mesh.elements\n\n          pid    elid  type      n_nodes  nodes                 nidxs\n     0      1      17  shell4          4  [9L, 17L, 15L, 8L]    [9L, 17L, 15L, 8L]\n     1      1      18  shell4          4  [15L, 17L, 10L, 11L]  [15L, 17L, 10L, 11L]\n     2      1      19  shell4          4  [10L, 17L, 9L, 4L]    [10L, 17L, 9L, 4L]\n     3      1      20  shell4          4  [5L, 16L, 15L, 13L]   [5L, 16L, 15L, 13L]\n     4      1      21  shell4          4  [6L, 14L, 15L, 16L]   [6L, 14L, 15L, 16L]\n     5      1      22  shell4          4  [6L, 16L, 5L, 2L]     [6L, 16L, 5L, 2L]\n     6      1      23  shell4          4  [15L, 14L, 7L, 8L]    [15L, 14L, 7L, 8L]\n     7      1      24  shell4          4  [15L, 11L, 12L, 13L]  [15L, 11L, 12L, 13L]\n     8      1      25  shell4          4  [5L, 13L, 12L, 1L]    [5L, 13L, 12L, 1L]\n     9      1      26  shell4          4  [6L, 3L, 7L, 14L]     [6L, 3L, 7L, 14L]\n\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "gmsh - API for a great Finite Element Mesher",
    "version": "4.13.0",
    "project_urls": {
        "Homepage": "https://github.com/lepy/gmsh_api"
    },
    "split_keywords": [
        "fem",
        "mesh"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e5fb8f6a7514f7b948d52a3a9419202b5492bfd7fd4acca374aa407b7235188c",
                "md5": "ae2253dbccc730f0166a5e8de31559de",
                "sha256": "4fb3439ac67a912348dfe342826820e0b9525c16a43f619cadb05dd8990669c4"
            },
            "downloads": -1,
            "filename": "gmsh_api-4.13.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ae2253dbccc730f0166a5e8de31559de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 30111569,
            "upload_time": "2024-04-15T13:20:16",
            "upload_time_iso_8601": "2024-04-15T13:20:16.451464Z",
            "url": "https://files.pythonhosted.org/packages/e5/fb/8f6a7514f7b948d52a3a9419202b5492bfd7fd4acca374aa407b7235188c/gmsh_api-4.13.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-15 13:20:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lepy",
    "github_project": "gmsh_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "gmsh-api"
}
        
Elapsed time: 0.36027s