From 9fa61d3cf461e681b821a40888ef3a1fca8058bc Mon Sep 17 00:00:00 2001
From: David Seus <david.seus@ians.uni-stuttgart.de>
Date: Thu, 4 Jul 2019 15:00:44 +0200
Subject: [PATCH] fix little bugs

---
 LDDsimulation/LDDsimulation.py                                | 4 ++--
 LDDsimulation/domainPatch.py                                  | 2 ++
 .../plots/meshres20_dt0.01_subsequent_errors.tex              | 3 ++-
 TP-TP-2-patch-pure-dd/TP-TP-2-patch-pure-dd.py                | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/LDDsimulation/LDDsimulation.py b/LDDsimulation/LDDsimulation.py
index 71b503d..a5f6821 100644
--- a/LDDsimulation/LDDsimulation.py
+++ b/LDDsimulation/LDDsimulation.py
@@ -312,7 +312,7 @@ class LDDsimulation(object):
         self.timestep_num = int(0)
         # note that at this point of the code self.t = self.starttime as set in
         # the beginning.
-        while self.timestep_num <= self.number_of_timesteps:
+        while self.timestep_num < self.number_of_timesteps:
             print(f"entering timestep ",
                   "{}".format(self.timestep_num),
                   "at time t = "+ "{number:.{digits}f}".format(number = self.t, digits = 4))
@@ -408,7 +408,7 @@ class LDDsimulation(object):
         iteration = 0
         # gobal stopping criterion for the iteration.
         all_subdomains_are_done = False
-        while iteration <= self._max_iter_num and not all_subdomains_are_done:
+        while iteration < self._max_iter_num and not all_subdomains_are_done:
             iteration += 1
             # we need to loop over the subdomains and solve an L-scheme type step
             # on each subdomain. here it should be possible to parallelise in
diff --git a/LDDsimulation/domainPatch.py b/LDDsimulation/domainPatch.py
index acdb82f..8e7978e 100644
--- a/LDDsimulation/domainPatch.py
+++ b/LDDsimulation/domainPatch.py
@@ -720,6 +720,7 @@ class DomainPatch(df.SubDomain):
                 {"y": self.function_space["flux"][phase].sub(1).dofmap()}
                 )
 
+
     def _init_markers(self) -> None:
         """ define boundary markers
 
@@ -766,6 +767,7 @@ class DomainPatch(df.SubDomain):
                     self.outer_boundary_marker, boundary_marker_value
                     )
 
+
     def _init_measures(self):
         """ define measures for the governing form
 
diff --git a/RR-multi-patch-plus-gravity/plots/meshres20_dt0.01_subsequent_errors.tex b/RR-multi-patch-plus-gravity/plots/meshres20_dt0.01_subsequent_errors.tex
index 423d177..caabb99 100644
--- a/RR-multi-patch-plus-gravity/plots/meshres20_dt0.01_subsequent_errors.tex
+++ b/RR-multi-patch-plus-gravity/plots/meshres20_dt0.01_subsequent_errors.tex
@@ -38,7 +38,8 @@
             legend entries={$\bigl\|p_1^i - p_1^{i-1}\bigr\|_{L^2(\dom_1)}$,
                             $\bigl\|p_2^i - p_2^{i-1}\bigr\|_{L^2(\dom_2)}$,
                             $\bigl\|p_3^i - p_3^{i-1}\bigr\|_{L^2(\dom_3)}$,
-                            $\bigl\|p_4^i - p_4^{i-1}\bigr\|_{L^2(\dom_4)}$},
+                            $\bigl\|p_4^i - p_4^{i-1}\bigr\|_{L^2(\dom_4)}$
+                            },
             ] % end of axis options %col sep=comma,
             \addplot table [x=iteration, y=wetting] {../output/mesh_res20_dt0.01_with_gravity/subdomain1_dt0.01_hmax0.112_gravitiy_True_lambda15_Lw0.25subsequent_iteration_errors_at_time\timestep000.csv};%
             \addplot table [x=iteration, y=wetting] {../output/mesh_res20_dt0.01_with_gravity/subdomain2_dt0.01_hmax0.113_gravitiy_True_lambda15_Lw0.25subsequent_iteration_errors_at_time\timestep000.csv};%
diff --git a/TP-TP-2-patch-pure-dd/TP-TP-2-patch-pure-dd.py b/TP-TP-2-patch-pure-dd/TP-TP-2-patch-pure-dd.py
index a12fded..1b31d37 100755
--- a/TP-TP-2-patch-pure-dd/TP-TP-2-patch-pure-dd.py
+++ b/TP-TP-2-patch-pure-dd/TP-TP-2-patch-pure-dd.py
@@ -316,7 +316,7 @@ sat_pressure_relationship = {
 #
 # sat_pressure_relationship = {
 #     1: ft.partial(saturation, n_index=3, alpha=0.001),
-#     2: ft.partial(saturation, n_index=6, alpha=0.001),
+#     2: ft.partial(saturation, n_index=6, alpha=0.001),p1w + Spc[1]
 #     # 3: ft.partial(saturation, n_index=3, alpha=0.001),
 #     # 4: ft.partial(saturation, n_index=3, alpha=0.001),
 #     # 5: ft.partial(saturation, n_index=3, alpha=0.001),
-- 
GitLab