diff --git a/LDDsimulation/LDDsimulation.py b/LDDsimulation/LDDsimulation.py index 032e7a1697ae60ce405d64134d7a62206520a172..6370b9a2dba9496aa11ba7488f5b4e5bcd0cae1c 100644 --- a/LDDsimulation/LDDsimulation.py +++ b/LDDsimulation/LDDsimulation.py @@ -466,39 +466,38 @@ class LDDsimulation(object): # the future. for sd_index, subdomain in self.subdomain.items(): # set subdomain iteration to current iteration - # mp.set_start_method('fork') - processQueue = mp.Queue() - Lsolver_step = mp.Process( - target=self.run_Lsolver_step, - args=( - iteration, - sd_index, - processQueue, - solution_over_iteration_within_timestep, - debug, - analyse_timestep, - analyse_condition, - ) - ) - Lsolver_step.start() - max_subsequent_error[sd_index-1] = processQueue.get() - print(Lsolver_step.exitcode) - Lsolver_step.join() - print(Lsolver_step.exitcode) - # update interface iteration numbers - # for index in subdomain.has_interface: - # interface = self.interface[index] - # interface.current_iteration[sd_index] = iteration - # Lsolver_step.terminate() - # self.run_Lsolver_step( - # iteration=iteration, - # subdomain_index=sd_index, - # max_subsequent_error=max_subsequent_error, - # sol_over_iter_file=solution_over_iteration_within_timestep, - # analyse_timestep=analyse_timestep, - # analyse_condition=analyse_condition, - # debug=debug - # ) + # # mp.set_start_method('fork') + # processQueue = mp.Queue() + # Lsolver_step = mp.Process( + # target=self.run_Lsolver_step, + # args=( + # iteration, + # sd_index, + # processQueue, + # solution_over_iteration_within_timestep, + # debug, + # analyse_timestep, + # analyse_condition, + # ) + # ) + # Lsolver_step.start() + # max_subsequent_error[sd_index-1] = processQueue.get() + # print(Lsolver_step.exitcode) + # Lsolver_step.join() + # print(Lsolver_step.exitcode) + # # update interface iteration numbers + # # for index in subdomain.has_interface: + # # interface = self.interface[index] + # # interface.current_iteration[sd_index] = iteration + # # Lsolver_step.terminate() + max_subsequent_error[sd_index - 1] = self.run_Lsolver_step( + iteration=iteration, + subdomain_index=sd_index, + sol_over_iter_file=solution_over_iteration_within_timestep, + analyse_timestep=analyse_timestep, + analyse_condition=analyse_condition, + debug=debug + ) # end loop over subdomains # stopping criterion for the solver. total_subsequent_error = np.amax(max_subsequent_error) @@ -522,7 +521,7 @@ class LDDsimulation(object): self, iteration: int, subdomain_index: int, - processQueue, + # processQueue, sol_over_iter_file: tp.Dict[int, tp.Type[SolutionFile]], debug: bool = False, analyse_timestep: bool = False, @@ -616,8 +615,8 @@ class LDDsimulation(object): # calculate the maximum over phase of subsequent errors for the # stopping criterion. # max_subsequent_error[sd_index-1] = max(subsequent_iter_error.values()) - processQueue.put(max(subsequent_iter_error.values())) - + # processQueue.put(max(subsequent_iter_error.values())) + return max(subsequent_iter_error.values()) def prepare_LDDsolver( self, diff --git a/Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py b/Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py index 9360a1fd371fc7fc2f0f9dd0001bfcc17f2bfb41..e0b4802c080aa29272318858c6f7b6e2ca56efa2 100755 --- a/Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py +++ b/Two-phase-Richards/two-patch/TP-R-two-patch-test-case/TP-R-2-patch-realistic.py @@ -38,7 +38,7 @@ thisfile = "TP-R-2-patch-realistic.py" # GENERAL SOLVER CONFIG ###################################################### # maximal iteration per timestep -max_iter_num = 50 +max_iter_num = 5 FEM_Lagrange_degree = 1 # GRID AND MESH STUDY SPECIFICATIONS ######################################### @@ -46,8 +46,8 @@ mesh_study = False resolutions = { # 1: 1e-5, # 2: 1e-5, - # 4: 1e-5, - # 8: 1e-5, + 4: 1e-5, + 8: 1e-5, 16: 5e-6, # 32: 5e-6, # 64: 2e-6, @@ -69,21 +69,21 @@ Lnw1= 0.025 Lw2 = 0.025 #/timestep_size Lnw2= 0.025 -lambda_w = 44 +lambda_w = 4 lambda_nw = 4 include_gravity = False -debugflag = True +debugflag = False analyse_condition = False # I/O CONFIG ################################################################# # when number_of_timesteps is high, it might take a long time to write all # timesteps to disk. Therefore, you can choose to only write data of every # plot_timestep_every timestep to disk. -plot_timestep_every = 4 +plot_timestep_every = 1 # Decide how many timesteps you want analysed. Analysed means, that # subsequent errors of the L-iteration within the timestep are written out. -number_of_timesteps_to_analyse = 5 +number_of_timesteps_to_analyse = 1 # fine grained control over data to be written to disk in the mesh study case # as well as for a regular simuation for a fixed grid. @@ -528,18 +528,18 @@ if __name__ == '__main__': for mesh_resolution, solver_tol in resolutions.items(): simulation_parameter.update({"solver_tol": solver_tol}) hlp.info(simulation_parameter["use_case"]) - # LDDsim = mp.Process( - # target=hlp.run_simulation, - # args=( - # simulation_parameter, - # starttime, - # mesh_resolution - # ) - # ) - # LDDsim.start() - # LDDsim.join() - hlp.run_simulation( - mesh_resolution=mesh_resolution, - starttime=starttime, - parameter=simulation_parameter - ) + LDDsim = mp.Process( + target=hlp.run_simulation, + args=( + simulation_parameter, + starttime, + mesh_resolution + ) + ) + LDDsim.start() + LDDsim.join() + # hlp.run_simulation( + # mesh_resolution=mesh_resolution, + # starttime=starttime, + # parameter=simulation_parameter + # )