PyGmsh
======
|Build Status| |Code Health| |codecov| |Documentation Status| |PyPi
Version| |GitHub stars|
`Gmsh <http://geuz.org/gmsh/>`__ is a powerful mesh generation tool with
a scripting language that is notoriously hard to write.
The goal of PyGmsh is to combine the power of Gmsh with the versatility
of Python and to provide useful abstractions from the Gmsh scripting
language so you can create complex geometries more easily.
.. figure:: https://nschloe.github.io/pygmsh/screw.png
:alt:
To create the above mesh, simply do
.. code:: python test
import pygmsh as pg
import numpy as np
geom = pg.Geometry()
# Draw a cross.
poly = geom.add_polygon([
[0.0, 0.5, 0.0],
[-0.1, 0.1, 0.0],
[-0.5, 0.0, 0.0],
[-0.1, -0.1, 0.0],
[0.0, -0.5, 0.0],
[0.1, -0.1, 0.0],
[0.5, 0.0, 0.0],
[0.1, 0.1, 0.0]
],
lcar=0.05
)
axis = [0, 0, 1]
geom.extrude(
poly,
translation_axis=axis,
rotation_axis=axis,
point_on_axis=[0, 0, 0],
angle=2.0 / 6.0 * np.pi
)
points, cells, point_data, cell_data, field_data = pg.generate_mesh(geom)
to retrieve all points and cells of the mesh for the specified geometry.
To store the mesh, you can use
`meshio <https://pypi.python.org/pypi/meshio>`__; for example
.. code:: python
import meshio
meshio.write('test.vtu', points, cells, cell_data=cell_data)
The output file can be visualized with various tools, e.g.,
`ParaView <http://www.paraview.org/>`__.
You will find the above mesh in the directory ``test/examples/`` along
with other small examples.
Installation
~~~~~~~~~~~~
PyGmsh is `available from the Python Package
Index <https://pypi.python.org/pypi/pygmsh/>`__, so simply type
::
pip install -U pygmsh
to install or upgrade.
Usage
~~~~~
Just
::
import pygmsh as pg
and make use of all the goodies the module provides. The
`documentation <http://pygmsh.readthedocs.org/>`__ and the examples
under
```test/examples/`` <https://github.com/nschloe/pygmsh/tree/master/test/examples>`__
might inspire you.
Testing
~~~~~~~
To run the PyGmsh unit tests, check out this repository and type
::
pytest
Distribution
~~~~~~~~~~~~
To create a new release
1. bump the ``__version__`` number,
2. publish to PyPi and GitHub:
::
$ make publish
License
~~~~~~~
PyGmsh is published under the `MIT
license <https://en.wikipedia.org/wiki/MIT_License>`__.
.. |Build Status| image:: https://travis-ci.org/nschloe/pygmsh.svg
:target: https://travis-ci.org/nschloe/pygmsh
.. |Code Health| image:: https://landscape.io/github/nschloe/pygmsh/master/landscape.png
:target: https://landscape.io/github/nschloe/pygmsh/master
.. |codecov| image:: https://codecov.io/gh/nschloe/pygmsh/branch/master/graph/badge.svg
:target: https://codecov.io/gh/nschloe/pygmsh
.. |Documentation Status| image:: https://readthedocs.org/projects/pygmsh/badge/?version=latest
:target: http://pygmsh.readthedocs.org/en/latest/?badge=latest
.. |PyPi Version| image:: https://img.shields.io/pypi/v/pygmsh.svg
:target: https://pypi.python.org/pypi/pygmsh
.. |GitHub stars| image:: https://img.shields.io/github/stars/nschloe/pygmsh.svg?style=social&label=Star&maxAge=2592000
:target: https://github.com/nschloe/pygmsh
======
|Build Status| |Code Health| |codecov| |Documentation Status| |PyPi
Version| |GitHub stars|
`Gmsh <http://geuz.org/gmsh/>`__ is a powerful mesh generation tool with
a scripting language that is notoriously hard to write.
The goal of PyGmsh is to combine the power of Gmsh with the versatility
of Python and to provide useful abstractions from the Gmsh scripting
language so you can create complex geometries more easily.
.. figure:: https://nschloe.github.io/pygmsh/screw.png
:alt:
To create the above mesh, simply do
.. code:: python test
import pygmsh as pg
import numpy as np
geom = pg.Geometry()
# Draw a cross.
poly = geom.add_polygon([
[0.0, 0.5, 0.0],
[-0.1, 0.1, 0.0],
[-0.5, 0.0, 0.0],
[-0.1, -0.1, 0.0],
[0.0, -0.5, 0.0],
[0.1, -0.1, 0.0],
[0.5, 0.0, 0.0],
[0.1, 0.1, 0.0]
],
lcar=0.05
)
axis = [0, 0, 1]
geom.extrude(
poly,
translation_axis=axis,
rotation_axis=axis,
point_on_axis=[0, 0, 0],
angle=2.0 / 6.0 * np.pi
)
points, cells, point_data, cell_data, field_data = pg.generate_mesh(geom)
to retrieve all points and cells of the mesh for the specified geometry.
To store the mesh, you can use
`meshio <https://pypi.python.org/pypi/meshio>`__; for example
.. code:: python
import meshio
meshio.write('test.vtu', points, cells, cell_data=cell_data)
The output file can be visualized with various tools, e.g.,
`ParaView <http://www.paraview.org/>`__.
You will find the above mesh in the directory ``test/examples/`` along
with other small examples.
Installation
~~~~~~~~~~~~
PyGmsh is `available from the Python Package
Index <https://pypi.python.org/pypi/pygmsh/>`__, so simply type
::
pip install -U pygmsh
to install or upgrade.
Usage
~~~~~
Just
::
import pygmsh as pg
and make use of all the goodies the module provides. The
`documentation <http://pygmsh.readthedocs.org/>`__ and the examples
under
```test/examples/`` <https://github.com/nschloe/pygmsh/tree/master/test/examples>`__
might inspire you.
Testing
~~~~~~~
To run the PyGmsh unit tests, check out this repository and type
::
pytest
Distribution
~~~~~~~~~~~~
To create a new release
1. bump the ``__version__`` number,
2. publish to PyPi and GitHub:
::
$ make publish
License
~~~~~~~
PyGmsh is published under the `MIT
license <https://en.wikipedia.org/wiki/MIT_License>`__.
.. |Build Status| image:: https://travis-ci.org/nschloe/pygmsh.svg
:target: https://travis-ci.org/nschloe/pygmsh
.. |Code Health| image:: https://landscape.io/github/nschloe/pygmsh/master/landscape.png
:target: https://landscape.io/github/nschloe/pygmsh/master
.. |codecov| image:: https://codecov.io/gh/nschloe/pygmsh/branch/master/graph/badge.svg
:target: https://codecov.io/gh/nschloe/pygmsh
.. |Documentation Status| image:: https://readthedocs.org/projects/pygmsh/badge/?version=latest
:target: http://pygmsh.readthedocs.org/en/latest/?badge=latest
.. |PyPi Version| image:: https://img.shields.io/pypi/v/pygmsh.svg
:target: https://pypi.python.org/pypi/pygmsh
.. |GitHub stars| image:: https://img.shields.io/github/stars/nschloe/pygmsh.svg?style=social&label=Star&maxAge=2592000
:target: https://github.com/nschloe/pygmsh
Metadata
Release files for pygmsh 3.0.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pygmsh-3.0.15-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Release files / pygmsh-3.0.15-py2.py3-none-any.whl
| Download URL | pygmsh-3.0.15-py2.py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f5984952afbddb4cc6b55d072e192dbb6a95afb09b439315aae1dd4f54a7353d
|
|
BLAKE2b-256 checksum How to use checksums |
92af062f704b2adb3d8e09330842f3a52ce70e2dfb3eff789a6d69a9b978ec8c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |