diff --git a/LDDsimulation/LDDsimulation.py b/LDDsimulation/LDDsimulation.py index 9959bbfcd0d21e15ef3f9aa751f55a5a887458f6..c38c71c91b8e959aee88d37afd9c07b9ba3b860d 100644 --- a/LDDsimulation/LDDsimulation.py +++ b/LDDsimulation/LDDsimulation.py @@ -525,10 +525,9 @@ class LDDsimulation(object): ) # prepare next iteration - # write the newly calculated solution to the inteface dictionaries + # write the newly calculated solution to the interface dictionaries # of the subdomain for communication. - if self.interface_def_points is not None: - subdomain.write_pressure_to_interfaces() + subdomain.write_pressure_to_interfaces() if analyse_timestep: subdomain.write_solution_to_xdmf(# @@ -628,8 +627,8 @@ class LDDsimulation(object): self.update_DirichletBC_dictionary(time = time, # subdomain_index = ind, ) - # # this is the beginning of the solver, so iteration must be set - # # to 0. + # this is the beginning of the solver, so iteration must be set + # to 0. subdomain.iteration_number = 0 for phase in subdomain.has_phases: # evaluate the sources to the current time. @@ -639,9 +638,11 @@ class LDDsimulation(object): print(colored(f"id(subdomain{subdomain.subdomain_index}.pressure_prev_timestep[{phase}])", "red"), " =\n", f"{id(subdomain.pressure_prev_timestep[phase])}") print(f"subdomain{subdomain.subdomain_index}.pressure_prev_timestep[{phase}].vector()[:]", " =\n", f"{subdomain.pressure_prev_timestep[phase].vector()[:]}") print(f"subdomain{subdomain.subdomain_index}.pressure[{phase}].vector()[:]", " =\n", f"{subdomain.pressure[phase].vector()[:]}") + subdomain.pressure_prev_timestep[phase].assign( subdomain.pressure[phase] ) + if debug: print(colored(f"id(subdomain{subdomain.subdomain_index}.pressure[{phase}])", "red"), " =\n", f"{id(subdomain.pressure[phase])}") print(f"subdomain{subdomain.subdomain_index}.pressure_prev_timestep[{phase}].vector()[:]", " =\n", f"{subdomain.pressure_prev_timestep[phase].vector()[:]}") @@ -1217,12 +1218,13 @@ class LDDsimulation(object): data_set_name=data_set_name ) - # populate interface dictionaries with pressure values. The calc_gli_term - # of each subdomain reads from the interface.pressure_values_prev - # and from interface.pressure_values dictionary so both need to be populated. - if self.interface_def_points is not None: - subdomain.write_pressure_to_interfaces() - subdomain.write_pressure_to_interfaces(previous_iter = True) + # this is also being done in the self.prepare_LDDsolver method!!!! + # # populate interface dictionaries with pressure values. The calc_gli_term + # # of each subdomain reads from the interface.pressure_values_prev + # # and from interface.pressure_values dictionary so both need to be populated. + # if self.interface_def_points is not None: + # subdomain.write_pressure_to_interfaces() + # subdomain.write_pressure_to_interfaces(previous_iter = True) subdomain.write_solution_to_xdmf(# file = self.solution_file[num], #