From 86623bae7675789d79f36b7073b7bcbc0dd08538 Mon Sep 17 00:00:00 2001
From: David Seus <david.seus@ians.uni-stuttgart.de>
Date: Fri, 7 Jun 2019 13:20:24 +0200
Subject: [PATCH] state before attempting to rewrite gli

---
 LDDsimulation/domainPatch.py                  |  22 +-
 ...ti-patch-with-gravity-constant-solution.py |  16 +-
 ...atch-with-inner-patch-constant-solution.py |  22 +-
 .../TP-TP-layered_soil-const-solution.py      | 115 +--
 ...ed_soil_with_inner_patch_const_solution.py | 196 +++---
 TP-TP-layered-soil-case/TP-TP-layered_soil.py | 153 ++--
 TP-TP-patch-test-case/TP-TP-2-patch-test.py   | 631 -----------------
 .../exact_solution_symbolic_computation.ipynb | 283 --------
 .../praeambels_and_definitions/.dropbox.attr  |   1 -
 .../theoreme_und_farbe.tex                    | 321 ---------
 .../L-Schema_Paper_makros.tex                 |  92 ---
 .../artikel_theoreme_und_farbe.tex            | 383 ----------
 .../artikelpraeambel.tex                      | 452 ------------
 .../lualatexartikelpraeambel.tex              | 340 ---------
 .../special_symbols.tex                       | 206 ------
 .../theoreme_und_farbe.tex                    | 366 ----------
 .../plots/subsequent_errors.tex               |  47 --
 .../TP-TP-2-patch-constant-solution.py        | 652 ------------------
 18 files changed, 293 insertions(+), 4005 deletions(-)
 delete mode 100755 TP-TP-patch-test-case/TP-TP-2-patch-test.py
 delete mode 100644 TP-TP-patch-test-case/exact_solution_symbolic_computation.ipynb
 delete mode 100755 TP-TP-patch-test-case/plots/praeambels_and_definitions/.dropbox.attr
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/Diplomarbeitsskriptpraeambel/theoreme_und_farbe.tex
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/L-Schema_Paper_makros.tex
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/artikel_theoreme_und_farbe.tex
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/artikelpraeambel.tex
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/lualatexartikelpraeambel.tex
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/special_symbols.tex
 delete mode 100644 TP-TP-patch-test-case/plots/praeambels_and_definitions/theoreme_und_farbe.tex
 delete mode 100644 TP-TP-patch-test-case/plots/subsequent_errors.tex
 delete mode 100755 TP-two-patch-constant-solution/TP-TP-2-patch-constant-solution.py

diff --git a/LDDsimulation/domainPatch.py b/LDDsimulation/domainPatch.py
index d2de50b..989b79f 100644
--- a/LDDsimulation/domainPatch.py
+++ b/LDDsimulation/domainPatch.py
@@ -363,7 +363,7 @@ class DomainPatch(df.SubDomain):
                     # and no interface term is practically appearing.
                     # interface_forms += (df.Constant(0)*phi_a)*ds(interface)
                     # pass
-                    interface_forms.append((df.Constant(0)*phi_a)*ds(marker_value))
+                    interface_forms.append((0*pa*phi_a)*ds(marker_value))
                 else:
                     # interface_forms += (dt*Lambda_a*pa*phi_a)*ds(interface)
                     interface_forms.append((dt*Lambda_a*pa*phi_a)*ds(marker_value))
@@ -391,7 +391,7 @@ class DomainPatch(df.SubDomain):
         return form_and_rhs
 
 
-    def calc_gl0_term(self, debug: bool = True) -> None: # tp.Dict[str, fl.Form]
+    def calc_gl0_term(self, debug: bool = False) -> None: # tp.Dict[str, fl.Form]
         """calculate the gl0 terms for all interfaces of the subdomain.
 
         assemble the gl0 terms for all interfaces of the subdomain and save them
@@ -431,7 +431,7 @@ class DomainPatch(df.SubDomain):
                 print(f"On subdomain{subdomain}, we have:\n",
                       f"Interface{interf_ind}, Neighbour index = {neighbour}\n",
                       f"dofs on interface:\n{interface_dofs['wetting']}\n",
-                      f"dof2global_vertex_map:\n{self.parent_mesh_index[self.dof2vertex['wetting'][interface_dofs['wetting']]]}\n"
+                      #f"dof2global_vertex_map:\n{self.parent_mesh_index[self.dof2vertex['wetting'][interface_dofs['wetting']]]}\n"
                       f"and dofs common with other interfaces:\n{dofs_in_common_with_other_interfaces['wetting']}")
 
             if self.isRichards:
@@ -507,13 +507,15 @@ class DomainPatch(df.SubDomain):
                     # we multiply these by 1/2
                     if dofs_in_common_with_other_interfaces[phase].size != 0:
                         if debug:
-                            print(f"the following dofs (phase = {phase}) of interface{interf_ind} are in common with \n",
+                            print(f"\nthe following dofs (phase = {phase}) of interface{interf_ind} are in common with \n",
                                 f" other interfaces: {dofs_in_common_with_other_interfaces[phase]}")
                         for common_dof in dofs_in_common_with_other_interfaces[phase]:
                             n_norm = self._normal_vector_norms_for_common_dofs[interf_ind][phase][common_dof]
                             # from the standpoint of the subdomain we are currently on,
                             # each dof can belong maximally to two interfaces.
-                            # because we have not
+                            print(f"On subdomain{self.subdomain_index} and interface{interf_ind} the flux\n",
+                                  f"neumann_flux_assembled[{common_dof}] is devided by the norm {n_norm}",
+                                  f"coordinate of the common_dof = {self.mesh.coordinates()[self.dof2vertex[phase][common_dof]]}")
                             neumann_flux_assembled[common_dof] = neumann_flux_assembled[common_dof]/n_norm
                             robin_pressure_assembled[common_dof] = robin_pressure_assembled[common_dof]/2
 
@@ -533,9 +535,9 @@ class DomainPatch(df.SubDomain):
                 interface = self.interface[interf_ind]
                 # # needed for the read_gli_dofs() functions
                 interface_dofs = self._dof_indices_of_interface[interf_ind]
-                if debug:
-                    print(f"Interface{interf_ind}.gli_term_prev[{subdomain}][{phase}]=\n",interface.gli_term_prev[subdomain][phase])
-                    print(f"before writing to interface[{interf_ind}] the values gli_assembled[{phase}]=\n",gli_assembled_tmp[phase])
+                # if debug:
+                #     print(f"Interface{interf_ind}.gli_term_prev[{subdomain}][{phase}]=\n",interface.gli_term_prev[subdomain][phase])
+                #     print(f"before writing to interface[{interf_ind}] the values gli_assembled[{phase}]=\n",gli_assembled_tmp[phase])
                 # write gli dofs to interface dicts for communiction.
                 interface.read_gli_dofs(from_array = gli_assembled_tmp[phase],#self.gli_assembled[phase], #
                                interface_dofs = interface_dofs[phase],#
@@ -545,8 +547,8 @@ class DomainPatch(df.SubDomain):
                                subdomain_ind = subdomain,#
                                previous_iter = True
                                )
-                if debug:
-                    print(f"gl0_terms after writing to interface[{interf_ind}] Interface[{interf_ind}].gli_term_prev[{subdomain}][{phase}]=\n",interface.gli_term_prev[subdomain][phase])
+                # if debug:
+                #     print(f"gl0_terms after writing to interface[{interf_ind}] Interface[{interf_ind}].gli_term_prev[{subdomain}][{phase}]=\n",interface.gli_term_prev[subdomain][phase])
     ### END calc_gl0_term
 
 
diff --git a/RR-multi-patch-plus-gravity-const-solution/RR-multi-patch-with-gravity-constant-solution.py b/RR-multi-patch-plus-gravity-const-solution/RR-multi-patch-with-gravity-constant-solution.py
index 14f1e7c..4ef0837 100755
--- a/RR-multi-patch-plus-gravity-const-solution/RR-multi-patch-with-gravity-constant-solution.py
+++ b/RR-multi-patch-plus-gravity-const-solution/RR-multi-patch-with-gravity-constant-solution.py
@@ -15,15 +15,15 @@ sym.init_printing()
 # ----------------------------------------------------------------------------#
 # ------------------- MESH ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-mesh_resolution = 30
+mesh_resolution = 29
 # ----------------------------------------:-------------------------------------#
 # ------------------- TIME ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
 timestep_size = 0.01
-number_of_timesteps = 10
+number_of_timesteps = 1
 # decide how many timesteps you want analysed. Analysed means, that we write
 # out subsequent errors of the L-iteration within the timestep.
-number_of_timesteps_to_analyse = 2
+number_of_timesteps_to_analyse = 1
 starttime = 0
 
 
@@ -163,10 +163,10 @@ porosity = {
 
 # subdom_num : subdomain L for L-scheme
 L = {
-    1: {'wetting': 0.5},
-    2: {'wetting': 0.5},
-    3: {'wetting': 0.5},
-    4: {'wetting': 0.5}
+    1: {'wetting': 0.25},
+    2: {'wetting': 0.25},
+    3: {'wetting': 0.25},
+    4: {'wetting': 0.25}
 }
 
 lamdal_w = 30
@@ -434,7 +434,7 @@ write_to_file = {
 }
 
 # initialise LDD simulation class
-simulation = ldd.LDDsimulation(tol=1E-14, debug=True, LDDsolver_tol=1E-9)
+simulation = ldd.LDDsimulation(tol=1E-14, debug=True, LDDsolver_tol=5E-7)
 simulation.set_parameters(output_dir="./output/",
                           subdomain_def_points=subdomain_def_points,
                           isRichards=isRichards,
diff --git a/RR-multi-patch-with-inner-patch-const-solution/RR-multi-patch-with-inner-patch-constant-solution.py b/RR-multi-patch-with-inner-patch-const-solution/RR-multi-patch-with-inner-patch-constant-solution.py
index f73abbc..bacc24d 100755
--- a/RR-multi-patch-with-inner-patch-const-solution/RR-multi-patch-with-inner-patch-constant-solution.py
+++ b/RR-multi-patch-with-inner-patch-const-solution/RR-multi-patch-with-inner-patch-constant-solution.py
@@ -15,15 +15,15 @@ sym.init_printing()
 # ----------------------------------------------------------------------------#
 # ------------------- MESH ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-mesh_resolution = 30
+mesh_resolution = 40
 # ----------------------------------------:-------------------------------------#
 # ------------------- TIME ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
 timestep_size = 0.01
-number_of_timesteps = 10
+number_of_timesteps = 30
 # decide how many timesteps you want analysed. Analysed means, that we write
 # out subsequent errors of the L-iteration within the timestep.
-number_of_timesteps_to_analyse = 2
+number_of_timesteps_to_analyse = 10
 starttime = 0
 
 
@@ -194,11 +194,11 @@ porosity = {
 
 # subdom_num : subdomain L for L-scheme
 L = {
-    1: {'wetting': 0.6},
-    2: {'wetting': 0.6},
-    3: {'wetting': 0.6},
-    4: {'wetting': 0.6},
-    5: {'wetting': 0.6}
+    1: {'wetting': 0.25},
+    2: {'wetting': 0.25},
+    3: {'wetting': 0.25},
+    4: {'wetting': 0.25},
+    5: {'wetting': 0.25}
 }
 
 lamdal_w = 32
@@ -229,7 +229,7 @@ subdomain1_rel_perm = {
 # relative permeabilty functions on subdomain 2
 def rel_perm2(s):
     # relative permeabilty on subdomain2
-    return s**3
+    return s**2
 
 
 _rel_perm2 = ft.partial(rel_perm2)
@@ -276,7 +276,7 @@ subdomain1_rel_perm_prime = {
 # relative permeabilty functions on subdomain 2
 def rel_perm2_prime(s):
     # relative permeabilty on subdomain2
-    return 3*s**2
+    return 2*s
 
 
 _rel_perm2_prime = ft.partial(rel_perm2_prime)
@@ -569,7 +569,7 @@ write_to_file = {
 }
 
 # initialise LDD simulation class
-simulation = ldd.LDDsimulation(tol=1E-14, debug=True, LDDsolver_tol=1E-9)
+simulation = ldd.LDDsimulation(tol=1E-14, debug=True, LDDsolver_tol=1E-5)
 simulation.set_parameters(output_dir="./output/",
                           subdomain_def_points=subdomain_def_points,
                           isRichards=isRichards,
diff --git a/TP-TP-layered-soil-case-const-solution/TP-TP-layered_soil-const-solution.py b/TP-TP-layered-soil-case-const-solution/TP-TP-layered_soil-const-solution.py
index c7ff9e4..914239a 100755
--- a/TP-TP-layered-soil-case-const-solution/TP-TP-layered_soil-const-solution.py
+++ b/TP-TP-layered-soil-case-const-solution/TP-TP-layered_soil-const-solution.py
@@ -23,7 +23,7 @@ sym.init_printing()
 # ----------------------------------------------------------------------------#
 # ------------------- MESH ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-mesh_resolution = 30
+mesh_resolution = 40
 # ----------------------------------------:-------------------------------------#
 # ------------------- TIME ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
@@ -34,20 +34,20 @@ number_of_timesteps = 100
 number_of_timesteps_to_analyse = 10
 starttime = 0
 
-l_param_w = 60
-l_param_nw = 60
+l_param_w = 40
+l_param_nw = 40
 
 # global domain
-subdomain0_vertices = [df.Point(0.0,0.0), #
-                        df.Point(13.0,0.0),#
-                        df.Point(13.0,8.0),#
-                        df.Point(0.0,8.0)]
-
-interface12_vertices = [df.Point(0.0, 7.0),
-                        df.Point(9.0, 7.0),
-                        df.Point(10.5, 7.5),
-                        df.Point(12.0, 7.0),
-                        df.Point(13.0, 6.5)]
+subdomain0_vertices = [df.Point(-1.0,-1.0), #
+                        df.Point(1.0,-1.0),#
+                        df.Point(1.0,1.0),#
+                        df.Point(-1.0,1.0)]
+
+interface12_vertices = [df.Point(-1.0, 0.8),
+                        df.Point(0.3, 0.8),
+                        df.Point(0.5, 0.9),
+                        df.Point(0.8, 0.7),
+                        df.Point(1.0, 0.65)]
 # subdomain1.
 subdomain1_vertices = [interface12_vertices[0],
                         interface12_vertices[1],
@@ -70,15 +70,15 @@ subdomain1_outer_boundary_verts = {
 
 
 # interface23
-interface23_vertices = [df.Point(0.0, 5.0),
-                        df.Point(3.0, 5.0),
+interface23_vertices = [df.Point(-1.0, 0.0),
+                        df.Point(-0.35, 0.0),
                         # df.Point(6.5, 4.5),
-                        df.Point(6.5, 5.0),
-                        df.Point(9.5, 5.0),
+                        df.Point(0.0, 0.0),
+                        df.Point(0.5, 0.0),
                         # df.Point(11.5, 3.5),
                         # df.Point(13.0, 3)
-                        df.Point(11.5, 5.0),
-                        df.Point(13.0, 5.0)
+                        df.Point(0.85, 0.0),
+                        df.Point(1.0, 0.0)
                         ]
 
 #subdomain1
@@ -103,11 +103,11 @@ subdomain2_outer_boundary_verts = {
 
 
 # interface34
-interface34_vertices = [df.Point(0.0, 2.0),
-                        df.Point(4.0, 2.0),
-                        df.Point(9.0, 2.5),
-                        df.Point(10.5, 2.0),
-                        df.Point(13.0, 1.5)]
+interface34_vertices = [df.Point(-1.0, -0.6),
+                        df.Point(-0.6, -0.45),
+                        df.Point(0.3, -0.25),
+                        df.Point(0.65, -0.6),
+                        df.Point(1.0, -0.7)]
 
 # subdomain3
 subdomain3_vertices = [interface34_vertices[0],
@@ -154,6 +154,7 @@ subdomain_def_points = [subdomain0_vertices,#
                       ]
 
 
+
 # interface_vertices introduces a global numbering of interfaces.
 interface_def_points = [interface12_vertices, interface23_vertices, interface34_vertices]
 adjacent_subdomains = [[1,2], [2,3], [3,4]]
@@ -186,25 +187,25 @@ isRichards = {
 # Dict of the form: { subdom_num : viscosity }
 viscosity = {
     1: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
     2: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
     3: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
     4: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
 }
 
 # Dict of the form: { subdom_num : density }
 densities = {
-    1: {'wetting': 997,
-         'nonwetting': 1.225},
-    2: {'wetting': 997,
-         'nonwetting': 1.225},
-    3: {'wetting': 997,
-         'nonwetting': 1.225},
-    4: {'wetting': 997,
-         'nonwetting': 1.225}
+    1: {'wetting': 1,  #997,
+         'nonwetting': 1},  #1.225},
+    2: {'wetting': 1,  #997,
+         'nonwetting': 1},  #1.225},
+    3: {'wetting': 1,  #997,
+         'nonwetting': 1},  #1.225},
+    4: {'wetting': 1,  #997,
+         'nonwetting': 1}  #1.225}
 }
 
 gravity_acceleration = 9.81
@@ -212,22 +213,22 @@ gravity_acceleration = 9.81
 # https://www.geotechdata.info/parameter/soil-porosity.html
 # Dict of the form: { subdom_num : porosity }
 porosity = {
-    1: 0.2,  # Clayey gravels, clayey sandy gravels
-    2: 0.22, # Silty gravels, silty sandy gravels
-    3: 0.37, # Clayey sands
-    4: 0.2 # Silty or sandy clay
+    1: 1,  #0.2,  # Clayey gravels, clayey sandy gravels
+    2: 1,  #0.22, # Silty gravels, silty sandy gravels
+    3: 1,  #0.37, # Clayey sands
+    4: 1,  #0.2 # Silty or sandy clay
 }
 
 # subdom_num : subdomain L for L-scheme
 L = {
-    1: {'wetting' :0.4,
-         'nonwetting': 0.4},
-    2: {'wetting' :0.4,
-         'nonwetting': 0.4},
-    3: {'wetting' :0.4,
-         'nonwetting': 0.4},
-    4: {'wetting' :0.4,
-         'nonwetting': 0.4}
+    1: {'wetting' : 0.25,
+         'nonwetting': 0.25},
+    2: {'wetting' : 0.25,
+         'nonwetting': 0.25},
+    3: {'wetting' : 0.25,
+         'nonwetting': 0.25},
+    4: {'wetting' : 0.25,
+         'nonwetting': 0.25}
 }
 
 # subdom_num : lambda parameter for the L-scheme
@@ -257,7 +258,7 @@ def rel_perm1nw(s):
 ## relative permeabilty functions on subdomain 2
 def rel_perm2w(s):
     # relative permeabilty wetting on subdomain2
-    return s**3
+    return s**2
 
 
 def rel_perm2nw(s):
@@ -308,7 +309,7 @@ def rel_perm1nw_prime(s):
 # relative permeabilty functions on subdomain 1
 def rel_perm2w_prime(s):
     # relative permeabilty on subdomain1
-    return 3*s**2
+    return 2*s
 
 def rel_perm2nw_prime(s):
     # relative permeabilty on subdomain1
@@ -372,22 +373,22 @@ def saturation_sym_prime(pc, n_index, alpha):
 S_pc_sym = {
     1: ft.partial(saturation_sym, n_index=3, alpha=0.001),
     2: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    3: ft.partial(saturation_sym, n_index=6, alpha=0.001),
-    4: ft.partial(saturation_sym, n_index=6, alpha=0.001)
+    3: ft.partial(saturation_sym, n_index=3, alpha=0.001),
+    4: ft.partial(saturation_sym, n_index=3, alpha=0.001)
 }
 
 S_pc_sym_prime = {
     1: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
     2: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    3: ft.partial(saturation_sym_prime, n_index=6, alpha=0.001),
-    4: ft.partial(saturation_sym_prime, n_index=6, alpha=0.001)
+    3: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
+    4: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001)
 }
 
 sat_pressure_relationship = {
     1: ft.partial(saturation, n_index=3, alpha=0.001),
     2: ft.partial(saturation, n_index=3, alpha=0.001),
-    3: ft.partial(saturation, n_index=6, alpha=0.001),
-    4: ft.partial(saturation, n_index=6, alpha=0.001)
+    3: ft.partial(saturation, n_index=3, alpha=0.001),
+    4: ft.partial(saturation, n_index=3, alpha=0.001)
 }
 
 
@@ -520,7 +521,7 @@ write_to_file = {
 }
 
 # initialise LDD simulation class
-simulation = ldd.LDDsimulation(tol=1E-14, debug=False, LDDsolver_tol=1E-7)
+simulation = ldd.LDDsimulation(tol=1E-14, debug=False, LDDsolver_tol=1E-5)
 simulation.set_parameters(output_dir="./output/",
                           subdomain_def_points=subdomain_def_points,
                           isRichards=isRichards,
diff --git a/TP-TP-layered-soil-case-with-inner-patch-constant-solution/TP-TP-layered_soil_with_inner_patch_const_solution.py b/TP-TP-layered-soil-case-with-inner-patch-constant-solution/TP-TP-layered_soil_with_inner_patch_const_solution.py
index 04505ac..03c28f6 100755
--- a/TP-TP-layered-soil-case-with-inner-patch-constant-solution/TP-TP-layered_soil_with_inner_patch_const_solution.py
+++ b/TP-TP-layered-soil-case-with-inner-patch-constant-solution/TP-TP-layered_soil_with_inner_patch_const_solution.py
@@ -23,51 +23,48 @@ sym.init_printing()
 # ----------------------------------------------------------------------------#
 # ------------------- MESH ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-mesh_resolution = 20
+mesh_resolution = 41
 # ----------------------------------------:-----------------------------------#
 # ------------------- TIME ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-timestep_size = 0.0001
-number_of_timesteps = 10
+timestep_size = 0.001
+number_of_timesteps = 100
 # decide how many timesteps you want analysed. Analysed means, that we write
 # out subsequent errors of the L-iteration within the timestep.
-number_of_timesteps_to_analyse = 4
+number_of_timesteps_to_analyse = 10
 starttime = 0
 
-Lw = 0.3
-Lnw = 0.4
+Lw = 0.25
+Lnw = 0.25
 
 l_param_w = 40
 l_param_nw = 40
 
 # global domain
-subdomain0_vertices = [df.Point(0.0,0.0), #
-                        df.Point(13.0,0.0),#
-                        df.Point(13.0,8.0),#
-                        df.Point(0.0,8.0)]
+subdomain0_vertices = [df.Point(-1.0,-1.0), #
+                        df.Point(1.0,-1.0),#
+                        df.Point(1.0,1.0),#
+                        df.Point(-1.0,1.0)]
 
-interface12_vertices = [df.Point(0.0, 7.0),
-                        df.Point(9.0, 7.0),
-                        df.Point(10.5, 7.5),
-                        df.Point(12.0, 7.0),
-                        df.Point(13.0, 6.5)]
+interface12_vertices = [df.Point(-1.0, 0.8),
+                        df.Point(0.3, 0.8),
+                        df.Point(0.5, 0.9),
+                        df.Point(0.8, 0.7),
+                        df.Point(1.0, 0.65)]
 
 
-# interface23
-interface23_vertices = [df.Point(0.0, 5.0),
-                        df.Point(3.0, 5.0),
+                        # interface23
+interface23_vertices = [df.Point(-1.0, 0.0),
+                        df.Point(-0.35, 0.0),
                         # df.Point(6.5, 4.5),
-                        df.Point(6.5, 5.0)]
+                        df.Point(0.0, 0.0)]
 
-interface24_vertices = [df.Point(6.5, 5.0),
-                        df.Point(9.5, 5.0),
-                        # df.Point(11.5, 3.5),
-                        # df.Point(13.0, 3)
-                        df.Point(11.5, 5.0)
+interface24_vertices = [interface23_vertices[2],
+                        df.Point(0.6, 0.0),
                         ]
 
-interface25_vertices = [df.Point(11.5, 5.0),
-                        df.Point(13.0, 5.0)
+interface25_vertices = [interface24_vertices[1],
+                        df.Point(1.0, 0.0)
                         ]
 
 
@@ -75,27 +72,73 @@ interface32_vertices = [interface23_vertices[2],
                         interface23_vertices[1],
                         interface23_vertices[0]]
 
-interface34_vertices = [df.Point(4.0, 2.0),
-                        df.Point(4.7, 3.0),
-                        interface23_vertices[2]]
-# interface36
-interface36_vertices = [df.Point(0.0, 2.0),
-                        df.Point(4.0, 2.0)]
 
+interface36_vertices = [df.Point(-1.0, -0.6),
+                        df.Point(-0.6, -0.45)]
+
+
+interface46_vertices = [interface36_vertices[1],
+                        df.Point(0.3, -0.25)]
+
+interface56_vertices = [interface46_vertices[1],
+                        df.Point(0.65, -0.6),
+                        df.Point(1.0, -0.7)]
 
-interface46_vertices = [df.Point(4.0, 2.0),
-                        df.Point(9.0, 2.5)]
 
-interface45_vertices = [df.Point(9.0, 2.5),
-                        df.Point(10.0, 3.0),
+
+
+interface34_vertices = [interface36_vertices[1],
+                        interface23_vertices[2]]
+# interface36
+
+interface45_vertices = [interface56_vertices[0],
+                        df.Point(0.7, -0.2),
                         interface25_vertices[0]
                         ]
 
-interface56_vertices = [df.Point(9.0, 2.5),
-                        df.Point(10.5, 2.0),
-                        df.Point(13.0, 1.5)]
+# # subdomain1.
+# subdomain1_vertices = [interface12_vertices[0],
+#                         interface12_vertices[1],
+#                         interface12_vertices[2],
+#                         interface12_vertices[3],
+#                         interface12_vertices[4], # southern boundary, 12 interface
+#                         subdomain0_vertices[2], # eastern boundary, outer boundary
+#                         subdomain0_vertices[3]] # northern boundary, outer on_boundary
+#
+# # vertex coordinates of the outer boundaries. If it can not be specified as a
+# # polygon, use an entry per boundary polygon. This information is used for defining
+# # the Dirichlet boundary conditions. If a domain is completely internal, the
+# # dictionary entry should be 0: None
+# subdomain1_outer_boundary_verts = {
+#     0: [interface12_vertices[4], #
+#         subdomain0_vertices[2], # eastern boundary, outer boundary
+#         subdomain0_vertices[3],
+#         interface12_vertices[0]]
+# }
+#
 
 
+# #subdomain1
+# subdomain2_vertices = [interface23_vertices[0],
+#                         interface23_vertices[1],
+#                         interface23_vertices[2],
+#                         interface23_vertices[3],
+#                         interface23_vertices[4],
+#                         interface23_vertices[5], # southern boundary, 23 interface
+#                         subdomain1_vertices[4], # eastern boundary, outer boundary
+#                         subdomain1_vertices[3],
+#                         subdomain1_vertices[2],
+#                         subdomain1_vertices[1],
+#                         subdomain1_vertices[0] ] # northern boundary, 12 interface
+#
+# subdomain2_outer_boundary_verts = {
+#     0: [interface23_vertices[5],
+#         subdomain1_vertices[4]],
+#     1: [subdomain1_vertices[0],
+#         interface23_vertices[0]]
+# }
+#
+
 # interface_vertices introduces a global numbering of interfaces.
 interface_def_points = [interface12_vertices,
                         interface23_vertices,
@@ -132,10 +175,10 @@ subdomain1_vertices = [interface12_vertices[0],
 # the Dirichlet boundary conditions. If a domain is completely internal, the
 # dictionary entry should be 0: None
 subdomain1_outer_boundary_verts = {
-    0: [interface12_vertices[4], #
-        subdomain0_vertices[2], # eastern boundary, outer boundary
-        subdomain0_vertices[3],
-        interface12_vertices[0]]
+    0: [subdomain1_vertices[4], #
+        subdomain1_vertices[5], # eastern boundary, outer boundary
+        subdomain1_vertices[6],
+        subdomain1_vertices[0]]
 }
 
 #subdomain1
@@ -143,7 +186,6 @@ subdomain2_vertices = [interface23_vertices[0],
                         interface23_vertices[1],
                         interface23_vertices[2],
                         interface24_vertices[1],
-                        interface24_vertices[2],
                         interface25_vertices[1], # southern boundary, 23 interface
                         subdomain1_vertices[4], # eastern boundary, outer boundary
                         subdomain1_vertices[3],
@@ -152,10 +194,10 @@ subdomain2_vertices = [interface23_vertices[0],
                         subdomain1_vertices[0] ] # northern boundary, 12 interface
 
 subdomain2_outer_boundary_verts = {
-    0: [interface25_vertices[1],
-        subdomain1_vertices[4]],
-    1: [subdomain1_vertices[0],
-        interface23_vertices[0]]
+    0: [subdomain2_vertices[9],
+        subdomain2_vertices[0]],
+    1: [subdomain2_vertices[4],
+        subdomain2_vertices[5]]
 }
 
 
@@ -163,14 +205,13 @@ subdomain3_vertices = [interface36_vertices[0],
                        interface36_vertices[1],
                        # interface34_vertices[0],
                        interface34_vertices[1],
-                       interface34_vertices[2],
                        # interface32_vertices[0],
                        interface32_vertices[1],
                        interface32_vertices[2]
                        ]
 
 subdomain3_outer_boundary_verts = {
-    0: [subdomain2_vertices[0],
+    0: [subdomain3_vertices[4],
         subdomain3_vertices[0]]
 }
 
@@ -178,8 +219,7 @@ subdomain3_outer_boundary_verts = {
 # subdomain3
 subdomain4_vertices = [interface46_vertices[0],
                        interface46_vertices[1],
-                       df.Point(10.0, 3.0),
-                       interface24_vertices[2],
+                       interface45_vertices[1],
                        interface24_vertices[1],
                        interface24_vertices[0],
                        interface34_vertices[1]
@@ -213,10 +253,10 @@ subdomain6_vertices = [subdomain0_vertices[0],
                        ]
 
 subdomain6_outer_boundary_verts = {
-    0: [subdomain4_vertices[6],
-        subdomain4_vertices[0],
-        subdomain4_vertices[1],
-        subdomain4_vertices[2]]
+    0: [subdomain6_vertices[6],
+        subdomain6_vertices[0],
+        subdomain6_vertices[1],
+        subdomain6_vertices[2]]
 }
 
 
@@ -253,16 +293,16 @@ outer_boundary_def_points = {
 #     }
 
 isRichards = {
-    1: True,
-    2: True,
-    3: True,
-    4: True,
-    5: True,
-    6: True
+    1: False,
+    2: False,
+    3: False,
+    4: False,
+    5: False,
+    6: False
     }
 
 visc = {'wetting': 1,
-        'nonwetting': 1/50}
+        'nonwetting': 1}
 dens = {'wetting': 1,
         'nonwetting': 1}
 poro = 1
@@ -547,28 +587,28 @@ def saturation_sym_prime(pc, n_index):
 S_pc_sym = {
     1: ft.partial(saturation_sym, n_index=1),
     2: ft.partial(saturation_sym, n_index=1),
-    3: ft.partial(saturation_sym, n_index=2),
-    4: ft.partial(saturation_sym, n_index=2),
-    5: ft.partial(saturation_sym, n_index=2),
-    6: ft.partial(saturation_sym, n_index=2)
+    3: ft.partial(saturation_sym, n_index=1),
+    4: ft.partial(saturation_sym, n_index=1),
+    5: ft.partial(saturation_sym, n_index=1),
+    6: ft.partial(saturation_sym, n_index=1)
 }
 
 S_pc_sym_prime = {
     1: ft.partial(saturation_sym_prime, n_index=1),
     2: ft.partial(saturation_sym_prime, n_index=1),
-    3: ft.partial(saturation_sym_prime, n_index=2),
-    4: ft.partial(saturation_sym_prime, n_index=2),
-    5: ft.partial(saturation_sym_prime, n_index=2),
-    6: ft.partial(saturation_sym_prime, n_index=2)
+    3: ft.partial(saturation_sym_prime, n_index=1),
+    4: ft.partial(saturation_sym_prime, n_index=1),
+    5: ft.partial(saturation_sym_prime, n_index=1),
+    6: ft.partial(saturation_sym_prime, n_index=1)
 }
 
 sat_pressure_relationship = {
     1: ft.partial(saturation, n_index=1),
     2: ft.partial(saturation, n_index=1),
-    3: ft.partial(saturation, n_index=2),
-    4: ft.partial(saturation, n_index=2),
-    5: ft.partial(saturation, n_index=2),
-    6: ft.partial(saturation, n_index=2)
+    3: ft.partial(saturation, n_index=1),
+    4: ft.partial(saturation, n_index=1),
+    5: ft.partial(saturation, n_index=1),
+    6: ft.partial(saturation, n_index=1)
 }
 
 
@@ -578,8 +618,8 @@ sat_pressure_relationship = {
 x, y = sym.symbols('x[0], x[1]')  # needed by UFL
 t = sym.symbols('t', positive=True)
 
-p_dict = {'wetting': -3 + 0*t,
-          'nonwetting': -2 + 0*t}
+p_dict = {'wetting': -3.0 + 0.0*t,
+          'nonwetting': -1.0 + 0.0*t}
 p_e_sym = dict()
 pc_e_sym = dict()
 for subdomain, isR in isRichards.items():
@@ -741,7 +781,7 @@ write_to_file = {
 }
 
 # initialise LDD simulation class
-simulation = ldd.LDDsimulation(tol=1E-14, debug=True, LDDsolver_tol=5E-4)
+simulation = ldd.LDDsimulation(tol=1E-14, debug=True, LDDsolver_tol=5E-5)
 simulation.set_parameters(output_dir="./output/",
                           subdomain_def_points=subdomain_def_points,
                           isRichards=isRichards,
diff --git a/TP-TP-layered-soil-case/TP-TP-layered_soil.py b/TP-TP-layered-soil-case/TP-TP-layered_soil.py
index 9cb30dc..68d799f 100755
--- a/TP-TP-layered-soil-case/TP-TP-layered_soil.py
+++ b/TP-TP-layered-soil-case/TP-TP-layered_soil.py
@@ -23,31 +23,31 @@ sym.init_printing()
 # ----------------------------------------------------------------------------#
 # ------------------- MESH ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-mesh_resolution = 30
+mesh_resolution = 19
 # ----------------------------------------:-------------------------------------#
 # ------------------- TIME ---------------------------------------------------#
 # ----------------------------------------------------------------------------#
-timestep_size = 0.0001
-number_of_timesteps = 5
+timestep_size = 0.001
+number_of_timesteps = 1000
 # decide how many timesteps you want analysed. Analysed means, that we write
 # out subsequent errors of the L-iteration within the timestep.
-number_of_timesteps_to_analyse = 0
+number_of_timesteps_to_analyse = 10
 starttime = 0
 
-l_param_w = 60
-l_param_nw = 60
+l_param_w = 40
+l_param_nw = 40
 
 # global domain
-subdomain0_vertices = [df.Point(0.0,0.0), #
-                        df.Point(13.0,0.0),#
-                        df.Point(13.0,8.0),#
-                        df.Point(0.0,8.0)]
-
-interface12_vertices = [df.Point(0.0, 7.0),
-                        df.Point(9.0, 7.0),
-                        df.Point(10.5, 7.5),
-                        df.Point(12.0, 7.0),
-                        df.Point(13.0, 6.5)]
+subdomain0_vertices = [df.Point(-1.0,-1.0), #
+                        df.Point(1.0,-1.0),#
+                        df.Point(1.0,1.0),#
+                        df.Point(-1.0,1.0)]
+
+interface12_vertices = [df.Point(-1.0, 0.8),
+                        df.Point(0.3, 0.8),
+                        df.Point(0.5, 0.9),
+                        df.Point(0.8, 0.7),
+                        df.Point(1.0, 0.65)]
 # subdomain1.
 subdomain1_vertices = [interface12_vertices[0],
                         interface12_vertices[1],
@@ -70,15 +70,15 @@ subdomain1_outer_boundary_verts = {
 
 
 # interface23
-interface23_vertices = [df.Point(0.0, 5.0),
-                        df.Point(3.0, 5.0),
+interface23_vertices = [df.Point(-1.0, 0.0),
+                        df.Point(-0.35, 0.0),
                         # df.Point(6.5, 4.5),
-                        df.Point(6.5, 5.0),
-                        df.Point(9.5, 5.0),
+                        df.Point(0.0, 0.0),
+                        df.Point(0.5, 0.0),
                         # df.Point(11.5, 3.5),
                         # df.Point(13.0, 3)
-                        df.Point(11.5, 5.0),
-                        df.Point(13.0, 5.0)
+                        df.Point(0.85, 0.0),
+                        df.Point(1.0, 0.0)
                         ]
 
 #subdomain1
@@ -103,11 +103,11 @@ subdomain2_outer_boundary_verts = {
 
 
 # interface34
-interface34_vertices = [df.Point(0.0, 2.0),
-                        df.Point(4.0, 2.0),
-                        df.Point(9.0, 2.5),
-                        df.Point(10.5, 2.0),
-                        df.Point(13.0, 1.5)]
+interface34_vertices = [df.Point(-1.0, -0.6),
+                        df.Point(-0.6, -0.45),
+                        df.Point(0.3, -0.25),
+                        df.Point(0.65, -0.6),
+                        df.Point(1.0, -0.7)]
 
 # subdomain3
 subdomain3_vertices = [interface34_vertices[0],
@@ -186,25 +186,25 @@ isRichards = {
 # Dict of the form: { subdom_num : viscosity }
 viscosity = {
     1: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
     2: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
     3: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
     4: {'wetting' :1,
-         'nonwetting': 1/50},
+         'nonwetting': 1},
 }
 
 # Dict of the form: { subdom_num : density }
 densities = {
-    1: {'wetting': 997,
-         'nonwetting': 1.225},
-    2: {'wetting': 997,
-         'nonwetting': 1.225},
-    3: {'wetting': 997,
-         'nonwetting': 1.225},
-    4: {'wetting': 997,
-         'nonwetting': 1.225}
+    1: {'wetting': 1,  #997
+         'nonwetting':1},  #1.225}},
+    2: {'wetting': 1,  #997
+         'nonwetting':1},  #1.225}},
+    3: {'wetting': 1,  #997
+         'nonwetting':1},  #1.225}},
+    4: {'wetting': 1,  #997
+         'nonwetting':1},  #1.225}}
 }
 
 gravity_acceleration = 9.81
@@ -212,22 +212,22 @@ gravity_acceleration = 9.81
 # https://www.geotechdata.info/parameter/soil-porosity.html
 # Dict of the form: { subdom_num : porosity }
 porosity = {
-    1: 0.2,  # Clayey gravels, clayey sandy gravels
-    2: 0.22, # Silty gravels, silty sandy gravels
-    3: 0.37, # Clayey sands
-    4: 0.2 # Silty or sandy clay
+    1: 1,  #0.2,  # Clayey gravels, clayey sandy gravels
+    2: 1,  #0.22, # Silty gravels, silty sandy gravels
+    3: 1,  #0.37, # Clayey sands
+    4: 1,  #0.2 # Silty or sandy clay
 }
 
 # subdom_num : subdomain L for L-scheme
 L = {
-    1: {'wetting' :0.4,
-         'nonwetting': 0.4},
-    2: {'wetting' :0.4,
-         'nonwetting': 0.4},
-    3: {'wetting' :0.4,
-         'nonwetting': 0.4},
-    4: {'wetting' :0.4,
-         'nonwetting': 0.4}
+    1: {'wetting' :0.25,
+         'nonwetting': 0.25},
+    2: {'wetting' :0.25,
+         'nonwetting': 0.25},
+    3: {'wetting' :0.25,
+         'nonwetting': 0.25},
+    4: {'wetting' :0.25,
+         'nonwetting': 0.25}
 }
 
 # subdom_num : lambda parameter for the L-scheme
@@ -257,7 +257,7 @@ def rel_perm1nw(s):
 ## relative permeabilty functions on subdomain 2
 def rel_perm2w(s):
     # relative permeabilty wetting on subdomain2
-    return s**3
+    return s**2
 
 
 def rel_perm2nw(s):
@@ -308,7 +308,7 @@ def rel_perm1nw_prime(s):
 # relative permeabilty functions on subdomain 1
 def rel_perm2w_prime(s):
     # relative permeabilty on subdomain1
-    return 3*s**2
+    return 2*s
 
 def rel_perm2nw_prime(s):
     # relative permeabilty on subdomain1
@@ -372,22 +372,22 @@ def saturation_sym_prime(pc, n_index, alpha):
 S_pc_sym = {
     1: ft.partial(saturation_sym, n_index=3, alpha=0.001),
     2: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    3: ft.partial(saturation_sym, n_index=6, alpha=0.001),
-    4: ft.partial(saturation_sym, n_index=6, alpha=0.001)
+    3: ft.partial(saturation_sym, n_index=3, alpha=0.001),
+    4: ft.partial(saturation_sym, n_index=3, alpha=0.001)
 }
 
 S_pc_sym_prime = {
     1: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
     2: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    3: ft.partial(saturation_sym_prime, n_index=6, alpha=0.001),
-    4: ft.partial(saturation_sym_prime, n_index=6, alpha=0.001)
+    3: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
+    4: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001)
 }
 
 sat_pressure_relationship = {
     1: ft.partial(saturation, n_index=3, alpha=0.001),
     2: ft.partial(saturation, n_index=3, alpha=0.001),
-    3: ft.partial(saturation, n_index=6, alpha=0.001),
-    4: ft.partial(saturation, n_index=6, alpha=0.001)
+    3: ft.partial(saturation, n_index=3, alpha=0.001),
+    4: ft.partial(saturation, n_index=3, alpha=0.001)
 }
 
 
@@ -397,17 +397,36 @@ sat_pressure_relationship = {
 x, y = sym.symbols('x[0], x[1]')  # needed by UFL
 t = sym.symbols('t', positive=True)
 
+p_e_sym_2patch = {
+    1: {'wetting': -1 - (1+t*t)*(1 + x*x + y*y),
+        'nonwetting': -t*(1-y - x**2)**2 - sym.sqrt(2+t**2)*(1-y)},
+    2: {'wetting': -1.0 - (1.0 + t*t)*(1.0 + x*x),
+        'nonwetting': -t*(1- x**2)**2 - sym.sqrt(2+t**2)*(1-y)},
+}
+
 p_e_sym = {
-    1: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)),
-        'nonwetting': - 2 - t*(1 + (y-5.0) + x**2)**2 -sym.sqrt(2+t**2)*(1 + (y-5.0)) },
-    2: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)),
-        'nonwetting': - 2 - t*(1 + (y-5.0) + x**2)**2 -sym.sqrt(2+t**2)*(1 + (y-5.0))},
-    3: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)) - (y-5.0)*(y-5.0)*3*sym.sin(-2*t+2*x)*sym.sin(1/2*y-1.2*t),
-        'nonwetting': - 2 - t*(1 + x**2)**2 -sym.sqrt(2+t**2)},
-    4: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)) - (y-5.0)*(y-5.0)*3*sym.sin(-2*t+2*x)*sym.sin(1/2*y-1.2*t),
-        'nonwetting': - 2 - t*(1 + x**2)**2 -sym.sqrt(2+t**2)}
+    1: {'wetting': p_e_sym_2patch[1]['wetting'],
+        'nonwetting': p_e_sym_2patch[1]['nonwetting']},
+    2: {'wetting': p_e_sym_2patch[1]['wetting'],
+        'nonwetting': p_e_sym_2patch[1]['nonwetting']},
+    3: {'wetting': p_e_sym_2patch[2]['wetting'],
+        'nonwetting': p_e_sym_2patch[2]['nonwetting']},
+    4: {'wetting': p_e_sym_2patch[2]['wetting'],
+        'nonwetting': p_e_sym_2patch[2]['nonwetting']}
 }
 
+
+# p_e_sym = {
+#     1: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)),
+#         'nonwetting': - 2 - t*(1 + (y-5.0) + x**2)**2 -sym.sqrt(2+t**2)*(1 + (y-5.0)) },
+#     2: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)),
+#         'nonwetting': - 2 - t*(1 + (y-5.0) + x**2)**2 -sym.sqrt(2+t**2)*(1 + (y-5.0))},
+#     3: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)) - (y-5.0)*(y-5.0)*3*sym.sin(-2*t+2*x)*sym.sin(1/2*y-1.2*t),
+#         'nonwetting': - 2 - t*(1 + x**2)**2 -sym.sqrt(2+t**2)},
+#     4: {'wetting': 1.0 - (1.0 + t*t)*(10.0 + x*x + (y-5.0)*(y-5.0)) - (y-5.0)*(y-5.0)*3*sym.sin(-2*t+2*x)*sym.sin(1/2*y-1.2*t),
+#         'nonwetting': - 2 - t*(1 + x**2)**2 -sym.sqrt(2+t**2)}
+# }
+
 pc_e_sym = {
     1: p_e_sym[1]['nonwetting'] - p_e_sym[1]['wetting'],
     2: p_e_sym[2]['nonwetting'] - p_e_sym[2]['wetting'],
diff --git a/TP-TP-patch-test-case/TP-TP-2-patch-test.py b/TP-TP-patch-test-case/TP-TP-2-patch-test.py
deleted file mode 100755
index c998d3b..0000000
--- a/TP-TP-patch-test-case/TP-TP-2-patch-test.py
+++ /dev/null
@@ -1,631 +0,0 @@
-#!/usr/bin/python3
-import dolfin as df
-import mshr
-import numpy as np
-import sympy as sym
-import typing as tp
-import domainPatch as dp
-import LDDsimulation as ldd
-import functools as ft
-#import ufl as ufl
-
-# init sympy session
-sym.init_printing()
-
-##### Domain and Interface ####
-# global simulation domain domain
-sub_domain0_vertices = [df.Point(0.0,0.0), #
-                        df.Point(1.0,0.0),#
-                        df.Point(1.0,1.0),#
-                        df.Point(0.0,1.0)]
-# interface between subdomain1 and subdomain2
-interface12_vertices = [df.Point(0.0, 0.5),
-                        df.Point(1.0, 0.5) ]
-# subdomain1.
-sub_domain1_vertices = [interface12_vertices[0],
-                        interface12_vertices[1],
-                        df.Point(1.0,1.0),
-                        df.Point(0.0,1.0) ]
-
-# vertex coordinates of the outer boundaries. If it can not be specified as a
-# polygon, use an entry per boundary polygon. This information is used for defining
-# the Dirichlet boundary conditions. If a domain is completely internal, the
-# dictionary entry should be 0: None
-subdomain1_outer_boundary_verts = {
-    0: [interface12_vertices[0], #
-        df.Point(0.0,1.0), #
-        df.Point(1.0,1.0), #
-        interface12_vertices[1]]
-}
-# subdomain2
-sub_domain2_vertices = [df.Point(0.0,0.0),
-                        df.Point(1.0,0.0),
-                        interface12_vertices[1],
-                        interface12_vertices[0] ]
-
-subdomain2_outer_boundary_verts = {
-    0: [interface12_vertices[1], #
-        df.Point(1.0,0.0), #
-        df.Point(0.0,0.0), #
-        interface12_vertices[0]]
-}
-# subdomain2_outer_boundary_verts = {
-#     0: [interface12_vertices[0], df.Point(0.0,0.0)],#
-#     1: [df.Point(0.0,0.0), df.Point(1.0,0.0)], #
-#     2: [df.Point(1.0,0.0), interface12_vertices[1]]
-# }
-# subdomain2_outer_boundary_verts = {
-#     0: None
-# }
-
-# list of subdomains given by the boundary polygon vertices.
-# Subdomains are given as a list of dolfin points forming
-# a closed polygon, such that mshr.Polygon(subdomain_def_points[i]) can be used
-# to create the subdomain. subdomain_def_points[0] contains the
-# vertices of the global simulation domain and subdomain_def_points[i] contains the
-# vertices of the subdomain i.
-subdomain_def_points = [sub_domain0_vertices,#
-                      sub_domain1_vertices,#
-                      sub_domain2_vertices]
-# in the below list, index 0 corresponds to the 12 interface which has index 1
-interface_def_points = [interface12_vertices]
-
-# if a subdomain has no outer boundary write None instead, i.e.
-# i: None
-# if i is the index of the inner subdomain.
-outer_boundary_def_points = {
-    # subdomain number
-    1 : subdomain1_outer_boundary_verts,
-    2 : subdomain2_outer_boundary_verts
-}
-
-# adjacent_subdomains[i] contains the indices of the subdomains sharing the
-# interface i (i.e. given by interface_def_points[i]).
-adjacent_subdomains = [[1,2]]
-isRichards = {
-    1: False, #
-    2: False
-    }
-
-
-############ GRID #######################ü
-mesh_resolution = 20
-timestep_size = 0.001
-number_of_timesteps = 3000
-# decide how many timesteps you want analysed. Analysed means, that we write out
-# subsequent errors of the L-iteration within the timestep.
-number_of_timesteps_to_analyse = 11
-starttime = 0
-
-viscosity = {#
-# subdom_num : viscosity
-    1 : {'wetting' :1,
-         'nonwetting': 1}, #
-    2 : {'wetting' :1,
-         'nonwetting': 1}
-}
-
-porosity = {#
-# subdom_num : porosity
-    1 : 1,#
-    2 : 1
-}
-
-L = {#
-# subdom_num : subdomain L for L-scheme
-    1 : {'wetting' :0.25,
-         'nonwetting': 0.25},#
-    2 : {'wetting' :0.25,
-         'nonwetting': 0.25}
-}
-
-l_param = 20
-lambda_param = {#
-# subdom_num : lambda parameter for the L-scheme
-    1 : {'wetting' :l_param,
-         'nonwetting': l_param},#
-    2 : {'wetting' :l_param,
-         'nonwetting': l_param}
-}
-
-## relative permeabilty functions on subdomain 1
-def rel_perm1w(s):
-    # relative permeabilty wetting on subdomain1
-    return s**2
-
-def rel_perm1nw(s):
-    # relative permeabilty nonwetting on subdomain1
-    return (1-s)**2
-
-_rel_perm1w = ft.partial(rel_perm1w)
-_rel_perm1nw = ft.partial(rel_perm1nw)
-subdomain1_rel_perm = {
-    'wetting': _rel_perm1w,#
-    'nonwetting': _rel_perm1nw
-}
-## relative permeabilty functions on subdomain 2
-def rel_perm2w(s):
-    # relative permeabilty wetting on subdomain2
-    return s**2
-def rel_perm2nw(s):
-    # relative permeabilty nonwetting on subdosym.cos(0.8*t - (0.8*x + 1/7*y))main2
-    return (1-s)**2
-
-_rel_perm2w = ft.partial(rel_perm2w)
-_rel_perm2nw = ft.partial(rel_perm2nw)
-
-subdomain2_rel_perm = {
-    'wetting': _rel_perm2w,#
-    'nonwetting': _rel_perm2nw
-}
-
-## dictionary of relative permeabilties on all domains.
-relative_permeability = {#
-    1: subdomain1_rel_perm,
-    2: subdomain2_rel_perm
-}
-
-
-# definition of the derivatives of the relative permeabilities
-# relative permeabilty functions on subdomain 1
-def rel_perm1w_prime(s):
-    # relative permeabilty on subdomain1
-    return 2*s
-
-def rel_perm1nw_prime(s):
-    # relative permeabilty on subdomain1
-    return 2*(1-s)
-
-# # definition of the derivatives of the relative permeabilities
-# # relative permeabilty functions on subdomain 1
-# def rel_perm2w_prime(s):
-#     # relative permeabilty on subdomain1
-#     return 3*s**2
-#
-# def rel_perm2nw_prime(s):
-#     # relative permeabilty on subdomain1
-#     return 2*(l_param_w1-s)
-
-_rel_perm1w_prime = ft.partial(rel_perm1w_prime)
-_rel_perm1nw_prime = ft.partial(rel_perm1nw_prime)
-# _rel_perm2w_prime = ft.partial(rel_perm2w_prime)
-# _rel_perm2nw_prime = ft.partial(rel_perm2nw_prime)
-
-subdomain1_rel_perm_prime = {
-    'wetting': _rel_perm1w_prime,
-    'nonwetting': _rel_perm1nw_prime
-}
-
-
-# subdomain2_rel_perm_prime = {
-#     'wetting': _rel_perm2w_prime,
-#     'nonwetting': _rel_perm2nw_prime
-# }
-
-# dictionary of relative permeabilties on all domains.
-ka_prime = {
-    1: subdomain1_rel_perm_prime,
-    2: subdomain1_rel_perm_prime,
-}
-
-
-
-
-def saturation(pc, n_index, alpha):
-    # inverse capillary pressure-saturation-relationship
-    return df.conditional(pc > 0, 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index)), 1)
-
-# S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where
-# we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw
-def saturation_sym(pc, n_index, alpha):
-    # inverse capillary pressure-saturation-relationship
-    #df.conditional(pc > 0,
-    return 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index))
-
-
-# derivative of S-pc relationship with respect to pc. This is needed for the
-# construction of a analytic solution.
-def saturation_sym_prime(pc, n_index, alpha):
-    # inverse capillary pressure-saturation-relationship
-    return -(alpha*(n_index - 1)*(alpha*pc)**(n_index - 1)) / ( (1 + (alpha*pc)**n_index)**((2*n_index - 1)/n_index) )
-
-# note that the conditional definition of S-pc in the nonsymbolic part will be
-# incorporated in the construction of the exact solution below.
-S_pc_sym = {
-    1: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    2: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 3: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 4: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 5: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 6: ft.partial(saturation_sym, n_index=3, alpha=0.001)
-}
-
-S_pc_sym_prime = {
-    1: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    2: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 3: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 4: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 5: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 6: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001)
-}
-
-sat_pressure_relationship = {
-    1: ft.partial(saturation, n_index=3, alpha=0.001),
-    2: ft.partial(saturation, n_index=3, alpha=0.001),
-    # 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),
-    # 6: ft.partial(saturation, n_index=3, alpha=0.001)
-}
-
-
-# S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where
-# we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw
-# def saturation(pc, n_index, alpha):
-#     # inverse capillary pressure-saturation-relationship
-#     return df.conditional(pc > 0, 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index)), 1)
-#
-# # S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where
-# # we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw
-# def saturation_sym(pc, n_index, alpha):
-#     # inverse capillary pressure-saturation-relationship
-#     #df.conditional(capillary_pressure > 0,
-#     return 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index))
-#
-# S_pc_rel = {#
-#     1: ft.partial(saturation_sym, n_index = 3, alpha=0.001),# n= 3 stands for non-uniform porous media
-#     2: ft.partial(saturation_sym, n_index = 6, alpha=0.001) # n=6 stands for uniform porous media matrix (siehe Helmig)
-# }
-
-# S_pc_rel_sym = {#
-#     1: ft.partial(saturation_sym, n_index = sym.Symbol('n'), alpha = sym.Symbol('a')),# n= 3 stands for non-uniform porous media
-#     2: ft.partial(saturation_sym, n_index = sym.Symbol('n'), alpha = sym.Symbol('a')) # n=6 stands for uniform porous media matrix (siehe Helmig)
-# }
-
-
-# # this function needs to be monotonically decreasing in the capillary_pressure.
-# # since in the richards case pc=-pw, this becomes as a function of pw a mono
-# # tonically INCREASING function like in our Richards-Richards paper. However
-# # since we unify the treatment in the code for Richards and two-phase, we need
-# # the same requierment
-# # for both cases, two-phase and Richards.
-# def saturation(pc, index):
-#     # inverse capillary pressure-saturation-relationship
-#     return df.conditional(pc > 0, 1/((1 + pc)**(1/(index + 1))), 1)
-#
-#
-# def saturation_sym(pc, index):
-#     # inverse capillary pressure-saturation-relationship
-#     return 1/((1 + pc)**(1/(index + 1)))
-#
-#
-# # derivative of S-pc relationship with respect to pc. This is needed for the
-# # construction of a analytic solution.
-# def saturation_sym_prime(pc, index):
-#     # inverse capillary pressure-saturation-relationship
-#     return -1/((index+1)*(1 + pc)**((index+2)/(index+1)))
-#
-#
-# # note that the conditional definition of S-pc in the nonsymbolic part will be
-# # incorporated in the construction of the exact solution below.
-# S_pc_sym = {
-#     1: ft.partial(saturation_sym, index=1),
-#     2: ft.partial(saturation_sym, index=2),
-#     # 3: ft.partial(saturation_sym, index=2),
-#     # 4: ft.partial(saturation_sym, index=2),
-#     # 5: ft.partial(saturation_sym, index=1)
-# }
-#
-# S_pc_sym_prime = {
-#     1: ft.partial(saturation_sym_prime, index=1),
-#     2: ft.partial(saturation_sym_prime, index=2),
-#     # 3: ft.partial(saturation_sym_prime, index=2),
-#     # 4: ft.partial(saturation_sym_prime, index=2),
-#     # 5: ft.partial(saturation_sym_prime, index=1)
-# }
-#
-# sat_pressure_relationship = {
-#     1: ft.partial(saturation, index=1),
-#     2: ft.partial(saturation, index=2),
-#     # 3: ft.partial(saturation, index=2),
-#     # 4: ft.partial(saturation, index=2),
-#     # 5: ft.partial(saturation, index=1)
-# }
-
-# exact_solution = {
-#     1: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0] + x[1]*x[1])'},
-#     2: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0])'},
-#     3: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0])'},
-#     4: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0])'},
-#     5: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0] + x[1]*x[1])'}
-# }
-#
-# initial_condition = {
-#     1: {'wetting': '-(x[0]*x[0] + x[1]*x[1])'},
-#     2: {'wetting': '-x[0]*x[0]'},
-#     3: {'wetting': '-x[0]*x[0]'},
-#     4: {'wetting': '-x[0]*x[0]'},
-#     5: {'wetting': '-(x[0]*x[0] + x[1]*x[1])'}
-# }
-
-#############################################
-# Manufacture source expressions with sympy #
-#############################################
-x, y = sym.symbols('x[0], x[1]')  # needed by UFL
-t = sym.symbols('t', positive=True)
-
-p_e_sym = {
-    1: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x + y*y)},
-    2: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x)},
-    # 3: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x)},
-    # 4: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x)},
-    # 5: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x + y*y)}
-}
-
-pc_e_sym = {
-    1: -1*p_e_sym[1]['wetting'],
-    2: -1*p_e_sym[2]['wetting'],
-    # 3: -1*p_e_sym[3]['wetting'],
-    # 4: -1*p_e_sym[4]['wetting'],
-    # 5: -1*p_e_sym[5]['wetting']
-}
-
-# #### Manufacture source expressions with sympy
-# ###############################################################################
-# ## subdomain1
-# x, y = sym.symbols('x[0], x[1]') # needed by UFL
-# t = sym.symbols('t', positive=True)
-# #f = -sym.diff(u, x, 2) - sym.diff(u, y, 2)  # -Laplace(u)
-# #f = sym.simplify(f)                         # simplify f
-# p1_w = 1 - (1+t**2)*(1 + x**2 + (y-0.5)**2)
-# p1_nw = t*(1-(y-0.5) - x**2)**2 - sym.sqrt(2+t**2)*(1-(y-0.5))
-#
-# #dtS1_w = sym.diff(S_pc_rel_sym[1](p1_nw - p1_w), t, 1)
-# #dtS1_nw = -sym.diff(S_pc_rel_sym[1](p1_nw - p1_w), t, 1)
-# dtS1_w = porosity[1]*sym.diff(sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ), t, 1)
-# dtS1_nw = -porosity[1]*sym.diff(sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ), t, 1)
-# print("dtS1_w = ", dtS1_w, "\n")
-# print("dtS1_nw = ", dtS1_nw, "\n")
-#
-# #dxdxflux1_w = -sym.diff(relative_permeability[1]['wetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_w, x, 1), x, 1)
-# #dydyflux1_w = -sym.diff(relative_permeability[1]['wetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_w, y, 1), y, 1)
-# dxdxflux1_w = -1/viscosity[1]['wetting']*sym.diff(relative_permeability[1]['wetting'](sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_w, x, 1), x, 1)
-# dydyflux1_w = -1/viscosity[1]['wetting']*sym.diff(relative_permeability[1]['wetting'](sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_w, y, 1), y, 1)
-#
-# rhs1_w = dtS1_w + dxdxflux1_w + dydyflux1_w
-# rhs1_w = sym.printing.ccode(rhs1_w)
-# print("rhs_w = ", rhs1_w, "\n")
-# #rhs_w = sym.expand(rhs_w)
-# #print("rhs_w", rhs_w, "\n")
-# #rhs_w = sym.collect(rhs_w, x)
-# #print("rhs_w", rhs_w, "\n")
-#
-# #dxdxflux1_nw = -sym.diff(relative_permeability[1]['nonwetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_nw, x, 1), x, 1)
-# #dydyflux1_nw = -sym.diff(relative_permeability[1]['nonwetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_nw, y, 1), y, 1)
-# dxdxflux1_nw = -1/viscosity[1]['nonwetting']*sym.diff(relative_permeability[1]['nonwetting'](1-sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_nw, x, 1), x, 1)
-# dydyflux1_nw = -1/viscosity[1]['nonwetting']*sym.diff(relative_permeability[1]['nonwetting'](1-sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_nw, y, 1), y, 1)
-#
-# rhs1_nw = dtS1_nw + dxdxflux1_nw + dydyflux1_nw
-# rhs1_nw = sym.printing.ccode(rhs1_nw)
-# print("rhs_nw = ", rhs1_nw, "\n")
-#
-# ## subdomain2
-# p2_w = 1 - (1+t**2)*(1 + x**2)
-# p2_nw = t*(1- x**2)**2 - sym.sqrt(2+t**2)*(1-(y-0.5))
-#
-# #dtS2_w = sym.diff(S_pc_rel_sym[2](p2_nw - p2_w), t, 1)
-# #dtS2_nw = -sym.diff(S_pc_rel_sym[2](p2_nw - p2_w), t, 1)
-# dtS2_w = porosity[2]*sym.diff(sym.Piecewise((sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ), (p2_nw - p2_w) > 0), (1, True) ), t, 1)
-# dtS2_nw = -porosity[2]*sym.diff(sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ), t, 1)
-# print("dtS2_w = ", dtS2_w, "\n")
-# print("dtS2_nw = ", dtS2_nw, "\n")
-#
-# #dxdxflux2_w = -sym.diff(relative_permeability[2]['wetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_w, x, 1), x, 1)
-# #dydyflux2_w = -sym.diff(relative_permeability[2]['wetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_w, y, 1), y, 1)
-# dxdxflux2_w = -1/viscosity[2]['wetting']*sym.diff(relative_permeability[2]['wetting'](sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_w, x, 1), x, 1)
-# dydyflux2_w = -1/viscosity[2]['wetting']*sym.diff(relative_permeability[2]['wetting'](sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_w, y, 1), y, 1)
-#
-# rhs2_w = dtS2_w + dxdxflux2_w + dydyflux2_w
-# rhs2_w = sym.printing.ccode(rhs2_w)
-# print("rhs2_w = ", rhs2_w, "\n")
-# #rhs_w = sym.expand(rhs_w)
-# #print("rhs_w", rhs_w, "\n")
-# #rhs_w = sym.collect(rhs_w, x)
-# #print("rhs_w", rhs_w, "\n")
-#
-# #dxdxflux2_nw = -sym.diff(relative_permeability[2]['nonwetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_nw, x, 1), x, 1)
-# #dydyflux2_nw = -sym.diff(relative_permeability[2]['nonwetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_nw, y, 1), y, 1)
-# dxdxflux2_nw = -1/viscosity[2]['nonwetting']*sym.diff(relative_permeability[2]['nonwetting'](1-sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_nw, x, 1), x, 1)
-# dydyflux2_nw = -1/viscosity[2]['nonwetting']*sym.diff(relative_permeability[2]['nonwetting'](1-sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_nw, y, 1), y, 1)
-#
-# rhs2_nw = dtS2_nw + dxdxflux2_nw + dydyflux2_nw
-# rhs2_nw = sym.printing.ccode(rhs2_nw)
-# print("rhs2_nw = ", rhs2_nw, "\n")
-#
-#
-# ###############################################################################
-#
-# source_expression = {
-#     1: {'wetting': rhs1_w,
-#         'nonwetting': rhs1_nw},
-#     2: {'wetting': rhs2_w,
-#         'nonwetting': rhs2_nw}
-# }
-#
-# p1_w_00 = p1_w.subs(t, 0)
-# p1_nw_00 = p1_nw.subs(t, 0)
-# p2_w_00 = p2_w.subs(t, 0)
-# p2_nw_00 = p2_nw.subs(t, 0)
-# # p1_w_00 = sym.printing.ccode(p1_w_00)
-#
-# initial_condition = {
-#     1: {'wetting': sym.printing.ccode(p1_w_00),
-#         'nonwetting': sym.printing.ccode(p1_nw_00)},#
-#     2: {'wetting': sym.printing.ccode(p2_w_00),
-#         'nonwetting': sym.printing.ccode(p2_nw_00)}
-# }
-#
-# exact_solution = {
-#     1: {'wetting': sym.printing.ccode(p1_w),
-#         'nonwetting': sym.printing.ccode(p1_nw)},#
-#     2: {'wetting': sym.printing.ccode(p2_w),
-#         'nonwetting': sym.printing.ccode(p2_nw)}
-# }
-#
-# # similary to the outer boundary dictionary, if a patch has no outer boundary
-# # None should be written instead of an expression. This is a bit of a brainfuck:
-# # dirichletBC[ind] gives a dictionary of the outer boundaries of subdomain ind.
-# # Since a domain patch can have several disjoint outer boundary parts, the expressions
-# # need to get an enumaration index which starts at 0. So dirichletBC[ind][j] is
-# # the dictionary of outer dirichlet conditions of subdomain ind and boundary part j.
-# # finally, dirichletBC[ind][j]['wetting'] and dirichletBC[ind][j]['nonwetting'] return
-# # the actual expression needed for the dirichlet condition for both phases if present.
-# dirichletBC = {
-# #subdomain index: {outer boudary part index: {phase: expression}}
-#     1: { 0: {'wetting': sym.printing.ccode(p1_w),
-#              'nonwetting': sym.printing.ccode(p1_nw)}},
-#     2: { 0: {'wetting': sym.printing.ccode(p2_w),
-#              'nonwetting': sym.printing.ccode(p2_nw)}}
-# }
-
-# turn above symbolic code into exact solution for dolphin and
-# construct the rhs that matches the above exact solution.
-dtS = dict()
-div_flux = dict()
-source_expression = dict()
-exact_solution = dict()
-initial_condition = dict()
-for subdomain, isR in isRichards.items():
-    dtS.update({subdomain: dict()})
-    div_flux.update({subdomain: dict()})
-    source_expression.update({subdomain: dict()})
-    exact_solution.update({subdomain: dict()})
-    initial_condition.update({subdomain: dict()})
-    if isR:
-        subdomain_has_phases = ["wetting"]
-    else:
-        subdomain_has_phases = ["wetting", "nonwetting"]
-
-    # conditional for S_pc_prime
-    pc = pc_e_sym[subdomain]
-    dtpc = sym.diff(pc, t, 1)
-    dxpc = sym.diff(pc, x, 1)
-    dypc = sym.diff(pc, y, 1)
-    S = sym.Piecewise((S_pc_sym[subdomain](pc), pc > 0), (1, True))
-    dS = sym.Piecewise((S_pc_sym_prime[subdomain](pc), pc > 0), (0, True))
-    for phase in subdomain_has_phases:
-        # Turn above symbolic expression for exact solution into c code
-        exact_solution[subdomain].update(
-            {phase: sym.printing.ccode(p_e_sym[subdomain][phase])}
-            )
-        # save the c code for initial conditions
-        initial_condition[subdomain].update(
-            {phase: sym.printing.ccode(p_e_sym[subdomain][phase].subs(t, 0))}
-            )
-        if phase == "nonwetting":
-            dtS[subdomain].update(
-                {phase: -porosity[subdomain]*dS*dtpc}
-                )
-        else:
-            dtS[subdomain].update(
-                {phase: porosity[subdomain]*dS*dtpc}
-                )
-        pa = p_e_sym[subdomain][phase]
-        dxpa = sym.diff(pa, x, 1)
-        dxdxpa = sym.diff(pa, x, 2)
-        dypa = sym.diff(pa, y, 1)
-        dydypa = sym.diff(pa, y, 2)
-        mu = viscosity[subdomain][phase]
-        ka = relative_permeability[subdomain][phase]
-        dka = ka_prime[subdomain][phase]
-        rho = densities[subdomain][phase]
-        g = gravity_acceleration
-
-        if phase == "nonwetting":
-            # x part of div(flux) for nonwetting
-            dxdxflux = -1/mu*dka(1-S)*dS*dxpc*dxpa + 1/mu*dxdxpa*ka(1-S)
-            # y part of div(flux) for nonwetting
-            dydyflux = -1/mu*dka(1-S)*dS*dypc*(dypa - rho*g) \
-                + 1/mu*dydypa*ka(1-S)
-        else:
-            # x part of div(flux) for wetting
-            dxdxflux = 1/mu*dka(S)*dS*dxpc*dxpa + 1/mu*dxdxpa*ka(S)
-            # y part of div(flux) for wetting
-            dydyflux = 1/mu*dka(S)*dS*dypc*(dypa - rho*g) + 1/mu*dydypa*ka(S)
-        div_flux[subdomain].update({phase: dxdxflux + dydyflux})
-        contructed_rhs = dtS[subdomain][phase] - div_flux[subdomain][phase]
-        source_expression[subdomain].update(
-            {phase: sym.printing.ccode(contructed_rhs)}
-            )
-        # print(f"source_expression[{subdomain}][{phase}] =", source_expression[subdomain][phase])
-
-# Dictionary of dirichlet boundary conditions.
-dirichletBC = dict()
-# similarly to the outer boundary dictionary, if a patch has no outer boundary
-# None should be written instead of an expression.
-# This is a bit of a brainfuck:
-# dirichletBC[ind] gives a dictionary of the outer boundaries of subdomain ind.
-# Since a domain patch can have several disjoint outer boundary parts, the
-# expressions need to get an enumaration index which starts at 0.
-# So dirichletBC[ind][j] is the dictionary of outer dirichlet conditions of
-# subdomain ind and boundary part j.
-# Finally, dirichletBC[ind][j]['wetting'] and dirichletBC[ind][j]['nonwetting']
-# return the actual expression needed for the dirichlet condition for both
-# phases if present.
-
-# subdomain index: {outer boudary part index: {phase: expression}}
-for subdomain in isRichards.keys():
-    # if subdomain has no outer boundary, outer_boundary_def_points[subdomain] is None
-    if outer_boundary_def_points[subdomain] is None:
-        dirichletBC.update({subdomain: None})
-    else:
-        dirichletBC.update({subdomain: dict()})
-        # set the dirichlet conditions to be the same code as exact solution on
-        # the subdomain.
-        for outer_boundary_ind in outer_boundary_def_points[subdomain].keys():
-            dirichletBC[subdomain].update(
-                {outer_boundary_ind: exact_solution[subdomain]}
-                )
-
-
-# def saturation(pressure, subdomain_index):
-#     # inverse capillary pressure-saturation-relationship
-#     return df.conditional(pressure < 0, 1/((1 - pressure)**(1/(subdomain_index + 1))), 1)
-#
-# sa
-
-write_to_file = {
-    'meshes_and_markers': True,
-    'L_iterations': True
-}
-
-
-# initialise LDD simulation class
-simulation = ldd.LDDsimulation(tol = 1E-14, LDDsolver_tol = 1E-9, debug = False)
-simulation.set_parameters(output_dir = "./output/",#
-    subdomain_def_points = subdomain_def_points,#
-    isRichards = isRichards,#
-    interface_def_points = interface_def_points,#
-    outer_boundary_def_points = outer_boundary_def_points,#
-    adjacent_subdomains = adjacent_subdomains,#
-    mesh_resolution = mesh_resolution,#
-    viscosity = viscosity,#
-    porosity = porosity,#
-    L = L,#
-    lambda_param = lambda_param,#
-    relative_permeability = relative_permeability,#
-    saturation = S_pc_rel,#
-    starttime = starttime,#
-    number_of_timesteps = number_of_timesteps,
-    number_of_timesteps_to_analyse = number_of_timesteps_to_analyse,
-    timestep_size = timestep_size,#
-    sources = source_expression,#
-    initial_conditions = initial_condition,#
-    dirichletBC_expression_strings = dirichletBC,#
-    exact_solution = exact_solution,#
-    write2file = write_to_file,#
-    )
-
-simulation.initialise()
-# simulation.write_exact_solution_to_xdmf()
-simulation.run()
diff --git a/TP-TP-patch-test-case/exact_solution_symbolic_computation.ipynb b/TP-TP-patch-test-case/exact_solution_symbolic_computation.ipynb
deleted file mode 100644
index 745a7b0..0000000
--- a/TP-TP-patch-test-case/exact_solution_symbolic_computation.ipynb
+++ /dev/null
@@ -1,283 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# Exact solution cases for subdomain1 and subdomain2."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "#import dolfin as df\n",
-    "#import mshr\n",
-    "import numpy as np\n",
-    "import sympy as sym\n",
-    "import typing as tp\n",
-    "#import domainPatch as dp\n",
-    "#import LDDsimulation as ldd\n",
-    "import functools as ft\n",
-    "\n",
-    "# init sympy session\n",
-    "sym.init_printing()"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 22,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "viscosity = {#\n",
-    "# subdom_num : viscosity\n",
-    "    1 : {'wetting' :1}, #\n",
-    "    2 : {'wetting' :1}\n",
-    "}\n",
-    "\n",
-    "porosity = {#\n",
-    "# subdom_num : porosity\n",
-    "    1 : 1,#\n",
-    "    2 : 1\n",
-    "}\n",
-    "\n",
-    "L = {#\n",
-    "# subdom_num : subdomain L for L-scheme\n",
-    "    1 : {'wetting' :0.25},#\n",
-    "    2 : {'wetting' :0.25}\n",
-    "}\n",
-    "\n",
-    "lambda_param = {#\n",
-    "# subdom_num : lambda parameter for the L-scheme\n",
-    "    1 : {'wetting' :100},#\n",
-    "    2 : {'wetting' :100}\n",
-    "}\n",
-    "\n",
-    "## relative permeabilty functions on subdomain 1\n",
-    "def rel_perm1w(s):\n",
-    "    # relative permeabilty wetting on subdomain1\n",
-    "    return s**2\n",
-    "\n",
-    "def rel_perm1nw(s):\n",
-    "    # relative permeabilty nonwetting on subdomain1\n",
-    "    return (1-s)**3\n",
-    "\n",
-    "_rel_perm1w = ft.partial(rel_perm1w)\n",
-    "_rel_perm1nw = ft.partial(rel_perm1nw)\n",
-    "subdomain1_rel_perm = {\n",
-    "    'wetting': _rel_perm1w,#\n",
-    "    'nonwetting': _rel_perm1nw\n",
-    "}\n",
-    "## relative permeabilty functions on subdomain 2\n",
-    "def rel_perm2w(s):\n",
-    "    # relative permeabilty wetting on subdomain2\n",
-    "    return s**3\n",
-    "def rel_perm2nw(s):\n",
-    "    # relative permeabilty nonwetting on subdomain2\n",
-    "    return (1-s)**2\n",
-    "\n",
-    "_rel_perm2w = ft.partial(rel_perm2w)\n",
-    "_rel_perm2nw = ft.partial(rel_perm2nw)\n",
-    "\n",
-    "subdomain2_rel_perm = {\n",
-    "    'wetting': _rel_perm2w,#\n",
-    "    'nonwetting': _rel_perm2nw\n",
-    "}\n",
-    "\n",
-    "## dictionary of relative permeabilties on all domains.\n",
-    "relative_permeability = {#\n",
-    "    1: subdomain1_rel_perm,\n",
-    "    2: subdomain2_rel_perm\n",
-    "}\n",
-    "\n",
-    "# S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where\n",
-    "# we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw\n",
-    "def saturation(capillary_pressure, n_index, alpha):\n",
-    "    # inverse capillary pressure-saturation-relationship\n",
-    "    #df.conditional(capillary_pressure > 0, \n",
-    "    return 1/((1 + (alpha*capillary_pressure)**n_index)**((n_index - 1)/n_index))\n",
-    "\n",
-    "S_pc_rel = {#\n",
-    "    1: ft.partial(saturation, n_index = 3, alpha=0.001),# n= 3 stands for non-uniform porous media\n",
-    "    2: ft.partial(saturation, n_index = 6, alpha=0.001) # n=6 stands for uniform porous media matrix (siehe Helmig)\n",
-    "}\n",
-    "S_pc_rel_sym = {#\n",
-    "    1: ft.partial(saturation, n_index = sym.Symbol('n'), alpha = sym.Symbol('a')),# n= 3 stands for non-uniform porous media\n",
-    "    2: ft.partial(saturation, n_index = sym.Symbol('n'), alpha = sym.Symbol('a')) # n=6 stands for uniform porous media matrix (siehe Helmig)\n",
-    "}"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 23,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "dtS1_w =  -0.666666666666667*((0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + x[1]**2 + 1) - 0.001)**3 + 1)**(-1.66666666666667)*(0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + x[1]**2 + 1) - 0.001)**2*(-0.003*t*(1 - x[1])/sqrt(t**2 + 2) + 0.003*x[0]**2 + 0.003*x[1]**2 + 0.003*(1 - x[1])**2 + 0.003) \n",
-      "\n",
-      "dtS1_nw =  0.666666666666667*((0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + x[1]**2 + 1) - 0.001)**3 + 1)**(-1.66666666666667)*(0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + x[1]**2 + 1) - 0.001)**2*(-0.003*t*(1 - x[1])/sqrt(t**2 + 2) + 0.003*x[0]**2 + 0.003*x[1]**2 + 0.003*(1 - x[1])**2 + 0.003) \n",
-      "\n",
-      "rhs_w =  16.0*pow(x[0], 2)*(-t - 1)*(0.001*t + 0.001)*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -2.333333333333333)*pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 2) + 2.6666666666666665*x[1]*(-t - 1)*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -2.333333333333333)*(0.0030000000000000001*t*(2*x[1] - 2) + 6*x[1]*(0.001*t + 0.001) + 0.0030000000000000001*sqrt(pow(t, 2) + 2))*pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 2) - 4*(-t - 1)*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -1.3333333333333333) - 0.66666666666666663*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -1.6666666666666665)*pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 2)*(-0.0030000000000000001*t*(1 - x[1])/sqrt(pow(t, 2) + 2) + 0.0030000000000000001*pow(x[0], 2) + 0.0030000000000000001*pow(x[1], 2) + 0.0030000000000000001*pow(1 - x[1], 2) + 0.0030000000000000001) \n",
-      "\n",
-      "rhs_nw =  -2*t*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -2.0) + 2.0*(t*(2*x[1] - 2) + sqrt(pow(t, 2) + 2))*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -3.0)*(0.0030000000000000001*t*(2*x[1] - 2) + 6*x[1]*(0.001*t + 0.001) + 0.0030000000000000001*sqrt(pow(t, 2) + 2))*pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 2) + 0.66666666666666663*pow(pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 3) + 1, -1.6666666666666665)*pow(0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + pow(x[1], 2) + 1) - 0.001, 2)*(-0.0030000000000000001*t*(1 - x[1])/sqrt(pow(t, 2) + 2) + 0.0030000000000000001*pow(x[0], 2) + 0.0030000000000000001*pow(x[1], 2) + 0.0030000000000000001*pow(1 - x[1], 2) + 0.0030000000000000001) \n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "### domain 1\n",
-    "x, y = sym.symbols('x[0], x[1]') # needed by UFL\n",
-    "t = sym.symbols('t', positive=True)\n",
-    "#f = -sym.diff(u, x, 2) - sym.diff(u, y, 2)  # -Laplace(u)\n",
-    "#f = sym.simplify(f)                         # simplify f\n",
-    "p1_w = 1 - (1+t)*(1 + x**2 + y**2)\n",
-    "p1_nw = t*(1-y)**2 - sym.sqrt(2+t**2)*(1-y) \n",
-    "\n",
-    "#dtS1_w = sym.diff(S_pc_rel_sym[1](p1_nw - p1_w), t, 1)\n",
-    "#dtS1_nw = -sym.diff(S_pc_rel_sym[1](p1_nw - p1_w), t, 1)\n",
-    "dtS1_w = porosity[1]*sym.diff(S_pc_rel[1](p1_nw - p1_w), t, 1)\n",
-    "dtS1_nw = -porosity[1]*sym.diff(S_pc_rel[1](p1_nw - p1_w), t, 1)\n",
-    "print(\"dtS1_w = \", dtS1_w, \"\\n\")\n",
-    "print(\"dtS1_nw = \", dtS1_nw, \"\\n\")\n",
-    "\n",
-    "#dxdxflux1_w = -sym.diff(relative_permeability[1]['wetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_w, x, 1), x, 1)\n",
-    "#dydyflux1_w = -sym.diff(relative_permeability[1]['wetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_w, y, 1), y, 1)\n",
-    "dxdxflux1_w = -1/viscosity[1]['wetting']*sym.diff(relative_permeability[1]['wetting'](S_pc_rel[1](p1_nw - p1_w))*sym.diff(p1_w, x, 1), x, 1)\n",
-    "dydyflux1_w = -1/viscosity[1]['wetting']*sym.diff(relative_permeability[1]['wetting'](S_pc_rel[1](p1_nw - p1_w))*sym.diff(p1_w, y, 1), y, 1)\n",
-    "\n",
-    "rhs1_w = dtS1_w + dxdxflux1_w + dydyflux1_w\n",
-    "rhs1_w = sym.printing.ccode(rhs1_w)\n",
-    "print(\"rhs_w = \", rhs1_w, \"\\n\")\n",
-    "#rhs_w = sym.expand(rhs_w)\n",
-    "#print(\"rhs_w\", rhs_w, \"\\n\")\n",
-    "#rhs_w = sym.collect(rhs_w, x)\n",
-    "#print(\"rhs_w\", rhs_w, \"\\n\")\n",
-    "\n",
-    "#dxdxflux1_nw = -sym.diff(relative_permeability[1]['nonwetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_nw, x, 1), x, 1)\n",
-    "#dydyflux1_nw = -sym.diff(relative_permeability[1]['nonwetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_nw, y, 1), y, 1)\n",
-    "dxdxflux1_nw = -1/viscosity[1]['nonwetting']*sym.diff(relative_permeability[1]['nonwetting'](1-S_pc_rel[1](p1_nw - p1_w))*sym.diff(p1_nw, x, 1), x, 1)\n",
-    "dydyflux1_nw = -1/viscosity[1]['nonwetting']*sym.diff(relative_permeability[1]['nonwetting'](1-S_pc_rel[1](p1_nw - p1_w))*sym.diff(p1_nw, y, 1), y, 1)\n",
-    "\n",
-    "rhs1_nw = dtS1_nw + dxdxflux1_nw + dydyflux1_nw\n",
-    "rhs1_nw = sym.printing.ccode(rhs1_nw)\n",
-    "print(\"rhs_nw = \", rhs1_nw, \"\\n\")\n",
-    "\n",
-    "dxdxflux1_w = sym.printing.ccode(dxdxflux1_w)\n",
-    "dxdxflux1_nw = sym.printing.ccode(dxdxflux1_nw)\n",
-    "dydyflux1_w = sym.printing.ccode(dydyflux1_w)\n",
-    "dydyflux1_nw = sym.printing.ccode(dydyflux1_nw)\n",
-    "\n",
-    "#print(\"dxdxflux1_w = \", dxdxflux1_w, \"\\n\")\n",
-    "#print(\"dydyflux1_w = \", dydyflux1_w, \"\\n\")\n",
-    "#print(\"dxdxflux1_nw = \", dxdxflux1_nw, \"\\n\")\n",
-    "#print(\"dydyflux1_nw = \", dydyflux1_nw, \"\\n\")"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 21,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "dtS2_w =  -0.833333333333333*((0.001*t*(0.5 - x[1])/(x[0] + 0.1) + 0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + 0.25*x[1] + 1) - 0.001)**6 + 1)**(-1.83333333333333)*(0.001*t*(0.5 - x[1])/(x[0] + 0.1) + 0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + 0.25*x[1] + 1) - 0.001)**5*(-0.006*t*(1 - x[1])/sqrt(t**2 + 2) + 0.006*x[0]**2 + 0.0015*x[1] + 0.006*(0.5 - x[1])/(x[0] + 0.1) + 0.006*(1 - x[1])**2 + 0.006) \n",
-      "\n",
-      "dtS2_nw =  0.833333333333333*((0.001*t*(0.5 - x[1])/(x[0] + 0.1) + 0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + 0.25*x[1] + 1) - 0.001)**6 + 1)**(-1.83333333333333)*(0.001*t*(0.5 - x[1])/(x[0] + 0.1) + 0.001*t*(1 - x[1])**2 - 0.001*(1 - x[1])*sqrt(t**2 + 2) + 0.001*(t + 1)*(x[0]**2 + 0.25*x[1] + 1) - 0.001)**5*(-0.006*t*(1 - x[1])/sqrt(t**2 + 2) + 0.006*x[0]**2 + 0.0015*x[1] + 0.006*(0.5 - x[1])/(x[0] + 0.1) + 0.006*(1 - x[1])**2 + 0.006) \n",
-      "\n",
-      "rhs2_w =  5.0*x[0]*(-t - 1)*(-0.0060000000000000001*t*(0.5 - x[1])/pow(x[0] + 0.10000000000000001, 2) + 12*x[0]*(0.001*t + 0.001))*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -3.5)*pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 5) - 2*(-t - 1)*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -2.5) + 2.5*(-0.25*t - 0.25)*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -3.5)*(0.0060000000000000001*t*(2*x[1] - 2) + 0.0015*t - 0.0060000000000000001*t/(x[0] + 0.10000000000000001) + 0.0060000000000000001*sqrt(pow(t, 2) + 2) + 0.0015)*pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 5) - 0.83333333333333337*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -1.8333333333333335)*pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 5)*(-0.0060000000000000001*t*(1 - x[1])/sqrt(pow(t, 2) + 2) + 0.0060000000000000001*pow(x[0], 2) + 0.0015*x[1] + 0.0060000000000000001*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.0060000000000000001*pow(1 - x[1], 2) + 0.0060000000000000001) \n",
-      "\n",
-      "rhs2_nw =  -1.6666666666666667*t*(0.5 - x[1])*(-0.0060000000000000001*t*(0.5 - x[1])/pow(x[0] + 0.10000000000000001, 2) + 12*x[0]*(0.001*t + 0.001))*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -2.666666666666667)*pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 5)/pow(x[0] + 0.10000000000000001, 2) - 2*t*(0.5 - x[1])*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -1.6666666666666667)/pow(x[0] + 0.10000000000000001, 3) - 2*t*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -1.6666666666666667) + 1.6666666666666667*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -2.666666666666667)*(t*(2*x[1] - 2) - t/(x[0] + 0.10000000000000001) + sqrt(pow(t, 2) + 2))*(0.0060000000000000001*t*(2*x[1] - 2) + 0.0015*t - 0.0060000000000000001*t/(x[0] + 0.10000000000000001) + 0.0060000000000000001*sqrt(pow(t, 2) + 2) + 0.0015)*pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 5) + 0.83333333333333337*pow(pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 6) + 1, -1.8333333333333335)*pow(0.001*t*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.001*t*pow(1 - x[1], 2) - 0.001*(1 - x[1])*sqrt(pow(t, 2) + 2) + 0.001*(t + 1)*(pow(x[0], 2) + 0.25*x[1] + 1) - 0.001, 5)*(-0.0060000000000000001*t*(1 - x[1])/sqrt(pow(t, 2) + 2) + 0.0060000000000000001*pow(x[0], 2) + 0.0015*x[1] + 0.0060000000000000001*(0.5 - x[1])/(x[0] + 0.10000000000000001) + 0.0060000000000000001*pow(1 - x[1], 2) + 0.0060000000000000001) \n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "### domain2\n",
-    "\n",
-    "x, y = sym.symbols('x[0], x[1]') # needed by UFL\n",
-    "t = sym.symbols('t', positive=True)\n",
-    "#f = -sym.diff(u, x, 2) - sym.diff(u, y, 2)  # -Laplace(u)\n",
-    "#f = sym.simplify(f)                         # simplify f\n",
-    "p2_w = 1 - (1+t)*(1 + x**2 + 0.25*y)\n",
-    "p2_nw = t*(1-y)**2 - sym.sqrt(2+t**2)*(1-y) +(0.5-y)*(t/(0.1+x))\n",
-    "\n",
-    "#dtS2_w = sym.diff(S_pc_rel_sym[2](p2_nw - p2_w), t, 1)\n",
-    "#dtS2_nw = -sym.diff(S_pc_rel_sym[2](p2_nw - p2_w), t, 1)\n",
-    "dtS2_w = porosity[2]*sym.diff(S_pc_rel[2](p2_nw - p2_w), t, 1)\n",
-    "dtS2_nw = -porosity[2]*sym.diff(S_pc_rel[2](p2_nw - p2_w), t, 1)\n",
-    "print(\"dtS2_w = \", dtS2_w, \"\\n\")\n",
-    "print(\"dtS2_nw = \", dtS2_nw, \"\\n\")\n",
-    "\n",
-    "#dxdxflux2_w = -sym.diff(relative_permeability[2]['wetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_w, x, 1), x, 1)\n",
-    "#dydyflux2_w = -sym.diff(relative_permeability[2]['wetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_w, y, 1), y, 1)\n",
-    "dxdxflux2_w = -1/viscosity[2]['wetting']*sym.diff(relative_permeability[2]['wetting'](S_pc_rel[2](p2_nw - p2_w))*sym.diff(p2_w, x, 1), x, 1)\n",
-    "dydyflux2_w = -1/viscosity[2]['wetting']*sym.diff(relative_permeability[2]['wetting'](S_pc_rel[2](p2_nw - p2_w))*sym.diff(p2_w, y, 1), y, 1)\n",
-    "\n",
-    "rhs2_w = dtS2_w + dxdxflux2_w + dydyflux2_w\n",
-    "rhs2_w = sym.printing.ccode(rhs2_w)\n",
-    "print(\"rhs2_w = \", rhs2_w, \"\\n\")\n",
-    "#rhs_w = sym.expand(rhs_w)\n",
-    "#print(\"rhs_w\", rhs_w, \"\\n\")\n",
-    "#rhs_w = sym.collect(rhs_w, x)\n",
-    "#print(\"rhs_w\", rhs_w, \"\\n\")\n",
-    "\n",
-    "#dxdxflux2_nw = -sym.diff(relative_permeability[2]['nonwetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_nw, x, 1), x, 1)\n",
-    "#dydyflux2_nw = -sym.diff(relative_permeability[2]['nonwetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_nw, y, 1), y, 1)\n",
-    "dxdxflux2_nw = -1/viscosity[2]['nonwetting']*sym.diff(relative_permeability[2]['nonwetting'](1-S_pc_rel[2](p2_nw - p2_w))*sym.diff(p2_nw, x, 1), x, 1)\n",
-    "dydyflux2_nw = -1/viscosity[2]['nonwetting']*sym.diff(relative_permeability[2]['nonwetting'](1-S_pc_rel[2](p2_nw - p2_w))*sym.diff(p2_nw, y, 1), y, 1)\n",
-    "\n",
-    "rhs2_nw = dtS2_nw + dxdxflux2_nw + dydyflux2_nw\n",
-    "rhs2_nw = sym.printing.ccode(rhs2_nw)\n",
-    "print(\"rhs2_nw = \", rhs2_nw, \"\\n\")\n",
-    "\n",
-    "#dxdxflux2_w = sym.printing.ccode(dxdxflux2_w)\n",
-    "#dxdxflux2_nw = sym.printing.ccode(dxdxflux2_nw)\n",
-    "#dydyflux2_w = sym.printing.ccode(dydyflux2_w)\n",
-    "#dydyflux2_nw = sym.printing.ccode(dydyflux2_nw)\n"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.7.3rc1"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 2
-}
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/.dropbox.attr b/TP-TP-patch-test-case/plots/praeambels_and_definitions/.dropbox.attr
deleted file mode 100755
index 9e26dfe..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/.dropbox.attr
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/Diplomarbeitsskriptpraeambel/theoreme_und_farbe.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/Diplomarbeitsskriptpraeambel/theoreme_und_farbe.tex
deleted file mode 100644
index 91d7dc6..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/Diplomarbeitsskriptpraeambel/theoreme_und_farbe.tex
+++ /dev/null
@@ -1,321 +0,0 @@
-%FARBDEFINTIONEN
-%\definecolor{dunkelblau}{rgb}{0.21,0.37,0.87}definert neue Farben. Mit rgb-Werten in % mit RGB kann man die %RGB werte driket angeben
-%BLAUTOENE
-\definecolor{mediumblue}{RGB}{0,0,205}
-\definecolor{navyblue}{RGB}{0,0,128}
-\definecolor{midnightblue}{RGB}{25,25,112}
-\definecolor{royalblue4}{RGB}{39,64,139}
-\definecolor{blue3}{RGB}{0,0,205}
-
-%ROT- UND BRAUNTOENE
-\definecolor{brown}{RGB}{165,42,42} %Bordaux %heller
-\definecolor{brown3}{RGB}{205,51,51} %eher rot
-\definecolor{brown4}{RGB}{139,35,35} %ART Bordeaux %etwas dunkler
-\definecolor{red3}{RGB}{205,0,0} %bordeauxrot %noch dunkler
-\definecolor{tomato}{RGB}{205,79,57} % noch dunkler aehnlich zu red3
-\definecolor{firebrick3}{RGB}{205,38,38}
-\definecolor{firebrick4}{RGB}{139,26,26}
-
-%GELBTOENE
-\definecolor{gold}{RGB}{255,215,0}
-\definecolor{gold3}{RGB}{238,201,0} %dunkler
-
-%ORANGETOENE
-\definecolor{orange}{rgb}{.9,.6,.1}
-\definecolor{dunkelorange}{rgb}{.9,.5,.0}
-
-%Gruen
-\definecolor{darkgreen}{RGB}{0,100,0}
-\definecolor{green3}{RGB}{0,205,0} %dunkler als das Standartgruen
-\definecolor{olivedrab}{RGB}{107,142,35}
-\definecolor{forestgreen}{RGB}{34,139,34}
-\definecolor{darkolivegreen}{RGB}{85,107,47}
-
-%Grautoene
-\definecolor{grey}{rgb}{0.5,0.5,0.5}
-\definecolor{dimgrey}{RGB}{105,105,105}
-\definecolor{dimgrey2}{RGB}{153,153,153}
-\definecolor{dimgrey3}{RGB}{181,181,181}
-\definecolor{lightgrey}{RGB}{211,211,211}
-\definecolor{lightergrey}{RGB}{201,201,201}
-\definecolor{verylightgrey}{RGB}{222,222,222}
-
-
-%BRAUNTOENE
-\definecolor{braun}{rgb}{.6,.5,.1}
-\definecolor{braun2}{rgb}{.6,.4,.1}
-
-%DEFINITIONEN DER SATZ- UND THEOREMUMGEBUNGEN
-
-%\newcommand{\<Befehlsname>}{<Definition, was hinterher im Dokument erscheinen soll>}
-%"'Befehlsname"` muss %ein wirklich neuer Befehl sein
-%\newcommand{\<Befehlsname>}[Anzahl der Argumente des neuen Befehls (1...9)]{#i,#(i+1)} i
-%= 1...9 %Beim %Befehlsaufruf erscheint das, was man in die Argumentklammern schreibt an
-%der jeweiligen Stelle #i
-%Analog fuer folgenden Befehl: "<\Befehl>" muss schon existieren
-%\renewcommand{\<Befehl>}{<Definition>}
-%\renewcommand{\<Befehl>}[<ArgAnz>]{<Definition>}
-\newcommand{\bewend}{\rule{1ex}{1ex}}
-%Beweis ende: ausgefuelltes Viereck fuer das Ende eines Beweises.
-\newcommand{\latop}[2]{#1 \atop #2}	%gibt dem TeX-Befehl \atop eine LaTeX ueblichere Form
-\newcommand{\lchoose}[2]{#1 \choose #2} 
-%gibt dem TeX-Befehl \choose eine LaTeX ueblichere Form 
-
-%%%%%%%%%%%%% ZUNAECHST DIE EIGENEN STYLES %%%%%%%%%%%%%
-%erst mal ein Bugfix.
-%entweder
-% \makeatletter
-% \def\thmt@refnamewithcomma #1#2#3,#4,#5\@nil{%
-% \@xa\def\csname\thmt@envname #1utorefname\endcsname{#3}%
-% \ifcsname #2refname\endcsname
-% \csname #2refname\expandafter\endcsname\expandafter{\thmt@envname}{#3}{#4}%
-% \fi
-% }
-% \makeatother
-%oder Zur zwischenzeitlichen Abhilfe sollte es helfen, Z.48 in thm-autoref wie folgt
-%abzuaendern:  \csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-%Ich habe das bereits gemacht.
-
-%Eingener Nummerierungsstyl am Rand und grau
-%Damit der Stil margincolored definiert ist muss 
-%  \definecolor{dimgrey}{RGB}{105,105,105}
-%  \definecolor{dimgrey2}{RGB}{153,153,153}
-%  \def\thmt@headstyle@margincolored{%
-%    \makebox[0pt][r]{\color{dimgrey2}\NUMBER\ }\NAME\NOTE
-%  }
- 
-% 
-% zu thm-ntheorem.sty und thm-amsthm.sty ergänzt werden.
-%%%%% Definitionsstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{olivedrab}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{olivedrab}$\pmb{\triangleleft}$]{customdefintion}
-%Defintion
-\declaretheorem[name=Definition,numberwithin=section,style=customdefintion,
-refname={Definition,Defintionen}]{df}
-%Bezeichnungen
-\declaretheorem[name=Bezeichnungen,sibling=df,style=customdefintion,
-refname={Bezeichnungen,Bezeichnungen}]{bez}
-\declaretheorem[name=Bezeichnung,sibling=df,style=customdefintion,
-refname={Bezeichnung,Bezeichnungen}]{bz}
-%Bezeichnungen ohne Nummer:
-\declaretheorem[name=Bezeichnungen,numbered=no,style=customdefintion,
-refname={Bezeichnungen,Bezeichnungen}]{bez*}
-
-%Festlegung mit und ohne nummer
-\declaretheorem[name=Festlegung,sibling=df,style=customdefintion,
-refname={Festlegungen,Festlegungen}]{festlg}
-\declaretheorem[name=Festlegung,numbered=no,style=customdefintion,
-refname={Festlegungen,Festlegungen}]{nnfestlg}
-
-%%%%% Beispiel- und Bemerkungstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber oder margin
-headfont={\color{midnightblue}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\color{midnightblue}$\pmb{\triangleleft}$]{custombspbem}
-%Beispiel 
-\declaretheorem[numberlike=df,name=Beispiel,style=custombspbem,
-refname={Beispiel,Beispiele}]{bsp}
-%Bemerkung
-\declaretheorem[name=Bemerkung,sibling=df,style=custombspbem,
-refname={Bemerkung,Bemerkungen}]{bem}
-
-%%%%% Lemma-,Korollarstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{tomato}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{tomato}$\pmb{\lrcorner}$]{customlemma}
-%Lemma 
-\declaretheorem[name=Lemma,sibling=df,style=customlemma,
-refname={Lemma,Lemmata}]{lm}
-%Korollar
-\declaretheorem[name=Korollar,sibling=df,style=customlemma,
-refname={Korollar,Korollare}]{kor}
-
-%%%%% Notizstyle 
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{darkgreen}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{darkgreen}$\pmb{\lrcorner}$]{customnotiz}
-%Notiz
-\declaretheorem[name=Notiz,sibling=df,style=customnotiz,
-refname={Notiz,Notizen}]{nz}
-%%Spezialnotiz fuer die D-Arbeit: Prinzip der Nullstellensuche
-\declaretheorem[name=Prinzip der Nullstellensuche,sibling=df,style=customnotiz,
-refname={Notiz,Notizen}]{pdnss}
-\declaretheorem[name=Fragestellung,sibling=df,style=customnotiz,
-refname={Fragestellung,Fragestellungen}]{frage}
-\declaretheorem[name=Fragestellungen,sibling=df,style=customnotiz,
-refname={Fragestellungen,Fragestellungen}]{fragen}
-
-\declaretheorem[name=Erklärung,sibling=df,style=customnotiz,
-refname={Erklärung,Erklärungen}]{erklaerung}
-\declaretheorem[name=Erklärung,numbered=no,style=customnotiz,
-refname={Erklärung,Erklärungen}]{erklaerung*}
-
-
-%%%%%%%%%%%%Berechnungstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{darkgreen}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\color{darkgreen}$\pmb{\bewend}$]{customberechnung}
-%Nebenrechnung
-\declaretheorem[name=Nebenrechnung,sibling=df,style=customberechnung,
-refname={Nebenrechnung,Nebenrechnungen}]{nr}
-
-%%%%% Satz-, Hauptsatz-, Satz und Definition und Propositionsstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{firebrick4}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{firebrick4}$\lrcorner$]{customsatz}
-%Satz
-\declaretheorem[name=Satz,sibling=df,style=customsatz,
-refname={Satz,S\"atze}]{sz}
-%ohne Nummer
-\declaretheorem[name=Satz,numbered=no,style=customsatz,
-refname={Satz,S\"atze}]{sz*}
-%Hauptsatz 
-\declaretheorem[name=Hauptsatz,sibling=df,style=customsatz,
-refname={Hauptsatz,Haupts\"atze}]{hsz}
-%ohne Nummer
-\declaretheorem[name=Hauptsatz,numbered=no,style=customsatz,
-refname={Hauptsatz,Haupts\"atze}]{hsz*}
-%Satz und Definition 
-\declaretheorem[name=Satz und Definition,sibling=df,style=customsatz,
-refname={Satz und Definition,S\"atze und Definitionen}]{szdf}
-%Proposition
-\declaretheorem[sibling=df,name=Proposition,style=customsatz,
-refname={Proposition,Propositionen}]{proposition}
-
-%%%%%%%%% Beweisumgebung
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont=\bfseries,
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\bewend]{custombew}
-%Satz
-\declaretheorem[numbered=no,name=Beweis,style=custombew,
-refname={Beweis,Beweise}]{bew}
-
-%%%%%%%%%%%%%%%%%%%%%%% Zitieren von Code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%allgemeine Vorgaben fuer das Zieren von Code. 
-
-\lstset{%
-numberbychapter=true, %
-breaklines=true,%
-prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},%
-breakatwhitespace=false,%
-basicstyle=\footnotesize\ttfamily,%
-commentstyle=\itshape,%
-fontadjust=true,%
-tabsize=2,%
-stringstyle=\itshape,%
-numbers=left,numberstyle=\footnotesize\ttfamily,%
-extendedchars=true,%
-inputencoding=utf8,%
-stepnumber=1,%
-frame=shadowbox,%
-rulesepcolor=\color{grey},%
-backgroundcolor=\color{white},%
-showspaces=false,%
-showstringspaces=false%
-aboveskip={1.5\baselineskip},%
-columns=fixed,%
-upquote=true,%
-}
-% Spezialvorgaben fuer das Zitieren von MATLAB Code.
-\newcommand{\citematlab}{\lstset{language=Matlab,%
-emph={if,elseif,else,end,for,while,function,return},%
-emphstyle=\bfseries\color{midnightblue},emph={[2]EigMitLambda,Zerol,CotKlTan
-,CotKlTanSpez,XsGrLambda,XsKlLambda,CotGrTan,ordnen,EvenSingTan,einord},%
-emphstyle={[2]\bfseries\color{olivedrab}},%
-emph={[3]zew,ew,l,L,lambda,ewsum,ewanz,phi,v1,v2},emphstyle={[3]\color{braun}}}}
-
-\crefname{lstlisting}{Listing}{Listings}
-\Crefname{lstlisting}{Listing}{Listings}
-
-%INDEXERSTELLUNG
-
-%\makeindex %erstellt ein indexfile. soll man am schluss erst machen!
-%\makeglossary
-%\includeonly{1laag1}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - HIER BEGINNT DAS DOKUMENT -
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-
-\linespread{1.35}
-%setzt einen anderen Zeilenabstand fest. Dieser Befehl sollte vor
-%\begin{document} stehen, damit er fuer das ganze Dokument gilt.
-
-%%%%%%%%%%%%%%%%%%%% Ausgemusterter Code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%Dies sind Theoremdefintionen f\"ur das ntheorem packet.
-% {\theoremseparator{.}
-% \theoremheaderfont{\color{olivedrab}\bfseries\scshape}
-% \theoremstyle{plain}
-% \newtheorem{df}{Definition}[section] }
-% 
-% {\theoremseparator{.}
-% \theoremheaderfont{\color{olivedrab}\bfseries\scshape}
-% {\theoremheaderfont{\color{midnightblue}\bfseries\scshape}
-% \theorembodyfont{\rmfamily}
-% \theoremstyle{plain}
-% \newtheorem{bem}[df]{Bemerkung}
-% \newtheorem{bsp}[df]{Beispiel}}	}
-% 
-% {\theoremseparator{.}
-% \theoremstyle{plain}
-% {\theoremheaderfont{\color{firebrick4} \bfseries\scshape}
-% \newtheorem{sz}[df]{Satz}
-% \newtheorem{prop}[df]{Proposition}
-% \newtheorem{szdf}[df]{Satz und Definition}
-% \newtheorem{hsz}[df]{Hauptsatz}}
-
-%{\theoremheaderfont{\color{tomato} \bfseries\scshape}
-% \newtheorem{lm}[df]{Lemma}
-% \newtheorem{nz}[df]{Notiz}
-% \newtheorem{nr}[df]{Nebenrechnung}
-% \newtheorem{kor}[df]{Korollar}}
-% }
-% 
-% {\theoremseparator{.}
-% \theoremstyle{plain}
-% {\theoremheaderfont{\bfseries\scshape}
-% \theorembodyfont{\rmfamily}
-% \newtheorem*{bew}{Beweis}}
-% }
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/L-Schema_Paper_makros.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/L-Schema_Paper_makros.tex
deleted file mode 100644
index cdfeee4..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/L-Schema_Paper_makros.tex
+++ /dev/null
@@ -1,92 +0,0 @@
-
-%%% THIS FILE CONTAINS MACROS FOR THE L-SCHEME-PAPER
-
-\newcommand{\restric}{\,\rule[-5pt]{0.4pt}{12pt}\,{}}
-\newcommand{\dom}{\Omega}
-\newcommand{\union}[2]{#1 \cup \, #2}
-%vector
-\newcommand{\vt}[1]{\boldsymbol{#1}}
-% smoothness of domain
-\newcommand{\smoothness}{{Lipschitz}}
-\newcommand{\addnullcolor}{black!60}
-% smoothness of interfac
-\newcommand{\interfacesmoothness}{{Lipschitz}}
-% Domain boundaries
-% outer Boundaries
-\newcommand{\oB}[1]{\partial\Omega^{#1}}
-%\newcommand{\OuterBoundary}{$\partial\dom\cap\partial\dom_2$}
-
-\newcommand{\kdiff}{k^{\text{diff}}}
-
-% makros for the L-scheme scheme
-\newcommand{\plni}[2][l]{p_{#1}^{n,#2}}
-%\newcommand{\gradplni}[2][l]{\vt{p_{#1}^{n,#2}}}
-\newcommand{\Splni}[1]{S_l(p_l^{n,#1})}
-\newcommand{\gradplni}[1]{\vt{\nabla p_l^{n,#1}}}
-\newcommand{\gradplniMinusG}[1]{\vt{\nabla \bigl( p_l^{n,#1} - z \bigr)}}
-\newcommand{\klni}[2][l]{k_#1\bigl(S_#1(p_#1^{n,#2})\bigr)}
-\newcommand{\kln}[1]{k_{#1}\bigl(S_{#1}(p_{#1}^{n})\bigr)}
-\newcommand{\klnnull}[1]{k_{#1}\left(S_{#1}\bigl(p_{#1}^{n-1}\bigr)\right)}
-\newcommand{\gli}[2][l]{g_{#1}^{#2}}
-% the same for the summed variables
-\newcommand{\pni}[1][i]{p^{n,#1}}
-\newcommand{\gradpni}[1][i]{\nabla p^{n,#1}}
-\newcommand{\gi}[1][i]{g^{#1}}
-\newcommand{\epli}[2][l]{e_{p,#1}^{#2}}
-\newcommand{\epliOnGamma}[2][l]{e_{p,#1|_\Gamma}^{#2}}
-\newcommand{\gradepli}[2][l]{\vt{\nabla e_{p,#1}^{#2}}}
-\newcommand{\egli}[2][l]{e_{g,#1}^{#2}}
-\newcommand{\flux}[2][l]{\vt{F_{#1}^{n,#2}}}
-% scalar product
-% normal math mode sized 
-\newcommand{\spl}{\bigl\langle}
-\newcommand{\spr}{\bigr\rangle}
-% text mode sized
-\newcommand{\tspl}{\langle}
-\newcommand{\tspr}{\rangle}
-% bigger sized
-\newcommand{\bspl}{\Bigl\langle}
-\newcommand{\bspr}{\Bigr\rangle}
-%norms 
-\newcommand{\nml}{\bigl\|}
-\newcommand{\nmr}{\bigr\|}
-\newcommand{\Nml}{\Bigl\|}
-\newcommand{\Nmr}{\Bigr\|}
-
-% spaces
-\newcommand{\fs}[1]{H_{\oB{#1}}^1}
-\newcommand{\Fs}{\mathcal{V}}
-\newcommand{\Tracespace}{H^{1/2}_{00}(\Gamma)}
-\newcommand{\tGamma}{{\tilde{\Gamma}}}
-\newcommand{\onGamma}[1]{{#1}_{|_\Gamma}}
-\newcommand{\RR}{\mathbb{R}}
-\newcommand{\RRd}{\mathbb{R}^d}
-\newcommand{\NN}{\mathbb{N}}
-\newcommand{\CC}{\mathbb{C}}
-\newcommand{\KK}{\mathbb{K}}
-\newcommand{\ZZ}{\mathbb{Z}}
-\newcommand{\QQ}{\mathbb{Q}}
-\newcommand{\Hr}{\mathscr{H}}
-\newcommand{\Lb}{\mathcal{L}}
-\newcommand{\D}{\mathcal{D}}
-\newcommand{\V}{\mathcal{V}}
-%\newcommand{\G}{\mathcal{G}}
-\newcommand{\E}{\mathcal{E}}
-\DeclareMathOperator{\Span}{Span}
-\DeclareMathOperator{\vol}{vol}
-\DeclareMathOperator{\re}{Re}
-\DeclareMathOperator{\im}{Im}
-\DeclareMathOperator{\cosinus}{cosinus}
-\DeclareMathOperator{\dv}{\nabla\cdot }
-\DeclareMathOperator{\supp}{supp}
-\DeclareMathOperator{\dist}{dist}
-\DeclareMathOperator{\length}{length}
-\DeclareMathOperator{\trace}{tr}
-%\DeclareMathOperator{\liminf}{lim inf}
-%\DeclareMathOperator{\deg}{deg}
-%\DeclareMathOperator{\max}{max}
-\providecommand{\abs}[1]{\lvert#1\rvert}
-\providecommand{\norm}[1]{\lVert#1\rVert}
-\newcommand{\tr}[1]{\trace_{#1}}
-
-\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/artikel_theoreme_und_farbe.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/artikel_theoreme_und_farbe.tex
deleted file mode 100644
index 4e7bcfd..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/artikel_theoreme_und_farbe.tex
+++ /dev/null
@@ -1,383 +0,0 @@
-%FARBDEFINTIONEN
-%\definecolor{dunkelblau}{rgb}{0.21,0.37,0.87}definert neue Farben. Mit rgb-Werten in % mit RGB kann man die %RGB werte driket angeben
-
-%BLAUTOENE
-\definecolor{mediumblue}{RGB}{0,0,205}
-\definecolor{navyblue}{RGB}{0,0,128}
-\definecolor{midnightblue}{RGB}{25,25,112}
-\definecolor{royalblue4}{RGB}{39,64,139}
-\definecolor{blue3}{RGB}{0,0,205}
-\definecolor{steelblue3}{RGB}{79,148,205}
-\definecolor{steelblue4}{RGB}{54,100,139}
-
-%ROT- UND BRAUNTOENE
-\definecolor{brown}{RGB}{165,42,42} %Bordaux %heller
-\definecolor{brown3}{RGB}{205,51,51} %eher rot
-\definecolor{brown4}{RGB}{139,35,35} %ART Bordeaux %etwas dunkler
-\definecolor{red3}{RGB}{205,0,0} %bordeauxrot %noch dunkler
-\definecolor{tomato}{RGB}{205,79,57} % noch dunkler aehnlich zu red3
-\definecolor{firebrick3}{RGB}{205,38,38}
-\definecolor{firebrick4}{RGB}{139,26,26}
-
-%GELBTOENE
-\definecolor{gold}{RGB}{255,215,0}
-\definecolor{gold3}{RGB}{238,201,0} %dunkler
-\definecolor{darkgoldenrod1}{RGB}{255,185,15}
-\definecolor{goldenrod1}{RGB}{255,193,37}
-\definecolor{goldenrod}{RGB}{218,165,32}
-
-%ORANGETOENE
-\definecolor{orange}{rgb}{.9,.6,.1}
-\definecolor{dunkelorange}{rgb}{.9,.5,.0}
-\definecolor{orange2}{RGB}{238,154,0}
-\definecolor{orange3}{RGB}{205,133,0}
-
-%Gruen
-\definecolor{darkgreen}{RGB}{0,100,0}
-\definecolor{green3}{RGB}{0,205,0} %dunkler als das Standartgruen
-\definecolor{olivedrab}{RGB}{107,142,35}
-\definecolor{olivedrab2}{RGB}{179,238,58}
-\definecolor{olivedrab3}{RGB}{154,205,50}
-\definecolor{forestgreen}{RGB}{34,139,34}
-\definecolor{darkolivegreen}{RGB}{85,107,47}
-\definecolor{darkolivegreen4}{RGB}{110,139,61}
-\definecolor{khaki3}{RGB}{205,198,115}
-
-%Grautoene
-\definecolor{grey}{rgb}{0.5,0.5,0.5}
-\definecolor{dimgrey}{RGB}{105,105,105}
-\definecolor{dimgrey2}{RGB}{153,153,153}
-\definecolor{dimgrey3}{RGB}{181,181,181}
-\definecolor{lightgrey}{RGB}{211,211,211}
-\definecolor{lightergrey}{RGB}{201,201,201}
-\definecolor{verylightgrey}{RGB}{222,222,222}
-
-
-%BRAUNTOENE
-\definecolor{braun}{rgb}{.6,.5,.1}
-\definecolor{braun2}{rgb}{.6,.4,.1}
-\definecolor{tan4}{RGB}{149,90,43}
-
-%%SCHATTIERUNGEN VON WEISS 
-\definecolor{wheat3}{RGB}{205,186,150}
-\definecolor{wheat4}{RGB}{139,126,102}
-
-
-%DEFINITIONEN DER SATZ- UND THEOREMUMGEBUNGEN
-
-%\newcommand{\<Befehlsname>}{<Definition, was hinterher im Dokument erscheinen soll>}
-%"'Befehlsname"` muss %ein wirklich neuer Befehl sein
-%\newcommand{\<Befehlsname>}[Anzahl der Argumente des neuen Befehls (1...9)]{#i,#(i+1)} i
-%= 1...9 %Beim %Befehlsaufruf erscheint das, was man in die Argumentklammern schreibt an
-%der jeweiligen Stelle #i
-%Analog fuer folgenden Befehl: "<\Befehl>" muss schon existieren
-%\renewcommand{\<Befehl>}{<Definition>}
-%\renewcommand{\<Befehl>}[<ArgAnz>]{<Definition>}
-\newcommand{\bewend}{\rule{1ex}{1ex}}
-\renewcommand{\qedsymbol}{\rule{1ex}{1ex}}
-%Beweis ende: ausgefuelltes Viereck fuer das Ende eines Beweises.
-\newcommand{\latop}[2]{#1 \atop #2}	%gibt dem TeX-Befehl \atop eine LaTeX ueblichere Form
-\newcommand{\lchoose}[2]{#1 \choose #2} 
-%gibt dem TeX-Befehl \choose eine LaTeX ueblichere Form 
-
-%%%%%%%%%%%%% ZUNAECHST DIE EIGENEN STYLES %%%%%%%%%%%%%
-%erst mal ein Bugfix.
-%entweder
-% \makeatletter
-% \def\thmt@refnamewithcomma #1#2#3,#4,#5\@nil{%
-% \@xa\def\csname\thmt@envname #1utorefname\endcsname{#3}%
-% \ifcsname #2refname\endcsname
-% \csname #2refname\expandafter\endcsname\expandafter{\thmt@envname}{#3}{#4}%
-% \fi
-% }
-% \makeatother
-%oder Zur zwischenzeitlichen Abhilfe sollte es helfen, Z.48 in thm-autoref wie folgt
-%abzuaendern:  \csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-%Dies ist in der TeXLive2014 bereits gefixt.
-
-%Eingener Nummerierungsstyl am Rand und grau
-%Damit der Stil margincolored definiert ist muss 
-\makeatletter
-  \def\thmt@headstyle@margincolored{%
-    \makebox[0pt][r]{\color{black!40}\NUMBER\ }\NAME\NOTE
-  }
-\makeatother
-% in thm-ntheorem.sty und thm-amsthm.sty ergaenzt werden. Dies ist mit diesem Code erledigt ohne 
-%die Originalpakete zu veraendern.
-
-% General Numbering Style
-%\def \customheadformat {margincolored}
-%%% FARBDEFINTIONEN fuer theoremstyles
-\newcommand{\definitionstylecolor}{black}
-\newcommand{\exampleandremarkstylecolor}{black}
-\newcommand{\lammacorollarystylecolor}{black}
-\newcommand{\notestylecolor}{black}
-\newcommand{\customtheoremstylecolor}{black}
-%\newcommand{margincolored}{margin}
-%%%%% Definitionsstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored,%margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{\definitionstylecolor}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{\definitionstylecolor}$\pmb{\triangleleft}$]{customdefintion}
-%Defintion
-\declaretheorem[name=Definition,numberwithin=section,style=customdefintion,
-refname={Definition,Defintionen}]{df}
-%Bezeichnungen
-\declaretheorem[name=Bezeichnungen,sibling=df,style=customdefintion,
-refname={Bezeichnungen,Bezeichnungen}]{bez}
-\declaretheorem[name=Bezeichnung,sibling=df,style=customdefintion,
-refname={Bezeichnung,Bezeichnungen}]{bz}
-%Bezeichnungen ohne Nummer:
-\declaretheorem[name=Bezeichnungen,numbered=no,style=customdefintion,
-refname={Bezeichnungen,Bezeichnungen}]{bez*}
-%notations
-\declaretheorem[name=Notations,sibling=df,style=customdefintion,
-refname={Notations,Notations}]{notations}
-%notation
-\declaretheorem[name=Notation,sibling=df,style=customdefintion,
-refname={Notation,Notations}]{notation}
-%notations without number:
-\declaretheorem[name=Notations,numbered=no,style=customdefintion,
-refname={Notations,Notations}]{notations*}
-%Assumption
-\declaretheorem[name=Assumption,sibling=df,style=customdefintion,
-refname={assumption,assumptions}]{assumption}
-%Assumptions
-\declaretheorem[name=Assumptions,sibling=df,style=customdefintion,
-refname={assumptions,assumptions}]{assumptions}
-
-
-%Festlegung mit und ohne nummer
-\declaretheorem[name=Festlegung,sibling=df,style=customdefintion,
-refname={Festlegungen,Festlegungen}]{festlg}
-\declaretheorem[name=Festlegung,numbered=no,style=customdefintion,
-refname={Festlegungen,Festlegungen}]{nnfestlg}
-
-%%%%% Beispiel- und Bemerkungstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber oder margin
-headfont={\color{\exampleandremarkstylecolor}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\color{\exampleandremarkstylecolor}$\pmb{\triangleleft}$]{custombspbem}
-%Beispiel 
-\declaretheorem[numberlike=df,name=Beispiel,style=custombspbem,
-refname={Beispiel,Beispiele}]{bsp}
-%Bemerkung
-\declaretheorem[name=Bemerkung,sibling=df,style=custombspbem,
-refname={Bemerkung,Bemerkungen}]{bem}
-%Example
-\declaretheorem[numberlike=df,name=Example,style=custombspbem,
-refname={Example,Examples}]{example}
-%remark
-\declaretheorem[name=Remark,sibling=df,style=custombspbem,
-refname={Remark,Remarks}]{remark}
-% observation
-\declaretheorem[name=Observation,sibling=df,style=custombspbem,
-refname={Observation,Observations}]{observation}
-%%%%% Lemma-,Korollarstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{\lammacorollarystylecolor}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{\lammacorollarystylecolor}$\pmb{\lrcorner}$]{customlemma}
-%Lemma 
-\declaretheorem[name=Lemma,sibling=df,style=customlemma,
-refname={Lemma,Lemmata}]{lemma}
-%Korollar
-\declaretheorem[name=Korollar,sibling=df,style=customlemma,
-refname={Korollar,Korollare}]{kor}
-%Corollay
-\declaretheorem[name=Corollary,sibling=df,style=customlemma,
-refname={Corollary,Corollaries}]{corollary}
-%Conclusion
-\declaretheorem[name=Conclusion,sibling=df,style=customlemma,
-refname={Conclusion,Conclusions}]{conclusion}
-
-
-
-%%%%% Notizstyle 
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored,%margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{\notestylecolor}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{\notestylecolor}$\pmb{\lrcorner}$]{customnotiz}
-%Notiz
-\declaretheorem[name=Notiz,sibling=df,style=customnotiz,
-refname={Notiz,Notizen}]{notiz}
-%%Spezialnotiz fuer die D-Arbeit: Prinzip der Nullstellensuche
-\declaretheorem[name=Prinzip der Nullstellensuche,sibling=df,style=customnotiz,
-refname={Notiz,Notizen}]{pdnss}
-\declaretheorem[name=Fragestellung,sibling=df,style=customnotiz,
-refname={Fragestellung,Fragestellungen}]{frage}
-\declaretheorem[name=Fragestellungen,sibling=df,style=customnotiz,
-refname={Fragestellungen,Fragestellungen}]{fragen}
-%Idea environment
-\declaretheorem[name=Idea,sibling=df,style=customnotiz,
-refname={idea,ideas}]{idea}
-%Main Idea environment
-\declaretheorem[name=Main idea,sibling=df,style=customnotiz,
-refname={main idea,main ideas}]{mainidea}
-%General Idea environment
-\declaretheorem[name=General idea,sibling=df,style=customnotiz,
-refname={general idea,general ideas}]{generalidea}
-%Questions and Tasks
-\declaretheorem[name=Questions and Tasks,sibling=df,style=customnotiz,
-refname={questions and tasks,question and tasks}]{QuestTasks}
-%Problem
-\declaretheorem[name=Problem,sibling=df,style=customnotiz,
-refname={problem,problems}]{problem}
-\declaretheorem[name=Problem,numbered=no,style=customnotiz,
-refname={problem,problems}]{problem*}
-% Note 
-\declaretheorem[name=Note,sibling=df,style=customnotiz,
-refname={Note,Notes}]{note}
-
-
-
-\declaretheorem[name=Erklärung,sibling=df,style=customnotiz,
-refname={Erklärung,Erklärungen}]{erklaerung}
-\declaretheorem[name=Erklärung,numbered=no,style=customnotiz,
-refname={Erklärung,Erklärungen}]{erklaerung*}
-
-
-%%%%%%%%%%%%Berechnungstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{darkgreen}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\color{darkgreen}$\pmb{\bewend}$]{customberechnung}
-%Nebenrechnung
-\declaretheorem[name=Nebenrechnung,sibling=df,style=customberechnung,
-refname={Nebenrechnung,Nebenrechnungen}]{nr}
-
-%%%%% Satz-, Hauptsatz-, Satz und Definition und Propositionsstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored,%margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{\customtheoremstylecolor}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{\customtheoremstylecolor}$\lrcorner$]{customsatz}
-%Satz
-\declaretheorem[name=Satz,sibling=df,style=customsatz,
-refname={Satz,S\"atze}]{satz}
-%ohne Nummer
-\declaretheorem[name=Satz,numbered=no,style=customsatz,
-refname={Satz,S\"atze}]{satz*}
-%Hauptsatz 
-\declaretheorem[name=Hauptsatz,sibling=df,style=customsatz,
-refname={Hauptsatz,Haupts\"atze}]{hauptsatz}
-%ohne Nummer
-\declaretheorem[name=Hauptsatz,numbered=no,style=customsatz,
-refname={Hauptsatz,Haupts\"atze}]{hauptsatz*}
-%Satz und Definition 
-\declaretheorem[name=Satz und Definition,sibling=df,style=customsatz,
-refname={Satz und Definition,S\"atze und Definitionen}]{satzunddefiniton}
-%Proposition
-\declaretheorem[sibling=df,name=Proposition,style=customsatz,
-refname={Proposition,Propositionen}]{proposition}
-% English
-%theorem
-\declaretheorem[name=Theorem,sibling=df,style=customsatz,
-refname={Theorem,Theorems}]{satzengl}
-%ohne Nummer
-\declaretheorem[name=Theorem,numbered=no,style=customsatz,
-refname={Theorem,Theorems}]{satzengl*}
-%Satz und Definition 
-\declaretheorem[name=Theorem and Definition,sibling=df,style=customsatz,
-refname={Theorem and Definition,Theorems and Definitions}]{thmdf}
-%Proposition
-\declaretheorem[sibling=df,name=Proposition,style=customsatz,
-refname={Proposition,Propositions}]{prop}
-
-
-%%%%%%%%% Beweisumgebung
-%\newcommand{\customtheoremstylecolor}{black}
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored,%margincolored, %auch moeglich ist swapnumber margin
-headfont=\bfseries,
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\bewend]{custombew}
-%Beweis
-\declaretheorem[numbered=no,name=Beweis,style=custombew,
-refname={Beweis,Beweise}]{Beweis}
-%1
-\declaretheorem[numbered=no,name=Proof,style=custombew,%
-refname={Proof,Proofs}]{Proof}
-
-%%% helps cleverref to use the correct capitalization
-\crefname{lstlisting}{listing}{listings}
-\Crefname{lstlisting}{Listing}{Listings}
-\crefname{problem}{problem}{problems}
-\Crefname{problem}{Problem}{Problems}
-\crefname{notation}{notation}{notations}
-\Crefname{notation}{Notation}{Notations}
-\crefname{lm}{lemma}{lemmata}
-\Crefname{lm}{Lemma}{Lemmata}
-\crefname{assumptions}{assumptions}{assumptions}
-\Crefname{assumptions}{Assumptions}{Assumptions}
-\crefname{satzengl}{theorem}{theorems}
-\Crefname{satzengl}{Theorem}{Theorems}
-\crefname{satzengl*}{theorem}{theorems}
-\Crefname{satzengl*}{Theorem}{Theorems}
-\crefname{cor}{corollary}{corollaries}
-\Crefname{cor}{Corollary}{Corollaries}
-\crefname{df}{defintion}{defintions}
-\Crefname{df}{Defintion}{Defintions}
-\crefname{remark}{remark}{remarks}
-\Crefname{remark}{Remark}{Remarks}
-\crefname{observation}{observation}{observations}
-\Crefname{observation}{Observation}{Observations}
-%%%%%%%%%%%%%%%%%%%%%%% Zitieren von Code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%allgemeine Vorgaben fuer das Zieren von Code. 
-% 
-% \lstset{%
-% numberbychapter=true, %
-% breaklines=true,%
-% prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},%
-% breakatwhitespace=false,%
-% basicstyle=\footnotesize\ttfamily,%
-% commentstyle=\itshape,%
-% fontadjust=true,%
-% tabsize=2,%
-% stringstyle=\itshape,%
-% numbers=left,numberstyle=\footnotesize\ttfamily,%
-% extendedchars=true,%
-% inputencoding=utf8,%
-% stepnumber=1,%
-% frame=shadowbox,%
-% rulesepcolor=\color{grey},%
-% backgroundcolor=\color{white},%
-% showspaces=false,%
-% showstringspaces=false%
-% aboveskip={1.5\baselineskip},%
-% columns=fixed,%
-% upquote=true,%
-% }
-% % Spezialvorgaben fuer das Zitieren von MATLAB Code.
-% \newcommand{\citematlab}{\lstset{language=Matlab,%
-% emph={if,elseif,else,end,for,while,function,return},%
-% emphstyle=\bfseries\color{midnightblue},emph={[2]EigMitLambda,Zerol,CotKlTan
-% ,CotKlTanSpez,XsGrLambda,XsKlLambda,CotGrTan,ordnen,EvenSingTan,einord},%
-% emphstyle={[2]\bfseries\color{olivedrab}},%
-% emph={[3]zew,ew,l,L,lambda,ewsum,ewanz,phi,v1,v2},emphstyle={[3]\color{braun}}}}
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/artikelpraeambel.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/artikelpraeambel.tex
deleted file mode 100644
index a72947c..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/artikelpraeambel.tex
+++ /dev/null
@@ -1,452 +0,0 @@
-%Dies ist der Kopf meiner Skripte. Er enthaelt alle Pakete und Einstellungen
-
-%%% BUG FIXING SECTION
-% There ist a bug in thmtools. After Latex Upgrade change line 48 in thm-autoref.sty so that
-% it reads
-%\csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-% then run texhash
-
-%MAKROPAKETE
-%1.PAKETE DIE MIT DER KODIERUNG VON ZEICHEN ZU TUN HABEN.
-%\usepackage[german]{babel}
-%Definition von Sprachabhaengigen Komponenten insbesondere fuer Dokumente
-%in anderen Sprachen als Englisch
-%\usepackage{fixltx2e}
-\usepackage{etex} %some fix for hyperref
-%Korrektur einiger Fehler die sich in LaTeX2e eingeschlichen haben. 
-%\usepackage{ngerman} 
-% stellt Sonderzeichen und ihre Befehle wie zum Beispiel "o zur Verfuegung
-
-%%%%%%%%%%%% SCHRIFTEN %%%%%%%%%%%%%%%%%%%%%%%%
-%\usepackage{mathpazo}%andere Schriftart
-%\usepackage{lmodern}
-%\usepackage{beramono}
-% Using Courier font
-\renewcommand{\ttdefault}{pcr}
-%Tweak, damit auch im Mathemodus tt-schrift fettgedruckt werden kann.
-\usepackage{ifluatex}
-%%%% PDFLaTeX or LUALaTeX %%%%%%%
-\ifluatex
-  %\usepackage{luatextra}
-  \usepackage{lualatex-math}
-%  \usepackage{unicode-math}
-%  \setmathfont{xits-math.otf}
-\else
-  %% if pdflatex is used uncomment the following packages. If lualatex is used comment them.
-  %dieses Paket ermoeglicht die Eingabe von Sonderzeichen ueber die Tastatur
-  \usepackage[utf8]{inputenx}
-  %additions for utf8
-  \input{ix-utf8enc.dfu}
-  %% comment \usepackage{uiinput} if lulatex is used! line 131
-  %% if pdflatex is used uncomment above packages. If lualatex is used comment them.
-\fi
-\usepackage{microtype}
-\usepackage[dvipsnames,svgnames,table]{xcolor} % Farben
-
-\usepackage[T1]{fontenc} %Kodierung von Zeichensaetzen. 
-	%Das optionale Argument <Kodierung> kann eine durch Komma getrennte Liste von
-%Kodierungen enthalten. Im Text koennte dann an %beliebiger %Stelle zum wechseln der
-%Kodierung die Befehlsfolge:
-    		%\fontencoding{<Kodierung>}
-    		%\selectfont
-	%verwendet werden. Gaengige Kodierungen sind:
-%                           Tabelle 5.4: Kodierungen
-%         T1      8-Bit-Standard fuer EC-Fonts	 
-%         TS      8-Bit-Zeichenkodierung fuer TS-Fonts
-%         OT1      7-Bit-Kodierung fuer Text1 , CM-Fonts
-%         OML      7-Bit-Kodierung fuer Formeltext1
-%         OMS      7-Bit-Kodierung fuer mathematische Symbole1
-%         OMX      7-Bit-Kodierung fuer erweiterte mathematische Symbole1
-\usepackage{latexsym}
-%Definiert zusaetzliche Symbolbefehle.
-\usepackage[full]{textcomp}
-% Sammlung von Textsymbolen. Optional kann [safe] oder [full]
-% als Option hinzugefuegt werden, lezteres aber nur bei
-%CM und EC-Fonts
-
-% einige mathesymbole wie \lbrack
-\usepackage{stmaryrd}
-\usepackage{eucal}
-%Stellt deutsche Frakturschrift im Math Modus zur Verfuegung bei \mathcal
-%\usepackage{sistyle,upgreek}
-%\usepackage{fixmath}
-% sistyle stellt \SI{Masszahl}{Einheit}
-% bereit, zur si-konformen Darstellung von phy Goessen. textcom und upgreek stellt
-% fweiter Symbole bereit, welche sistyle braucht. Ausserdem diese Befehle \micro,
-% \ohm, \SIdecimalsign{,}(legt die trennung bei Dezimalzahlen fest)
-% \SIproductsign{\cdot} (legt das Multiplikationszeichen fest) \SIgroupfourfalse
-% erzeugt bei grossen Zahlen kleine Abstaende zwischen 3ergruppen \ang{zahl} ist das
-% gradzeichen.
-\usepackage{mathrsfs} %Stellt schreibschrift zur verfuegung im Mathemoduns mit \mathscr
-
-%1.01 LAYOUTPAKETE
-\usepackage[left = 2.5 cm, right = 2.5 cm, top = 2.5 cm, bottom = 3cm]{geometry} %a4paper
-% left = 3.5 cm, right = 3.5 cm, top = 3.3 cm, bottom = 6.6cm
-%\usepackage{fancyhdr}%Wird fuer erweiterte Kopf- und Fusszeileneinstellungen benoetigt.
-
-%\usepackage{enumerate}%Stellt die freie Auswahl von Aufzaehlungszeichen zur Verfuegung
-\usepackage[shortlabels]{enumitem} %Anpassbare Enumerates/Itemizes mit [label=]
-									%shortlabels: komp.  zu enumerate
-%Packete zur benutzung des KOMA-Paketes fuer europaeische Layouts also zur
-%Benutzung von 'scrartcl' fuer Artikel, 'scrreprt' fuer umfangreiche %Artikel und
-%Artikelsammlungen, 'scrbook' fuer Buecher und %'scrlettr2' fuer Briefe:
-%\usepackage{scrpage2} %fuer Kopf- und Fusszeilen, 
-%\usepackage{scrdate,scrtime}% fuer Wochentag und Uhrzeit, 
-%\usepackage{scraddr}
-%zur Loesung von Problemen mit Paketabhaengigkeiten scrfile sowie fuer
-%Briefadressverwaltung scraddr. 
-
-%%%% neue Befehle
-%Zahlensymbole
-
-%1.1PAKETE NOTWENDIG FUER MATHEMATISCHE FORMELN 
-\usepackage{amsfonts}%Fonts = Schriftarten der American mathematical Society (ams)
-\usepackage{amssymb}%Mathematische Symbole der ams.
-\usepackage{bbm}
-\usepackage{amsmath}
-% \ifluatex
-%    \usepackage{unicode-math}
-% \else
-% 
-% \fi
-
-%Definiert viele weitere Befehle fuer mathematischen Formeln und darueber hinaus.
-\usepackage{exscale}
-% Skaliert mathematische Symbole in anderen Schriftarten als ‚cmex10‘, so dass
-% falls die Schriftart in anderen Groessen als 10pt vorliegt diese angepasst
-% werden koennen
-\usepackage{amstext}
-% erlaubt es in abgesetzten Gleichungen mit \text kurzen Text einzufuegen.
-%\usepackage{amsextra}%hauptsaechlich fuer die Kompatibilitaet von Dokumenten
-%gebraucht.
-%\usepackage[arrow,matrix,curve]{xy} 
-% Packet xy-pic um Kommutative Diagramme und
-% zweidim Zeichnungen zu %zeichnen.in den eckigen Klammern stehen Module die
-% geladen werden, je nach dem was man braucht. In der %Matheumgebung wird das so
-% benutzt: \begin{xy} ...\end{xy}
-
-%Theoremumgebungen
-\usepackage{amsthm}%Ermoeglicht kontrolle ueber die Theorem-Umgebung beisst
-%sich mit ntheorem funktioniert aber mit \usepackage{thmtools}
-\usepackage{thm-patch,aliasctr,parseargs,keyval}
-\usepackage{thmtools}
-
-%stellt \declaretheorem[style=definition,qed=$\rtimes$]{definition}
-%zur verfuegung
-% There ist a bug in thmtools. After Latex Upgrade change line 48 in thm-autoref.sty so that
-% it reads
-% \csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-% then run texhash
-
-%Erlaubt das Setzen fetter Symbole mit \boldymbol{} bzw\pmb{}
-\usepackage{bm} 
-\usepackage{amsbsy}
-% stellt die Befehle \bm \hm zur Verfuegung, um mathematische
-% Symbole fett zu machen. Muss nach allen Fontpacketen geladen %werden!!!
-
-\ifluatex
-  %\usepackage{unicode-math}
-\else
-  % if LUALaTeX is used uncomment this
-  %\usepackage{uniinput} %ermoeglicht die Eingabe von unicode Zeichen
-\fi
-
-%\usepackage{listings} 
-%Wird verwendet um sourcecode zu TeXen, stellt 
-%\begin{lstlisting} .. \end{lstlisting} und \lstinputlisting zur Verfuegung
-                                                                   
- 
-%2.PAKETE FUER GRAFIKEN UND GLEITOBJEKTE
-\usepackage{float,scrhack}
-%Stellt zusaetzliche Befehle fuer Gleitobjekte zur Verfuegung
-\usepackage{wrapfig}
-%Stellt die Moeglichkeit zur Verfuegung Text um Bilder herumlaufen zu lassen.
-\usepackage[textfont=it,labelfont=bf,format=plain]{caption}
-% Ermoeglicht das einstellen von figureumgebungen
-\usepackage{subcaption}
-
-\usepackage{array}%Verbessert die Darstellung von Tabellen und stellt erweiterte Befehle
-%zur Verfuegung.
-\usepackage{hhline} %stellt den \hhline in Tabellen zur Verfuegung
-\usepackage{delarray}
-%stellt eine einfachere Umgebung fuer begrenzte Arrays zur
-%Verfuegung.\begin{array} LB {<Spaltenvereinbarung>} RB
-
-% das tabu Packet, ein machtiges Tabellenpaket
-\usepackage{tabu}
-\usepackage{colortbl} % Farben in Tabellenzeilen
-
-%\usepackage{flafter} %Verhindert, dass Gleitobjekte in einem Dokument vor die
-%Stelle gesetzt werden, an der sie in der Eingabedatei %aufgebaut werden.
-%\usepackage{graphpap}%Zum Setzen von „Millimeter“-Papier. Es definiert den
-%graphics paper-Befehl in der picture-Umgebung. 
-
-%\usepackage[]{graphicx} %vorsicht, laedt hyperref
-%\usepackage{sidecap}
-%Für das malen von Graphen
-%Für das malen von Grafiken
-% waehle zunaechst das richtige Treiberbackend fuer Tikz.
-% beamer erkennt z. T nicht das richtige backend. pgfsys-pdf.def ist die Option, die am meisten unterstuetzt.
-%Für das malen von Graphen
-\usepackage{tikz}
-\usepackage{pgfplots}
-\pgfplotsset{compat=newest,%
-%	     width=0.49\textwidth%
-	     every axis plot post/.append style={
-	      every mark/.append style={scale=0.8,solid},
-	     }
-}
-\usetikzlibrary{arrows,%
-		arrows.meta,%
-                petri,%
-                topaths,%
-		fit,%
-		positioning,%
-		decorations.pathmorphing,%
-		backgrounds,
-		calc,%
-}%
-
-% Ausgabe von Grafiken als externe Grafik
-\usetikzlibrary{external}
-\usepgfplotslibrary{external}
-%\tikzset{external/optimize=true}%
-%% tikzset von Jim
-\tikzset{external/system call={lualatex \tikzexternalcheckshellescape --shell-escape -halt-on-error 
--interaction=batchmode -jobname "\image" "\texsource"}}
-
-%%%%%%% convert externalized tikzgraphics to png
-%optional png setup
-\tikzset{
-  png export/.style={
-    external/system call=%
-    {lualatex \tikzexternalcheckshellescape --shell-escape -halt-on-error -interaction=batchmode -jobname 
-"\image" "\texsource" && %
-    convert -density 300 "\image.pdf" "\image.png"},
-  }
-}
-
-\tikzset{%
-  % Add size information to the .dpth file (png is in density not size)
-  /pgf/images/external info,
-  % Use the png export AND the import
-  use png/.style={png export,png import},
-  png import/.code={%
-    \tikzset{%
-      /pgf/images/include external/.code={%
-	% Here you can alter to whatever you want
-	% \pgfexternalwidth is only available if /pgf/images/external info
-	% is set
-	\includegraphics%
-	[width=\pgfexternalwidth,height=\pgfexternalheight]%
-	{{##1}.png}%
-      }%
-    }%
-  }%
-}
-
-% dann kann man das mit
-\tikzset{png export}
-% \tikzset{use png}
-% im dokument aktivieren.
-%%%%%%% END convert externalized tikzgraphics to png %%%%%%%%%%%%%%%%%%%
-
-% \tikzset{external/system call= {pdflatex -enable-write18 -shell-escape %
-% % % 				  -save-size=80000 %
-% % %                                -pool-size=100000000 %
-% % %                                -extra-mem-top=500000000 %
-% % %                                -extra-mem-bot=100000000 %
-% % %                                -main-memory=900000000 %
-%                                \tikzexternalcheckshellescape %
-%                                -halt-on-error %
-%                                -interaction=batchmode %
-%                                -jobname "\image" "\texsource"}} 
-\tikzexternalize[%
-% %mode=graphics if exists,
-  up to date check=md5,
-  figure list=true,
-  prefix=Tikzcache/,%
- ]
-\tikzifexternalizing{%
-% don’t include package XYZ here
-}{%
-%hier kommen Pakete hinzu, die Probleme mit der external library von tikz haben
-\usepackage{pdfpages}
-%\usepackage{vmargin}
-% this package is incompatible with tikz externalization and is problematic
-%\usepackage[textsize=normal,textwidth=2cm,obeyFinal]{todonotes}
-% %obeyDraft lässt die Notes erscheinen, wenn man draft an hat und nicht, wenn nicht. Vertraegt sich nicht mit hyperref
-% % % additional todo stuff
-% % % extra functionality for todonotes taken from the manual
-% % % usage: \mycomment[HSM]{Testing second time.}.
-% \newcounter{mycomment}
-% \newcommand{\mycomment}[2][]{%
-% % initials of the author (optional) + note in the margin
-% \refstepcounter{mycomment}%
-% {%
-%   \setstretch{0.7}% spacing
-%   \todo[color={red!100!green!33},size=\small]{%
-%   \textbf{Comment [\uppercase{#1}\themycomment]:}~#2}%
-% }}
-% %
-% % mark whole section
-% \newcommand\todoin[2][]{\todo[color={green},inline, caption={2do}, #1]{
-% \begin{minipage}{\textwidth-4pt}#2\end{minipage}}}
-% % This example renders like
-% % \todoin{
-% %   Some text.
-% %   \begin{align}
-% %   \sin(\theta)^2 + \cos(\theta)^2 = 1
-% %   \end{align}
-% %   A formula and a list
-% %   \begin{itemize}
-% %     \item An item
-% %   \end{itemize}
-% % }
-% %
-% % numbered todonotes 
-% \newcommand{\ntodo}[2][]{\todo[#1]{\thesubsection{}. #2}}
-% % combining everything
-% \newcounter{todoListItems}
-% \newcommand{\sstodo}[2][]
-% {\addtocounter{todoListItems}{1}
-% \todo[caption={\protect\hypertarget{todo\thetodoListItems}{}\thesection. #2}, #1]
-% {\begin{spacing}{1} \hfill \hyperlink{todo\thetodoListItems}{#2} \end{spacing} }}
-}%
-
-
-%\usepackage[position=top]{subfig}
-% % BIBLIOGRAPHIE 
-% \usepackage[
-% 	  backend=biber,
-% %	  bibliographystyle=alphabetic,
-% 	  style=nature,		%globaler Style (Zitier- und Bibstil)
-% 	  citestyle=numeric, 	% Zitierstil
-% % % %	  bibliographystyle=chem-acs,	% Bibliographiestil
-% % 	  firstinits=true, 		% Vornamen abruerzen
-% % 	  sorting=nty, %sort by name,title,year
-% % 	  maxbibnames=99,
-% % %         maxnames=99,
-% %           language=british,
-% % %          abbreviate=true,
-%  	  doi=false,
-% %     isbn=false,
-%      url=false,
-%      sortcites=true,
-%      backref=true,
-%      defernumbers=true,
-% ]{biblatex}
-% \addbibresource{articlebibliography.bib}
-% 
-
-%3.PAKETE, DIE DAS ERSTELLEN EINES INDEX ERLEICHTERN
-%\usepackage{makeidx} 
-%'makeidx' Stellt Befehle fuer Indexerstellung zur Verfuegung.
-%\usepackage{showidx}%'showidx'bewirkt die Anzeige von Indexeintraegen %im
-%Randbereich.
-
-%3.SONSTIGE NUETZLICHE PAKETE
-%\usepackage{ifthen}%Definiert einfache Strukturen der Programmiersprachen
-\usepackage{verbatim}
-%\usepackage{alltt} % verbatim-Umgebung mit Interpretation von Befehlen.
-%Analysepaket zur ueberpruefung der Korrektheit der Syntax bei unterdrueckter
-%Ausgabe:
-%\usepackage{syntonly}% stellt dem Anwender den Befehl '\syntaxonly'zur Verfuegung,
-%der in der Praeambel angegeben werden muss, um beim
-%Formatieren die Ausgabe zu unterdruecken; eine bereits vorhandene .dvi-Datei
-%bleibt also erhalten.
-
-
-%%%% REFERENZIERUNG %%%%% 
-% Die Reihenfolge der folgenden 4 Packete ist wichtig.
-\usepackage{nameref}
-\usepackage[english]{varioref}%Stellt erweiterte Befehle zur Referenzierung von
-%Gleitobjekten zur Verfuegung
-\usepackage{hyperref}
-\hypersetup{
-%       pdfpagelabels=true,	% set pdf page lables
-%      naturalnames=true,     % use \Latex-computed names for links
-%     bookmarks=true,         % show bookmarks bar?
-      unicode=true,           % non-Latin characters in Acrobat’s bookmarks
-%     pdftoolbar=true,        % show Acrobat’s toolbar?
-%     pdfmenubar=true,        % show Acrobat’s menu?
-%     pdffitwindow=false,     % window fit to page when opened
-%     pdfstartview={FitH},    % fits the width of the page to the window
-%     pdftitle={My title},    % title
-%     pdfauthor={Author},     % author
-%     pdfsubject={Subject},   % subject of the document
-%     pdfcreator={Creator},   % creator of the document
-%     pdfproducer={Producer}, % producer of the document
-%     pdfkeywords={keyword1, key2, key3}, % list of keywords
-%     pdfnewwindow=true,      % links in new PDF window
-     plainpages=false,		% do page number anchors as plain arabic
-%     colorlinks=false,       % false: boxed links; true: colored links
-%     hidelinks=true,
-%     hyperfigures=true,
-     linkcolor=blue,          % color of internal links (change box color with linkbordercolor)
-     citecolor=darkgreen,        % color of links to bibliography
-     filecolor=black,      % color of file links
-     urlcolor=blue           % color of external links
-     pdfborder={0 0 1},		% width of pdf link border 0 0 1, 0 0 0 = colorlinks 
-     linkbordercolor=gray!15,
-     citebordercolor=green!15,
-}
-% Old hyperref options
-%[citecolor=black,urlcolor=blue,linkcolor=blue,colorlinks=true,pdfborder={0 0 %
-%0},pdfpagelabels,plainpages=false,naturalnames,unicode]
-\usepackage{memhfixc}
-%\usepackage[ngerman,capitalize]{cleveref}
-\usepackage[capitalize]{cleveref}
-
-\usepackage{bookmark}
-% Fix fuer das referenzieren von figures
-%\usepackage[all]{hypcap}
-
-
-%SEITENEINSTELLUNGEN
-\setlength{\parindent}{0cm} %Hebt die Einrueckung von Absaetzen auf.
-\linespread{1.35}
-%\setlength{\textwidth}{14.5cm} %Legt die Textbreite fest
-\pagestyle{myheadings} 
-%\usepackage{titlepage}
-
-%'plain' wuerde den Seitenkopf leer lassen aber die Seiten unten
-%mittig durchnummerieren. 'empty' laesst die Seite komplett leer
-%\markright{\today\hfill}
-%\usepackage{changepage}
-\allowdisplaybreaks[1] %Erlaubt bei der Align-Umgebung dass Zeilen auf
-%verschiedene Seiten gesetzt werden. die zahlen 1-4 koennen angegeben werden um
-%das Umbrechen noch weiter zu forcieren.
-
-%\pagestyle{fancy}  \fancyhf{}  
-%\renewcommand{\headrulewidth}{0.4 pt}%Strichdicke  
-%\setlength{\headheight}{1.2 cm}%Hoehe der Kopfzeile
- 
-%\fancyhead[EL]{\page}
-%\fancyhead[ER]{\textsc{\rightmark}}
-%\fancyhead[C]{{\Large \textbf{FK019 freier Fall, g-Leiter}}\\\small 24.10.2008}
-%\fancyhead[OR]{\page}
-%\fancyhead[OL]{\textsc{\rightmark}}
-
-%% todo makros
-
-% self made todo solution
-\newcommand{\todo}[1]{\marginpar{\textcolor{red}{[\textbf{TODO:} #1]}}}
-\newcommand{\todox}[1]{\textcolor{red}{[\textbf{TODO:} #1]}} 
-
-%INDEXERSTELLUNG
-
-%\makeindex %erstellt ein indexfile. soll man am schluss erst machen!
-%\makeglossary
-%\includeonly{1laag1}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - HIER BEGINNT DAS DOKUMENT -
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/lualatexartikelpraeambel.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/lualatexartikelpraeambel.tex
deleted file mode 100644
index 7955fee..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/lualatexartikelpraeambel.tex
+++ /dev/null
@@ -1,340 +0,0 @@
-%Dies ist der Kopf meiner Skripte. Er enthaelt alle Pakete und Einstellungen
-
-%%% BUG FIXING SECTION
-% There ist a bug in thmtools. After Latex Upgrade change line 48 in thm-autoref.sty so that
-% it reads
-%\csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-% then run texhash
-
-%MAKROPAKETE
-%1.PAKETE DIE MIT DER KODIERUNG VON ZEICHEN ZU TUN HABEN.
-%\usepackage[german]{babel}
-%Definition von Sprachabhaengigen Komponenten insbesondere fuer Dokumente
-%in anderen Sprachen als Englisch
-\usepackage{fixltx2e}
-\usepackage{etex} %some fix for hyperref
-%Korrektur einiger Fehler die sich in LaTeX2e eingeschlichen haben. 
-%\usepackage{ngerman} 
-% stellt Sonderzeichen und ihre Befehle wie zum Beispiel "o zur Verfuegung
-
-%%%%%%%%%%%% SCHRIFTEN %%%%%%%%%%%%%%%%%%%%%%%%
-%\usepackage{mathpazo}%andere Schriftart
-%\usepackage{lmodern}
-%\usepackage{beramono}
-% Using Courier font
-\renewcommand{\ttdefault}{pcr}
-%Tweak, damit auch im Mathemodus tt-schrift fettgedruckt werden kann.
-
-%%%% PDFLaTeX or LUALaTeX %%%%%%%
-%% if pdflatex is used uncomment the following packages. If lualatex is used comment them.
-%dieses Paket ermoeglicht die Eingabe von Sonderzeichen ueber die Tastatur
-% \usepackage[utf8]{inputenx}
-% %additions for utf8
-% \input{ix-utf8enc.dfu}
-%% comment \usepackage{uiinput} if lulatex is used! line 131
-%% if pdflatex is used uncomment above packages. If lualatex is used comment them.
-\usepackage{microtype}
-\usepackage[dvipsnames,svgnames,table]{xcolor} % Farben
-
-\usepackage[T1]{fontenc} %Kodierung von Zeichensaetzen. 
-	%Das optionale Argument <Kodierung> kann eine durch Komma getrennte Liste von
-%Kodierungen enthalten. Im Text koennte dann an %beliebiger %Stelle zum wechseln der
-%Kodierung die Befehlsfolge:
-    		%\fontencoding{<Kodierung>}
-    		%\selectfont
-	%verwendet werden. Gaengige Kodierungen sind:
-%                           Tabelle 5.4: Kodierungen
-%         T1      8-Bit-Standard fuer EC-Fonts	 
-%         TS      8-Bit-Zeichenkodierung fuer TS-Fonts
-%         OT1      7-Bit-Kodierung fuer Text1 , CM-Fonts
-%         OML      7-Bit-Kodierung fuer Formeltext1
-%         OMS      7-Bit-Kodierung fuer mathematische Symbole1
-%         OMX      7-Bit-Kodierung fuer erweiterte mathematische Symbole1
-\usepackage{latexsym}
-%Definiert zusaetzliche Symbolbefehle.
-\usepackage[full]{textcomp}
-% Sammlung von Textsymbolen. Optional kann [safe] oder [full]
-% als Option hinzugefuegt werden, lezteres aber nur bei
-%CM und EC-Fonts
-
-\usepackage{eucal}
-%Stellt deutsche Frakturschrift im Math Modus zur Verfuegung bei \mathcal
-%\usepackage{sistyle,upgreek}
-%\usepackage{fixmath}
-% sistyle stellt \SI{Masszahl}{Einheit}
-% bereit, zur si-konformen Darstellung von phy Goessen. textcom und upgreek stellt
-% fweiter Symbole bereit, welche sistyle braucht. Ausserdem diese Befehle \micro,
-% \ohm, \SIdecimalsign{,}(legt die trennung bei Dezimalzahlen fest)
-% \SIproductsign{\cdot} (legt das Multiplikationszeichen fest) \SIgroupfourfalse
-% erzeugt bei grossen Zahlen kleine Abstaende zwischen 3ergruppen \ang{zahl} ist das
-% gradzeichen.
-\usepackage{mathrsfs} %Stellt schreibschrift zur verfuegung im Mathemoduns mit \mathscr
-
-%1.01 LAYOUTPAKETE
-\usepackage[left = 2.5 cm, right = 2.5 cm, top = 2.5 cm, bottom = 3cm]{geometry} %a4paper
-% left = 3.5 cm, right = 3.5 cm, top = 3.3 cm, bottom = 6.6cm
-%\usepackage{fancyhdr}%Wird fuer erweiterte Kopf- und Fusszeileneinstellungen benoetigt.
-
-%\usepackage{enumerate}%Stellt die freie Auswahl von Aufzaehlungszeichen zur Verfuegung
-\usepackage[shortlabels]{enumitem} %Anpassbare Enumerates/Itemizes mit [label=]
-									%shortlabels: komp.  zu enumerate
-%Packete zur benutzung des KOMA-Paketes fuer europaeische Layouts also zur
-%Benutzung von 'scrartcl' fuer Artikel, 'scrreprt' fuer umfangreiche %Artikel und
-%Artikelsammlungen, 'scrbook' fuer Buecher und %'scrlettr2' fuer Briefe:
-%\usepackage{scrpage2} %fuer Kopf- und Fusszeilen, 
-%\usepackage{scrdate,scrtime}% fuer Wochentag und Uhrzeit, 
-%\usepackage{scraddr}
-%zur Loesung von Problemen mit Paketabhaengigkeiten scrfile sowie fuer
-%Briefadressverwaltung scraddr. 
-
-%%%% neue Befehle
-%Zahlensymbole
-
-%1.1PAKETE NOTWENDIG FUER MATHEMATISCHE FORMELN 
-\usepackage{amsfonts}%Fonts = Schriftarten der American mathematical Society (ams)
-\usepackage{amssymb}%Mathematische Symbole der ams.
-\usepackage{bbm}
-\usepackage{amsmath} 
-%Definiert viele weitere Befehle fuer mathematischen Formeln und darueber hinaus.
-\usepackage{exscale}
-% Skaliert mathematische Symbole in anderen Schriftarten als ‚cmex10‘, so dass
-% falls die Schriftart in anderen Groessen als 10pt vorliegt diese angepasst
-% werden koennen
-\usepackage{amstext}
-% erlaubt es in abgesetzten Gleichungen mit \text kurzen Text einzufuegen.
-%\usepackage{amsextra}%hauptsaechlich fuer die Kompatibilitaet von Dokumenten
-%gebraucht.
-%\usepackage[arrow,matrix,curve]{xy} 
-% Packet xy-pic um Kommutative Diagramme und
-% zweidim Zeichnungen zu %zeichnen.in den eckigen Klammern stehen Module die
-% geladen werden, je nach dem was man braucht. In der %Matheumgebung wird das so
-% benutzt: \begin{xy} ...\end{xy}
-
-%Theoremumgebungen
-\usepackage{amsthm}%Ermoeglicht kontrolle ueber die Theorem-Umgebung beisst
-%sich mit ntheorem funktioniert aber mit \usepackage{thmtools}
-\usepackage{thm-patch,aliasctr,parseargs,keyval}
-\usepackage{thmtools}
-%stellt \declaretheorem[style=definition,qed=$\rtimes$]{definition}
-%zur verfuegung
-% There ist a bug in thmtools. After Latex Upgrade change line 48 in thm-autoref.sty so that
-% it reads
-% \csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-% then run texhash
-
-%Erlaubt das Setzen fetter Symbole mit \boldymbol{} bzw\pmb{}
-\usepackage{bm} 
-\usepackage{amsbsy}
-% stellt die Befehle \bm \hm zur Verfuegung, um mathematische
-% Symbole fett zu machen. Muss nach allen Fontpacketen geladen %werden!!!
-
-% if LUALaTeX is used uncomment this
-%\usepackage{uniinput} %ermoeglicht die Eingabe von unicode Zeichen
-
-
-%\usepackage{listings} 
-%Wird verwendet um sourcecode zu TeXen, stellt 
-%\begin{lstlisting} .. \end{lstlisting} und \lstinputlisting zur Verfuegung
-                                                                   
- 
-%2.PAKETE FUER GRAFIKEN UND GLEITOBJEKTE
-\usepackage{float,scrhack}
-%Stellt zusaetzliche Befehle fuer Gleitobjekte zur Verfuegung
-\usepackage{wrapfig}
-%Stellt die Moeglichkeit zur Verfuegung Text um Bilder herumlaufen zu lassen.
-\usepackage[textfont=it,labelfont=bf,format=plain]{caption}
-% Ermoeglicht das einstellen von figureumgebungen
-\usepackage{subcaption}
-
-\usepackage{array}%Verbessert die Darstellung von Tabellen und stellt erweiterte Befehle
-%zur Verfuegung.
-\usepackage{hhline} %stellt den \hhline in Tabellen zur Verfuegung
-\usepackage{delarray}
-%stellt eine einfachere Umgebung fuer begrenzte Arrays zur
-%Verfuegung.\begin{array} LB {<Spaltenvereinbarung>} RB
-
-% das tabu Packet, ein machtiges Tabellenpaket
-\usepackage{tabu}
-\usepackage{colortbl} % Farben in Tabellenzeilen
-
-%\usepackage{flafter} %Verhindert, dass Gleitobjekte in einem Dokument vor die
-%Stelle gesetzt werden, an der sie in der Eingabedatei %aufgebaut werden.
-%\usepackage{graphpap}%Zum Setzen von „Millimeter“-Papier. Es definiert den
-%graphics paper-Befehl in der picture-Umgebung. 
-
-%\usepackage[]{graphicx} %vorsicht, laedt hyperref
-%\usepackage{sidecap}
-%Für das malen von Graphen
-%Für das malen von Grafiken
-% waehle zunaechst das richtige Treiberbackend fuer Tikz.
-% beamer erkennt z. T nicht das richtige backend. pgfsys-pdf.def ist die Option, die am meisten unterstuetzt.
-%Für das malen von Graphen
-\usepackage{tikz}
-\usepackage{pgfplots}
-\pgfplotsset{compat=newest}
-\usetikzlibrary{arrows,%
-%                 petri,%
-%                topaths,%
-%		fit,%
-%		positioning,%
-%		decorations.pathmorphing,%
-%		backgrounds,%
-}%
-
-% Ausgabe von Grafiken als externe Grafik
-\usetikzlibrary{external}
-% \usepgfplotslibrary{external}
-\tikzset{external/optimize=true}%
-% \tikzset{external/system call= {pdflatex -enable-write18 -shell-escape %
-% % % 				  -save-size=80000 %
-% % %                                -pool-size=100000000 %
-% % %                                -extra-mem-top=500000000 %
-% % %                                -extra-mem-bot=100000000 %
-% % %                                -main-memory=900000000 %
-%                                \tikzexternalcheckshellescape %
-%                                -halt-on-error %
-%                                -interaction=batchmode %
-%                                -jobname "\image" "\texsource"}} 
-\tikzexternalize[%
-% %mode=graphics if exists,
-  up to date check=md5,
- figure list=true,
- prefix=Tikzcache/,%
- ]
-\tikzifexternalizing{%
-% don’t include package XYZ here
-}{%
-%hier kommen Pakete hinzu, die Probleme mit der external library von tikz haben
-%\usepackage{pdfpages}
-%\usepackage{vmargin}
-% this package is incompatible with tikz externalization and is problematic
-}%
-% \usepackage[textsize=normal,textwidth=2cm,obeyFinal]{todonotes}
-% %obeyDraft lässt die Notes erscheinen, wenn man draft an hat und nicht, wenn nicht. Vertraegt sich nicht mit hyperref
-
-% % additional todo stuff
-% % extra functionality for todonotes taken from the manual
-% % usage: \mycomment[HSM]{Testing second time.}.
-% \newcounter{mycomment}
-% \newcommand{\mycomment}[2][]{%
-% % initials of the author (optional) + note in the margin
-% \refstepcounter{mycomment}%
-% {%
-%   \setstretch{0.7}% spacing
-%   \todo[color={red!100!green!33},size=\small]{%
-%   \textbf{Comment [\uppercase{#1}\themycomment]:}~#2}%
-% }}
-% 
-% % mark whole section
-% \newcommand\todoin[2][]{\todo[color={green},inline, caption={2do}, #1]{
-% \begin{minipage}{\textwidth-4pt}#2\end{minipage}}}
-% % This example renders like
-% % \todoin{
-% % 	Some text.
-% % 	\begin{align}
-% % 	\sin(\theta)^2 + \cos(\theta)^2 = 1
-% % 	\end{align}
-% % 	A formula and a list
-% % 	\begin{itemize}
-% % 		\item An item
-% % 	\end{itemize}
-% % }
-% 
-% % numbered todonotes 
-% \newcommand{\ntodo}[2][]{\todo[#1]{\thesubsection{}. #2}}
-% % combining everything
-% \newcounter{todoListItems}
-% \newcommand{\sstodo}[2][]
-% {\addtocounter{todoListItems}{1}
-% \todo[caption={\protect\hypertarget{todo\thetodoListItems}{}\thesection. #2}, #1]
-% {\begin{spacing}{1} \hfill \hyperlink{todo\thetodoListItems}{#2} \end{spacing} }}
-
-
-%\usepackage[position=top]{subfig}
-% BIBLIOGRAPHIE 
-\usepackage[
-	  backend=biber,
-%	  bibliographystyle=alphabetic,
-%	  style=ieee,		%globaler Style (Zitier- und Bibstil)
-	  citestyle=numeric, 	% Zitierstil
-%	  bibliographystyle=chem-acs,	% Bibliographiestil
-	  firstinits=true, 		% Vornamen abruerzen
-	  sorting=nty, %sort by name,title,year
-	  maxbibnames=99,
-%         maxnames=99,
-          language=british,
-%          abbreviate=true,
-	  doi=false,
-          isbn=false,
-          url=false,
-          sortcites=true,
-          backref=true,
-          defernumbers=true,
-]{biblatex}
-\addbibresource{/home/seusdd/Dissertation/Bibliographie/dissertationsliteratur.bib}
-
-
-%3.PAKETE, DIE DAS ERSTELLEN EINES INDEX ERLEICHTERN
-%\usepackage{makeidx} 
-%'makeidx' Stellt Befehle fuer Indexerstellung zur Verfuegung.
-%\usepackage{showidx}%'showidx'bewirkt die Anzeige von Indexeintraegen %im
-%Randbereich.
-
-%3.SONSTIGE NUETZLICHE PAKETE
-%\usepackage{ifthen}%Definiert einfache Strukturen der Programmiersprachen
-%\usepackage{alltt} % verbatim-Umgebung mit Interpretation von Befehlen.
-%Analysepaket zur ueberpruefung der Korrektheit der Syntax bei unterdrueckter
-%Ausgabe:
-%\usepackage{syntonly}% stellt dem Anwender den Befehl '\syntaxonly'zur Verfuegung,
-%der in der Praeambel angegeben werden muss, um beim
-%Formatieren die Ausgabe zu unterdruecken; eine bereits vorhandene .dvi-Datei
-%bleibt also erhalten.
-
-
-%%%% REFERENZIERUNG %%%%% 
-% Die Reihenfolge der folgenden 4 Packete ist wichtig.
-\usepackage{nameref}
-\usepackage[english]{varioref}%Stellt erweiterte Befehle zur Referenzierung von
-%Gleitobjekten zur Verfuegung
-\usepackage[citecolor=black,urlcolor=blue,linkcolor=blue,colorlinks=true,pdfborder={0 0 %
-0},pdfpagelabels,plainpages=false,naturalnames,unicode]{hyperref}
-\usepackage{memhfixc}
-%\usepackage[ngerman,capitalize]{cleveref}
-\usepackage[]{cleveref}
-
-\usepackage{bookmark}
-% Fix fuer das referenzieren von figures
-%\usepackage[all]{hypcap}
-
-
-%SEITENEINSTELLUNGEN
-\setlength{\parindent}{0cm} %Hebt die Einrueckung von Absaetzen auf.
-%\setlength{\textwidth}{14.5cm} %Legt die Textbreite fest
-\pagestyle{myheadings} 
-%\usepackage{titlepage}
-
-%'plain' wuerde den Seitenkopf leer lassen aber die Seiten unten
-%mittig durchnummerieren. 'empty' laesst die Seite komplett leer
-%\markright{\today\hfill}
-%\usepackage{changepage}
-\allowdisplaybreaks[1] %Erlaubt bei der Align-Umgebung dass Zeilen auf
-%verschiedene Seiten gesetzt werden. die zahlen 1-4 koennen angegeben werden um
-%das Umbrechen noch weiter zu forcieren.
-
-%\pagestyle{fancy}  \fancyhf{}  
-%\renewcommand{\headrulewidth}{0.4 pt}%Strichdicke  
-%\setlength{\headheight}{1.2 cm}%Hoehe der Kopfzeile
- 
-%\fancyhead[EL]{\page}
-%\fancyhead[ER]{\textsc{\rightmark}}
-%\fancyhead[C]{{\Large \textbf{FK019 freier Fall, g-Leiter}}\\\small 24.10.2008}
-%\fancyhead[OR]{\page}
-%\fancyhead[OL]{\textsc{\rightmark}}
-
-%% todo makros
-
-% self made todo solution
-\newcommand{\todo}[1]{\marginpar{\textcolor{red}{[\textbf{TODO:} #1]}}}
-\newcommand{\todox}[1]{\textcolor{red}{[\textbf{TODO:} #1]}} 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/special_symbols.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/special_symbols.tex
deleted file mode 100644
index c697716..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/special_symbols.tex
+++ /dev/null
@@ -1,206 +0,0 @@
-%% SPECIAL INTEGRAL SIGNS
-% The following example defines macro
-% 
-% \mint{<symbol>}\limits_{...} ^{...} %statt \limits kann auch  \nolimits \displaylimits_stehen
-% 
-%     The first argument is the symbol that is put in smaller math style in the middle of the integral symbol.
-%     Then a limits specification follows, any number and order. The last one is used.
-%     Then one subscript and/or one superscript can follow in any order, but at most one of each type.
-% 
-% The implementation takes care of:
-% 
-%     the current math style,
-%     calculates the correct position for the middle of the integral
-%     even, if subscript and/or superscript are given with \limits,
-%     lets the horizontal spacing around the symbol intact and
-%     is aware of \mathsurround.
-
-
-\makeatletter
-\newcommand*{\mint}[1]{%
-  % #1: overlay symbol
-  \mint@l{#1}{}%
-}
-\newcommand*{\mint@l}[2]{%
-  % #1: overlay symbol
-  % #2: limits
-  \@ifnextchar\limits{%
-    \mint@l{#1}%
-  }{%
-    \@ifnextchar\nolimits{%
-      \mint@l{#1}%
-    }{%
-      \@ifnextchar\displaylimits{%
-        \mint@l{#1}%
-      }{%
-        \mint@s{#2}{#1}%
-      }%
-    }%
-  }%
-}
-\newcommand*{\mint@s}[2]{%
-  % #1: limits
-  % #2: overlay symbol
-  \@ifnextchar_{%
-    \mint@sub{#1}{#2}%
-  }{%
-    \@ifnextchar^{%
-      \mint@sup{#1}{#2}%
-    }{%
-      \mint@{#1}{#2}{}{}%
-    }%
-  }%
-}
-\def\mint@sub#1#2_#3{%
-  \@ifnextchar^{%
-    \mint@sub@sup{#1}{#2}{#3}%
-  }{%
-    \mint@{#1}{#2}{#3}{}%
-  }%
-}
-\def\mint@sup#1#2^#3{%
-  \@ifnextchar_{%
-    \mint@sub@sup{#1}{#2}{#3}%
-  }{%
-    \mint@{#1}{#2}{}{#3}%
-  }%
-}
-\def\mint@sub@sup#1#2#3^#4{%
-  \mint@{#1}{#2}{#3}{#4}%
-}
-\def\mint@sup@sub#1#2#3_#4{%
-  \mint@{#1}{#2}{#4}{#3}%
-}
-\newcommand*{\mint@}[4]{%
-  % #1: \limits, \nolimits, \displaylimits
-  % #2: overlay symbol: -, =, ...
-  % #3: subscript
-  % #4: superscript
-  \mathop{}%
-  \mkern-\thinmuskip
-  \mathchoice{%
-    \mint@@{#1}{#2}{#3}{#4}%
-        \displaystyle\textstyle\scriptstyle
-  }{%
-    \mint@@{#1}{#2}{#3}{#4}%
-        \textstyle\scriptstyle\scriptstyle
-  }{%
-    \mint@@{#1}{#2}{#3}{#4}%
-        \scriptstyle\scriptscriptstyle\scriptscriptstyle
-  }{%
-    \mint@@{#1}{#2}{#3}{#4}%
-        \scriptscriptstyle\scriptscriptstyle\scriptscriptstyle
-  }%
-  \mkern-\thinmuskip
-  \int#1%
-  \ifx\\#3\\\else_{#3}\fi
-  \ifx\\#4\\\else^{#4}\fi  
-}
-\newcommand*{\mint@@}[7]{%
-  % #1: limits
-  % #2: overlay symbol
-  % #3: subscript
-  % #4: superscript
-  % #5: math style
-  % #6: math style for overlay symbol
-  % #7: math style for subscript/superscript
-  \begingroup
-    \sbox0{$#5\int\m@th$}%
-    \sbox2{$#5\int_{}\m@th$}%
-    \dimen2=\wd0 %
-    % => \dimen2 = width of \int
-    \let\mint@limits=#1\relax
-    \ifx\mint@limits\relax
-      \sbox4{$#5\int_{\kern1sp}^{\kern1sp}\m@th$}%
-      \ifdim\wd4>\wd2 %
-        \let\mint@limits=\nolimits
-      \else
-        \let\mint@limits=\limits
-      \fi
-    \fi
-    \ifx\mint@limits\displaylimits
-      \ifx#5\displaystyle
-        \let\mint@limits=\limits
-      \fi
-    \fi
-    \ifx\mint@limits\limits
-      \sbox0{$#7#3\m@th$}%
-      \sbox2{$#7#4\m@th$}%
-      \ifdim\wd0>\dimen2 %
-        \dimen2=\wd0 %
-      \fi
-      \ifdim\wd2>\dimen2 %
-        \dimen2=\wd2 %
-      \fi
-    \fi
-    \rlap{%
-      $#5%
-        \vcenter{%
-          \hbox to\dimen2{%
-            \hss
-            $#6{#2}\m@th$%
-            \hss
-          }%
-        }%
-      $%
-    }%
-  \endgroup
-}
-% EXAMPLE INTEGRAL SIGNS
-% \begin{document}
-% \[
-%   \displaystyle A\int B
-%   \textstyle A\int B
-%   \scriptstyle A\int B
-%   \scriptscriptstyle A\int B
-% \]
-% \[
-%   \displaystyle A\mint{-} B
-%   \textstyle A\mint{-} B
-%   \scriptstyle A\mint{-} B
-%   \scriptscriptstyle A\mint{-} B
-% \]
-% \[
-%   \displaystyle A\mint{-}_{123}^{456} B
-%   \textstyle A\mint{-}_{123}^{456} B
-%   \scriptstyle A\mint{-}_{123}^{456} B
-%   \scriptscriptstyle A\mint{-}_{123}^{456} B
-% \]
-% \[
-%   \displaystyle A\mint{-}\limits_{12345}^{6} B
-%   \textstyle A\mint{-}\limits_{12345}^{6} B
-%   \scriptstyle A\mint{-}\limits_{12345}^{6} B
-%   \scriptscriptstyle A\mint{-}\limits_{12345}^{6} B
-% \]
-% \[
-%   \displaystyle A\mint{-}\limits_{1}^{23456} B
-%   \textstyle A\mint{-}\limits_{1}^{23456} B
-%   \scriptstyle A\mint{-}\limits_{1}^{23456} B
-%   \scriptscriptstyle A\mint{-}\limits_{1}^{23456} B
-% \]
-% \[
-%   \displaystyle A\mint{-}\displaylimits_{0}^{\infty} B
-%   \textstyle A\mint{-}\displaylimits_{0}^{\infty} B
-%   \scriptstyle A\mint{-}\displaylimits_{0}^{\infty} B
-%   \scriptscriptstyle A\mint{-}\displaylimits_{0}^{\infty} B
-% \]
-% \[
-%   \displaystyle A\mint{=} B
-%   \textstyle A\mint{=} B
-%   \scriptstyle A\mint{=} B
-%   \scriptscriptstyle A\mint{=} B
-% \]
-% \[
-%   \displaystyle A\mint{\equiv} B
-%   \textstyle A\mint{\equiv} B
-%   \scriptstyle A\mint{\equiv} B
-%   \scriptscriptstyle A\mint{\equiv} B
-% \]
-% \[
-%   \displaystyle A\mint{\circ} B
-%   \textstyle A\mint{\circ} B
-%   \scriptstyle A\mint{\circ} B
-%   \scriptscriptstyle A\mint{\circ} B
-% \]
-%\end{document}
- 
\ No newline at end of file
diff --git a/TP-TP-patch-test-case/plots/praeambels_and_definitions/theoreme_und_farbe.tex b/TP-TP-patch-test-case/plots/praeambels_and_definitions/theoreme_und_farbe.tex
deleted file mode 100644
index 2ca623f..0000000
--- a/TP-TP-patch-test-case/plots/praeambels_and_definitions/theoreme_und_farbe.tex
+++ /dev/null
@@ -1,366 +0,0 @@
-%FARBDEFINTIONEN
-%\definecolor{dunkelblau}{rgb}{0.21,0.37,0.87}definert neue Farben. Mit rgb-Werten in % mit RGB kann man die %RGB werte driket angeben
-
-%BLAUTOENE
-\definecolor{mediumblue}{RGB}{0,0,205}
-\definecolor{navyblue}{RGB}{0,0,128}
-\definecolor{midnightblue}{RGB}{25,25,112}
-\definecolor{royalblue4}{RGB}{39,64,139}
-\definecolor{blue3}{RGB}{0,0,205}
-\definecolor{steelblue3}{RGB}{79,148,205}
-\definecolor{steelblue4}{RGB}{54,100,139}
-
-%ROT- UND BRAUNTOENE
-\definecolor{brown}{RGB}{165,42,42} %Bordaux %heller
-\definecolor{brown3}{RGB}{205,51,51} %eher rot
-\definecolor{brown4}{RGB}{139,35,35} %ART Bordeaux %etwas dunkler
-\definecolor{red3}{RGB}{205,0,0} %bordeauxrot %noch dunkler
-\definecolor{tomato}{RGB}{205,79,57} % noch dunkler aehnlich zu red3
-\definecolor{firebrick3}{RGB}{205,38,38}
-\definecolor{firebrick4}{RGB}{139,26,26}
-
-%GELBTOENE
-\definecolor{gold}{RGB}{255,215,0}
-\definecolor{gold3}{RGB}{238,201,0} %dunkler
-\definecolor{darkgoldenrod1}{RGB}{255,185,15}
-\definecolor{goldenrod1}{RGB}{255,193,37}
-\definecolor{goldenrod}{RGB}{218,165,32}
-
-%ORANGETOENE
-\definecolor{orange}{rgb}{.9,.6,.1}
-\definecolor{dunkelorange}{rgb}{.9,.5,.0}
-\definecolor{orange2}{RGB}{238,154,0}
-\definecolor{orange3}{RGB}{205,133,0}
-
-%Gruen
-\definecolor{darkgreen}{RGB}{0,100,0}
-\definecolor{green3}{RGB}{0,205,0} %dunkler als das Standartgruen
-\definecolor{olivedrab}{RGB}{107,142,35}
-\definecolor{olivedrab2}{RGB}{179,238,58}
-\definecolor{olivedrab3}{RGB}{154,205,50}
-\definecolor{forestgreen}{RGB}{34,139,34}
-\definecolor{darkolivegreen}{RGB}{85,107,47}
-\definecolor{darkolivegreen4}{RGB}{110,139,61}
-\definecolor{khaki3}{RGB}{205,198,115}
-
-%Grautoene
-\definecolor{grey}{rgb}{0.5,0.5,0.5}
-\definecolor{dimgrey}{RGB}{105,105,105}
-\definecolor{dimgrey2}{RGB}{153,153,153}
-\definecolor{dimgrey3}{RGB}{181,181,181}
-\definecolor{lightgrey}{RGB}{211,211,211}
-\definecolor{lightergrey}{RGB}{201,201,201}
-\definecolor{verylightgrey}{RGB}{222,222,222}
-
-
-%BRAUNTOENE
-\definecolor{braun}{rgb}{.6,.5,.1}
-\definecolor{braun2}{rgb}{.6,.4,.1}
-\definecolor{tan4}{RGB}{149,90,43}
-
-%%SCHATTIERUNGEN VON WEISS 
-\definecolor{wheat3}{RGB}{205,186,150}
-\definecolor{wheat4}{RGB}{139,126,102}
-
-
-%DEFINITIONEN DER SATZ- UND THEOREMUMGEBUNGEN
-
-%\newcommand{\<Befehlsname>}{<Definition, was hinterher im Dokument erscheinen soll>}
-%"'Befehlsname"` muss %ein wirklich neuer Befehl sein
-%\newcommand{\<Befehlsname>}[Anzahl der Argumente des neuen Befehls (1...9)]{#i,#(i+1)} i
-%= 1...9 %Beim %Befehlsaufruf erscheint das, was man in die Argumentklammern schreibt an
-%der jeweiligen Stelle #i
-%Analog fuer folgenden Befehl: "<\Befehl>" muss schon existieren
-%\renewcommand{\<Befehl>}{<Definition>}
-%\renewcommand{\<Befehl>}[<ArgAnz>]{<Definition>}
-\newcommand{\bewend}{\rule{1ex}{1ex}}
-%Beweis ende: ausgefuelltes Viereck fuer das Ende eines Beweises.
-\newcommand{\latop}[2]{#1 \atop #2}	%gibt dem TeX-Befehl \atop eine LaTeX ueblichere Form
-\newcommand{\lchoose}[2]{#1 \choose #2} 
-%gibt dem TeX-Befehl \choose eine LaTeX ueblichere Form 
-
-%%%%%%%%%%%%% ZUNAECHST DIE EIGENEN STYLES %%%%%%%%%%%%%
-%erst mal ein Bugfix.
-%entweder
-% \makeatletter
-% \def\thmt@refnamewithcomma #1#2#3,#4,#5\@nil{%
-% \@xa\def\csname\thmt@envname #1utorefname\endcsname{#3}%
-% \ifcsname #2refname\endcsname
-% \csname #2refname\expandafter\endcsname\expandafter{\thmt@envname}{#3}{#4}%
-% \fi
-% }
-% \makeatother
-%oder Zur zwischenzeitlichen Abhilfe sollte es helfen, Z.48 in thm-autoref wie folgt
-%abzuaendern:  \csname #2refname\@xa\endcsname\@xa{\thmt@envname}{#3}{#4}%
-%Dies ist in der TeXLive2014 bereits gefixt.
-
-%Eingener Nummerierungsstyl am Rand und grau
-%Damit der Stil margincolored definiert ist muss 
-%  \definecolor{dimgrey}{RGB}{105,105,105}
-%  \definecolor{dimgrey2}{RGB}{153,153,153}
-\makeatletter
-  \def\thmt@headstyle@margincolored{%
-    \makebox[0pt][r]{\color{dimgrey}\NUMBER\ }\NAME\NOTE
-  }
-\makeatother
-% zu thm-ntheorem.sty und thm-amsthm.sty ergänzt werden.
-
-
-%%%%% Definitionsstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{olivedrab}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-%numbercolor=\color{dimgrey2},
-postheadspace=1em,
-qed=\color{olivedrab}$\pmb{\triangleleft}$]{customdefintion}
-%Defintion
-\declaretheorem[name=Definition,numberwithin=section,style=customdefintion,
-refname={Definition,Defintionen}]{df}
-%Bezeichnungen
-\declaretheorem[name=Bezeichnungen,sibling=df,style=customdefintion,
-refname={Bezeichnungen,Bezeichnungen}]{bez}
-\declaretheorem[name=Bezeichnung,sibling=df,style=customdefintion,
-refname={Bezeichnung,Bezeichnungen}]{bz}
-%Bezeichnungen ohne Nummer:
-\declaretheorem[name=Bezeichnungen,numbered=no,style=customdefintion,
-refname={Bezeichnungen,Bezeichnungen}]{bez*}
-%notations
-\declaretheorem[name=Notations,sibling=df,style=customdefintion,
-refname={Notations,Notations}]{notations}
-%notation
-\declaretheorem[name=Notation,sibling=df,style=customdefintion,
-refname={Notation,Notations}]{notation}
-%notations without number:
-\declaretheorem[name=Notations,numbered=no,style=customdefintion,
-refname={Notations,Notations}]{notations*}
-%Assumption
-\declaretheorem[name=Assumption,sibling=df,style=customdefintion,
-refname={assumption,assumptions}]{assumption}
-%Assumptions
-\declaretheorem[name=Assumptions,sibling=df,style=customdefintion,
-refname={assumptions,assumptions}]{assumptions}
-
-
-%Festlegung mit und ohne nummer
-\declaretheorem[name=Festlegung,sibling=df,style=customdefintion,
-refname={Festlegungen,Festlegungen}]{festlg}
-\declaretheorem[name=Festlegung,numbered=no,style=customdefintion,
-refname={Festlegungen,Festlegungen}]{nnfestlg}
-
-%%%%% Beispiel- und Bemerkungstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber oder margin
-headfont={\color{midnightblue}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\color{midnightblue}$\pmb{\triangleleft}$]{custombspbem}
-%Beispiel 
-\declaretheorem[numberlike=df,name=Beispiel,style=custombspbem,
-refname={Beispiel,Beispiele}]{bsp}
-%Bemerkung
-\declaretheorem[name=Bemerkung,sibling=df,style=custombspbem,
-refname={Bemerkung,Bemerkungen}]{bem}
-%Example
-\declaretheorem[numberlike=df,name=Example,style=custombspbem,
-refname={Example,Examples}]{example}
-%remark
-\declaretheorem[name=Remark,sibling=df,style=custombspbem,
-refname={Remark,Remarks}]{remark}
-
-%%%%% Lemma-,Korollarstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{steelblue4}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{steelblue4}$\pmb{\lrcorner}$]{customlemma}
-%Lemma 
-\declaretheorem[name=Lemma,sibling=df,style=customlemma,
-refname={Lemma,Lemmata}]{lm}
-%Korollar
-\declaretheorem[name=Korollar,sibling=df,style=customlemma,
-refname={Korollar,Korollare}]{kor}
-%Corollay
-\declaretheorem[name=Corollary,sibling=df,style=customlemma,
-refname={Corollary,Corollaries}]{cor}
-%Conclusion
-\declaretheorem[name=Conclusion,sibling=df,style=customlemma,
-refname={Conclusion,Conclusions}]{conclusion}
-
-
-
-%%%%% Notizstyle 
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{darkgreen}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{darkgreen}$\pmb{\lrcorner}$]{customnotiz}
-%Notiz
-\declaretheorem[name=Notiz,sibling=df,style=customnotiz,
-refname={Notiz,Notizen}]{nz}
-%%Spezialnotiz fuer die D-Arbeit: Prinzip der Nullstellensuche
-\declaretheorem[name=Prinzip der Nullstellensuche,sibling=df,style=customnotiz,
-refname={Notiz,Notizen}]{pdnss}
-\declaretheorem[name=Fragestellung,sibling=df,style=customnotiz,
-refname={Fragestellung,Fragestellungen}]{frage}
-\declaretheorem[name=Fragestellungen,sibling=df,style=customnotiz,
-refname={Fragestellungen,Fragestellungen}]{fragen}
-%Idea environment
-\declaretheorem[name=Idea,sibling=df,style=customnotiz,
-refname={idea,ideas}]{idea}
-%Main Idea environment
-\declaretheorem[name=Main idea,sibling=df,style=customnotiz,
-refname={main idea,main ideas}]{mainidea}
-%General Idea environment
-\declaretheorem[name=General idea,sibling=df,style=customnotiz,
-refname={general idea,general ideas}]{generalidea}
-%Questions and Tasks
-\declaretheorem[name=Questions and Tasks,sibling=df,style=customnotiz,
-refname={questions and tasks,question and tasks}]{QuestTasks}
-%Problem
-\declaretheorem[name=Problem,sibling=df,style=customnotiz,
-refname={problem,problems}]{problem}
-\declaretheorem[name=Problem,numbered=no,style=customnotiz,
-refname={problem,problems}]{problem*}
-
-
-
-\declaretheorem[name=Erklärung,sibling=df,style=customnotiz,
-refname={Erklärung,Erklärungen}]{erklaerung}
-\declaretheorem[name=Erklärung,numbered=no,style=customnotiz,
-refname={Erklärung,Erklärungen}]{erklaerung*}
-
-
-%%%%%%%%%%%%Berechnungstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{darkgreen}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\color{darkgreen}$\pmb{\bewend}$]{customberechnung}
-%Nebenrechnung
-\declaretheorem[name=Nebenrechnung,sibling=df,style=customberechnung,
-refname={Nebenrechnung,Nebenrechnungen}]{nr}
-
-%%%%% Satz-, Hauptsatz-, Satz und Definition und Propositionsstyle
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont={\color{firebrick4}\scshape \bfseries},
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\itshape,
-postheadspace=1em,
-qed=\color{firebrick4}$\lrcorner$]{customsatz}
-%Satz
-\declaretheorem[name=Satz,sibling=df,style=customsatz,
-refname={Satz,S\"atze}]{sz}
-%ohne Nummer
-\declaretheorem[name=Satz,numbered=no,style=customsatz,
-refname={Satz,S\"atze}]{sz*}
-%Hauptsatz 
-\declaretheorem[name=Hauptsatz,sibling=df,style=customsatz,
-refname={Hauptsatz,Haupts\"atze}]{hsz}
-%ohne Nummer
-\declaretheorem[name=Hauptsatz,numbered=no,style=customsatz,
-refname={Hauptsatz,Haupts\"atze}]{hsz*}
-%Satz und Definition 
-\declaretheorem[name=Satz und Definition,sibling=df,style=customsatz,
-refname={Satz und Definition,S\"atze und Definitionen}]{szdf}
-%Proposition
-\declaretheorem[sibling=df,name=Proposition,style=customsatz,
-refname={Proposition,Propositionen}]{proposition}
-%
-%theorem
-\declaretheorem[name=Theorem,sibling=df,style=customsatz,
-refname={Theorem,Theorems}]{satzengl}
-%ohne Nummer
-\declaretheorem[name=Theorem,numbered=no,style=customsatz,
-refname={Theorem,Theorems}]{satzengl*}
-%Satz und Definition 
-\declaretheorem[name=Theorem and Definition,sibling=df,style=customsatz,
-refname={Theorem and Definition,Theorems and Definitions}]{thmdf}
-%Proposition
-\declaretheorem[sibling=df,name=Proposition,style=customsatz,
-refname={Proposition,Propositions}]{prop}
-
-
-%%%%%%%%% Beweisumgebung
-\declaretheoremstyle[
-spaceabove=6pt, spacebelow=6pt,
-headformat=margincolored, %auch moeglich ist swapnumber margin
-headfont=\bfseries,
-notefont=\normalfont\bfseries, notebraces={(}{)},
-bodyfont=\normalfont,
-postheadspace=1em,
-qed=\bewend]{custombew}
-%Beweis
-\declaretheorem[numbered=no,name=Beweis,style=custombew,
-refname={Beweis,Beweise}]{bew}
-%Proof
-\declaretheorem[numbered=no,name=Proof,style=custombew,
-refname={Proof,Proofs}]{Proof}
-
-%%%%%%%%%%%%%%%%%%%%%%% Zitieren von Code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%allgemeine Vorgaben fuer das Zieren von Code. 
-
-\lstset{%
-numberbychapter=true, %
-breaklines=true,%
-prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},%
-breakatwhitespace=false,%
-basicstyle=\footnotesize\ttfamily,%
-commentstyle=\itshape,%
-fontadjust=true,%
-tabsize=2,%
-stringstyle=\itshape,%
-numbers=left,numberstyle=\footnotesize\ttfamily,%
-extendedchars=true,%
-inputencoding=utf8,%
-stepnumber=1,%
-frame=shadowbox,%
-rulesepcolor=\color{grey},%
-backgroundcolor=\color{white},%
-showspaces=false,%
-showstringspaces=false%
-aboveskip={1.5\baselineskip},%
-columns=fixed,%
-upquote=true,%
-}
-% Spezialvorgaben fuer das Zitieren von MATLAB Code.
-\newcommand{\citematlab}{\lstset{language=Matlab,%
-emph={if,elseif,else,end,for,while,function,return},%
-emphstyle=\bfseries\color{midnightblue},emph={[2]EigMitLambda,Zerol,CotKlTan
-,CotKlTanSpez,XsGrLambda,XsKlLambda,CotGrTan,ordnen,EvenSingTan,einord},%
-emphstyle={[2]\bfseries\color{olivedrab}},%
-emph={[3]zew,ew,l,L,lambda,ewsum,ewanz,phi,v1,v2},emphstyle={[3]\color{braun}}}}
-
-\crefname{lstlisting}{listing}{listings}
-\Crefname{lstlisting}{Listing}{Listings}
-\crefname{problem}{problem}{problems}
-\Crefname{problem}{Problem}{Problems}
-\crefname{notation}{notation}{notations}
-\Crefname{notation}{Notation}{Notations}
-\crefname{lm}{lemma}{lemmata}
-\Crefname{lm}{Lemma}{Lemmata}
-\crefname{assumptions}{assumptions}{assumptions}
-\Crefname{assumptions}{Assumptions}{Assumptions}
-\crefname{satzengl}{theorem}{theorems}
-\Crefname{satzengl}{Theorem}{Theorems}
-\crefname{satzengl*}{theorem}{theorems}
-\Crefname{satzengl*}{Theorem}{Theorems}
-\crefname{cor}{corollary}{corollaries}
-\Crefname{cor}{Corollary}{Corollaries}
-\crefname{df}{defintion}{defintions}
-\Crefname{df}{Defintion}{Defintions}
diff --git a/TP-TP-patch-test-case/plots/subsequent_errors.tex b/TP-TP-patch-test-case/plots/subsequent_errors.tex
deleted file mode 100644
index 5c68a2c..0000000
--- a/TP-TP-patch-test-case/plots/subsequent_errors.tex
+++ /dev/null
@@ -1,47 +0,0 @@
-\documentclass[a4paper]{scrartcl}%scrartcl
-\input{praeambels_and_definitions/artikelpraeambel.tex}
-\input{praeambels_and_definitions/artikel_theoreme_und_farbe.tex}
-%\input{praeambels_and_definitions/special_symbols.tex}
-%%%% MAKROS %%%%%%%%%%%%% restriction
-\input{./praeambels_and_definitions/L-Schema_Paper_makros.tex}
-% set graphicspath
-\graphicspath{ {./} }
-
-\usepackage{pgfplotstable}
-
-\begin{document}
-    % Generation of Profile_Error_new.png
-    \tikzsetnextfilename{Subsequent_errors_t0}
-    \tikzset{external/force remake}
-    \begin{tikzpicture}
-% %     \path[draw,dashed,thick] (3.13,0) -- (3.13,5.2);
-        \begin{semilogyaxis}[%
-            width=0.5\textwidth,
-            title={ Subsequent errors for $t = 0$,  $ h \approx 0.02$, $\tau = 2\cdot 10^{-4}$ },
-        % 	    axis lines=left,
-        % 	legend style = {draw=none},
-%             legend cell align = left,
-            xlabel= {iterations},
-            ylabel= {subsequent errors},
-            xmin= 0,
-            xmax= 53,
-%             ymin= 0,
-%             ymax= 0.0003,
-        	grid= major, %both or minor
-% %             axis line style={-Latex[round]},
-            legend style={
-%                 anchor=north east,
-%                 at={(1,1)},
-                font=\tiny,
-            },
-%             legend entries={$\bigl\|p_l^i - p_l^{i-1}\bigr\|_{L^2(\dom_1)}$,
-%                             $\bigl\|p_l^i - p_l^{i-1}\bigr\|_{L^2(\dom_2)}$},
-            ] % end of axis options %col sep=comma,
-            \addplot table [x=iteration, y=wetting] {../output/subdomain1_subsequent_iteration_error_for_phase_nonwetting_at_time0.csv};%
-            \addplot table [x=iteration, y=wetting] {../output/subdomain2_subsequent_iteration_error_for_phase_nonwetting_at_time0.csv};%
-%             \addplot table [x=iteration, y=nonwetting] {../output/subdomain2_subsequent_iteration_error_for_phase_wetting_at_time0.csv};
-% %             \addplot table [col sep=comma] {../output/subdomain1_subsequent_iteration_error_for_phase_wetting_at_time0.csv};%
-% % %             \addplot table [col sep=comma] {../output/subdomain2_subsequent_iteration_error_for_phase_wetting_at_time0.csv};%        
-        \end{semilogyaxis}
-    \end{tikzpicture}  
-\end{document}
diff --git a/TP-two-patch-constant-solution/TP-TP-2-patch-constant-solution.py b/TP-two-patch-constant-solution/TP-TP-2-patch-constant-solution.py
deleted file mode 100755
index 96a0541..0000000
--- a/TP-two-patch-constant-solution/TP-TP-2-patch-constant-solution.py
+++ /dev/null
@@ -1,652 +0,0 @@
-#!/usr/bin/python3
-import dolfin as df
-import mshr
-import numpy as np
-import sympy as sym
-import typing as tp
-import domainPatch as dp
-import LDDsimulation as ldd
-import functools as ft
-#import ufl as ufl
-
-# init sympy session
-sym.init_printing()
-
-##### Domain and Interface ####
-# global simulation domain domain
-sub_domain0_vertices = [df.Point(0.0,0.0), #
-                        df.Point(1.0,0.0),#
-                        df.Point(1.0,1.0),#
-                        df.Point(0.0,1.0)]
-# interface between subdomain1 and subdomain2
-interface12_vertices = [df.Point(0.0, 0.5),
-                        df.Point(1.0, 0.5) ]
-# subdomain1.
-sub_domain1_vertices = [interface12_vertices[0],
-                        interface12_vertices[1],
-                        df.Point(1.0,1.0),
-                        df.Point(0.0,1.0) ]
-
-# vertex coordinates of the outer boundaries. If it can not be specified as a
-# polygon, use an entry per boundary polygon. This information is used for defining
-# the Dirichlet boundary conditions. If a domain is completely internal, the
-# dictionary entry should be 0: None
-subdomain1_outer_boundary_verts = {
-    0: [interface12_vertices[0], #
-        df.Point(0.0,1.0), #
-        df.Point(1.0,1.0), #
-        interface12_vertices[1]]
-}
-# subdomain2
-sub_domain2_vertices = [df.Point(0.0,0.0),
-                        df.Point(1.0,0.0),
-                        interface12_vertices[1],
-                        interface12_vertices[0] ]
-
-subdomain2_outer_boundary_verts = {
-    0: [interface12_vertices[1], #
-        df.Point(1.0,0.0), #
-        df.Point(0.0,0.0), #
-        interface12_vertices[0]]
-}
-# subdomain2_outer_boundary_verts = {
-#     0: [interface12_vertices[0], df.Point(0.0,0.0)],#
-#     1: [df.Point(0.0,0.0), df.Point(1.0,0.0)], #
-#     2: [df.Point(1.0,0.0), interface12_vertices[1]]
-# }
-# subdomain2_outer_boundary_verts = {
-#     0: None
-# }
-
-# list of subdomains given by the boundary polygon vertices.
-# Subdomains are given as a list of dolfin points forming
-# a closed polygon, such that mshr.Polygon(subdomain_def_points[i]) can be used
-# to create the subdomain. subdomain_def_points[0] contains the
-# vertices of the global simulation domain and subdomain_def_points[i] contains the
-# vertices of the subdomain i.
-subdomain_def_points = [sub_domain0_vertices,#
-                      sub_domain1_vertices,#
-                      sub_domain2_vertices]
-# in the below list, index 0 corresponds to the 12 interface which has index 1
-interface_def_points = [interface12_vertices]
-
-# if a subdomain has no outer boundary write None instead, i.e.
-# i: None
-# if i is the index of the inner subdomain.
-outer_boundary_def_points = {
-    # subdomain number
-    1 : subdomain1_outer_boundary_verts,
-    2 : subdomain2_outer_boundary_verts
-}
-
-# adjacent_subdomains[i] contains the indices of the subdomains sharing the
-# interface i (i.e. given by interface_def_points[i]).
-adjacent_subdomains = [[1,2]]
-isRichards = {
-    1: False, #
-    2: False
-    }
-
-
-############ GRID #######################ü
-mesh_resolution = 40
-timestep_size = 0.01
-number_of_timesteps = 100
-# decide how many timesteps you want analysed. Analysed means, that we write out
-# subsequent errors of the L-iteration within the timestep.
-number_of_timesteps_to_analyse = 11
-starttime = 0
-
-viscosity = {#
-# subdom_num : viscosity
-    1 : {'wetting' :1,
-         'nonwetting': 1}, #
-    2 : {'wetting' :1,
-         'nonwetting': 1}
-}
-
-densities = {
-    1: {'wetting': 1,
-        'nonwetting': 1},
-    2: {'wetting': 1,
-        'nonwetting': 1},
-    # 3: {'wetting': 1},
-    # 4: {'wetting': 1}
-}
-
-gravity_acceleration = 9.81
-
-porosity = {#
-# subdom_num : porosity
-    1 : 1,#
-    2 : 1
-}
-
-L = {#
-# subdom_num : subdomain L for L-scheme
-    1 : {'wetting' :0.25,
-         'nonwetting': 0.25},#
-    2 : {'wetting' :0.25,
-         'nonwetting': 0.25}
-}
-
-l_param = 30
-lambda_param = {#
-# subdom_num : lambda parameter for the L-scheme
-    1 : {'wetting' :l_param,
-         'nonwetting': l_param},#
-    2 : {'wetting' :l_param,
-         'nonwetting': l_param}
-}
-
-## relative permeabilty functions on subdomain 1
-def rel_perm1w(s):
-    # relative permeabilty wetting on subdomain1
-    return s**2
-
-def rel_perm1nw(s):
-    # relative permeabilty nonwetting on subdomain1
-    return (1-s)**2
-
-_rel_perm1w = ft.partial(rel_perm1w)
-_rel_perm1nw = ft.partial(rel_perm1nw)
-subdomain1_rel_perm = {
-    'wetting': _rel_perm1w,#
-    'nonwetting': _rel_perm1nw
-}
-## relative permeabilty functions on subdomain 2
-def rel_perm2w(s):
-    # relative permeabilty wetting on subdomain2
-    return s**2
-def rel_perm2nw(s):
-    # relative permeabilty nonwetting on subdosym.cos(0.8*t - (0.8*x + 1/7*y))main2
-    return (1-s)**2
-
-_rel_perm2w = ft.partial(rel_perm2w)
-_rel_perm2nw = ft.partial(rel_perm2nw)
-
-subdomain2_rel_perm = {
-    'wetting': _rel_perm2w,#
-    'nonwetting': _rel_perm2nw
-}
-
-## dictionary of relative permeabilties on all domains.
-relative_permeability = {#
-    1: subdomain1_rel_perm,
-    2: subdomain2_rel_perm
-}
-
-
-# definition of the derivatives of the relative permeabilities
-# relative permeabilty functions on subdomain 1
-def rel_perm1w_prime(s):
-    # relative permeabilty on subdomain1
-    return 2*s
-
-def rel_perm1nw_prime(s):
-    # relative permeabilty on subdomain1
-    return 2*(1-s)
-
-# # definition of the derivatives of the relative permeabilities
-# # relative permeabilty functions on subdomain 1
-# def rel_perm2w_prime(s):
-#     # relative permeabilty on subdomain1
-#     return 3*s**2
-#
-# def rel_perm2nw_prime(s):
-#     # relative permeabilty on subdomain1
-#     return 2*(l_param_w1-s)
-
-_rel_perm1w_prime = ft.partial(rel_perm1w_prime)
-_rel_perm1nw_prime = ft.partial(rel_perm1nw_prime)
-# _rel_perm2w_prime = ft.partial(rel_perm2w_prime)
-# _rel_perm2nw_prime = ft.partial(rel_perm2nw_prime)
-
-subdomain1_rel_perm_prime = {
-    'wetting': _rel_perm1w_prime,
-    'nonwetting': _rel_perm1nw_prime
-}
-
-
-# subdomain2_rel_perm_prime = {
-#     'wetting': _rel_perm2w_prime,
-#     'nonwetting': _rel_perm2nw_prime
-# }
-
-# dictionary of relative permeabilties on all domains.
-ka_prime = {
-    1: subdomain1_rel_perm_prime,
-    2: subdomain1_rel_perm_prime,
-}
-
-def saturation(pc, n_index, alpha):
-    # inverse capillary pressure-saturation-relationship
-    return df.conditional(pc > 0, 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index)), 1)
-
-# S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where
-# we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw
-def saturation_sym(pc, n_index, alpha):
-    # inverse capillary pressure-saturation-relationship
-    #df.conditional(pc > 0,
-    return 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index))
-
-
-# derivative of S-pc relationship with respect to pc. This is needed for the
-# construction of a analytic solution.
-def saturation_sym_prime(pc, n_index, alpha):
-    # inverse capillary pressure-saturation-relationship
-    return -(alpha*(n_index - 1)*(alpha*pc)**(n_index - 1)) / ( (1 + (alpha*pc)**n_index)**((2*n_index - 1)/n_index) )
-
-# note that the conditional definition of S-pc in the nonsymbolic part will be
-# incorporated in the construction of the exact solution below.
-S_pc_sym = {
-    1: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    2: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 3: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 4: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 5: ft.partial(saturation_sym, n_index=3, alpha=0.001),
-    # 6: ft.partial(saturation_sym, n_index=3, alpha=0.001)
-}
-
-S_pc_sym_prime = {
-    1: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    2: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 3: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 4: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 5: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001),
-    # 6: ft.partial(saturation_sym_prime, n_index=3, alpha=0.001)
-}
-
-sat_pressure_relationship = {
-    1: ft.partial(saturation, n_index=3, alpha=0.001),
-    2: ft.partial(saturation, n_index=3, alpha=0.001),
-    # 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),
-    # 6: ft.partial(saturation, n_index=3, alpha=0.001)
-}
-
-
-# S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where
-# we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw
-# def saturation(pc, n_index, alpha):
-#     # inverse capillary pressure-saturation-relationship
-#     return df.conditional(pc > 0, 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index)), 1)
-#
-# # S-pc-relation ship. We use the van Genuchten approach, i.e. pc = 1/alpha*(S^{-1/m} -1)^1/n, where
-# # we set alpha = 0, assume m = 1-1/n (see Helmig) and assume that residual saturation is Sw
-# def saturation_sym(pc, n_index, alpha):
-#     # inverse capillary pressure-saturation-relationship
-#     #df.conditional(capillary_pressure > 0,
-#     return 1/((1 + (alpha*pc)**n_index)**((n_index - 1)/n_index))
-#
-# S_pc_rel = {#
-#     1: ft.partial(saturation_sym, n_index = 3, alpha=0.001),# n= 3 stands for non-uniform porous media
-#     2: ft.partial(saturation_sym, n_index = 6, alpha=0.001) # n=6 stands for uniform porous media matrix (siehe Helmig)
-# }
-
-# S_pc_rel_sym = {#
-#     1: ft.partial(saturation_sym, n_index = sym.Symbol('n'), alpha = sym.Symbol('a')),# n= 3 stands for non-uniform porous media
-#     2: ft.partial(saturation_sym, n_index = sym.Symbol('n'), alpha = sym.Symbol('a')) # n=6 stands for uniform porous media matrix (siehe Helmig)
-# }
-
-
-# # this function needs to be monotonically decreasing in the capillary_pressure.
-# # since in the richards case pc=-pw, this becomes as a function of pw a mono
-# # tonically INCREASING function like in our Richards-Richards paper. However
-# # since we unify the treatment in the code for Richards and two-phase, we need
-# # the same requierment
-# # for both cases, two-phase and Richards.
-# def saturation(pc, index):
-#     # inverse capillary pressure-saturation-relationship
-#     return df.conditional(pc > 0, 1/((1 + pc)**(1/(index + 1))), 1)
-#
-#
-# def saturation_sym(pc, index):
-#     # inverse capillary pressure-saturation-relationship
-#     return 1/((1 + pc)**(1/(index + 1)))
-#
-#
-# # derivative of S-pc relationship with respect to pc. This is needed for the
-# # construction of a analytic solution.
-# def saturation_sym_prime(pc, index):
-#     # inverse capillary pressure-saturation-relationship
-#     return -1/((index+1)*(1 + pc)**((index+2)/(index+1)))
-#
-#
-# # note that the conditional definition of S-pc in the nonsymbolic part will be
-# # incorporated in the construction of the exact solution below.
-# S_pc_sym = {
-#     1: ft.partial(saturation_sym, index=1),
-#     2: ft.partial(saturation_sym, index=2),
-#     # 3: ft.partial(saturation_sym, index=2),
-#     # 4: ft.partial(saturation_sym, index=2),
-#     # 5: ft.partial(saturation_sym, index=1)
-# }
-#
-# S_pc_sym_prime = {
-#     1: ft.partial(saturation_sym_prime, index=1),
-#     2: ft.partial(saturation_sym_prime, index=2),
-#     # 3: ft.partial(saturation_sym_prime, index=2),
-#     # 4: ft.partial(saturation_sym_prime, index=2),
-#     # 5: ft.partial(saturation_sym_prime, index=1)
-# }
-#
-# sat_pressure_relationship = {
-#     1: ft.partial(saturation, index=1),
-#     2: ft.partial(saturation, index=2),
-#     # 3: ft.partial(saturation, index=2),
-#     # 4: ft.partial(saturation, index=2),
-#     # 5: ft.partial(saturation, index=1)
-# }
-
-# exact_solution = {
-#     1: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0] + x[1]*x[1])'},
-#     2: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0])'},
-#     3: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0])'},
-#     4: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0])'},
-#     5: {'wetting': '1.0 - (1.0 + t*t)*(1.0 + x[0]*x[0] + x[1]*x[1])'}
-# }
-#
-# initial_condition = {
-#     1: {'wetting': '-(x[0]*x[0] + x[1]*x[1])'},
-#     2: {'wetting': '-x[0]*x[0]'},
-#     3: {'wetting': '-x[0]*x[0]'},
-#     4: {'wetting': '-x[0]*x[0]'},
-#     5: {'wetting': '-(x[0]*x[0] + x[1]*x[1])'}
-# }
-
-#############################################
-# Manufacture source expressions with sympy #
-#############################################
-x, y = sym.symbols('x[0], x[1]')  # needed by UFL
-t = sym.symbols('t', positive=True)
-
-p_e_sym = {
-    1: {'wetting': -3 + 0*t,
-        'nonwetting': -1+ 0*t},
-    2: {'wetting': -3+ 0*t,
-        'nonwetting': -1+ 0*t},
-    # 3: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x)},
-    # 4: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x)},
-    # 5: {'wetting': 1.0 - (1.0 + t*t)*(1.0 + x*x + y*y)}
-}
-
-# pc_e_sym = {
-#     1: -1*p_e_sym[1]['wetting'],
-#     2: -1*p_e_sym[2]['wetting'],
-#     # 3: -1*p_e_sym[3]['wetting'],
-#     # 4: -1*p_e_sym[4]['wetting'],
-#     # 5: -1*p_e_sym[5]['wetting']
-# }
-
-pc_e_sym = {
-    1: p_e_sym[1]['nonwetting'] - p_e_sym[1]['wetting'],
-    2: p_e_sym[2]['nonwetting'] - p_e_sym[2]['wetting'],
-    # 3: -1*p_e_sym[3]['wetting'],
-    # 4: -1*p_e_sym[4]['wetting'],
-    # 5: -1*p_e_sym[5]['wetting']
-}
-
-
-# #### Manufacture source expressions with sympy
-# ###############################################################################
-# ## subdomain1
-# x, y = sym.symbols('x[0], x[1]') # needed by UFL
-# t = sym.symbols('t', positive=True)
-# #f = -sym.diff(u, x, 2) - sym.diff(u, y, 2)  # -Laplace(u)
-# #f = sym.simplify(f)                         # simplify f
-# p1_w = 1 - (1+t**2)*(1 + x**2 + (y-0.5)**2)
-# p1_nw = t*(1-(y-0.5) - x**2)**2 - sym.sqrt(2+t**2)*(1-(y-0.5))
-#
-# #dtS1_w = sym.diff(S_pc_rel_sym[1](p1_nw - p1_w), t, 1)
-# #dtS1_nw = -sym.diff(S_pc_rel_sym[1](p1_nw - p1_w), t, 1)
-# dtS1_w = porosity[1]*sym.diff(sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ), t, 1)
-# dtS1_nw = -porosity[1]*sym.diff(sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ), t, 1)
-# print("dtS1_w = ", dtS1_w, "\n")
-# print("dtS1_nw = ", dtS1_nw, "\n")
-#
-# #dxdxflux1_w = -sym.diff(relative_permeability[1]['wetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_w, x, 1), x, 1)
-# #dydyflux1_w = -sym.diff(relative_permeability[1]['wetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_w, y, 1), y, 1)
-# dxdxflux1_w = -1/viscosity[1]['wetting']*sym.diff(relative_permeability[1]['wetting'](sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_w, x, 1), x, 1)
-# dydyflux1_w = -1/viscosity[1]['wetting']*sym.diff(relative_permeability[1]['wetting'](sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_w, y, 1), y, 1)
-#
-# rhs1_w = dtS1_w + dxdxflux1_w + dydyflux1_w
-# rhs1_w = sym.printing.ccode(rhs1_w)
-# print("rhs_w = ", rhs1_w, "\n")
-# #rhs_w = sym.expand(rhs_w)
-# #print("rhs_w", rhs_w, "\n")
-# #rhs_w = sym.collect(rhs_w, x)
-# #print("rhs_w", rhs_w, "\n")
-#
-# #dxdxflux1_nw = -sym.diff(relative_permeability[1]['nonwetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_nw, x, 1), x, 1)
-# #dydyflux1_nw = -sym.diff(relative_permeability[1]['nonwetting'](S_pc_rel_sym[1](p1_nw - p1_w))*sym.diff(p1_nw, y, 1), y, 1)
-# dxdxflux1_nw = -1/viscosity[1]['nonwetting']*sym.diff(relative_permeability[1]['nonwetting'](1-sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_nw, x, 1), x, 1)
-# dydyflux1_nw = -1/viscosity[1]['nonwetting']*sym.diff(relative_permeability[1]['nonwetting'](1-sym.Piecewise((S_pc_rel[1](p1_nw - p1_w), (p1_nw - p1_w) > 0), (1, True) ))*sym.diff(p1_nw, y, 1), y, 1)
-#
-# rhs1_nw = dtS1_nw + dxdxflux1_nw + dydyflux1_nw
-# rhs1_nw = sym.printing.ccode(rhs1_nw)
-# print("rhs_nw = ", rhs1_nw, "\n")
-#
-# ## subdomain2
-# p2_w = 1 - (1+t**2)*(1 + x**2)
-# p2_nw = t*(1- x**2)**2 - sym.sqrt(2+t**2)*(1-(y-0.5))
-#
-# #dtS2_w = sym.diff(S_pc_rel_sym[2](p2_nw - p2_w), t, 1)
-# #dtS2_nw = -sym.diff(S_pc_rel_sym[2](p2_nw - p2_w), t, 1)
-# dtS2_w = porosity[2]*sym.diff(sym.Piecewise((sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ), (p2_nw - p2_w) > 0), (1, True) ), t, 1)
-# dtS2_nw = -porosity[2]*sym.diff(sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ), t, 1)
-# print("dtS2_w = ", dtS2_w, "\n")
-# print("dtS2_nw = ", dtS2_nw, "\n")
-#
-# #dxdxflux2_w = -sym.diff(relative_permeability[2]['wetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_w, x, 1), x, 1)
-# #dydyflux2_w = -sym.diff(relative_permeability[2]['wetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_w, y, 1), y, 1)
-# dxdxflux2_w = -1/viscosity[2]['wetting']*sym.diff(relative_permeability[2]['wetting'](sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_w, x, 1), x, 1)
-# dydyflux2_w = -1/viscosity[2]['wetting']*sym.diff(relative_permeability[2]['wetting'](sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_w, y, 1), y, 1)
-#
-# rhs2_w = dtS2_w + dxdxflux2_w + dydyflux2_w
-# rhs2_w = sym.printing.ccode(rhs2_w)
-# print("rhs2_w = ", rhs2_w, "\n")
-# #rhs_w = sym.expand(rhs_w)
-# #print("rhs_w", rhs_w, "\n")
-# #rhs_w = sym.collect(rhs_w, x)
-# #print("rhs_w", rhs_w, "\n")
-#
-# #dxdxflux2_nw = -sym.diff(relative_permeability[2]['nonwetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_nw, x, 1), x, 1)
-# #dydyflux2_nw = -sym.diff(relative_permeability[2]['nonwetting'](S_pc_rel_sym[2](p2_nw - p2_w))*sym.diff(p2_nw, y, 1), y, 1)
-# dxdxflux2_nw = -1/viscosity[2]['nonwetting']*sym.diff(relative_permeability[2]['nonwetting'](1-sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_nw, x, 1), x, 1)
-# dydyflux2_nw = -1/viscosity[2]['nonwetting']*sym.diff(relative_permeability[2]['nonwetting'](1-sym.Piecewise((S_pc_rel[2](p2_nw - p2_w), (p2_nw - p2_w) > 0), (1, True) ))*sym.diff(p2_nw, y, 1), y, 1)
-#
-# rhs2_nw = dtS2_nw + dxdxflux2_nw + dydyflux2_nw
-# rhs2_nw = sym.printing.ccode(rhs2_nw)
-# print("rhs2_nw = ", rhs2_nw, "\n")
-#
-#
-# ###############################################################################
-#
-# source_expression = {
-#     1: {'wetting': rhs1_w,
-#         'nonwetting': rhs1_nw},
-#     2: {'wetting': rhs2_w,
-#         'nonwetting': rhs2_nw}
-# }
-#
-# p1_w_00 = p1_w.subs(t, 0)
-# p1_nw_00 = p1_nw.subs(t, 0)
-# p2_w_00 = p2_w.subs(t, 0)
-# p2_nw_00 = p2_nw.subs(t, 0)
-# # p1_w_00 = sym.printing.ccode(p1_w_00)
-#
-# initial_condition = {
-#     1: {'wetting': sym.printing.ccode(p1_w_00),
-#         'nonwetting': sym.printing.ccode(p1_nw_00)},#
-#     2: {'wetting': sym.printing.ccode(p2_w_00),
-#         'nonwetting': sym.printing.ccode(p2_nw_00)}
-# }
-#
-# exact_solution = {
-#     1: {'wetting': sym.printing.ccode(p1_w),
-#         'nonwetting': sym.printing.ccode(p1_nw)},#
-#     2: {'wetting': sym.printing.ccode(p2_w),
-#         'nonwetting': sym.printing.ccode(p2_nw)}
-# }
-#
-# # similary to the outer boundary dictionary, if a patch has no outer boundary
-# # None should be written instead of an expression. This is a bit of a brainfuck:
-# # dirichletBC[ind] gives a dictionary of the outer boundaries of subdomain ind.
-# # Since a domain patch can have several disjoint outer boundary parts, the expressions
-# # need to get an enumaration index which starts at 0. So dirichletBC[ind][j] is
-# # the dictionary of outer dirichlet conditions of subdomain ind and boundary part j.
-# # finally, dirichletBC[ind][j]['wetting'] and dirichletBC[ind][j]['nonwetting'] return
-# # the actual expression needed for the dirichlet condition for both phases if present.
-# dirichletBC = {
-# #subdomain index: {outer boudary part index: {phase: expression}}
-#     1: { 0: {'wetting': sym.printing.ccode(p1_w),
-#              'nonwetting': sym.printing.ccode(p1_nw)}},
-#     2: { 0: {'wetting': sym.printing.ccode(p2_w),
-#              'nonwetting': sym.printing.ccode(p2_nw)}}
-# }
-
-# turn above symbolic code into exact solution for dolphin and
-# construct the rhs that matches the above exact solution.
-dtS = dict()
-div_flux = dict()
-source_expression = dict()
-exact_solution = dict()
-initial_condition = dict()
-for subdomain, isR in isRichards.items():
-    dtS.update({subdomain: dict()})
-    div_flux.update({subdomain: dict()})
-    source_expression.update({subdomain: dict()})
-    exact_solution.update({subdomain: dict()})
-    initial_condition.update({subdomain: dict()})
-    if isR:
-        subdomain_has_phases = ["wetting"]
-    else:
-        subdomain_has_phases = ["wetting", "nonwetting"]
-
-    # conditional for S_pc_prime
-    pc = pc_e_sym[subdomain]
-    dtpc = sym.diff(pc, t, 1)
-    dxpc = sym.diff(pc, x, 1)
-    dypc = sym.diff(pc, y, 1)
-    S = sym.Piecewise((S_pc_sym[subdomain](pc), pc > 0), (1, True))
-    dS = sym.Piecewise((S_pc_sym_prime[subdomain](pc), pc > 0), (0, True))
-    for phase in subdomain_has_phases:
-        # Turn above symbolic expression for exact solution into c code
-        exact_solution[subdomain].update(
-            {phase: sym.printing.ccode(p_e_sym[subdomain][phase])}
-            )
-        # save the c code for initial conditions
-        initial_condition[subdomain].update(
-            {phase: sym.printing.ccode(p_e_sym[subdomain][phase].subs(t, 0))}
-            )
-        if phase == "nonwetting":
-            dtS[subdomain].update(
-                {phase: -porosity[subdomain]*dS*dtpc}
-                )
-        else:
-            dtS[subdomain].update(
-                {phase: porosity[subdomain]*dS*dtpc}
-                )
-        pa = p_e_sym[subdomain][phase]
-        dxpa = sym.diff(pa, x, 1)
-        dxdxpa = sym.diff(pa, x, 2)
-        dypa = sym.diff(pa, y, 1)
-        dydypa = sym.diff(pa, y, 2)
-        mu = viscosity[subdomain][phase]
-        ka = relative_permeability[subdomain][phase]
-        dka = ka_prime[subdomain][phase]
-        rho = densities[subdomain][phase]
-        g = gravity_acceleration
-
-        if phase == "nonwetting":
-            # x part of div(flux) for nonwetting
-            dxdxflux = -1/mu*dka(1-S)*dS*dxpc*dxpa + 1/mu*dxdxpa*ka(1-S)
-            # y part of div(flux) for nonwetting
-            dydyflux = -1/mu*dka(1-S)*dS*dypc*(dypa - rho*g) \
-                + 1/mu*dydypa*ka(1-S)
-        else:
-            # x part of div(flux) for wetting
-            dxdxflux = 1/mu*dka(S)*dS*dxpc*dxpa + 1/mu*dxdxpa*ka(S)
-            # y part of div(flux) for wetting
-            dydyflux = 1/mu*dka(S)*dS*dypc*(dypa - rho*g) + 1/mu*dydypa*ka(S)
-        div_flux[subdomain].update({phase: dxdxflux + dydyflux})
-        contructed_rhs = dtS[subdomain][phase] - div_flux[subdomain][phase]
-        source_expression[subdomain].update(
-            {phase: sym.printing.ccode(contructed_rhs)}
-            )
-        # print(f"source_expression[{subdomain}][{phase}] =", source_expression[subdomain][phase])
-
-# Dictionary of dirichlet boundary conditions.
-dirichletBC = dict()
-# similarly to the outer boundary dictionary, if a patch has no outer boundary
-# None should be written instead of an expression.
-# This is a bit of a brainfuck:
-# dirichletBC[ind] gives a dictionary of the outer boundaries of subdomain ind.
-# Since a domain patch can have several disjoint outer boundary parts, the
-# expressions need to get an enumaration index which starts at 0.
-# So dirichletBC[ind][j] is the dictionary of outer dirichlet conditions of
-# subdomain ind and boundary part j.
-# Finally, dirichletBC[ind][j]['wetting'] and dirichletBC[ind][j]['nonwetting']
-# return the actual expression needed for the dirichlet condition for both
-# phases if present.
-
-# subdomain index: {outer boudary part index: {phase: expression}}
-for subdomain in isRichards.keys():
-    # if subdomain has no outer boundary, outer_boundary_def_points[subdomain] is None
-    if outer_boundary_def_points[subdomain] is None:
-        dirichletBC.update({subdomain: None})
-    else:
-        dirichletBC.update({subdomain: dict()})
-        # set the dirichlet conditions to be the same code as exact solution on
-        # the subdomain.
-        for outer_boundary_ind in outer_boundary_def_points[subdomain].keys():
-            dirichletBC[subdomain].update(
-                {outer_boundary_ind: exact_solution[subdomain]}
-                )
-
-
-# def saturation(pressure, subdomain_index):
-#     # inverse capillary pressure-saturation-relationship
-#     return df.conditional(pressure < 0, 1/((1 - pressure)**(1/(subdomain_index + 1))), 1)
-#
-# sa
-
-write_to_file = {
-    'meshes_and_markers': True,
-    'L_iterations': True
-}
-
-
-# initialise LDD simulation class
-simulation = ldd.LDDsimulation(tol = 1E-14, LDDsolver_tol = 1E-9, debug = False)
-simulation.set_parameters(output_dir = "./output/",#
-    subdomain_def_points = subdomain_def_points,#
-    isRichards = isRichards,#
-    interface_def_points = interface_def_points,#
-    outer_boundary_def_points = outer_boundary_def_points,#
-    adjacent_subdomains = adjacent_subdomains,#
-    mesh_resolution = mesh_resolution,#
-    viscosity = viscosity,#
-    porosity = porosity,#
-    L = L,#
-    lambda_param = lambda_param,#
-    relative_permeability = relative_permeability,#
-    saturation = sat_pressure_relationship,#
-    starttime = starttime,#
-    number_of_timesteps = number_of_timesteps,
-    number_of_timesteps_to_analyse = number_of_timesteps_to_analyse,
-    timestep_size = timestep_size,#
-    sources = source_expression,#
-    initial_conditions = initial_condition,#
-    dirichletBC_expression_strings = dirichletBC,#
-    exact_solution = exact_solution,#
-    densities=densities,
-    include_gravity=True,
-    write2file = write_to_file,#
-    )
-
-simulation.initialise()
-# simulation.write_exact_solution_to_xdmf()
-simulation.run()
-- 
GitLab