Skip to content

Commit b5ac877

Browse files
sabakhshikanekosheytanadler
authored
Support for Numpy 2.1 and OpenMDAO 3.35 (#450)
* Add support for numpy2 and OpenMDAO 3.35 * Fix b-spline interpolation for mid_panel x_interp points. Compatible with openMDAO 3.35 and later * Bump OAS version and required OpenMDAO version. Update docs * Removed openmdao version constraint * also removed numpy version constraint * Add support for numpy2 and OpenMDAO 3.35 * Fix b-spline interpolation for mid_panel x_interp points. Compatible with openMDAO 3.35 and later * Bump OAS version and required OpenMDAO version. Update docs * Removed openmdao version constraint * also removed numpy version constraint * Update b-spline component for structures and retrain all tests * Flake 8 fix * Docs updates * Change MPhys capitalization --------- Co-authored-by: Shugo Kaneko <49300827+kanekosh@users.noreply.github.com> Co-authored-by: Eytan Adler <63426601+eytanadler@users.noreply.github.com>
1 parent f79f9cc commit b5ac877

29 files changed

Lines changed: 78 additions & 54 deletions

.github/build_real.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
22
set -e
33
sed -i '/mphys/d' "$HOME/.config/pip/constraints.txt" # Remove the pip constraint on the mphys version
4+
sed -i '/numpy/d; /openmdao/d' "$HOME/.config/pip/constraints.txt" # Remove the pip constraint on the numpy and openmdao version
45
pip install .[testing,mphys]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The oldest and latest versions of the dependencies that we test regularly are th
9898
| Python | 3.8 | 3.11 |
9999
| NumPy | 1.20 | latest |
100100
| SciPy | 1.6.0 | latest |
101-
| OpenMDAO | 3.15 | latest |
101+
| OpenMDAO | 3.35 | latest |
102102
| Matplotlib | latest | latest |
103103
| MPhys (optional) | 2.0.0 | latest |
104104
| pyGeo (optional) | 1.6.0 | latest |

openaerostruct/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.9.1"
1+
__version__ = "2.10.0"

openaerostruct/aerodynamics/eval_mtx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def setup(self):
210210
(num_eval_points, nx - 1, ny - 1, 3, 3)
211211
)
212212
aic_base = np.einsum("ijkl,m->ijklm", vel_mtx_indices, np.ones(3, int))
213-
aic_len = np.sum(np.product(aic_base.shape))
213+
aic_len = np.sum(np.prod(aic_base.shape))
214214

215215
if ground_effect:
216216
# mirrored surface along the x mesh direction

openaerostruct/docs/installation.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The oldest and latest versions of the dependencies that we test regularly are th
4444
- 1.6.0
4545
- latest
4646
* - OpenMDAO
47-
- 3.15
47+
- 3.35
4848
- latest
4949
* - Matplotlib
5050
- latest
@@ -55,6 +55,9 @@ The oldest and latest versions of the dependencies that we test regularly are th
5555
* - OpenVSP (optional)
5656
- 3.27.1
5757
- 3.27.1
58+
* - MPhys (optional)
59+
- 2.0
60+
- latest
5861

5962
If you are unfamiliar with OpenMDAO and wish to modify the internals of OpenAeroStruct, you should examine the OpenMDAO documentation at http://openmdao.org/twodocs/versions/latest/index.html. The tutorials provided with OpenMDAO are helpful to understand the basics of using OpenMDAO to solve an optimization problem.
6063

openaerostruct/geometry/geometry_group.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def setup(self):
4646
comp = self.add_subsystem(
4747
"t_over_c_bsp",
4848
om.SplineComp(
49-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
49+
method="bsplines",
50+
x_interp_val=x_interp,
51+
num_cp=n_cp,
52+
interp_options={"order": min(n_cp, 4), "x_cp_start": 0.0, "x_cp_end": 1.0},
5053
),
5154
promotes_inputs=["t_over_c_cp"],
5255
promotes_outputs=["t_over_c"],
@@ -110,7 +113,10 @@ def setup(self):
110113
comp = self.add_subsystem(
111114
"t_over_c_bsp",
112115
om.SplineComp(
113-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
116+
method="bsplines",
117+
x_interp_val=x_interp,
118+
num_cp=n_cp,
119+
interp_options={"order": min(n_cp, 4), "x_cp_start": 0, "x_cp_end": 1},
114120
),
115121
promotes_inputs=["t_over_c_cp"],
116122
promotes_outputs=["t_over_c"],

openaerostruct/structures/tube_group.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def setup(self):
2222
comp = self.add_subsystem(
2323
"thickness_bsp",
2424
om.SplineComp(
25-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
25+
method="bsplines",
26+
x_interp_val=x_interp,
27+
num_cp=n_cp,
28+
interp_options={"order": min(n_cp, 4), "x_cp_start": 0, "x_cp_end": 1},
2629
),
2730
promotes_inputs=["thickness_cp"],
2831
promotes_outputs=["thickness"],
@@ -37,7 +40,10 @@ def setup(self):
3740
comp = self.add_subsystem(
3841
"radius_bsp",
3942
om.SplineComp(
40-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
43+
method="bsplines",
44+
x_interp_val=x_interp,
45+
num_cp=n_cp,
46+
interp_options={"order": min(n_cp, 4), "x_cp_start": 0, "x_cp_end": 1},
4147
),
4248
promotes_inputs=["radius_cp"],
4349
promotes_outputs=["radius"],

openaerostruct/structures/wingbox_group.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ def setup(self):
2020
comp = self.add_subsystem(
2121
"spar_thickness_bsp",
2222
om.SplineComp(
23-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
23+
method="bsplines",
24+
x_interp_val=x_interp,
25+
num_cp=n_cp,
26+
interp_options={"order": min(n_cp, 4), "x_cp_start": 0, "x_cp_end": 1},
2427
),
2528
promotes_inputs=["spar_thickness_cp"],
2629
promotes_outputs=["spar_thickness"],
@@ -35,7 +38,10 @@ def setup(self):
3538
comp = self.add_subsystem(
3639
"skin_thickness_bsp",
3740
om.SplineComp(
38-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
41+
method="bsplines",
42+
x_interp_val=x_interp,
43+
num_cp=n_cp,
44+
interp_options={"order": min(n_cp, 4), "x_cp_start": 0, "x_cp_end": 1},
3945
),
4046
promotes_inputs=["skin_thickness_cp"],
4147
promotes_outputs=["skin_thickness"],

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
package_data={"openaerostruct": ["tests/*.py", "*/tests/*.py", "*/*/tests/*.py"]},
5454
install_requires=[
5555
# Remember to update the oldest versions in the GitHub Actions build, the readme, and in docs/installation.rst
56-
"openmdao>=3.15",
56+
"openmdao>=3.35",
5757
"numpy>=1.20",
5858
"scipy>=1.6.0",
5959
"matplotlib",

tests/aerodynamics_tests/test_wave_drag.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ def test(self):
2929
comp = group.add_subsystem(
3030
"t_over_c_bsp",
3131
om.SplineComp(
32-
method="bsplines", x_interp_val=x_interp, num_cp=n_cp, interp_options={"order": min(n_cp, 4)}
32+
method="bsplines",
33+
x_interp_val=x_interp,
34+
num_cp=n_cp,
35+
interp_options={"order": min(n_cp, 4)},
3336
),
3437
promotes_inputs=["t_over_c_cp"],
3538
promotes_outputs=["t_over_c"],

0 commit comments

Comments
 (0)