bsplyne 1.0.0__py3-none-any.whl → 1.0.1__py3-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.
- bsplyne/__init__.py +1 -1
- bsplyne/b_spline.py +6 -0
- bsplyne/b_spline_basis.py +8 -8
- bsplyne/multi_patch_b_spline.py +21 -21
- bsplyne/save_utils.py +2 -2
- {bsplyne-1.0.0.dist-info → bsplyne-1.0.1.dist-info}/METADATA +24 -19
- bsplyne-1.0.1.dist-info/RECORD +13 -0
- bsplyne-1.0.0.dist-info/RECORD +0 -13
- {bsplyne-1.0.0.dist-info → bsplyne-1.0.1.dist-info}/WHEEL +0 -0
- {bsplyne-1.0.0.dist-info → bsplyne-1.0.1.dist-info}/licenses/LICENSE.txt +0 -0
- {bsplyne-1.0.0.dist-info → bsplyne-1.0.1.dist-info}/top_level.txt +0 -0
bsplyne/__init__.py
CHANGED
bsplyne/b_spline.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from typing import Iterable, Literal, Union
|
|
3
3
|
import json, pickle
|
|
4
|
+
import warnings
|
|
4
5
|
|
|
5
6
|
import numpy as np
|
|
6
7
|
import scipy.sparse as sps
|
|
@@ -1943,6 +1944,11 @@ class BSpline:
|
|
|
1943
1944
|
show,
|
|
1944
1945
|
)
|
|
1945
1946
|
else:
|
|
1947
|
+
if not _can_visualize_pyvista:
|
|
1948
|
+
warnings.warn(
|
|
1949
|
+
"Can't use PyVista. Fallback to Matplotlib plotter. "
|
|
1950
|
+
"For better visualization, install PyVista."
|
|
1951
|
+
)
|
|
1946
1952
|
return self.plotMPL(
|
|
1947
1953
|
ctrl_pts,
|
|
1948
1954
|
n_eval_per_elem,
|
bsplyne/b_spline_basis.py
CHANGED
|
@@ -511,7 +511,7 @@ class BSplineBasis:
|
|
|
511
511
|
Row index of D.
|
|
512
512
|
j : int
|
|
513
513
|
Column index of D.
|
|
514
|
-
new_knot :
|
|
514
|
+
new_knot : np.ndarray[np.floating]
|
|
515
515
|
New knot vector to use.
|
|
516
516
|
p : int
|
|
517
517
|
Degree of the BSpline.
|
|
@@ -547,7 +547,7 @@ class BSplineBasis:
|
|
|
547
547
|
|
|
548
548
|
Parameters
|
|
549
549
|
----------
|
|
550
|
-
new_knot :
|
|
550
|
+
new_knot : np.ndarray[np.floating]
|
|
551
551
|
The new knot vector for the knot insertion.
|
|
552
552
|
|
|
553
553
|
Returns
|
|
@@ -802,7 +802,7 @@ def _funcNElemOneXi(i, p, knot, xi):
|
|
|
802
802
|
Index of the basis function wanted.
|
|
803
803
|
p : int
|
|
804
804
|
Degree of the BSpline evaluated.
|
|
805
|
-
knot :
|
|
805
|
+
knot : np.ndarray[np.floating]
|
|
806
806
|
Knot vector of the BSpline basis.
|
|
807
807
|
xi : float
|
|
808
808
|
Value in the parametric space at which the BSpline is evaluated.
|
|
@@ -846,7 +846,7 @@ def _funcDNElemOneXi(i, p, knot, xi, k):
|
|
|
846
846
|
Index of the basis function wanted.
|
|
847
847
|
p : int
|
|
848
848
|
Degree of the BSpline evaluated.
|
|
849
|
-
knot :
|
|
849
|
+
knot : np.ndarray[np.floating]
|
|
850
850
|
Knot vector of the BSpline basis.
|
|
851
851
|
xi : float
|
|
852
852
|
Value in the parametric space at which the BSpline is evaluated.
|
|
@@ -904,7 +904,7 @@ def _findElem(p, m, n, knot, xi):
|
|
|
904
904
|
Last index of the knot vector.
|
|
905
905
|
n : int
|
|
906
906
|
Last index of the basis.
|
|
907
|
-
knot :
|
|
907
|
+
knot : np.ndarray[np.floating]
|
|
908
908
|
Knot vector of the BSpline basis.
|
|
909
909
|
xi : float
|
|
910
910
|
Value in the parametric space.
|
|
@@ -955,16 +955,16 @@ def _DN(p, m, n, knot, XI, k):
|
|
|
955
955
|
Last index of the knot vector.
|
|
956
956
|
n : int
|
|
957
957
|
Last index of the basis.
|
|
958
|
-
knot :
|
|
958
|
+
knot : np.ndarray[np.floating]
|
|
959
959
|
Knot vector of the BSpline basis.
|
|
960
|
-
XI :
|
|
960
|
+
XI : np.ndarray[np.floating]
|
|
961
961
|
Values in the parametric space at which the BSpline is evaluated.
|
|
962
962
|
k : int
|
|
963
963
|
`k`-th derivative of the BSpline evaluated. The default is 0.
|
|
964
964
|
|
|
965
965
|
Returns
|
|
966
966
|
-------
|
|
967
|
-
(vals, row, col) : (
|
|
967
|
+
(vals, row, col) : (np.ndarray[np.floating], np.ndarray[np.integer], np.ndarray[np.integer])
|
|
968
968
|
Values and indices of the `k`-th derivative matrix of the BSpline
|
|
969
969
|
basis functions in the columns for each value of `XI` in the rows.
|
|
970
970
|
|
bsplyne/multi_patch_b_spline.py
CHANGED
|
@@ -62,9 +62,9 @@ class MultiPatchBSplineConnectivity:
|
|
|
62
62
|
|
|
63
63
|
Attributes
|
|
64
64
|
----------
|
|
65
|
-
unique_nodes_inds :
|
|
65
|
+
unique_nodes_inds : np.ndarray[np.integer]
|
|
66
66
|
The indices of the unique representation needed to create the unpacked one.
|
|
67
|
-
shape_by_patch :
|
|
67
|
+
shape_by_patch : np.ndarray[np.integer]
|
|
68
68
|
The shape of the separated nodes by patch.
|
|
69
69
|
nb_nodes : int
|
|
70
70
|
The total number of unpacked nodes.
|
|
@@ -88,9 +88,9 @@ class MultiPatchBSplineConnectivity:
|
|
|
88
88
|
|
|
89
89
|
Parameters
|
|
90
90
|
----------
|
|
91
|
-
unique_nodes_inds :
|
|
91
|
+
unique_nodes_inds : np.ndarray[np.integer]
|
|
92
92
|
The indices of the unique representation needed to create the unpacked one.
|
|
93
|
-
shape_by_patch :
|
|
93
|
+
shape_by_patch : np.ndarray[np.integer]
|
|
94
94
|
The shape of the separated nodes by patch.
|
|
95
95
|
nb_unique_nodes : int
|
|
96
96
|
The total number of unique nodes.
|
|
@@ -108,10 +108,10 @@ class MultiPatchBSplineConnectivity:
|
|
|
108
108
|
|
|
109
109
|
Parameters
|
|
110
110
|
----------
|
|
111
|
-
nodes_couples :
|
|
111
|
+
nodes_couples : np.ndarray[np.integer]
|
|
112
112
|
Couples of indices of unpacked nodes that are considered the same.
|
|
113
113
|
Its shape should be (# of couples, 2)
|
|
114
|
-
shape_by_patch :
|
|
114
|
+
shape_by_patch : np.ndarray[np.integer]
|
|
115
115
|
The shape of the separated nodes by patch.
|
|
116
116
|
|
|
117
117
|
Returns
|
|
@@ -142,7 +142,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
142
142
|
|
|
143
143
|
Parameters
|
|
144
144
|
----------
|
|
145
|
-
separated_ctrlPts : list of
|
|
145
|
+
separated_ctrlPts : list of np.ndarray[np.floating]
|
|
146
146
|
Control points of every patch to be compared in the separated
|
|
147
147
|
representation. Every array is of shape :
|
|
148
148
|
(``NPh``, nb elem for dim 1, ..., nb elem for dim ``npa``)
|
|
@@ -217,13 +217,13 @@ class MultiPatchBSplineConnectivity:
|
|
|
217
217
|
|
|
218
218
|
Parameters
|
|
219
219
|
----------
|
|
220
|
-
unique_field :
|
|
220
|
+
unique_field : np.ndarray
|
|
221
221
|
The unique representation. Its shape should be :
|
|
222
222
|
(field, shape, ..., `self`.`nb_unique_nodes`)
|
|
223
223
|
|
|
224
224
|
Returns
|
|
225
225
|
-------
|
|
226
|
-
unpacked_field :
|
|
226
|
+
unpacked_field : np.ndarray
|
|
227
227
|
The unpacked representation. Its shape is :
|
|
228
228
|
(field, shape, ..., `self`.`nb_nodes`)
|
|
229
229
|
"""
|
|
@@ -236,7 +236,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
236
236
|
|
|
237
237
|
Parameters
|
|
238
238
|
----------
|
|
239
|
-
unpacked_field :
|
|
239
|
+
unpacked_field : np.ndarray
|
|
240
240
|
The unpacked representation. Its shape should be :
|
|
241
241
|
(field, shape, ..., `self`.`nb_nodes`)
|
|
242
242
|
method: str
|
|
@@ -244,7 +244,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
244
244
|
|
|
245
245
|
Returns
|
|
246
246
|
-------
|
|
247
|
-
unique_nodes :
|
|
247
|
+
unique_nodes : np.ndarray
|
|
248
248
|
The unique representation. Its shape is :
|
|
249
249
|
(field, shape, ..., `self`.`nb_unique_nodes`)
|
|
250
250
|
"""
|
|
@@ -273,13 +273,13 @@ class MultiPatchBSplineConnectivity:
|
|
|
273
273
|
|
|
274
274
|
Parameters
|
|
275
275
|
----------
|
|
276
|
-
unpacked_field :
|
|
276
|
+
unpacked_field : np.ndarray
|
|
277
277
|
The unpacked representation. Its shape is :
|
|
278
278
|
(field, shape, ..., `self`.`nb_nodes`)
|
|
279
279
|
|
|
280
280
|
Returns
|
|
281
281
|
-------
|
|
282
|
-
separated_field : list of
|
|
282
|
+
separated_field : list of np.ndarray
|
|
283
283
|
The separated representation. Every array is of shape :
|
|
284
284
|
(field, shape, ..., nb elem for dim 1, ..., nb elem for dim `npa`)
|
|
285
285
|
"""
|
|
@@ -300,13 +300,13 @@ class MultiPatchBSplineConnectivity:
|
|
|
300
300
|
|
|
301
301
|
Parameters
|
|
302
302
|
----------
|
|
303
|
-
separated_field : list of
|
|
303
|
+
separated_field : list of np.ndarray
|
|
304
304
|
The separated representation. Every array is of shape :
|
|
305
305
|
(field, shape, ..., nb elem for dim 1, ..., nb elem for dim `npa`)
|
|
306
306
|
|
|
307
307
|
Returns
|
|
308
308
|
-------
|
|
309
|
-
unpacked_field :
|
|
309
|
+
unpacked_field : np.ndarray
|
|
310
310
|
The unpacked representation. Its shape is :
|
|
311
311
|
(field, shape, ..., `self`.`nb_nodes`)
|
|
312
312
|
"""
|
|
@@ -334,7 +334,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
334
334
|
|
|
335
335
|
Returns
|
|
336
336
|
-------
|
|
337
|
-
unique_field_indices :
|
|
337
|
+
unique_field_indices : np.ndarray[np.integer] or list of np.ndarray[np.integer]
|
|
338
338
|
The unique, unpacked or separated representation of a field's unique indices.
|
|
339
339
|
If unique, its shape is (*`field_shape`, `self`.`nb_unique_nodes`).
|
|
340
340
|
If unpacked, its shape is : (*`field_shape`, `self`.`nb_nodes`).
|
|
@@ -366,7 +366,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
366
366
|
|
|
367
367
|
Returns
|
|
368
368
|
-------
|
|
369
|
-
duplicate_nodes_mask :
|
|
369
|
+
duplicate_nodes_mask : np.ndarray
|
|
370
370
|
Boolean mask of shape (nb_nodes,) where True indicates a node is duplicated
|
|
371
371
|
across multiple patches and False indicates it appears only once.
|
|
372
372
|
"""
|
|
@@ -391,7 +391,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
391
391
|
Connectivity information for the border patches.
|
|
392
392
|
border_splines : list[BSpline]
|
|
393
393
|
Array of B-spline patches representing the borders.
|
|
394
|
-
border_unique_to_self_unique_connectivity :
|
|
394
|
+
border_unique_to_self_unique_connectivity : np.ndarray[np.integer]
|
|
395
395
|
Array mapping border unique nodes to original unique nodes.
|
|
396
396
|
|
|
397
397
|
Raises
|
|
@@ -484,7 +484,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
484
484
|
Connectivity information for the border patches.
|
|
485
485
|
border_splines : list[BSpline]
|
|
486
486
|
Array of B-spline patches representing the borders.
|
|
487
|
-
border_unique_to_self_unique_connectivity :
|
|
487
|
+
border_unique_to_self_unique_connectivity : np.ndarray[np.integer]
|
|
488
488
|
Array mapping border unique nodes to original unique nodes.
|
|
489
489
|
|
|
490
490
|
Raises
|
|
@@ -649,7 +649,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
649
649
|
----------
|
|
650
650
|
splines : list[BSpline]
|
|
651
651
|
Array of B-spline patches to subset.
|
|
652
|
-
patches_to_keep :
|
|
652
|
+
patches_to_keep : np.ndarray[np.integer]
|
|
653
653
|
Indices of patches to keep in the subset.
|
|
654
654
|
|
|
655
655
|
Returns
|
|
@@ -658,7 +658,7 @@ class MultiPatchBSplineConnectivity:
|
|
|
658
658
|
New connectivity object containing only the selected patches.
|
|
659
659
|
new_splines : list[BSpline]
|
|
660
660
|
Array of B-spline patches for the selected patches.
|
|
661
|
-
new_unique_to_self_unique_connectivity :
|
|
661
|
+
new_unique_to_self_unique_connectivity : np.ndarray[np.integer]
|
|
662
662
|
Array mapping new unique nodes to original unique nodes.
|
|
663
663
|
"""
|
|
664
664
|
new_splines = splines[patches_to_keep]
|
bsplyne/save_utils.py
CHANGED
|
@@ -3,7 +3,7 @@ import meshio as io
|
|
|
3
3
|
from typing import Iterable
|
|
4
4
|
from functools import reduce
|
|
5
5
|
import os
|
|
6
|
-
import
|
|
6
|
+
from xml.dom import minidom
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def writePVD(fileName: str, groups: dict[str, dict]):
|
|
@@ -32,7 +32,7 @@ def writePVD(fileName: str, groups: dict[str, dict]):
|
|
|
32
32
|
None
|
|
33
33
|
"""
|
|
34
34
|
rep, fname = os.path.split(fileName)
|
|
35
|
-
pvd =
|
|
35
|
+
pvd = minidom.Document()
|
|
36
36
|
pvd_root = pvd.createElementNS("VTK", "VTKFile")
|
|
37
37
|
pvd_root.setAttribute("type", "Collection")
|
|
38
38
|
pvd_root.setAttribute("version", "0.1")
|
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bsplyne
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: N-dimensional B-spline library for numerical mechanics and geometry
|
|
5
|
+
Author-email: Dorian Bichet <dbichet@insa-toulouse.fr>
|
|
6
|
+
Project-URL: Homepage, https://github.com/Dorian210/bsplyne
|
|
7
|
+
Project-URL: Repository, https://github.com/Dorian210/bsplyne
|
|
8
|
+
Project-URL: Issues, https://github.com/Dorian210/bsplyne/issues
|
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
9
11
|
Classifier: Operating System :: OS Independent
|
|
10
12
|
Classifier: License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Requires-Python: >=3.9
|
|
11
16
|
Description-Content-Type: text/markdown
|
|
12
17
|
License-File: LICENSE.txt
|
|
13
|
-
Requires-Dist: numpy
|
|
14
|
-
Requires-Dist: numba
|
|
15
|
-
Requires-Dist: scipy
|
|
16
|
-
Requires-Dist: matplotlib
|
|
17
|
-
Requires-Dist: meshio
|
|
18
|
-
Requires-Dist: tqdm
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
Requires-Dist: numpy>=1.20
|
|
19
|
+
Requires-Dist: numba>=0.55
|
|
20
|
+
Requires-Dist: scipy>=1.8
|
|
21
|
+
Requires-Dist: matplotlib>=3.5
|
|
22
|
+
Requires-Dist: meshio>=5.0
|
|
23
|
+
Requires-Dist: tqdm>=4.60
|
|
24
|
+
Provides-Extra: viz
|
|
25
|
+
Requires-Dist: pyvista>=0.41; extra == "viz"
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build; extra == "dev"
|
|
28
|
+
Requires-Dist: twine; extra == "dev"
|
|
29
|
+
Provides-Extra: docs
|
|
30
|
+
Requires-Dist: wkhtmltopdf; extra == "docs"
|
|
31
|
+
Requires-Dist: pdoc>=12.0; extra == "docs"
|
|
25
32
|
Dynamic: license-file
|
|
26
|
-
Dynamic: requires-dist
|
|
27
|
-
Dynamic: summary
|
|
28
33
|
|
|
29
34
|
# bsplyne
|
|
30
35
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
bsplyne/__init__.py,sha256=JyAdwOKZ1G2zAtT_bWmXCvjIj-5beIEWSzoqZhsZotw,1902
|
|
2
|
+
bsplyne/b_spline.py,sha256=i3GHwVs9gEZP28UVo4Bub_SsAxrlN5oaTi111pTzt9s,110352
|
|
3
|
+
bsplyne/b_spline_basis.py,sha256=vldxFkdWrsXFmwGPBFprmUyPYPfwgeYNYmULXQlN-Jc,35347
|
|
4
|
+
bsplyne/geometries_in_3D.py,sha256=krQPNZEg-PZCTnlhd1YrJjwCwv7R9T7oAxxlZJms_Zs,36519
|
|
5
|
+
bsplyne/multi_patch_b_spline.py,sha256=zPL4hax-otlRSVft7SteQiWbjk5qN3q-AsG-rAtqP8Y,75925
|
|
6
|
+
bsplyne/my_wide_product.py,sha256=JqFy2s3ks0wKf4iq22NyzrZo-3Uo7ita-r6fGcGEfEE,5678
|
|
7
|
+
bsplyne/parallel_utils.py,sha256=M0Tuy8wA3AYltsnr_iYOnREWRGZnPxavq9cpWaEC_lU,15326
|
|
8
|
+
bsplyne/save_utils.py,sha256=DgIWoLmka75AprbSQnZwAUA0ox2winSOmW9UNBeFU_s,5032
|
|
9
|
+
bsplyne-1.0.1.dist-info/licenses/LICENSE.txt,sha256=NuJeFieCkXCWPQlUUkzn5TrngzZmXp09-Q8fk15_r6A,3196
|
|
10
|
+
bsplyne-1.0.1.dist-info/METADATA,sha256=1su0tLWuOCrhCSstMAttLty7g3QFWMXXRbI2LiD548M,3154
|
|
11
|
+
bsplyne-1.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
bsplyne-1.0.1.dist-info/top_level.txt,sha256=Mwj9pTQb41GC_guOzmpvMcdkXeeAIWF6VtZcXghgx0c,8
|
|
13
|
+
bsplyne-1.0.1.dist-info/RECORD,,
|
bsplyne-1.0.0.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
bsplyne/__init__.py,sha256=sajGBdm1-pu6iMgD-G_nimXrbXZsXwrJT6bjA_JyLO8,1899
|
|
2
|
-
bsplyne/b_spline.py,sha256=CJYIS_kAJFOy1ay7kIOACyX1j20BkT9TRn1t1j8WkGU,110105
|
|
3
|
-
bsplyne/b_spline_basis.py,sha256=J4vrGx-WcW7suZDJzvLr3zDQyGCCLAZlMbzuGeQ1fZ4,35315
|
|
4
|
-
bsplyne/geometries_in_3D.py,sha256=krQPNZEg-PZCTnlhd1YrJjwCwv7R9T7oAxxlZJms_Zs,36519
|
|
5
|
-
bsplyne/multi_patch_b_spline.py,sha256=4lsxS3m7EV_igfzOBjCKaB7Pd8pxI-ZHyLmnQRP4NhQ,75925
|
|
6
|
-
bsplyne/my_wide_product.py,sha256=JqFy2s3ks0wKf4iq22NyzrZo-3Uo7ita-r6fGcGEfEE,5678
|
|
7
|
-
bsplyne/parallel_utils.py,sha256=M0Tuy8wA3AYltsnr_iYOnREWRGZnPxavq9cpWaEC_lU,15326
|
|
8
|
-
bsplyne/save_utils.py,sha256=p-gDHTAU4Fr8iI_yPfdrMHtEF6bOlgkm8b4yHxA5qtw,5023
|
|
9
|
-
bsplyne-1.0.0.dist-info/licenses/LICENSE.txt,sha256=NuJeFieCkXCWPQlUUkzn5TrngzZmXp09-Q8fk15_r6A,3196
|
|
10
|
-
bsplyne-1.0.0.dist-info/METADATA,sha256=5Gb889Dpk_bkCi3Pgds_5EintBhxWTNCREE7C4bNjkY,2690
|
|
11
|
-
bsplyne-1.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
-
bsplyne-1.0.0.dist-info/top_level.txt,sha256=Mwj9pTQb41GC_guOzmpvMcdkXeeAIWF6VtZcXghgx0c,8
|
|
13
|
-
bsplyne-1.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|