def cost_function(self, sense='single', verbose=False):
        """
        A method to run CFD for the new shape.

        Kwargs:
            sense (str): whther to return single or multi-objective values.
        """
        if verbose:
            return self.__cost_function(sense=sense)
        else:
            with nostdout():
                return self.__cost_function(sense=sense)
Exemplo n.º 2
0
    def cost_function(self, sense='single', verbose=False):
        """
        A method to run CFD for the new shape.

        Kwargs:
            sense (str): whther to return single or multi-objective values.
        """
        if verbose:
            self.stdout = sys.stdout
            return self.__cost_function(sense=sense)
        else:
            self.stdout = open(os.devnull, 'wb')
            with nostdout():
                res = self.__cost_function(sense=sense)
            return res
 def prepare_case(self, source_case, verbose=False):
     if verbose:
         self.__prepare_case(source_case)
     else:
         with nostdout():
             self.__prepare_case(source_case)