Ejemplo n.º 1
0
    def setup_cases(self):
        """ setup the cases """
        if (self.run_dakota):
            self.ws_driver.setup_cases(self.studycases, self.aerocode)
        else:
            self.runcases = []
            ## cases should be list of DesignLoadCases
            for dlc in self.studycases:
                if (self.raw_cases):  # goes with "tabular" input distn format
                    print "building dlc for: ", dlc.x
                    runcase = ParamDesignLoadCaseBuilder.buildRunCase_x(dlc.x, dlc.param_names, dlc)
                    self.runcases.append(Case(inputs= [('runner.input', runcase)]))
                else:
                    print 'Generating run cases for study case %s' % dlc.name
# ask aero code to produce runcass for this study case
                    allruns = self.aerocode.genRunCases(dlc)
                    for runcase in allruns:
                        print 'Adding Case for run case %s' % runcase.name
                        # create the case
                        #                self.runcases.append(Case(inputs= [('runner.input', runcase)],   
                        #                                          outputs=['runner.output', 'runner.input']))
                        self.runcases.append(Case(inputs= [('runner.input', runcase)]))
                               ## vars used here need to exist in relevant (sub)-objects
                               ##(ie aerocode.input needs to exist--eg in openAeroCode) , else openMDAO throws exception
                               ## This will result in aerocode.execute() being called with self.input = runcase = relevant RunCase
                        save_run_cases(dlc.name, allruns)

            self.ws_driver.iterator = ListCaseIterator(self.runcases)
Ejemplo n.º 2
0
    def setup_cases(self):
        """ setup the cases """
        if (self.run_dakota):
            self.ws_driver.setup_cases(self.studycases, self.aerocode)
        else:
            self.runcases = []
            ## cases should be list of DesignLoadCases
            for dlc in self.studycases:
                if (self.raw_cases):  # goes with "tabular" input distn format
                    print "building dlc for: ", dlc.x
                    runcase = ParamDesignLoadCaseBuilder.buildRunCase_x(
                        dlc.x, dlc.param_names, dlc)
                    self.runcases.append(
                        Case(inputs=[('runner.input', runcase)]))
                else:
                    print 'Generating run cases for study case %s' % dlc.name
                    # ask aero code to produce runcass for this study case
                    allruns = self.aerocode.genRunCases(dlc)
                    for runcase in allruns:
                        print 'Adding Case for run case %s' % runcase.name
                        # create the case
                        #                self.runcases.append(Case(inputs= [('runner.input', runcase)],
                        #                                          outputs=['runner.output', 'runner.input']))
                        self.runcases.append(
                            Case(inputs=[('runner.input', runcase)]))
                        ## vars used here need to exist in relevant (sub)-objects
                        ##(ie aerocode.input needs to exist--eg in openAeroCode) , else openMDAO throws exception
                        ## This will result in aerocode.execute() being called with self.input = runcase = relevant RunCase
                        save_run_cases(dlc.name, allruns)

            self.ws_driver.iterator = ListCaseIterator(self.runcases)
Ejemplo n.º 3
0
 def dlc_from_params(self, x):
     print x, self.param_names, self.dlc.name
     case = ParamDesignLoadCaseBuilder.buildRunCase_x(
         x, self.param_names, self.dlc)
     print case.fst_params
     return case
Ejemplo n.º 4
0
 def dlc_from_params(self,x):
     print x, self.param_names, self.dlc.name
     case = ParamDesignLoadCaseBuilder.buildRunCase_x(x, self.param_names, self.dlc)
     print case.fst_params
     return case