From 8856fa4ad3fbbaaf085202fb648bb22d0c63a4c4 Mon Sep 17 00:00:00 2001
From: David Seus <david.seus@ians.uni-stuttgart.de>
Date: Wed, 19 Jun 2019 17:50:37 +0200
Subject: [PATCH] fix wrong order of loops in write_exact_solution_to_xdmf

---
 LDDsimulation/LDDsimulation.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/LDDsimulation/LDDsimulation.py b/LDDsimulation/LDDsimulation.py
index c16233a..68aa1a0 100644
--- a/LDDsimulation/LDDsimulation.py
+++ b/LDDsimulation/LDDsimulation.py
@@ -672,9 +672,9 @@ class LDDsimulation(object):
         all timesteps and write it to the solution file.
         """
         t = copy.copy(self.starttime)
-        for timestep in range(0,self.number_of_timesteps+1):
-            for subdom_ind, subdomain in self.subdomain.items():
-                file = self.solution_file[subdom_ind]
+        for subdom_ind, subdomain in self.subdomain.items():
+            file = self.solution_file[subdom_ind]
+            for timestep in range(0,self.number_of_timesteps+1):
                 for phase in subdomain.has_phases:
                     pa_exact = subdomain.pressure_exact[phase]
                     pa_exact.t = t
@@ -682,8 +682,8 @@ class LDDsimulation(object):
                     tmp_exact_pressure.rename("exact_pressure_"+"{}".format(phase), "exactpressure_"+"{}".format(phase))
                     file.write(tmp_exact_pressure, t)
 
-                file.close()
-            t += self.timestep_size
+                t += self.timestep_size
+            file.close()
 
     def write_subsequent_errors_to_csv(self,#
                                 filename: str, #
@@ -1017,7 +1017,7 @@ class LDDsimulation(object):
                 subdomain.pressure_prev_iter[phase].assign(pa0_interpolated)
                 subdomain.pressure_prev_timestep[phase].assign(pa0_interpolated)
 
-            # populate interface dictionaries with pressure values. The calc_gli_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.
             subdomain.write_pressure_to_interfaces()
-- 
GitLab