From d788e1114aaed2c5e7c8212399b02ccfa3d2e52b Mon Sep 17 00:00:00 2001 From: Tim Brooks <41971846+timryanb@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:26:44 -0400 Subject: [PATCH] Adding option to prevent OpenMDAO from suppressing tecplot file writing (#427) * Adding option to prevent OpenMDAO from suppressing tecplot file writing when using `group_by_pre_opt_post` feature * black reformat * version upperbound for next mphys major release * Bump patch version --------- Co-authored-by: Eytan Adler <63426601+eytanadler@users.noreply.github.com> --- openaerostruct/mphys/lift_distribution.py | 2 ++ openaerostruct/mphys/surface_contours.py | 2 ++ setup.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/openaerostruct/mphys/lift_distribution.py b/openaerostruct/mphys/lift_distribution.py index 056a70eed..bb7bb79b9 100644 --- a/openaerostruct/mphys/lift_distribution.py +++ b/openaerostruct/mphys/lift_distribution.py @@ -42,6 +42,8 @@ def setup(self): nx, ny, _ = mesh.shape self.add_input(name + "_def_mesh", val=mesh, units="m", tags=["mphys_coupling"]) self.add_input(name + "_sec_forces", val=np.ones((nx - 1, ny - 1, 3)), units="N", tags=["mphys_coupling"]) + # Prevents OpenMDAO from suppressing this component when using group_by_pre_opt_post feature + self.options["always_opt"] = True def compute(self, inputs, outputs): """ diff --git a/openaerostruct/mphys/surface_contours.py b/openaerostruct/mphys/surface_contours.py index cff18ae19..022b00d26 100644 --- a/openaerostruct/mphys/surface_contours.py +++ b/openaerostruct/mphys/surface_contours.py @@ -47,6 +47,8 @@ def setup(self): self.add_input(name + "_sec_forces", val=np.ones([nx - 1, ny - 1, 3]), units="N", tags=["mphys_coupling"]) self.add_input("circulations", val=np.zeros([tot_panels]), units="m**2/s", tags=["mphys_coupling"]) self.solution_counter = 0 + # Prevents OpenMDAO from suppressing this component when using group_by_pre_opt_post feature + self.options["always_opt"] = True def compute(self, inputs, outputs): """ diff --git a/setup.py b/setup.py index 1614b911b..ee0d8435b 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ "docs": ["sphinx_mdolab_theme"], "test": ["testflo"], "ffd": ["pygeo>=1.6.0"], - "mphys": ["mphys>=1.0.0"], + "mphys": ["mphys>=1.0.0,<2.0.0"], } # Add an optional dependency that concatenates all others