@unittest.skipIf((not scipy_gte_019), 'only run if scipy>=0.19.')
def test_vectorized(self):
    import numpy as np
    import openmdao.api as om
    p1 = np.linspace(0, 100, 25)
    p2 = np.linspace((- 10), 10, 5)
    p3 = np.linspace(0, 1, 10)
    (P1, P2, P3) = np.meshgrid(p1, p2, p3, indexing='ij')
    f = (np.sqrt(P1) + (P2 * P3))
    interp = om.MetaModelStructuredComp(method='scipy_cubic', vec_size=2)
    interp.add_input('p1', 0.5, training_data=p1)
    interp.add_input('p2', 0.0, training_data=p2)
    interp.add_input('p3', 3.14, training_data=p3)
    interp.add_output('f', 0.0, training_data=f)
    model = om.Group()
    model.add_subsystem('comp', interp, promotes=['*'])
    prob = om.Problem(model)
    prob.setup()
    prob.set_val('p1', np.array([55.12, 12.0]))
    prob.set_val('p2', np.array([(- 2.14), 3.5]))
    prob.set_val('p3', np.array([0.323, 0.5]))
    prob.run_model()
    computed = prob['f']
    actual = np.array([6.73306472, 5.2118645])
    assert_almost_equal(computed, actual)
@unittest.skipIf((not scipy_gte_019), 'only run if scipy>=0.19.')
def test_vectorized(self):
    import numpy as np
    import openmdao.api as om
    p1 = np.linspace(0, 100, 25)
    p2 = np.linspace((- 10), 10, 5)
    p3 = np.linspace(0, 1, 10)
    (P1, P2, P3) = np.meshgrid(p1, p2, p3, indexing='ij')
    f = (np.sqrt(P1) + (P2 * P3))
    interp = om.MetaModelStructuredComp(method='scipy_cubic', vec_size=2)
    interp.add_input('p1', 0.5, training_data=p1)
    interp.add_input('p2', 0.0, training_data=p2)
    interp.add_input('p3', 3.14, training_data=p3)
    interp.add_output('f', 0.0, training_data=f)
    model = om.Group()
    model.add_subsystem('comp', interp, promotes=['*'])
    prob = om.Problem(model)
    prob.setup()
    prob.set_val('p1', np.array([55.12, 12.0]))
    prob.set_val('p2', np.array([(- 2.14), 3.5]))
    prob.set_val('p3', np.array([0.323, 0.5]))
    prob.run_model()
    computed = prob['f']
    actual = np.array([6.73306472, 5.2118645])
    assert_almost_equal(computed, actual)