lsdo-geo 1.0.0__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_geo-1.0.0/LICENSE.txt +165 -0
- lsdo_geo-1.0.0/MANIFEST.in +10 -0
- lsdo_geo-1.0.0/PKG-INFO +166 -0
- lsdo_geo-1.0.0/README.md +126 -0
- lsdo_geo-1.0.0/lsdo_geo/__init__.py +60 -0
- lsdo_geo-1.0.0/lsdo_geo/core/__init__.py +0 -0
- lsdo_geo-1.0.0/lsdo_geo/core/geometry/__init__.py +0 -0
- lsdo_geo-1.0.0/lsdo_geo/core/geometry/geometry.py +589 -0
- lsdo_geo-1.0.0/lsdo_geo/core/geometry/geometry_functions.py +401 -0
- lsdo_geo-1.0.0/lsdo_geo/core/geometry/mesh.py +51 -0
- lsdo_geo-1.0.0/lsdo_geo/core/parameterization/__init__.py +0 -0
- lsdo_geo-1.0.0/lsdo_geo/core/parameterization/ffd_block.py +301 -0
- lsdo_geo-1.0.0/lsdo_geo/core/parameterization/free_form_deformation_functions.py +191 -0
- lsdo_geo-1.0.0/lsdo_geo/core/parameterization/parameterization_solver.py +241 -0
- lsdo_geo-1.0.0/lsdo_geo/core/parameterization/sectional_parameterization.py +976 -0
- lsdo_geo-1.0.0/lsdo_geo/optimization/__init__.py +1 -0
- lsdo_geo-1.0.0/lsdo_geo/optimization/optimization.py +431 -0
- lsdo_geo-1.0.0/lsdo_geo.egg-info/PKG-INFO +166 -0
- lsdo_geo-1.0.0/lsdo_geo.egg-info/SOURCES.txt +44 -0
- lsdo_geo-1.0.0/lsdo_geo.egg-info/dependency_links.txt +1 -0
- lsdo_geo-1.0.0/lsdo_geo.egg-info/requires.txt +19 -0
- lsdo_geo-1.0.0/lsdo_geo.egg-info/top_level.txt +1 -0
- lsdo_geo-1.0.0/pyproject.toml +69 -0
- lsdo_geo-1.0.0/release_notes.md +63 -0
- lsdo_geo-1.0.0/setup.cfg +4 -0
- lsdo_geo-1.0.0/tests/test_ffd_block.py +175 -0
- lsdo_geo-1.0.0/tests/test_geometry.py +121 -0
- lsdo_geo-1.0.0/tests/test_geometry_functions.py +65 -0
- lsdo_geo-1.0.0/tests/test_mapping.py +46 -0
- lsdo_geo-1.0.0/tests/test_mesh.py +101 -0
- lsdo_geo-1.0.0/tests/test_parameterization_solver.py +145 -0
- lsdo_geo-1.0.0/tests/test_plotting.py +129 -0
- lsdo_geo-1.0.0/tests/test_sectional_parameterization.py +295 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include LICENSE.txt README.md pyproject.toml release_notes.md
|
|
2
|
+
recursive-include lsdo_geo *.py
|
|
3
|
+
recursive-include tests *.py
|
|
4
|
+
recursive-exclude scratch *
|
|
5
|
+
recursive-exclude docs *
|
|
6
|
+
recursive-exclude examples *
|
|
7
|
+
global-exclude __pycache__
|
|
8
|
+
global-exclude *.py[co]
|
|
9
|
+
global-exclude .DS_Store
|
|
10
|
+
|
lsdo_geo-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lsdo_geo
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A package for geometry and state modeling/representation, parameterization, and mesh creation for MDO.
|
|
5
|
+
Author-email: Andrew Fletcher <afletcher168@gmail.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Documentation, https://lsdo-geo.readthedocs.io/en/latest/
|
|
8
|
+
Project-URL: Repository, https://github.com/LSDOlab/lsdo_geo
|
|
9
|
+
Project-URL: Issue Tracker, https://github.com/LSDOlab/lsdo_geo/issues
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE.txt
|
|
22
|
+
Requires-Dist: numpy
|
|
23
|
+
Requires-Dist: pyvista
|
|
24
|
+
Requires-Dist: joblib
|
|
25
|
+
Requires-Dist: pandas
|
|
26
|
+
Requires-Dist: scipy
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: pytest; extra == "test"
|
|
29
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
30
|
+
Provides-Extra: docs
|
|
31
|
+
Requires-Dist: myst-nb; extra == "docs"
|
|
32
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
33
|
+
Requires-Dist: sphinx_rtd_theme; extra == "docs"
|
|
34
|
+
Requires-Dist: sphinx-copybutton; extra == "docs"
|
|
35
|
+
Requires-Dist: sphinx-autoapi>=3.0; extra == "docs"
|
|
36
|
+
Requires-Dist: numpydoc; extra == "docs"
|
|
37
|
+
Requires-Dist: gitpython; extra == "docs"
|
|
38
|
+
Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# lsdo_geo
|
|
42
|
+
|
|
43
|
+
[](https://lsdo-geo.readthedocs.io/en/latest/?badge=latest)
|
|
44
|
+
[](https://github.com/LSDOlab/lsdo_geo/actions)
|
|
45
|
+

|
|
46
|
+
[](LICENSE.txt)
|
|
47
|
+
|
|
48
|
+
**lsdo_geo** is a Python library for geometry representation, implicit deformational parameterization, and analytic adjoint sensitivity analysis tailored for gradient-based Multidisciplinary Design Optimization (MDO).
|
|
49
|
+
|
|
50
|
+
Developed by the [Large-Scale Design Optimization (LSDO) Lab](https://lsdo.eng.ucsd.edu/) at the University of California, San Diego.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Key Features
|
|
55
|
+
|
|
56
|
+
* **Geometry-Centric MDO**: Serves as a single, consistent geometric "source of truth", generating and updating discipline-specific meshes (CFD, FEA, acoustics) without manual re-meshing or geometric inconsistency.
|
|
57
|
+
* **Implicit Parameterization Framework**: Formulates geometry parameterization as an inner constrained optimization problem, solving the first-order Karush-Kuhn-Tucker (KKT) system with an exact Newton solver.
|
|
58
|
+
* **Hierarchical Free-Form Deformation (FFD)**: Supports trivariate spline volume lattices with sectional deformation modes—twist, sweep, dihedral, spanwise stretching, and chord taper.
|
|
59
|
+
* **Analytic Adjoint Sensitivities**: Provides exact implicit derivatives $\frac{d\mathbf{x}}{d\mathbf{x}_g}$ through the converged KKT state, seamlessly propagating gradients across the CSDL computational graph.
|
|
60
|
+
* **CAD & Mesh Interoperability**: Direct import, fitting, and export across OpenVSP (`.vsp3`), IGES (`.iges`), STEP (`.stp`), and surface/volume meshes (`.msh`, `.stl`).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Architecture Overview
|
|
65
|
+
|
|
66
|
+
| Subpackage | Key Classes | Description |
|
|
67
|
+
|:---|:---|:---|
|
|
68
|
+
| **`lsdo_geo.core.geometry`** | `Geometry`, `Mesh` | Central multi-component geometric model, CAD imports, rigid transformations, and discipline mesh projections. |
|
|
69
|
+
| **`lsdo_geo.core.parameterization`** | `ParameterizationSolver`, `GeometricVariables`, `FFDBlock`, `SectionalParameterization` | Trivariate FFD lattices, sectional mode definitions, and exact Newton KKT solver. |
|
|
70
|
+
| **`lsdo_geo.optimization`** | `Optimization`, `NewtonOptimizer` | Connects geometric states and constraints into CSDL graph models for analytic adjoint sensitivity analysis. |
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Quickstart
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
import numpy as np
|
|
78
|
+
import csdl_alpha as csdl
|
|
79
|
+
import lsdo_geo as lg
|
|
80
|
+
|
|
81
|
+
# 1. Initialize CSDL graph recorder
|
|
82
|
+
recorder = csdl.Recorder(inline=True)
|
|
83
|
+
recorder.start()
|
|
84
|
+
|
|
85
|
+
# 2. Define or import geometry
|
|
86
|
+
geometry = lg.import_geometry("path/to/wing.stp")
|
|
87
|
+
|
|
88
|
+
# 3. Create a Free-Form Deformation (FFD) block around the geometry
|
|
89
|
+
ffd_block = lg.construct_ffd_block_around_entities(
|
|
90
|
+
geometry,
|
|
91
|
+
num_control_points=(4, 4, 2),
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
# 4. Apply geometric transformations (rotation, translation)
|
|
95
|
+
rotation_origin = np.array([0.0, 0.0, 0.0])
|
|
96
|
+
rotation_axis = np.array([0.0, 0.0, 1.0])
|
|
97
|
+
rotated_points = lg.rotate(
|
|
98
|
+
geometry.coefficients,
|
|
99
|
+
rotation_origin=rotation_origin,
|
|
100
|
+
axis_vector=rotation_axis,
|
|
101
|
+
angles=15.0,
|
|
102
|
+
units="degrees",
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Installation
|
|
109
|
+
|
|
110
|
+
### Prerequisites & Installation
|
|
111
|
+
`lsdo_geo` relies on `CSDL_alpha` and `lsdo_function_spaces`:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
# 1. Install dependencies
|
|
115
|
+
pip install jax networkx
|
|
116
|
+
pip install git+https://github.com/LSDOlab/CSDL_alpha.git@dev_andrew
|
|
117
|
+
pip install git+https://github.com/LSDOlab/lsdo_function_spaces.git
|
|
118
|
+
|
|
119
|
+
# 2. Install lsdo_geo (User)
|
|
120
|
+
pip install lsdo_geo
|
|
121
|
+
# Or install development version directly from GitHub:
|
|
122
|
+
pip install git+https://github.com/LSDOlab/lsdo_geo.git
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### For Developers
|
|
126
|
+
Clone the repository and install in editable mode with testing and documentation extras:
|
|
127
|
+
```sh
|
|
128
|
+
git clone https://github.com/LSDOlab/lsdo_geo.git
|
|
129
|
+
cd lsdo_geo
|
|
130
|
+
pip install jax networkx
|
|
131
|
+
pip install git+https://github.com/LSDOlab/CSDL_alpha.git@dev_andrew
|
|
132
|
+
pip install git+https://github.com/LSDOlab/lsdo_function_spaces.git
|
|
133
|
+
pip install -e ".[test,docs]"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Testing
|
|
139
|
+
|
|
140
|
+
Run the test suite using `pytest`:
|
|
141
|
+
```sh
|
|
142
|
+
pytest
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
To run fast unit tests only:
|
|
146
|
+
```sh
|
|
147
|
+
pytest -m "not slow"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Documentation
|
|
153
|
+
|
|
154
|
+
Full documentation, theoretical background, tutorials, and API reference are hosted on Read the Docs:
|
|
155
|
+
👉 **[lsdo-geo.readthedocs.io](https://lsdo-geo.readthedocs.io/en/latest/)**
|
|
156
|
+
|
|
157
|
+
To build the documentation locally:
|
|
158
|
+
```sh
|
|
159
|
+
sphinx-build -b html docs docs/_build/html
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
`lsdo_geo` is distributed under the terms of the Apache License 2.0. See [LICENSE.txt](LICENSE.txt) for details.
|
lsdo_geo-1.0.0/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# lsdo_geo
|
|
2
|
+
|
|
3
|
+
[](https://lsdo-geo.readthedocs.io/en/latest/?badge=latest)
|
|
4
|
+
[](https://github.com/LSDOlab/lsdo_geo/actions)
|
|
5
|
+

|
|
6
|
+
[](LICENSE.txt)
|
|
7
|
+
|
|
8
|
+
**lsdo_geo** is a Python library for geometry representation, implicit deformational parameterization, and analytic adjoint sensitivity analysis tailored for gradient-based Multidisciplinary Design Optimization (MDO).
|
|
9
|
+
|
|
10
|
+
Developed by the [Large-Scale Design Optimization (LSDO) Lab](https://lsdo.eng.ucsd.edu/) at the University of California, San Diego.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Key Features
|
|
15
|
+
|
|
16
|
+
* **Geometry-Centric MDO**: Serves as a single, consistent geometric "source of truth", generating and updating discipline-specific meshes (CFD, FEA, acoustics) without manual re-meshing or geometric inconsistency.
|
|
17
|
+
* **Implicit Parameterization Framework**: Formulates geometry parameterization as an inner constrained optimization problem, solving the first-order Karush-Kuhn-Tucker (KKT) system with an exact Newton solver.
|
|
18
|
+
* **Hierarchical Free-Form Deformation (FFD)**: Supports trivariate spline volume lattices with sectional deformation modes—twist, sweep, dihedral, spanwise stretching, and chord taper.
|
|
19
|
+
* **Analytic Adjoint Sensitivities**: Provides exact implicit derivatives $\frac{d\mathbf{x}}{d\mathbf{x}_g}$ through the converged KKT state, seamlessly propagating gradients across the CSDL computational graph.
|
|
20
|
+
* **CAD & Mesh Interoperability**: Direct import, fitting, and export across OpenVSP (`.vsp3`), IGES (`.iges`), STEP (`.stp`), and surface/volume meshes (`.msh`, `.stl`).
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Architecture Overview
|
|
25
|
+
|
|
26
|
+
| Subpackage | Key Classes | Description |
|
|
27
|
+
|:---|:---|:---|
|
|
28
|
+
| **`lsdo_geo.core.geometry`** | `Geometry`, `Mesh` | Central multi-component geometric model, CAD imports, rigid transformations, and discipline mesh projections. |
|
|
29
|
+
| **`lsdo_geo.core.parameterization`** | `ParameterizationSolver`, `GeometricVariables`, `FFDBlock`, `SectionalParameterization` | Trivariate FFD lattices, sectional mode definitions, and exact Newton KKT solver. |
|
|
30
|
+
| **`lsdo_geo.optimization`** | `Optimization`, `NewtonOptimizer` | Connects geometric states and constraints into CSDL graph models for analytic adjoint sensitivity analysis. |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quickstart
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
import numpy as np
|
|
38
|
+
import csdl_alpha as csdl
|
|
39
|
+
import lsdo_geo as lg
|
|
40
|
+
|
|
41
|
+
# 1. Initialize CSDL graph recorder
|
|
42
|
+
recorder = csdl.Recorder(inline=True)
|
|
43
|
+
recorder.start()
|
|
44
|
+
|
|
45
|
+
# 2. Define or import geometry
|
|
46
|
+
geometry = lg.import_geometry("path/to/wing.stp")
|
|
47
|
+
|
|
48
|
+
# 3. Create a Free-Form Deformation (FFD) block around the geometry
|
|
49
|
+
ffd_block = lg.construct_ffd_block_around_entities(
|
|
50
|
+
geometry,
|
|
51
|
+
num_control_points=(4, 4, 2),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# 4. Apply geometric transformations (rotation, translation)
|
|
55
|
+
rotation_origin = np.array([0.0, 0.0, 0.0])
|
|
56
|
+
rotation_axis = np.array([0.0, 0.0, 1.0])
|
|
57
|
+
rotated_points = lg.rotate(
|
|
58
|
+
geometry.coefficients,
|
|
59
|
+
rotation_origin=rotation_origin,
|
|
60
|
+
axis_vector=rotation_axis,
|
|
61
|
+
angles=15.0,
|
|
62
|
+
units="degrees",
|
|
63
|
+
)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
### Prerequisites & Installation
|
|
71
|
+
`lsdo_geo` relies on `CSDL_alpha` and `lsdo_function_spaces`:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
# 1. Install dependencies
|
|
75
|
+
pip install jax networkx
|
|
76
|
+
pip install git+https://github.com/LSDOlab/CSDL_alpha.git@dev_andrew
|
|
77
|
+
pip install git+https://github.com/LSDOlab/lsdo_function_spaces.git
|
|
78
|
+
|
|
79
|
+
# 2. Install lsdo_geo (User)
|
|
80
|
+
pip install lsdo_geo
|
|
81
|
+
# Or install development version directly from GitHub:
|
|
82
|
+
pip install git+https://github.com/LSDOlab/lsdo_geo.git
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### For Developers
|
|
86
|
+
Clone the repository and install in editable mode with testing and documentation extras:
|
|
87
|
+
```sh
|
|
88
|
+
git clone https://github.com/LSDOlab/lsdo_geo.git
|
|
89
|
+
cd lsdo_geo
|
|
90
|
+
pip install jax networkx
|
|
91
|
+
pip install git+https://github.com/LSDOlab/CSDL_alpha.git@dev_andrew
|
|
92
|
+
pip install git+https://github.com/LSDOlab/lsdo_function_spaces.git
|
|
93
|
+
pip install -e ".[test,docs]"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Testing
|
|
99
|
+
|
|
100
|
+
Run the test suite using `pytest`:
|
|
101
|
+
```sh
|
|
102
|
+
pytest
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
To run fast unit tests only:
|
|
106
|
+
```sh
|
|
107
|
+
pytest -m "not slow"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Documentation
|
|
113
|
+
|
|
114
|
+
Full documentation, theoretical background, tutorials, and API reference are hosted on Read the Docs:
|
|
115
|
+
👉 **[lsdo-geo.readthedocs.io](https://lsdo-geo.readthedocs.io/en/latest/)**
|
|
116
|
+
|
|
117
|
+
To build the documentation locally:
|
|
118
|
+
```sh
|
|
119
|
+
sphinx-build -b html docs docs/_build/html
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
`lsdo_geo` is distributed under the terms of the Apache License 2.0. See [LICENSE.txt](LICENSE.txt) for details.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""
|
|
2
|
+
lsdo_geo: Geometry representation, deformational parameterization,
|
|
3
|
+
and sensitivity analysis for Multidisciplinary Design Optimization (MDO).
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "1.0.0"
|
|
7
|
+
|
|
8
|
+
from .core.geometry.geometry import Geometry
|
|
9
|
+
from .core.geometry.mesh import Mesh
|
|
10
|
+
from .core.geometry.geometry_functions import (
|
|
11
|
+
import_geometry,
|
|
12
|
+
rotate,
|
|
13
|
+
apply_quaternion_rotation,
|
|
14
|
+
hamilton_product,
|
|
15
|
+
)
|
|
16
|
+
from .core.parameterization.ffd_block import FFDBlock
|
|
17
|
+
from .core.parameterization.free_form_deformation_functions import (
|
|
18
|
+
construct_ffd_block_around_entities,
|
|
19
|
+
construct_ffd_block_from_corners,
|
|
20
|
+
construct_tight_fit_ffd_block,
|
|
21
|
+
)
|
|
22
|
+
from .core.parameterization.sectional_parameterization import (
|
|
23
|
+
SectionalParameterization,
|
|
24
|
+
SectionalParameters,
|
|
25
|
+
VolumeSectionalParameterization,
|
|
26
|
+
VolumeSectionalParameterizationInputs,
|
|
27
|
+
)
|
|
28
|
+
from .core.parameterization.parameterization_solver import (
|
|
29
|
+
ParameterizationSolver,
|
|
30
|
+
GeometricVariables,
|
|
31
|
+
)
|
|
32
|
+
from .optimization import (
|
|
33
|
+
Optimization,
|
|
34
|
+
NewtonOptimizer,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"__version__",
|
|
39
|
+
# Geometry
|
|
40
|
+
"Geometry",
|
|
41
|
+
"Mesh",
|
|
42
|
+
"import_geometry",
|
|
43
|
+
"rotate",
|
|
44
|
+
"apply_quaternion_rotation",
|
|
45
|
+
"hamilton_product",
|
|
46
|
+
# Parameterization
|
|
47
|
+
"FFDBlock",
|
|
48
|
+
"construct_ffd_block_around_entities",
|
|
49
|
+
"construct_ffd_block_from_corners",
|
|
50
|
+
"construct_tight_fit_ffd_block",
|
|
51
|
+
"SectionalParameterization",
|
|
52
|
+
"SectionalParameters",
|
|
53
|
+
"VolumeSectionalParameterization",
|
|
54
|
+
"VolumeSectionalParameterizationInputs",
|
|
55
|
+
"ParameterizationSolver",
|
|
56
|
+
"GeometricVariables",
|
|
57
|
+
# Optimization
|
|
58
|
+
"Optimization",
|
|
59
|
+
"NewtonOptimizer",
|
|
60
|
+
]
|
|
File without changes
|
|
File without changes
|