lsdo-function-spaces 1.2.0__tar.gz → 1.2.1__tar.gz
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.
- {lsdo_function_spaces-1.2.0/lsdo_function_spaces.egg-info → lsdo_function_spaces-1.2.1}/PKG-INFO +1 -1
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/__init__.py +1 -1
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function.py +5 -5
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function_network.py +15 -9
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function_set.py +1 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/interface.py +24 -16
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/marker.py +3 -1
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/b_spline_patch_projection.py +8 -8
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/b_spline_patch_projection_non_differentiable.py +8 -8
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/b_spline_patch_projection_optimized.py +11 -6
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/compute_basis_matrix_jax.py +2 -2
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/compute_basis_matrix_jax_stencil.py +2 -2
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/file_io.py +6 -1
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/plotting_functions.py +4 -4
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1/lsdo_function_spaces.egg-info}/PKG-INFO +1 -1
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/pyproject.toml +1 -1
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/release_notes.md +7 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/LICENSE.txt +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/MANIFEST.in +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/README.md +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/__init__.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function_set_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/operations/__init__.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/operations/basic_ops.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/operations/operations.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/optimization.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/__init__.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/b_spline_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/conditional_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/constant_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/idw_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/__init__.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/b_spline_csdl_custom_ops.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/b_spline_csdl_custom_ops_v2.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/b_spline_space_new.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/compute_basis_matrix_jax_factory.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/compute_basis_matrix_numpy.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/non_cython_bsplines/compute_basis_matrix_numpy_factory.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/operation_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/polynomial_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/rbf_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/sinusoid.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/spaces/tri_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/__init__.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/internal_utilities.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/utility_functions.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces.egg-info/SOURCES.txt +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces.egg-info/dependency_links.txt +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces.egg-info/requires.txt +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces.egg-info/top_level.txt +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/setup.cfg +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/conftest.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_b_spline_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_backward_compatibility.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_connectivity.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_file_io.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_function.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_function_set.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_function_set_space.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_jax_bsplines.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_marker.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_optimization.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_optimized_projection_and_factories.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_plotting.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_projection.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_spaces.py +0 -0
- {lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_utilities.py +0 -0
{lsdo_function_spaces-1.2.0/lsdo_function_spaces.egg-info → lsdo_function_spaces-1.2.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lsdo_function_spaces
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A package for functional representation and function spaces in multidisciplinary design optimization.
|
|
5
5
|
Author-email: Andrew Fletcher <afletcher168@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function.py
RENAMED
|
@@ -956,7 +956,7 @@ class Function:
|
|
|
956
956
|
Plots the B-spline Surface.
|
|
957
957
|
|
|
958
958
|
Parameters
|
|
959
|
-
|
|
959
|
+
----------
|
|
960
960
|
points_type : list = ['evaluated_points']
|
|
961
961
|
The type of points to be plotted. {evaluated_points, coefficients}
|
|
962
962
|
plot_types : list = ['function']
|
|
@@ -1033,7 +1033,7 @@ class Function:
|
|
|
1033
1033
|
Plots the points of the function.
|
|
1034
1034
|
|
|
1035
1035
|
Parameters
|
|
1036
|
-
|
|
1036
|
+
----------
|
|
1037
1037
|
points_type : str = 'evaluated_points'
|
|
1038
1038
|
The type of points to be plotted. {evaluated_points, coefficients}
|
|
1039
1039
|
opactity : float = 1.
|
|
@@ -1063,7 +1063,7 @@ class Function:
|
|
|
1063
1063
|
Plots the function as a curve. NOTE: This should only be called if the function is a curve!
|
|
1064
1064
|
|
|
1065
1065
|
Parameters
|
|
1066
|
-
|
|
1066
|
+
----------
|
|
1067
1067
|
points_type : str = 'evaluated_points'
|
|
1068
1068
|
The type of points to be plotted. {evaluated_points, coefficients}
|
|
1069
1069
|
opactity : float = 1.
|
|
@@ -1148,7 +1148,7 @@ class Function:
|
|
|
1148
1148
|
Plots the function as a surface. NOTE: This should only be called if the function is a surface!
|
|
1149
1149
|
|
|
1150
1150
|
Parameters
|
|
1151
|
-
|
|
1151
|
+
----------
|
|
1152
1152
|
points_type : str = 'evaluated_points'
|
|
1153
1153
|
The type of points to be plotted. {evaluated_points, coefficients}
|
|
1154
1154
|
plot_types : list = ['function']
|
|
@@ -1261,7 +1261,7 @@ class Function:
|
|
|
1261
1261
|
Plots the function as a volume. NOTE: This should only be called if the function is a volume!
|
|
1262
1262
|
|
|
1263
1263
|
Parameters
|
|
1264
|
-
|
|
1264
|
+
----------
|
|
1265
1265
|
points_type : str = 'evaluated_points'
|
|
1266
1266
|
The type of points to be plotted. {evaluated_points, coefficients}
|
|
1267
1267
|
plot_types : list = ['function']
|
|
@@ -14,7 +14,7 @@ from lsdo_function_spaces.core.interface import Interface, InterfaceCondition, C
|
|
|
14
14
|
|
|
15
15
|
@dataclass
|
|
16
16
|
class RankNullityReport:
|
|
17
|
-
"""
|
|
17
|
+
r"""
|
|
18
18
|
Diagnostic report of constraint matrix rank, redundancy, and nullity.
|
|
19
19
|
|
|
20
20
|
Parameters
|
|
@@ -24,15 +24,15 @@ class RankNullityReport:
|
|
|
24
24
|
num_constraints : int
|
|
25
25
|
Total number of scalar constraint equations evaluated.
|
|
26
26
|
rank : int
|
|
27
|
-
Numerical rank
|
|
27
|
+
Numerical rank :math:`r = \mathrm{rank}(J_c)` computed via singular value decomposition.
|
|
28
28
|
redundancy : int
|
|
29
|
-
Number of redundant constraint equations:
|
|
29
|
+
Number of redundant constraint equations: :math:`p - r`.
|
|
30
30
|
nullity : int
|
|
31
|
-
Dimension of the constraint null space:
|
|
31
|
+
Dimension of the constraint null space: :math:`n - r`.
|
|
32
32
|
gauge_modes : int
|
|
33
33
|
Number of rigid-body or unconstrained gauge degrees of freedom accounted for.
|
|
34
34
|
relative_freedom : int
|
|
35
|
-
Effective design degrees of freedom:
|
|
35
|
+
Effective design degrees of freedom: :math:`\max(0, \mathrm{nullity} - \mathrm{gauge\_modes})`.
|
|
36
36
|
rank_tolerance : float
|
|
37
37
|
Singular value cutoff threshold used to determine rank.
|
|
38
38
|
is_licq_satisfied : bool
|
|
@@ -54,7 +54,8 @@ class FunctionNetwork:
|
|
|
54
54
|
Coupled network of functions, multi-patch function sets, interfaces, and conditions.
|
|
55
55
|
|
|
56
56
|
A FunctionNetwork represents the overall topological and algebraic assembly:
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
- Nodes: Function or FunctionSet patches :math:`(f_i, \\mathrm{patch\\_id})`.
|
|
58
59
|
- Hyperedges: Interface objects coupling markers across patches.
|
|
59
60
|
- Mechanics: InterfaceCondition objects enforcing algebraic residuals.
|
|
60
61
|
|
|
@@ -269,15 +270,20 @@ class FunctionNetwork:
|
|
|
269
270
|
return internal, between
|
|
270
271
|
|
|
271
272
|
def compute_cycle_rank(self) -> Tuple[int, int]:
|
|
272
|
-
"""
|
|
273
|
-
Computes the first Betti number
|
|
274
|
-
|
|
273
|
+
r"""
|
|
274
|
+
Computes the first Betti number :math:`b_1` on the patch-level incidence multigraph:
|
|
275
|
+
|
|
276
|
+
.. math::
|
|
277
|
+
|
|
278
|
+
b_{1,\mathrm{multigraph}} = |E_{\mathrm{inc}}| - (|V_{\mathrm{patches}}| + |V_{\mathrm{interfaces}}|) + C
|
|
279
|
+
|
|
275
280
|
and the macroscopic loop count after collapsing parallel edges between identical patch sets.
|
|
276
281
|
|
|
277
282
|
Returns
|
|
278
283
|
-------
|
|
279
284
|
Tuple[int, int]
|
|
280
285
|
(b1_multigraph, b1_macroscopic)
|
|
286
|
+
|
|
281
287
|
- b1_multigraph counts all independent topological cycles including multi-point parallel attachments.
|
|
282
288
|
- b1_macroscopic counts global topological loops between components.
|
|
283
289
|
"""
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/function_set.py
RENAMED
|
@@ -407,6 +407,7 @@ class FunctionSet:
|
|
|
407
407
|
----------
|
|
408
408
|
parametric_coordinates : Optional[Union[tuple[int, npt.NDArray[np.float64]], list[tuple[int, npt.NDArray[np.float64]]]]]
|
|
409
409
|
Direct parametric coordinates on the function set, specified as:
|
|
410
|
+
|
|
410
411
|
- A tuple: (function_index, uv_array) for a single point.
|
|
411
412
|
- Or a list of tuples: [(function_index, uv_array), ...] for one or more points.
|
|
412
413
|
name : Optional[str]
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/interface.py
RENAMED
|
@@ -572,17 +572,18 @@ class InterfaceCondition:
|
|
|
572
572
|
|
|
573
573
|
|
|
574
574
|
class CollocationCondition(InterfaceCondition):
|
|
575
|
-
"""
|
|
575
|
+
r"""
|
|
576
576
|
Collocation condition enforcing trace equality across markers, unary target planes, or prescribed offsets.
|
|
577
577
|
|
|
578
578
|
Supports component selection per marker (e.g. constraining only x and z components)
|
|
579
|
-
and derivative matching for
|
|
579
|
+
and derivative matching for :math:`C^1` continuity.
|
|
580
580
|
|
|
581
581
|
Formulation:
|
|
582
|
+
|
|
582
583
|
- Multi-marker (star scheme against marker 0):
|
|
583
|
-
|
|
584
|
+
:math:`r_k(\gamma) = (f_k \circ \alpha_k)(\gamma) - (f_0 \circ \alpha_0)(\gamma) - \mathrm{offset}`
|
|
584
585
|
- Unary target:
|
|
585
|
-
|
|
586
|
+
:math:`r_0(\gamma) = (f_0 \circ \alpha_0)(\gamma) - \mathrm{target}`
|
|
586
587
|
|
|
587
588
|
Parameters
|
|
588
589
|
----------
|
|
@@ -686,12 +687,13 @@ class CollocationCondition(InterfaceCondition):
|
|
|
686
687
|
|
|
687
688
|
|
|
688
689
|
class TransversalDerivativeCondition(InterfaceCondition):
|
|
689
|
-
"""
|
|
690
|
+
r"""
|
|
690
691
|
Directional / transversal derivative matching condition across an Interface.
|
|
691
692
|
|
|
692
|
-
Enforces
|
|
693
|
+
Enforces :math:`C^1` parametric derivative matching across patch boundaries:
|
|
694
|
+
|
|
693
695
|
- Multi-marker (star scheme against marker 0):
|
|
694
|
-
|
|
696
|
+
:math:`r_k(\gamma) = D_{d_k}(f_k \circ \alpha_k)(\gamma) - \mu_k D_{d_0}(f_0 \circ \alpha_0)(\gamma)`
|
|
695
697
|
|
|
696
698
|
Parameters
|
|
697
699
|
----------
|
|
@@ -778,13 +780,15 @@ class TransversalDerivativeCondition(InterfaceCondition):
|
|
|
778
780
|
|
|
779
781
|
|
|
780
782
|
class NormalAlignmentCondition(InterfaceCondition):
|
|
781
|
-
"""
|
|
782
|
-
Surface normal alignment condition enforcing
|
|
783
|
+
r"""
|
|
784
|
+
Surface normal alignment condition enforcing :math:`G^1` / tangent-plane continuity across an Interface.
|
|
783
785
|
|
|
784
786
|
Enforces that unit surface normal vectors align across patch boundaries:
|
|
787
|
+
|
|
785
788
|
- Multi-marker (star scheme against marker 0):
|
|
786
|
-
|
|
787
|
-
|
|
789
|
+
:math:`r_k(\gamma) = n_k(\gamma) - \sigma n_0(\gamma)`
|
|
790
|
+
|
|
791
|
+
where :math:`\sigma = \pm 1` represents relative surface orientation.
|
|
788
792
|
|
|
789
793
|
Parameters
|
|
790
794
|
----------
|
|
@@ -865,10 +869,11 @@ class NormalAlignmentCondition(InterfaceCondition):
|
|
|
865
869
|
|
|
866
870
|
|
|
867
871
|
class ClearanceCondition(InterfaceCondition):
|
|
868
|
-
"""
|
|
872
|
+
r"""
|
|
869
873
|
Clearance / non-penetration inequality condition across an Interface.
|
|
870
874
|
|
|
871
|
-
Enforces that the Euclidean distance between pairs of markers satisfies a minimum clearance
|
|
875
|
+
Enforces that the Euclidean distance between pairs of markers satisfies a minimum clearance::
|
|
876
|
+
|
|
872
877
|
||f_k(gamma_k) - f_0(gamma_0)|| >= min_clearance
|
|
873
878
|
|
|
874
879
|
Parameters
|
|
@@ -876,10 +881,13 @@ class ClearanceCondition(InterfaceCondition):
|
|
|
876
881
|
interface : Interface
|
|
877
882
|
The interface hyperedge containing the coupled markers (must have at least 2 markers).
|
|
878
883
|
min_clearance : float
|
|
879
|
-
Minimum required physical clearance distance
|
|
884
|
+
Minimum required physical clearance distance :math:`d_{\min} \ge 0`. Default is 0.0.
|
|
880
885
|
mode : Literal["violation", "margin"], optional
|
|
881
|
-
|
|
882
|
-
|
|
886
|
+
Evaluation mode:
|
|
887
|
+
|
|
888
|
+
- "violation": evaluates :math:`\max(0, d_{\min}^2 - \|p_k - p_0\|^2)`, which is zero when satisfied.
|
|
889
|
+
- "margin": evaluates :math:`\|p_k - p_0\|^2 - d_{\min}^2`, where :math:`\ge 0` indicates satisfaction.
|
|
890
|
+
|
|
883
891
|
Default is "violation".
|
|
884
892
|
discretization : Optional[Discretization], optional
|
|
885
893
|
Discretization scheme for continuous interfaces. If None, uses interface.discretization.
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/marker.py
RENAMED
|
@@ -286,8 +286,10 @@ class Marker:
|
|
|
286
286
|
|
|
287
287
|
def compute_boundary_violation(self) -> Optional[csdl.Variable]:
|
|
288
288
|
"""
|
|
289
|
-
Computes the quadratic box boundary violation penalty for variable parametric coordinates
|
|
289
|
+
Computes the quadratic box boundary violation penalty for variable parametric coordinates::
|
|
290
|
+
|
|
290
291
|
sum( relu(u_min - u)^2 + relu(u - u_max)^2 )
|
|
292
|
+
|
|
291
293
|
Returns None if coordinates are numeric constant, or a scalar CSDL variable if variable.
|
|
292
294
|
"""
|
|
293
295
|
if self.is_constant:
|
|
@@ -23,8 +23,8 @@ def compute_projection_residual(
|
|
|
23
23
|
"""
|
|
24
24
|
Compute the residual of the projection of a point in space onto a B-spline surface.
|
|
25
25
|
|
|
26
|
-
Parameters
|
|
27
|
-
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
28
|
point_in_space : jnp.ndarray, shape (d,)
|
|
29
29
|
The point in space to project.
|
|
30
30
|
para_coords : jnp.ndarray, shape (M, d)
|
|
@@ -36,8 +36,8 @@ def compute_projection_residual(
|
|
|
36
36
|
knot_vectors : tuple of jnp.ndarray
|
|
37
37
|
Knot vectors for each dimension.
|
|
38
38
|
|
|
39
|
-
Returns
|
|
40
|
-
|
|
39
|
+
Returns
|
|
40
|
+
-------
|
|
41
41
|
residual : jnp.ndarray, shape (M,)
|
|
42
42
|
The residuals of the projection.
|
|
43
43
|
"""
|
|
@@ -88,8 +88,8 @@ def compute_projection_jacobian(
|
|
|
88
88
|
"""
|
|
89
89
|
Compute the Jacobian of the projection of a point in space onto a B-spline surface.
|
|
90
90
|
|
|
91
|
-
Parameters
|
|
92
|
-
|
|
91
|
+
Parameters
|
|
92
|
+
----------
|
|
93
93
|
point_in_space : jnp.ndarray, shape (d,)
|
|
94
94
|
The point in space to project.
|
|
95
95
|
para_coords : jnp.ndarray, shape (M, d)
|
|
@@ -105,8 +105,8 @@ def compute_projection_jacobian(
|
|
|
105
105
|
surface_jacobian : list of jnp.ndarray, shape (M, num_phys_dims)
|
|
106
106
|
Jacobian of the B-spline surface at the parameter coordinates.
|
|
107
107
|
|
|
108
|
-
Returns
|
|
109
|
-
|
|
108
|
+
Returns
|
|
109
|
+
-------
|
|
110
110
|
jacobian : jnp.ndarray, shape (M, d)
|
|
111
111
|
The Jacobian of the projection.
|
|
112
112
|
"""
|
|
@@ -12,8 +12,8 @@ def compute_projection_residual(
|
|
|
12
12
|
"""
|
|
13
13
|
Compute the residual of the projection of a point in space onto a B-spline surface.
|
|
14
14
|
|
|
15
|
-
Parameters
|
|
16
|
-
|
|
15
|
+
Parameters
|
|
16
|
+
----------
|
|
17
17
|
point_in_space : jnp.ndarray, shape (d,)
|
|
18
18
|
The point in space to project.
|
|
19
19
|
para_coords : jnp.ndarray, shape (M, d)
|
|
@@ -25,8 +25,8 @@ def compute_projection_residual(
|
|
|
25
25
|
knot_vectors : tuple of jnp.ndarray
|
|
26
26
|
Knot vectors for each dimension.
|
|
27
27
|
|
|
28
|
-
Returns
|
|
29
|
-
|
|
28
|
+
Returns
|
|
29
|
+
-------
|
|
30
30
|
residual : jnp.ndarray, shape (M,)
|
|
31
31
|
The residuals of the projection.
|
|
32
32
|
"""
|
|
@@ -73,8 +73,8 @@ def compute_projection_jacobian(
|
|
|
73
73
|
"""
|
|
74
74
|
Compute the Jacobian of the projection of a point in space onto a B-spline surface.
|
|
75
75
|
|
|
76
|
-
Parameters
|
|
77
|
-
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
78
|
point_in_space : jnp.ndarray, shape (d,)
|
|
79
79
|
The point in space to project.
|
|
80
80
|
para_coords : jnp.ndarray, shape (M, d)
|
|
@@ -90,8 +90,8 @@ def compute_projection_jacobian(
|
|
|
90
90
|
surface_jacobian : list of jnp.ndarray, shape (M, num_phys_dims)
|
|
91
91
|
Jacobian of the B-spline surface at the parameter coordinates.
|
|
92
92
|
|
|
93
|
-
Returns
|
|
94
|
-
|
|
93
|
+
Returns
|
|
94
|
+
-------
|
|
95
95
|
jacobian : jnp.ndarray, shape (M, d)
|
|
96
96
|
The Jacobian of the projection.
|
|
97
97
|
"""
|
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
Optimized B-spline surface projection (point -> parametric coords).
|
|
4
4
|
|
|
5
5
|
Key features:
|
|
6
|
+
|
|
6
7
|
1. High-efficiency Gauss-Newton / Levenberg-Marquardt (LM) distance minimization.
|
|
7
8
|
2. JAX implementation (jit + vmap friendly).
|
|
8
9
|
3. NumPy vectorized implementation.
|
|
9
10
|
|
|
10
11
|
Algorithm overview:
|
|
12
|
+
|
|
11
13
|
- Avoids second derivatives (surface Hessians) entirely.
|
|
12
|
-
- Minimizes squared distance: f(xi) = 1/2 * || S(xi) - p ||^2
|
|
13
|
-
- Gauss-Newton step: (J^T J) delta = - J^T r
|
|
14
|
-
- LM step: (J^T J + lambda I) delta = - J^T r
|
|
14
|
+
- Minimizes squared distance: ``f(xi) = 1/2 * || S(xi) - p ||^2``.
|
|
15
|
+
- Gauss-Newton step: ``(J^T J) delta = - J^T r``.
|
|
16
|
+
- LM step: ``(J^T J + lambda I) delta = - J^T r``.
|
|
15
17
|
|
|
16
18
|
Both implementations implement:
|
|
19
|
+
|
|
17
20
|
- Box constraints via clipping.
|
|
18
21
|
- Active-set masking near bounds.
|
|
19
22
|
- Early stopping using convergence masks.
|
|
@@ -365,9 +368,11 @@ def make_projector_lm_numpy(
|
|
|
365
368
|
"""
|
|
366
369
|
Factory returning evaluators for S(u) and partials using your stencil-based NumPy evaluator.
|
|
367
370
|
|
|
368
|
-
Returns
|
|
369
|
-
|
|
370
|
-
|
|
371
|
+
Returns
|
|
372
|
+
-------
|
|
373
|
+
tuple
|
|
374
|
+
eval_S(us, coeffs) -> (M, phys_dim)
|
|
375
|
+
eval_partials(us, coeffs) -> (M, phys_dim, n_param)
|
|
371
376
|
"""
|
|
372
377
|
if make_bspline_evaluator_numpy is None:
|
|
373
378
|
raise ImportError("make_bspline_evaluator_numpy not found; ensure compute_basis_matrix_numpy_factory.py is on path.")
|
|
@@ -147,8 +147,8 @@ def evaluate_b_spline_jax(us, degrees, knot_vectors, coeffs, der_orders=None):
|
|
|
147
147
|
"""
|
|
148
148
|
Evaluate B-spline basis functions at parameter u with derivatives.
|
|
149
149
|
|
|
150
|
-
Parameters
|
|
151
|
-
|
|
150
|
+
Parameters
|
|
151
|
+
----------
|
|
152
152
|
us : jnp.ndarray, shape (M, d)
|
|
153
153
|
Parameter values where the B-spline basis functions are evaluated.
|
|
154
154
|
degrees : tuple of int
|
|
@@ -332,8 +332,8 @@ def evaluate_b_spline_jax(us, degrees, knot_vectors, coeffs, der_orders=None):
|
|
|
332
332
|
"""
|
|
333
333
|
Evaluate B-spline basis functions at parameter u with derivatives.
|
|
334
334
|
|
|
335
|
-
Parameters
|
|
336
|
-
|
|
335
|
+
Parameters
|
|
336
|
+
----------
|
|
337
337
|
us : jnp.ndarray, shape (M, d)
|
|
338
338
|
Parameter values where the B-spline basis functions are evaluated.
|
|
339
339
|
degrees : tuple of int
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/file_io.py
RENAMED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"""STEP file importer (patched).
|
|
2
2
|
|
|
3
3
|
Correctness fixes:
|
|
4
|
+
|
|
4
5
|
- Robust entity parsing across line wraps (entities end with ';')
|
|
5
6
|
- Correct float parsing for knots/control points (supports E/e and D/d exponents)
|
|
6
7
|
- Correct knot expansion with multiplicities
|
|
7
8
|
- Order-preserving control point lookup via id->xyz dictionary
|
|
8
9
|
|
|
9
10
|
Performance improvements:
|
|
11
|
+
|
|
10
12
|
- Single pass read: builds entity dict and point dict once
|
|
11
13
|
- Avoids pandas and global regex scans
|
|
12
14
|
- Caches BSplineSpace objects by a stable hash key
|
|
@@ -14,6 +16,7 @@ Performance improvements:
|
|
|
14
16
|
Intended primarily for OpenVSP-exported STEP files containing B_SPLINE_SURFACE_WITH_KNOTS.
|
|
15
17
|
|
|
16
18
|
Public API:
|
|
19
|
+
|
|
17
20
|
- import_file(...)
|
|
18
21
|
- _check_if_load_stored_import(...)
|
|
19
22
|
"""
|
|
@@ -233,7 +236,9 @@ def _detect_knot_fields(fields: List[str]) -> Tuple[List[int], List[int], List[f
|
|
|
233
236
|
def _parse_bspline_surface_with_knots(rhs: str) -> Optional[Tuple[str, int, int, np.ndarray, List[int], List[int], List[float], List[float]]]:
|
|
234
237
|
"""Parse B_SPLINE_SURFACE_WITH_KNOTS entity RHS.
|
|
235
238
|
|
|
236
|
-
Returns
|
|
239
|
+
Returns
|
|
240
|
+
-------
|
|
241
|
+
tuple
|
|
237
242
|
(name, deg_u, deg_v, cp_id_grid, u_mults, v_mults, u_knots, v_knots)
|
|
238
243
|
"""
|
|
239
244
|
if not rhs.startswith('B_SPLINE_SURFACE_WITH_KNOTS'):
|
|
@@ -81,7 +81,7 @@ def show_plot(
|
|
|
81
81
|
Shows the plot.
|
|
82
82
|
|
|
83
83
|
Parameters
|
|
84
|
-
|
|
84
|
+
----------
|
|
85
85
|
plotting_elements : Optional[list]
|
|
86
86
|
The list of PyVista plotting elements to plot. Default is None ([]).
|
|
87
87
|
title : str
|
|
@@ -150,7 +150,7 @@ def plot_points(points:np.ndarray, opacity:float=1., color:Union[str, np.ndarray
|
|
|
150
150
|
Plots a point cloud.
|
|
151
151
|
|
|
152
152
|
Parameters
|
|
153
|
-
|
|
153
|
+
----------
|
|
154
154
|
points : np.ndarray
|
|
155
155
|
The points to plot.
|
|
156
156
|
opactity : float = 1.
|
|
@@ -201,7 +201,7 @@ def plot_curve(points:np.ndarray, opacity:float=1., color:Union[str, np.ndarray]
|
|
|
201
201
|
Plots the B-spline Surface.
|
|
202
202
|
|
|
203
203
|
Parameters
|
|
204
|
-
|
|
204
|
+
----------
|
|
205
205
|
points : np.ndarray -- shape=(num_points, num_physical_dimensions)
|
|
206
206
|
The points of the curve to be plotted.
|
|
207
207
|
opactity : float
|
|
@@ -253,7 +253,7 @@ def plot_surface(points:np.ndarray, plot_types:list=['function'], opacity:float=
|
|
|
253
253
|
Plots the B-spline Surface.
|
|
254
254
|
|
|
255
255
|
Parameters
|
|
256
|
-
|
|
256
|
+
----------
|
|
257
257
|
points : np.ndarray -- shape=(num_points_u, num_points_v, num_physical_dimensions)
|
|
258
258
|
The type of points to be plotted. {evaluated_points, coefficients}
|
|
259
259
|
plot_types : list
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1/lsdo_function_spaces.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lsdo_function_spaces
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: A package for functional representation and function spaces in multidisciplinary design optimization.
|
|
5
5
|
Author-email: Andrew Fletcher <afletcher168@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Release Notes
|
|
2
2
|
|
|
3
|
+
## lsdo_function_spaces 1.2.1 (November 2026)
|
|
4
|
+
|
|
5
|
+
* **Documentation & Sphinx CI Fixes**: Corrected reST docstring formatting, list indentation, and LaTeX math syntax in `FunctionNetwork`, `CollocationCondition`, `NormalAlignmentCondition`, `TransversalDerivativeCondition`, `ClearanceCondition`, and `Marker` to resolve Sphinx `-W` build verification warnings on Python 3.11.
|
|
6
|
+
* **Docstring Cleanups**: Normalized numpydoc section headers and underline lengths across core and utility modules.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
3
10
|
## lsdo_function_spaces 1.2.0 (November 2026)
|
|
4
11
|
|
|
5
12
|
`lsdo_function_spaces` 1.2.0 introduces a comprehensive topological connectivity, semantic marker, and function network framework for multidisciplinary geometric modeling and optimization. This release establishes a mathematically rigorous separation between connectivity topology and constraint mechanics, supporting continuous and discrete multi-patch coupling, high-order continuity enforcement, automated seam discovery on CAD geometries, and algebraic freedom diagnostics via Singular Value Decomposition (SVD).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/core/optimization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces/utils/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/lsdo_function_spaces.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lsdo_function_spaces-1.2.0 → lsdo_function_spaces-1.2.1}/tests/test_backward_compatibility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|