Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README.rst to explain project goal #14

Merged
merged 13 commits into from
Dec 24, 2023
38 changes: 38 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Motivation
==========

`PyVista`_ accessors for `Gmsh`_ to generate 3D finite element mesh.

.. _PyVista: https://docs.pyvista.org/version/stable/
.. _Gmsh: https://gmsh.info/

Usage
=====

.. code-block:: python

>>> import pyvista as pv
>>> import pvgmsh

We can define the surface using PyVista.

.. code-block:: python

>>> square = pv.Polygon(n_sides=4, radius=8, fill=False)
>>> square = square.rotate_z(45, inplace=False)

We can then generate a 2D mesh.

.. code-block:: python

>>> tess = pvgmsh.frontal_delaunay_2d(edge_source=square, mesh_size=1.0)

To visualize the model we can use PyVista.

.. code-block:: python

>>> plotter = pv.Plotter()
>>> _ = plotter.add_mesh(tess, show_edges=True)
>>> plotter.show(cpos="xy")

.. image:: https://github.com/pyvista/pyvista-gmsh/raw/main/frontal_delaunay_2d_01.png