Skip to content
Snippets Groups Projects
Commit b13f64b7 authored by David Seus's avatar David Seus
Browse files

remove redundantly writing pressures to interfaces in _init_initial_values

parent 47ea421c
Branches
Tags
No related merge requests found
......@@ -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], #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment