Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A collection of meshes for canonical domains

NotificationsYou must be signed in to change notification settings

meshpro/meshzoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

meshzoo

PyPi VersionPyPI pyversionsGitHub starsDownloads

Discord

When generating meshes for FEM/FVM computations, sometimes your geometry is so simplethat you don't need a complex mesh generator (likepygmsh,MeshPy,mshr,pygalmesh,dmsh),but something simple and fast that makes use of the structure of the domain. Entermeshzoo.

Installation

Install meshzoofrom PyPI with

pip install meshzoo

How to get a license

Licenses for personal and academic use can be purchasedhere.You'll receive a confirmation email with a license key.Install the key with

plm add <your-license-key>

on your machine and you're good to go.

For commercial use, please contactsupport@mondaytech.com.

Examples

Triangle

importmeshzoobary,cells=meshzoo.triangle(8)# corners = np.array(#     [#         [0.0, -0.5 * numpy.sqrt(3.0), +0.5 * numpy.sqrt(3.0)],#         [1.0, -0.5, -0.5],#     ]# )# points = np.dot(corners, bary).T# Process the mesh, e.g., write it to a file using meshio# meshio.write_points_cells("triangle.vtk", points, {"triangle": cells})

Rectangle

importmeshzooimportnumpyasnppoints,cells=meshzoo.rectangle_tri(np.linspace(0.0,1.0,11),np.linspace(0.0,1.0,11),variant="zigzag",# or "up", "down", "center")points,cells=meshzoo.rectangle_quad(np.linspace(0.0,1.0,11),np.linspace(0.0,1.0,11),cell_type="quad4",# or "quad8", "quad9")

Regular polygon

meshzoo.ngon(4, 8)meshzoo.ngon(6, 8)meshzoo.ngon(9, 8)
importmeshzoopoints,cells=meshzoo.ngon(5,11)

Disk

meshzoo.disk(4, 8)meshzoo.disk(6, 8)meshzoo.disk(9, 8)

The disk meshes are inflations of regular polygons.

importmeshzoopoints,cells=meshzoo.disk(6,11)points,cells=meshzoo.disk_quad(10,cell_type="quad4")# or "quad8", "quad9"

Möbius strip

importmeshzoopoints,cells=meshzoo.moebius(num_twists=1,nl=60,nw=11)

Sphere (surface)

importmeshzoopoints,cells=meshzoo.uv_sphere(num_points_per_circle=20,num_circles=10,radius=1.0)points,tri,quad=meshzoo.geo_sphere(num_points_per_circle=20,num_circles=10,radius=1.0)

Spheres can also be generated by refining the faces ofplatonicsolids and then "inflating" them. meshzooimplements a few of them. The sphere generated from the icosahedron has thehighest-quality (most equilateral) triangles.

All cells are oriented such that its normals point outwards.

meshzoo.tetra_sphere(10)meshzoo.octa_sphere(10)meshzoo.icosa_sphere(10)

Ball (solid)

importmeshzoopoints,cells=meshzoo.ball_tetra(10)points,cells=meshzoo.ball_hexa(10)

Tube

importmeshzoopoints,cells=meshzoo.tube(length=1.0,radius=1.0,n=30)

Cube

importmeshzooimportnumpyasnppoints,cells=meshzoo.cube_tetra(np.linspace(0.0,1.0,11),np.linspace(0.0,1.0,11),np.linspace(0.0,1.0,11))points,cells=meshzoo.cube_hexa(np.linspace(0.0,1.0,11),np.linspace(0.0,1.0,11),np.linspace(0.0,1.0,11))

About

A collection of meshes for canonical domains

Topics

Resources

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp