meshplex 0.22.6__cp315-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,195 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshplex
3
+ Version: 0.22.6
4
+ Summary: Fast tools for simplex meshes
5
+ Author-email: Nico Schlömer <nico.schloemer@gmail.com>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://github.com/meshpro/meshplex
8
+ Project-URL: Issues, https://github.com/meshpro/meshplex/issues
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Programming Language :: Python :: 3.15
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ Requires-Dist: meshio<8,>=4
25
+ Requires-Dist: npx>=0.1.8
26
+ Requires-Dist: numpy>=2
27
+ Requires-Dist: stonefish-license-manager>=0.8
28
+ Requires-Dist: stonefish-runtime>=0.8
29
+ Provides-Extra: all
30
+ Requires-Dist: matplotlib; extra == "all"
31
+ Requires-Dist: scipy; extra == "all"
32
+ Requires-Dist: vtk; extra == "all"
33
+ Provides-Extra: plot
34
+ Requires-Dist: matplotlib; extra == "plot"
35
+ Requires-Dist: vtk; extra == "plot"
36
+ Requires-Dist: stonefish-runtime>=0.8.1
37
+
38
+ <p align="center">
39
+ <a href="https://github.com/nschloe/meshplex"><img alt="meshplex" src="https://raw.githubusercontent.com/meshpro/meshplex/assets/meshplex-logo.svg" width="60%"></a>
40
+ <p align="center">Fast tools for simplex meshes.</p>
41
+ </p>
42
+
43
+ [![PyPi Version](https://img.shields.io/pypi/v/meshplex.svg?style=flat-square)](https://pypi.org/project/meshplex/)
44
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/meshplex.svg?style=flat-square)](https://pypi.org/project/meshplex/)
45
+ [![GitHub stars](https://img.shields.io/github/stars/nschloe/meshplex.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/meshplex)
46
+ [![PyPi downloads](https://img.shields.io/pypi/dm/meshplex.svg?style=flat-square)](https://pypistats.org/packages/meshplex)
47
+
48
+ Compute all sorts of interesting points, areas, and volumes in simplex
49
+ (triangle, tetrahedral, n-simplex) meshes of any dimension, with a focus on
50
+ efficiency. Useful in many contexts, e.g., finite-element and finite-volume
51
+ computations.
52
+
53
+ ### Installation
54
+
55
+ Install meshplex [from PyPI](https://pypi.org/project/meshplex/) with
56
+
57
+ ```
58
+ pip install meshplex
59
+ ```
60
+
61
+ For full usage of meshplex, you require a license. Licenses for personal and
62
+ academic use can be purchased
63
+ [here](https://buy.stripe.com/5kA3eV8t8af83iE9AE). For more info, see
64
+ [here](https://github.com/meshpro).
65
+
66
+ ### Quickstart
67
+
68
+ meshplex can compute the following data:
69
+
70
+ ```python
71
+ import meshplex
72
+
73
+ # create a simple Mesh instance
74
+ # (could be tetrahedra or even higher dimensional simplices)
75
+ points = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
76
+ cells = [[0, 1, 2]]
77
+ mesh = meshplex.Mesh(points, cells)
78
+ # or read it from a file
79
+ # mesh = meshplex.read("pacman.vtk")
80
+
81
+ # simplex volumes, heights
82
+ print(mesh.cell_volumes)
83
+ print(mesh.signed_cell_volumes)
84
+ print(mesh.cell_heights)
85
+ print(mesh.volume)
86
+ print(mesh.surface_area)
87
+
88
+ # centers of any kind
89
+ print(mesh.cell_circumcenters)
90
+ print(mesh.cell_centroids)
91
+ print(mesh.cell_incenters)
92
+ print(mesh.cell_monge_points)
93
+ print(mesh.cell_nagel_points)
94
+ print(mesh.cell_spieker_centers)
95
+ print(mesh.cell_lemoine_points)
96
+ print(mesh.center_of_gravity)
97
+
98
+ # circumradius, inradius, cell quality
99
+ print(mesh.cell_circumradius)
100
+ print(mesh.cell_inradius)
101
+ print(mesh.q_radius_ratio) # d * inradius / circumradius (min 0, max 1)
102
+
103
+ # control volumes, centroids
104
+ print(mesh.control_volumes)
105
+ print(mesh.control_volume_centroids)
106
+
107
+ # covolume/edge length ratios
108
+ print(mesh.ce_ratios)
109
+
110
+ # count Delaunay violations
111
+ print(mesh.num_delaunay_violations)
112
+
113
+ # get all boundary angles in radians
114
+ print(mesh.outside_boundary_angles_radians)
115
+
116
+ # removes some cells
117
+ mesh.remove_cells([0])
118
+ ```
119
+
120
+ For triangular meshes (`MeshTri`), meshplex also has some mesh manipulation routines:
121
+
122
+ <!--pytest.mark.skip-->
123
+
124
+ ```python
125
+ mesh.show() # show the mesh
126
+ mesh.angles # compute angles
127
+ mesh.flip_until_delaunay() # flips edges until the mesh is Delaunay
128
+ ```
129
+
130
+ For a documentation of all classes and functions, see
131
+ [readthedocs](https://meshplex.readthedocs.io/).
132
+
133
+ (For mesh creation, check out
134
+ [this list](https://github.com/nschloe/awesome-scientific-computing#meshing)).
135
+
136
+ ### Plotting
137
+
138
+ #### Triangles
139
+
140
+ <img src="https://raw.githubusercontent.com/meshpro/meshplex/assets/pacman.png" width="30%">
141
+
142
+ <!--pytest.mark.skip-->
143
+
144
+ ```python
145
+ import meshplex
146
+
147
+ mesh = meshplex.read("pacman.vtk")
148
+ mesh.show(
149
+ # show_coedges=True,
150
+ # control_volume_centroid_color=None,
151
+ # mesh_color="k",
152
+ # nondelaunay_edge_color=None,
153
+ # boundary_edge_color=None,
154
+ # comesh_color=(0.8, 0.8, 0.8),
155
+ show_axes=False,
156
+ )
157
+ ```
158
+
159
+ #### Tetrahedra
160
+
161
+ <img src="https://raw.githubusercontent.com/meshpro/meshplex/assets/tetra.png" width="30%">
162
+
163
+ <!--pytest.mark.skip-->
164
+
165
+ ```python
166
+ import numpy as np
167
+ import meshplex
168
+
169
+ # Generate tetrahedron
170
+ points = np.array(
171
+ [
172
+ [1.0, 0.0, -1.0 / np.sqrt(8)],
173
+ [-0.5, +np.sqrt(3.0) / 2.0, -1.0 / np.sqrt(8)],
174
+ [-0.5, -np.sqrt(3.0) / 2.0, -1.0 / np.sqrt(8)],
175
+ [0.0, 0.0, np.sqrt(2.0) - 1.0 / np.sqrt(8)],
176
+ ]
177
+ ) / np.sqrt(3.0)
178
+ cells = [[0, 1, 2, 3]]
179
+
180
+ # Create mesh object
181
+ mesh = meshplex.MeshTetra(points, cells)
182
+
183
+ # Plot cell 0 with control volume boundaries
184
+ mesh.show_cell(
185
+ 0,
186
+ # barycenter_rgba=(1, 0, 0, 1.0),
187
+ # circumcenter_rgba=(0.1, 0.1, 0.1, 1.0),
188
+ # circumsphere_rgba=(0, 1, 0, 1.0),
189
+ # incenter_rgba=(1, 0, 1, 1.0),
190
+ # insphere_rgba=(1, 0, 1, 1.0),
191
+ # face_circumcenter_rgba=(0, 0, 1, 1.0),
192
+ control_volume_boundaries_rgba=(1.0, 0.0, 0.0, 1.0),
193
+ line_width=3.0,
194
+ )
195
+ ```
@@ -0,0 +1,5 @@
1
+ meshplex-0.22.6.dist-info/METADATA,sha256=MftPI7I-JzeMJSH0Q5a8LozPtH1CwxjCw_OwUIKGmkE,5953
2
+ meshplex-0.22.6.dist-info/WHEEL,sha256=E0bxZwGow566sLu-koO-FIhzqGs-_etk-jdmZvGiCJ0,91
3
+ meshplex-0.22.6.dist-info/top_level.txt,sha256=98SwEjhyZbR27fRE5D6CgqEBUE64pUltRTdA5GJUP1U,9
4
+ meshplex.cpython-315.sfc,sha256=WnmaYCvaY405QfSvVOM4jilKkHBEou1I99JvaZtDxpI,178650
5
+ meshplex-0.22.6.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: stonefish (0.8.1)
3
+ Root-Is-Purelib: true
4
+ Tag: cp315-none-any
5
+
@@ -0,0 +1 @@
1
+ meshplex
Binary file