

def test_simple_array_comp2D(self):
    prob = Problem()
    root = prob.root = Group()
    root.add('p1', IndepVarComp('x', np.zeros((2, 2))), promotes=['*'])
    root.add('comp', ArrayComp2D(), promotes=['*'])
    root.add('con', ExecComp('c = y - 20.0', c=np.zeros((2, 2)), y=np.zeros((2, 2))), promotes=['*'])
    self.add('obj', ExecComp('o = y[0, 0]', y=np.zeros((2, 2))), promotes=['*'])
    prob.driver = ScipyOptimizer()
    prob.driver.options['optimizer'] = 'SLSQP'
    prob.driver.add_desvar('x', lower=(- 50.0), upper=50.0)
    prob.driver.add_objective('o')
    prob.driver.add_constraint('c', equals=0.0)
    prob.driver.options['disp'] = False
    prob.setup(check=False)
    prob.run()
    obj = prob['o']
    assert_rel_error(self, obj, 20.0, 1e-06)

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/drivers/test/test_scipy_optimizer.py TestScipyOptimize.test_simple_array_comp2D/VarMisuse@116/155 `root`->`self`