heat_transfer_simulation_utilities.py
def complete_simulation(self) -> dict:
        """
        Running all the simulation steps, if not stopped
        """

        # Calling the evaluating function as long as the simulation has not finished
        while not self.Sim.simulation_has_finished:
            # Processing the callback and getting the simulation state at the same time
            # Then acting accordingly to the current state
            simulation_state = self.MyCallBack(self.Sim)
            if simulation_state == "running":
                # Calling the function that is determining next step
                self.Sim.evaluate_one_step()
            elif simulation_state == "paused":
                # Sleeping for some little time before checking again, to save CPU
                time.sleep(0.1)
            elif simulation_state == "stopped":
                # Breaking out of the loop - finishing simulation
                print("stopping")
                break

        # Calling callback at the very end, to update the plot with complete results
        self.MyCallBack(self.Sim, force_update=True)

        # Invoking whatever action should happen after simulation finishes
        # Passing whole self object, so Simulation has access to all
        #   connections here and can communicate with GUI
        self.Sim.after_simulation_action(self)

        # If wanted to, save the results by a custom function
        if self.save_results:
            self.Sim.save_results()

        return {"error_value": self.Sim.error_norm}

        Running all the simulation steps, if not stopped
        
Running all the simulation steps, if not stopped
Running all the simulation steps if not stopped
def complete_simulation(self) -> dict:
        while not self.Sim.simulation_has_finished:
            simulation_state = self.MyCallBack(self.Sim)
            if simulation_state == "running":
                self.Sim.evaluate_one_step()
            elif simulation_state == "paused":
                time.sleep(0.1)
            elif simulation_state == "stopped":
                print("stopping")
                break
        self.MyCallBack(self.Sim, force_update=True)
        self.Sim.after_simulation_action(self)
        if self.save_results:
            self.Sim.save_results()
        return {"error_value": self.Sim.error_norm}
def complete_simulation ( self ) -> dict : while not self . Sim . simulation_has_finished : simulation_state = self . MyCallBack ( self . Sim ) if simulation_state == "running" : self . Sim . evaluate_one_step ( ) elif simulation_state == "paused" : time . sleep ( 0.1 ) elif simulation_state == "stopped" : print ( "stopping" ) break self . MyCallBack ( self . Sim , force_update = True ) self . Sim . after_simulation_action ( self ) if self . save_results : self . Sim . save_results ( ) return { "error_value" : self . Sim . error_norm }
Running all the simulation steps, if not stopped
Running all the simulation steps if not stopped
"""
        Running all the simulation steps, if not stopped
        """ # Calling the evaluating function as long as the simulation has not finished # Processing the callback and getting the simulation state at the same time # Then acting accordingly to the current state # Calling the function that is determining next step # Sleeping for some little time before checking again, to save CPU # Breaking out of the loop - finishing simulation # Calling callback at the very end, to update the plot with complete results # Invoking whatever action should happen after simulation finishes # Passing whole self object, so Simulation has access to all #   connections here and can communicate with GUI # If wanted to, save the results by a custom function
self