def test(self):
    mesh_dict = {'num_y': 7, 'num_x': 2, 'wing_type': 'CRM', 'symmetry': True, 'num_twist_cp': 5}
    (mesh, twist_cp) = generate_mesh(mesh_dict)
    surf_dict = {'name': 'wing', 'symmetry': True, 'S_ref_type': 'wetted', 'fem_model_type': 'tube', 'twist_cp': twist_cp, 'mesh': mesh, 'CL0': 0.0, 'CD0': 0.015, 'k_lam': 0.05, 't_over_c_cp': np.array([0.15]), 'c_max_t': 0.303, 'with_viscous': True, 'with_wave': False}
    mesh_dict = {'num_y': 7, 'num_x': 2, 'wing_type': 'rect', 'symmetry': True, 'offset': np.array([50, 0.0, 0.0])}
    mesh = generate_mesh(mesh_dict)
    surf_dict2 = {'name': 'tail', 'symmetry': True, 'S_ref_type': 'wetted', 'twist_cp': twist_cp, 'mesh': mesh, 'CL0': 0.0, 'CD0': 0.0, 'fem_origin': 0.35, 'k_lam': 0.05, 't_over_c_cp': np.array([0.15]), 'c_max_t': 0.303, 'with_viscous': True, 'with_wave': False}
    surfaces = [surf_dict, surf_dict2]
    prob = Problem()
    indep_var_comp = IndepVarComp()
    indep_var_comp.add_output('v', val=248.136, units='m/s')
    indep_var_comp.add_output('alpha', val=5.0, units='deg')
    indep_var_comp.add_output('Mach_number', val=0.84)
    indep_var_comp.add_output('re', val=1000000.0, units='1/m')
    indep_var_comp.add_output('rho', val=0.38, units='kg/m**3')
    indep_var_comp.add_output('cg', val=np.zeros(3), units='m')
    prob.model.add_subsystem('prob_vars', indep_var_comp, promotes=['*'])
    for surface in surfaces:
        geom_group = Geometry(surface=surface)
        prob.model.add_subsystem(surface['name'], geom_group)
    for i in range(1):
        aero_group = AeroPoint(surfaces=surfaces)
        point_name = 'aero_point_{}'.format(i)
        prob.model.add_subsystem(point_name, aero_group)
        prob.model.connect('v', (point_name + '.v'))
        prob.model.connect('alpha', (point_name + '.alpha'))
        prob.model.connect('Mach_number', (point_name + '.Mach_number'))
        prob.model.connect('re', (point_name + '.re'))
        prob.model.connect('rho', (point_name + '.rho'))
        prob.model.connect('cg', (point_name + '.cg'))
        for surface in surfaces:
            name = surface['name']
            prob.model.connect((name + '.mesh'), (((point_name + '.') + name) + '.def_mesh'))
            prob.model.connect((name + '.mesh'), (((point_name + '.aero_states.') + name) + '_def_mesh'))
            prob.model.connect((name + '.t_over_c'), ((((point_name + '.') + name) + '_perf.') + 't_over_c'))
    prob.setup()
    prob.run_model()
    assert_rel_error(self, prob['aero_point_0.wing_perf.CD'][0], 0.037210478659832125, 1e-06)
    assert_rel_error(self, prob['aero_point_0.wing_perf.CL'][0], 0.5124736932248048, 1e-06)
    assert_rel_error(self, prob['aero_point_0.CM'][1], (- 1.7028233361964462), 1e-06)
def test(self):
    mesh_dict = {'num_y': 7, 'num_x': 2, 'wing_type': 'CRM', 'symmetry': True, 'num_twist_cp': 5}
    (mesh, twist_cp) = generate_mesh(mesh_dict)
    surf_dict = {'name': 'wing', 'symmetry': True, 'S_ref_type': 'wetted', 'fem_model_type': 'tube', 'twist_cp': twist_cp, 'mesh': mesh, 'CL0': 0.0, 'CD0': 0.015, 'k_lam': 0.05, 't_over_c_cp': np.array([0.15]), 'c_max_t': 0.303, 'with_viscous': True, 'with_wave': False}
    mesh_dict = {'num_y': 7, 'num_x': 2, 'wing_type': 'rect', 'symmetry': True, 'offset': np.array([50, 0.0, 0.0])}
    mesh = generate_mesh(mesh_dict)
    surf_dict2 = {'name': 'tail', 'symmetry': True, 'S_ref_type': 'wetted', 'twist_cp': twist_cp, 'mesh': mesh, 'CL0': 0.0, 'CD0': 0.0, 'fem_origin': 0.35, 'k_lam': 0.05, 't_over_c_cp': np.array([0.15]), 'c_max_t': 0.303, 'with_viscous': True, 'with_wave': False}
    surfaces = [surf_dict, surf_dict2]
    prob = Problem()
    indep_var_comp = IndepVarComp()
    indep_var_comp.add_output('v', val=248.136, units='m/s')
    indep_var_comp.add_output('alpha', val=5.0, units='deg')
    indep_var_comp.add_output('Mach_number', val=0.84)
    indep_var_comp.add_output('re', val=1000000.0, units='1/m')
    indep_var_comp.add_output('rho', val=0.38, units='kg/m**3')
    indep_var_comp.add_output('cg', val=np.zeros(3), units='m')
    prob.model.add_subsystem('prob_vars', indep_var_comp, promotes=['*'])
    for surface in surfaces:
        geom_group = Geometry(surface=surface)
        prob.model.add_subsystem(surface['name'], geom_group)
    for i in range(1):
        aero_group = AeroPoint(surfaces=surfaces)
        point_name = 'aero_point_{}'.format(i)
        prob.model.add_subsystem(point_name, aero_group)
        prob.model.connect('v', (point_name + '.v'))
        prob.model.connect('alpha', (point_name + '.alpha'))
        prob.model.connect('Mach_number', (point_name + '.Mach_number'))
        prob.model.connect('re', (point_name + '.re'))
        prob.model.connect('rho', (point_name + '.rho'))
        prob.model.connect('cg', (point_name + '.cg'))
        for surface in surfaces:
            name = surface['name']
            prob.model.connect((name + '.mesh'), (((point_name + '.') + name) + '.def_mesh'))
            prob.model.connect((name + '.mesh'), (((point_name + '.aero_states.') + name) + '_def_mesh'))
            prob.model.connect((name + '.t_over_c'), ((((point_name + '.') + name) + '_perf.') + 't_over_c'))
    prob.setup()
    prob.run_model()
    assert_rel_error(self, prob['aero_point_0.wing_perf.CD'][0], 0.037210478659832125, 1e-06)
    assert_rel_error(self, prob['aero_point_0.wing_perf.CL'][0], 0.5124736932248048, 1e-06)
    assert_rel_error(self, prob['aero_point_0.CM'][1], (- 1.7028233361964462), 1e-06)