parameters: (self)
docstring: This function executes the solution loop of the AnalysisStage
          It can be overridden by derived classes
docstring_summary: This function executes the solution loop of the AnalysisStage
          It can be overridden by derived classes
docstring_tokens: This function executes the solution loop of the AnalysisStage It can be overridden by derived classes
function: def RunSolutionLoop(self):
          """This function executes the solution loop of the AnalysisStage
          It can be overridden by derived classes
          """
          # If we remesh using a process
          computing_model_part = self._GetSolver().GetComputingModelPart()
          root_model_part = computing_model_part.GetRootModelPart()
          if self.process_remesh:
              while self.time < self.end_time:
                  self.time = self._GetSolver().AdvanceInTime(self.time)
                  # We reinitialize if remeshed previously
                  if root_model_part.Is(KM.MODIFIED):
                      self._ReInitializeSolver()
                  self.InitializeSolutionStep()
                  # We reinitialize if remeshed on the InitializeSolutionStep
                  if root_model_part.Is(KM.MODIFIED):
                      self._ReInitializeSolver()
                      self.InitializeSolutionStep()
                  self._GetSolver().Predict()
                  self._GetSolver().SolveSolutionStep()
                  self._transfer_slave_to_master()
                  self.FinalizeSolutionStep()
                  self.OutputSolutionStep()
          else: # Remeshing adaptively
              metric_process = self._GetSolver().get_metric_process()
              remeshing_process = self._GetSolver().get_remeshing_process()
              convergence_criteria = self._GetSolver()._GetConvergenceCriterion()
              builder_and_solver = self._GetSolver()._GetBuilderAndSolver()
              mechanical_solution_strategy = self._GetSolver()._GetSolutionStrategy()
  
              while self.time < self.end_time:
                  self.time = self._GetSolver().AdvanceInTime(self.time)
                  non_linear_iteration = 1
                  while non_linear_iteration <= self.non_linear_iterations:
                      if computing_model_part.Is(KM.MODIFIED):
                          self._GetSolver().Clear()
                          # WE RECOMPUTE THE PROCESSES AGAIN
                          # Processes initialization
                          for process in self._GetListOfProcesses():
                              process.ExecuteInitialize()
                          ## Processes before the loop
                          for process in self._GetListOfProcesses():
                              process.ExecuteBeforeSolutionLoop()
                          ## Processes of initialize the solution step
                          for process in self._GetListOfProcesses():
                              process.ExecuteInitializeSolutionStep()
                      if non_linear_iteration == 1 or computing_model_part.Is(KM.MODIFIED):
                          self.InitializeSolutionStep()
                          self._GetSolver().Predict()
                          computing_model_part.Set(KM.MODIFIED, False)
                      computing_model_part.ProcessInfo.SetValue(KM.NL_ITERATION_NUMBER, non_linear_iteration)
                      is_converged = convergence_criteria.PreCriteria(computing_model_part, builder_and_solver.GetDofSet(), mechanical_solution_strategy.GetSystemMatrix(), mechanical_solution_strategy.GetSolutionVector(), mechanical_solution_strategy.GetSystemVector())
                      self._GetSolver().SolveSolutionStep()
                      is_converged = convergence_criteria.PostCriteria(computing_model_part, builder_and_solver.GetDofSet(), mechanical_solution_strategy.GetSystemMatrix(), mechanical_solution_strategy.GetSolutionVector(), mechanical_solution_strategy.GetSystemVector())
                      self._transfer_slave_to_master()
                      self.FinalizeSolutionStep()
                      if is_converged:
                          KM.Logger.PrintInfo(self._GetSimulationName(), "Adaptative strategy converged in ", non_linear_iteration, "iterations" )
                          break
                      elif non_linear_iteration == self.non_linear_iterations:
                          KM.Logger.PrintInfo(self._GetSimulationName(), "Adaptative strategy not converged after ", non_linear_iteration, "iterations" )
                          break
                      else:
                          # Before remesh we set the flag INTERFACE to the conditions (we need edges to preserve submodelparts)
                          KM.VariableUtils().SetFlag(KM.INTERFACE, True, computing_model_part.GetSubModelPart("Contact").Conditions)
                          # We remove the contact model part to avoid problems (it will  be recomputed later)
                          contact_model_part = computing_model_part.GetSubModelPart("Contact")
                          for model_part in contact_model_part.SubModelParts:
                              contact_model_part.RemoveSubModelPart(model_part.Name)
                          computing_model_part.RemoveSubModelPart("ComputingContact")
                          # Now we can remesh
                          metric_process.Execute()
                          remeshing_process.Execute()
                          # We remove the contact model part to avoid problems (it will  be recomputed later)
                          computing_model_part.RemoveSubModelPart("Contact")
                          # Now we set as modified
                          computing_model_part.Set(KM.MODIFIED, True)
                          non_linear_iteration += 1
                  self.OutputSolutionStep()
function_tokens: def RunSolutionLoop ( self ) : # If we remesh using a process computing_model_part = self . _GetSolver ( ) . GetComputingModelPart ( ) root_model_part = computing_model_part . GetRootModelPart ( ) if self . process_remesh : while self . time < self . end_time : self . time = self . _GetSolver ( ) . AdvanceInTime ( self . time ) # We reinitialize if remeshed previously if root_model_part . Is ( KM . MODIFIED ) : self . _ReInitializeSolver ( ) self . InitializeSolutionStep ( ) # We reinitialize if remeshed on the InitializeSolutionStep if root_model_part . Is ( KM . MODIFIED ) : self . _ReInitializeSolver ( ) self . InitializeSolutionStep ( ) self . _GetSolver ( ) . Predict ( ) self . _GetSolver ( ) . SolveSolutionStep ( ) self . _transfer_slave_to_master ( ) self . FinalizeSolutionStep ( ) self . OutputSolutionStep ( ) else : # Remeshing adaptively metric_process = self . _GetSolver ( ) . get_metric_process ( ) remeshing_process = self . _GetSolver ( ) . get_remeshing_process ( ) convergence_criteria = self . _GetSolver ( ) . _GetConvergenceCriterion ( ) builder_and_solver = self . _GetSolver ( ) . _GetBuilderAndSolver ( ) mechanical_solution_strategy = self . _GetSolver ( ) . _GetSolutionStrategy ( ) while self . time < self . end_time : self . time = self . _GetSolver ( ) . AdvanceInTime ( self . time ) non_linear_iteration = 1 while non_linear_iteration <= self . non_linear_iterations : if computing_model_part . Is ( KM . MODIFIED ) : self . _GetSolver ( ) . Clear ( ) # WE RECOMPUTE THE PROCESSES AGAIN # Processes initialization for process in self . _GetListOfProcesses ( ) : process . ExecuteInitialize ( ) ## Processes before the loop for process in self . _GetListOfProcesses ( ) : process . ExecuteBeforeSolutionLoop ( ) ## Processes of initialize the solution step for process in self . _GetListOfProcesses ( ) : process . ExecuteInitializeSolutionStep ( ) if non_linear_iteration == 1 or computing_model_part . Is ( KM . MODIFIED ) : self . InitializeSolutionStep ( ) self . _GetSolver ( ) . Predict ( ) computing_model_part . Set ( KM . MODIFIED , False ) computing_model_part . ProcessInfo . SetValue ( KM . NL_ITERATION_NUMBER , non_linear_iteration ) is_converged = convergence_criteria . PreCriteria ( computing_model_part , builder_and_solver . GetDofSet ( ) , mechanical_solution_strategy . GetSystemMatrix ( ) , mechanical_solution_strategy . GetSolutionVector ( ) , mechanical_solution_strategy . GetSystemVector ( ) ) self . _GetSolver ( ) . SolveSolutionStep ( ) is_converged = convergence_criteria . PostCriteria ( computing_model_part , builder_and_solver . GetDofSet ( ) , mechanical_solution_strategy . GetSystemMatrix ( ) , mechanical_solution_strategy . GetSolutionVector ( ) , mechanical_solution_strategy . GetSystemVector ( ) ) self . _transfer_slave_to_master ( ) self . FinalizeSolutionStep ( ) if is_converged : KM . Logger . PrintInfo ( self . _GetSimulationName ( ) , "Adaptative strategy converged in " , non_linear_iteration , "iterations" ) break elif non_linear_iteration == self . non_linear_iterations : KM . Logger . PrintInfo ( self . _GetSimulationName ( ) , "Adaptative strategy not converged after " , non_linear_iteration , "iterations" ) break else : # Before remesh we set the flag INTERFACE to the conditions (we need edges to preserve submodelparts) KM . VariableUtils ( ) . SetFlag ( KM . INTERFACE , True , computing_model_part . GetSubModelPart ( "Contact" ) . Conditions ) # We remove the contact model part to avoid problems (it will  be recomputed later) contact_model_part = computing_model_part . GetSubModelPart ( "Contact" ) for model_part in contact_model_part . SubModelParts : contact_model_part . RemoveSubModelPart ( model_part . Name ) computing_model_part . RemoveSubModelPart ( "ComputingContact" ) # Now we can remesh metric_process . Execute ( ) remeshing_process . Execute ( ) # We remove the contact model part to avoid problems (it will  be recomputed later) computing_model_part . RemoveSubModelPart ( "Contact" ) # Now we set as modified computing_model_part . Set ( KM . MODIFIED , True ) non_linear_iteration += 1 self . OutputSolutionStep ( )