Esempio n. 1
0
    def optimize(self):

        timer = timer_factory.CreateTimer()
        algorithmName = self.OptimizationSettings["optimization_algorithm"][
            "name"].GetString()

        print(
            "\n> =============================================================================================================="
        )
        print("> ", timer.GetTimeStamp(),
              ": Starting optimization using the following algorithm: ",
              algorithmName)
        print(
            "> ==============================================================================================================\n"
        )

        algorithm = algorithm_factory.CreateAlgorithm(
            self.OptimizationModelPart, self.analyzer,
            self.OptimizationSettings)
        algorithm.execute()

        print(
            "\n> =============================================================================================================="
        )
        print(
            "> Finished optimization                                                                                           "
        )
        print(
            "> ==============================================================================================================\n"
        )


# ==============================================================================
Esempio n. 2
0
    def Optimize(self):
        algorithm_name = self.optimization_settings["optimization_algorithm"][
            "name"].GetString()

        print(
            "\n> =============================================================================================================="
        )
        print("> ",
              Timer().GetTimeStamp(),
              ": Starting optimization using the following algorithm: ",
              algorithm_name)
        print(
            "> ==============================================================================================================\n"
        )

        if self.model_part_controller.IsOptimizationModelPartAlreadyImported():
            print(
                "> Skipping import of optimization model part as already done by another application. "
            )
        else:
            self.model_part_controller.ImportOptimizationModelPart()

        algorithm = algorithm_factory.CreateAlgorithm(
            self.optimization_settings, self.model_part_controller,
            self.analyzer, self.communicator)

        algorithm.InitializeOptimizationLoop()
        algorithm.RunOptimizationLoop()
        algorithm.FinalizeOptimizationLoop()

        print(
            "\n> =============================================================================================================="
        )
        print(
            "> Finished optimization                                                                                           "
        )
        print(
            "> ==============================================================================================================\n"
        )


# ==============================================================================
Esempio n. 3
0
    def optimize( self ):
        
        timer = timer_factory.CreateTimer()
        algorithmName = self.optimizationSettings["optimization_algorithm"]["name"].GetString()

        print("\n> ==============================================================================================================")
        print("> ",timer.getTimeStamp(),": Starting optimization using the following algorithm: ", algorithmName)
        print("> ==============================================================================================================\n")
    
        designSurface = self.__getDesignSurfaceFromInputModelPart()
        dampingRegions = self.__getdampingRegionsFromInputModelPart()

        mapper = mapper_factory.CreateMapper( designSurface, self.optimizationSettings ) 
        communicator = communicator_factory.CreateCommunicator( self.optimizationSettings )

        algorithm = algorithm_factory.CreateAlgorithm( designSurface, dampingRegions, self.analyzer, mapper, communicator, self.optimizationSettings )
        algorithm.execute()       

        print("\n> ==============================================================================================================")
        print("> Finished optimization                                                                                           ")
        print("> ==============================================================================================================\n")