Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tkoyama010
Copy link
Member

@tkoyama010 tkoyama010 commented Jul 25, 2022

import pvgmsh
import pyvista
import numpy as np


# Gmsh Python tutorial 1
# https://gitlab.onelab.info/gmsh/gmsh/blob/gmsh_4_10_5/tutorials/python/t1.py

vertices = np.array([[0, 0, 0], [0.1, 0, 0], [0.1, 0.3, 0], [0, 0.3, 0]])
faces = np.hstack([[4, 0, 1, 2, 3]])
surf = pyvista.PolyData(vertices, faces)

# pvgmsh does not support PhysicalGroup; group configuration can be easily done with PyVista.

mesh = pvgmsh.generate_mesh(surf)

plotter = pyvista.Plotter(shape=(1, 2))
plotter.subplot(0, 0)
plotter.add_mesh(surf, color="tan", show_edges=True)
plotter.subplot(0, 1)
plotter.add_mesh(mesh, color="tan", show_edges=True)
plotter.show(cpos="xy")

test

@tkoyama010 tkoyama010 added the enhancement New feature or request label Jul 25, 2022
@tkoyama010 tkoyama010 changed the title Add Gmsh Python tutorial 1 Add Tutorial 1 Jul 28, 2022
@tkoyama010 tkoyama010 marked this pull request as ready for review December 23, 2023 04:34
@tkoyama010 tkoyama010 changed the title Add Tutorial 1 Add tutorial to show how to use pyvista-gmsh which is inspired by gmsh tutorial Dec 23, 2023
@tkoyama010 tkoyama010 added documentation Improvements or additions to documentation enhancement New feature or request and removed enhancement New feature or request labels Dec 23, 2023
@tkoyama010 tkoyama010 merged commit cab3db4 into main Dec 23, 2023
@tkoyama010 tkoyama010 deleted the feat/tutorial-1 branch December 23, 2023 06:32
@tkoyama010
Copy link
Member Author

@allcontributors please add @tkoyama010 for ideas

Copy link
Contributor

@tkoyama010

I've put up a pull request to add @tkoyama010! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant