def test_deriv1_swap(self):
    model = om.Group()
    ivc = om.IndepVarComp()
    mapdata = SampleMap()
    params = mapdata.param_data
    (x, y, z) = params
    outs = mapdata.output_data
    z = outs[0]
    ivc.add_output('x', x['default'], units=x['units'])
    ivc.add_output('y', y['default'], units=y['units'])
    ivc.add_output('z', z['default'], units=z['units'])
    model.add_subsystem('des_vars', ivc, promotes=['*'])
    comp = om.MetaModelStructuredComp(method='slinear', extrapolate=True)
    for out in outs:
        comp.add_output(out['name'], out['default'], out['values'])
    for param in params:
        comp.add_input(param['name'], param['default'], param['values'])
    model.add_subsystem('comp', comp, promotes=['*'])
    prob = om.Problem(model)
    prob.setup()
    prob['x'] = 1.0
    prob['y'] = 0.75
    prob['z'] = (- 1.7)
    self.run_and_check_derivs(prob)
def test_deriv1_swap(self):
    model = om.Group()
    ivc = om.IndepVarComp()
    mapdata = SampleMap()
    params = mapdata.param_data
    (x, y, z) = params
    outs = mapdata.output_data
    z = outs[0]
    ivc.add_output('x', x['default'], units=x['units'])
    ivc.add_output('y', y['default'], units=y['units'])
    ivc.add_output('z', z['default'], units=z['units'])
    model.add_subsystem('des_vars', ivc, promotes=['*'])
    comp = om.MetaModelStructuredComp(method='slinear', extrapolate=True)
    for out in outs:
        comp.add_output(out['name'], out['default'], out['values'])
    for param in params:
        comp.add_input(param['name'], param['default'], param['values'])
    model.add_subsystem('comp', comp, promotes=['*'])
    prob = om.Problem(model)
    prob.setup()
    prob['x'] = 1.0
    prob['y'] = 0.75
    prob['z'] = (- 1.7)
    self.run_and_check_derivs(prob)