openmdao

Unable to call PETSc/MPI-based external code in parallel OpenMDAO

时光怂恿深爱的人放手 提交于 2019-12-23 02:19:39
问题 I am writing an OpenMDAO problem that calls a group of external codes in a parallel group. One of these external codes is a PETSc-based fortran FEM code. I realize this is potentially problematic since OpenMDAO also utilizes PETSc. At the moment, I'm calling the external code in a component using python's subprocess. If I run my OpenMDAO problem in serial (i.e. python2.7 omdao_problem.py), everything, including the external code, works just fine. When I try to run it in parallel, however (i.e

How to use nested problems in OpenMDAO 1.x?

Deadly 提交于 2019-12-17 09:59:10
问题 I am trying to implement Collaborative Optimization & other multi-level architectures on OpenMDAO. I read here that this can be done by defining a separate solve_nonlinear method in the Subclass of Problem. The issue is that while running the problem instance the defined solve_linear is not being called. Here is the code - from __future__ import print_function, division import numpy as np import time from openmdao.api import Component,Group, IndepVarComp, ExecComp,\ Problem, ScipyOptimizer,

Failure to import pyOptSparseDriver

拜拜、爱过 提交于 2019-12-13 03:47:16
问题 I have installed OpenMDAO ver. 1.7.4 & successfully run several tutorial examples. However when issuing the command "from openmdao.api import pyOptSparseDriver" I get the response "ImportError: cannot import name pyOptSparseDriver". I feel sure that I should be able to import pyOptSparseDriver (& that I have spelled it correctly). I have tried reinstalling OpenMDAO and this seemed to complete without error, but the problem persists. Could anyone point me in the right direction? Thanks! 回答1:

Scaled paraboloid and derivatives checking

纵然是瞬间 提交于 2019-12-12 19:57:34
问题 I am surprised by the output of the check_partial_derivatives() method applied to the problem showed in my previous question : Paraboloid optimization requiring scaling. When I add the call to that method : from __future__ import print_function import sys from openmdao.api import IndepVarComp, Component, Problem, Group, ScipyOptimizer class Paraboloid(Component): def __init__(self): super(Paraboloid, self).__init__() self.add_param('x', val=0.0) self.add_param('y', val=0.0) self.add_output('f

OpenMDAO how to set subgroup properties?

戏子无情 提交于 2019-12-12 04:26:22
问题 Normally when I use my optimization group I include it in a problem. Then, I can set it's component properties: # import modules, prepare data for Problem setup ... # Initialize problem with my group prob = Problem(impl=impl, root=AEPGroup(nTurbines=10, nDirections=5, minSpacing=2)) # Configure driver, desvars, and constraints prob.driver = pyOptSparseDriver() prob.driver.add_desvar('turbineX', lower=np.ones(nTurbs)*min(turbineX), upper=np.ones(nTurbs)*max(turbineX), scaler=1E-2) prob.driver

Using IPOPT with Openmdao (or pyoptsparse) in python

廉价感情. 提交于 2019-12-12 03:41:44
问题 Hello everyone. I have a little problem : I am working with openmdao and pyOptSparseDriver. It is working for some solvers (SLSQP, PSQP for instance) so there is no problem about that installation. Now i'd like to try the same with IPOPT, but the code is not given with pyoptsparse. I followed the COIN-OR documentation to install IPOPT (http://www.coin-or.org/Ipopt/documentation/node10.html), and everything SEEMS ok (i don't know how to check it). Now i have a COIN-OR folder on my desk and i

Implementing AMMF within OpenMDAO

百般思念 提交于 2019-12-12 02:49:23
问题 I am interested in exploring Multi-Fidelity (MF) optimization methods. I am trying to figure out how well OpenMDAO will support this work. I don't want to get too deep into OpenMDAO code unless I am sure it can do the job. One of the simple MF approaches is AMMF. It basically optimizes the low fidelity model within a trust region with first order corrections so the results are similar to the high fidelity method. The basic algorithm is as follows: X=X_0 While not converged Calculate y_hf =

How to setup multi-level MDO formulation with openmdao 1.x?

匆匆过客 提交于 2019-12-11 18:12:12
问题 As an openmdao 1.x problem handles only one driver and as optimizers are still supposed to be drivers, how a multi-level formulation could be implemented? Should I use two problems? Should I call an optimizer directly within a solve_nonlinear component method? Thanks. 回答1: There have been some changes, and Problem is no longer a system. The best way to do this now is to create a Component that contains the sub-problem, tells it when to run, and passes data in and out. See example here: How to

i can not manage to record/access derivatives

。_饼干妹妹 提交于 2019-12-11 15:37:44
问题 The sample case for recording/accessing derivatives in this link works fine for me, if i simply copy paste the code. I am trying to figure out why the similar method does not work for my own problem . I set the recording options identical. I tried to list some differences but not sure if they can be the cause of this: I have an extra maxiter option so optimizer ''fails'' after 3 iterations. I can access all other recorded variables (objectives, constraints,list_output) I can not access to

OpenMDAO: How to handle non-converging points in ExplicitComponent.compute?

牧云@^-^@ 提交于 2019-12-11 14:53:44
问题 I've tried to handle non-converging points in the compute method of my ExplicitComponent , by raising an AnalysisError , as suggested in What is the best way to tell openMDAO driver or solver that it is impossible to evaluate the model at some point? (originally I wanted to make a comment in this thread, but I wasn't allowed due to my low Stack Overflow reputation score). However, this doesn't seem to solve my problem. What I expected was that error would be caught, the design point would be