mdolab / OpenAeroStruct

OpenAeroStruct is a lightweight tool that performs aerostructural optimization using OpenMDAO.
Apache License 2.0
193 stars 118 forks source link

Unable to run AeroPoint calculations #344

Closed jdebecdelievre closed 3 years ago

jdebecdelievre commented 3 years ago

Hello,

I am trying to run the quick start example: http://mdolab.engin.umich.edu/OpenAeroStruct/quick_example.html on a Mac with python 3.8.5, OpenMDAO 3.1.0 and OpenAeroStruct 2.2.1/

I get the following error:

Traceback (most recent call last):
  File "uav_aero.py", line 124, in <module>
    prob.setup(check=True)
  File "opt/anaconda3/envs/denv/lib/python3.8/site-packages/openmdao/core/problem.py", line 757, in setup
    model._setup(model_comm, 'full', mode, distributed_vector_class, local_vector_class,
  File "opt/anaconda3/envs/denv/lib/python3.8/site-packages/openmdao/core/system.py", line 790, in _setup
    self._setup_procs(self.pathname, comm, mode, self._problem_options)
  File "opt/anaconda3/envs/denv/lib/python3.8/site-packages/openmdao/core/group.py", line 420, in _setup_procs
    subsys._setup_procs(subsys.pathname, sub_comm, mode, prob_options)
  File "opt/anaconda3/envs/denv/lib/python3.8/site-packages/openmdao/core/group.py", line 361, in _setup_procs
    self.setup()
  File "OpenAeroStruct/openaerostruct/aerodynamics/aero_groups.py", line 99, in setup
    self.set_input_defaults('beta', val=0., units='deg')
AttributeError: 'AeroPoint' object has no attribute 'set_input_defaults'

The same error was raised when I tried other run cases with only Aero. Do you know where this could be from?

Thank you! Jean

kanekosh commented 3 years ago

Hello Jean,

Could you try it with OpenMDAO 3.2+? The set_input_defaults attribute was introduced in 3.2. The current version of OAS does not support OM 3.1 or older.

Thank you, Shugo

jdebecdelievre commented 3 years ago

Thank you, this worked. Sorry about that!

ewu63 commented 3 years ago

Hm I'm curious how this happened, since the setup.py file specifies openmdao>=3.2. Did you perhaps downgrade OpenMDAO after installing OpenAeroStruct?

jdebecdelievre commented 3 years ago

I didn't downgrade - I even reran pip install 'openmdao[all]' before posting this. I am not sure how this happened but my guess is that, while I regularly pull the more recent openAeroStruct code from git, I have not run pip install -e . in several months.

Anyways, I retried from scratch:

  1. install openmdao with pip
  2. install openAeroStruct by cloning git and using pip and things went fine.
ewu63 commented 3 years ago

I see, if you installed via pip install -e . then you do not need to re-run pip install for OpenAeroStruct after subsequent git pull. We upgraded the OpenMDAO requirements and I guess that never came up because of this.

kanekosh commented 3 years ago

That's right, for OAS, git pull is enough to update the code if you pip-installed it with -e (editable) option. However, git pull does not call setup.py, which would've upgraded OpenMDAO to 3.2+. And I think pip install 'openmdao[all]' does not upgrade OpenMDAO for you.

ewu63 commented 3 years ago

And I think pip install 'openmdao[all]' does not upgrade OpenMDAO for you.

That is correct, you have to either use the -U flag, or specify the version to pip.

jdebecdelievre commented 3 years ago

Thank you for all of your answers!