Esempio n. 1
0
 def test_file_read(self):
     file = open(join(runs_dir, self.test_avl_case + '.avl'))
     case = Case.case_from_input_file(file)
     file.close()
     file = open('read_test_write.avl', 'w')
     case.write_input_file(file)
     file.close()
Esempio n. 2
0
 def test_file_read(self):
     file = open(join(runs_dir, self.test_avl_case+'.avl'))
     case = Case.case_from_input_file(file)
     file.close()
     file = open('read_test_write.avl', 'w')
     case.write_input_file(file)
     file.close()
Esempio n. 3
0
 def load_case_from_file(self, filename):
     self.avl.sendline('load %s' % filename)
     self.case_filename = filename
     if os.path.isabs(filename):
         f = open(filename)
     else:
         f = open(os.path.join(self.cwd, filename))
     self.case = Case.case_from_input_file(f, cwd=self.cwd)
     f.close()
     AVL.goto_state(self.avl)
     self.populate_runcases()
Esempio n. 4
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)
Esempio n. 5
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)