Beispiel #1
0
    def test_GEMParametricGeometry(self):
        geom = GEMParametricGeometry()
        geom.model_file = self.model_file
        params = geom.listParameters()
        expected_inputs = set(['width', 'depth', 'height', 
            'neckDiam', 'neckHeight', 'wall',
            'filRad1', 'filRad2'])
        self.assertEqual(expected_inputs, 
            set([k for k,v in params if v['iotype']=='in']))
        expected_outs = set(['zcg', 'zmax', 'xcg', 'zmin', 'Ixz', 'Izx', 'Ixx', 'Ixy', 
                'baseHt', 'xmin', 'Izy', 'Izz', 'ymin', 'ibody', 'ymax', 'nnode', 'ycg', 'nface', 
                'volume', 'Iyy', 'Iyx', 'Iyz', 'area', 'nedge', 'xmax'])
        self.assertEqual(expected_outs, set([k for k,v in params if v['iotype']=='out']))

        meta = geom.getParameter('baseHt')
        baseHt = meta['value']
        self.assertEqual(baseHt, 12.0)
        geom.setParameter('height', 20.0)
        geom.regenModel()
        meta = geom.getParameter('baseHt')
        baseHt = meta['value']
        self.assertEqual(baseHt, 17.0)
        geom.terminate()