예제 #1
0
 def test_ui(self):
     file = open(join(runs_dir, self.test_avl_case+'.avl'))
     self.case = Case.case_from_input_file(file)
     import sys
     self.case.configure_traits()
     #self.case.geometry.surfaces[0].write_to_file(sys.stdout)
     
     #self.case.geometry.configure_traits()
     #self.case.geometry.surfaces[0].configure_traits()
     #self.case.geometry.write_to_file(sys.stdout)
     from pyavl.ui.geometry_viewer import GeometryViewer
     g = GeometryViewer(geometry=self.case.geometry)
     g.configure_traits(scrollable=True)
예제 #2
0
 def _geometry_view_default(self):
     from pyavl.ui.geometry_viewer import GeometryViewer
     geometry_view = TraitsUIView(
         id='pyavl.geometry',
         name='Geometry View',
         obj=GeometryViewer(geometry=self.avl.case.geometry))
     return geometry_view
예제 #3
0
        filename = os.path.abspath(filename)
        sectiondata.write_airfoil_file(filename, 'parafoil')
        if self.number_of_cells%2==1:
            le = numpy.zeros((3,))
            sectionafile = SectionAFILEData(filename=filename)
            sections.append(Section(leading_edge=le, chord=self.chord, type=sectionafile.type, data=sectionafile))
        for i, theta in enumerate(anhedral_angle_r * y):
            le = numpy.array([0, r * numpy.sin(theta), r * (numpy.cos(theta) - 1)])
            sectionafile = SectionAFILEData(filename=filename)
            sections.append(Section(leading_edge=le, chord=self.chord, type=sectionafile.type, data=sectionafile))
        surface = Surface(name='Parafoil', yduplicate=0, sections=sections)
        return surface
    traits_view = View('span','chord','number_of_cells','anhedral_angle',
                       Item('object.sectiondata.filename',label='section data file'),
                       'inlet_height','cut_angle')

if __name__ == '__main__':
    import sys
    from pyavl.case import Case
    from pyavl import runs_dir, join
    file = open(join(runs_dir, 'bd.avl'))
    case = Case.case_from_input_file(file)
    pw = ParafoilWizard()
    pw.configure_traits()
    surface = pw.get_surface()
    #surface.configure_traits()
    geometry = Geometry(surfaces=[surface])
    #geometry.configure_traits()
    g = GeometryViewer(geometry=geometry)
    g.configure_traits()
    surface.write_to_file(sys.stdout)
예제 #4
0
            CD_p = 0.0
        geometry = Geometry.create_from_lines(lines, lineno, cwd=cwd)
        case = Case(name=name,
                    mach_no=mach_no,
                    symmetry=symmetry,
                    ref_area=ref_area,
                    ref_chord=ref_chord,
                    ref_span=ref_span,
                    ref_cg=ref_cg,
                    CD_p=CD_p,
                    geometry=geometry,
                    cwd=cwd)
        return case


if __name__ == '__main__':
    from pyavl import runs_dir
    file = open(join(runs_dir, 'allegro.avl'))
    case = Case.case_from_input_file(file)
    #import sys
    case.configure_traits()
    #self.case.geometry.surfaces[0].write_to_file(sys.stdout)

    #self.case.geometry.configure_traits()
    #self.case.geometry.surfaces[0].configure_traits()
    #self.case.geometry.write_to_file(sys.stdout)
    from pyavl.ui.geometry_viewer import GeometryViewer
    print case.geometry, type(case.geometry)
    g = GeometryViewer(geometry=case.geometry)
    g.configure_traits(scrollable=True)
예제 #5
0
파일: case.py 프로젝트: ArtemyVI/pyavl
        mach_no = float(lines[1].split()[0])
        symmetry = lines[2].split()
        symmetry = [int(symmetry[0]), int(symmetry[1]), float(symmetry[2])]
        ref_area, ref_chord, ref_span = [float(value) for value in lines[3].split()[:3]]
        ref_cg = [float(value) for value in lines[4].split()[:3]]
        lineno = 5
        try:
            CD_p = float(lines[5].split()[0])
            lineno = 6
        except ValueError:
            CD_p = 0.0
        geometry = Geometry.create_from_lines(lines, lineno, cwd=cwd)
        case = Case(name=name, mach_no=mach_no, symmetry=symmetry, ref_area=ref_area, ref_chord=ref_chord, ref_span=ref_span, ref_cg=ref_cg, CD_p=CD_p, geometry=geometry, cwd=cwd)
        return case
    
if __name__ == '__main__':
    from pyavl import runs_dir
    file = open(join(runs_dir, 'allegro.avl'))
    case = Case.case_from_input_file(file)
    #import sys
    case.configure_traits()
    #self.case.geometry.surfaces[0].write_to_file(sys.stdout)
    
    #self.case.geometry.configure_traits()
    #self.case.geometry.surfaces[0].configure_traits()
    #self.case.geometry.write_to_file(sys.stdout)
    from pyavl.ui.geometry_viewer import GeometryViewer
    print case.geometry, type(case.geometry)
    g = GeometryViewer(geometry=case.geometry)
    g.configure_traits(scrollable=True)