]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Corrected indentation, expected values and missing parenthesis
authormichael <michael@localhost.localdomain>
Mon, 30 Nov 2020 13:11:43 +0000 (14:11 +0100)
committermichael <michael@localhost.localdomain>
Mon, 30 Nov 2020 13:11:43 +0000 (14:11 +0100)
18 files changed:
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFE_Dirichlet_DelaunayTriangles/convergence_StationaryDiffusion_2DFE_Dirichlet_DelaunayTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFE_Dirichlet_RightTriangles/convergence_StationaryDiffusion_2DFE_Dirichlet_RightTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFE_Neumann_DelaunayTriangles/convergence_StationaryDiffusion_2DFE_Neumann_DelaunayTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFE_Neumann_RightTriangles/convergence_StationaryDiffusion_2DFE_Neumann_RightTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Dirichlet_DelaunayTriangles/convergence_StationaryDiffusion_2DFV_Dirichlet_DelaunayTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Dirichlet_EquilateralTriangles/convergence_StationaryDiffusion_2DFV_Dirichlet_EquilateralTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Dirichlet_Hexagons/convergence_StationaryDiffusion_2DFV_Dirichlet_Hexagons.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Dirichlet_RightTriangles/convergence_StationaryDiffusion_2DFV_Dirichlet_RightTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Dirichlet_Squares/convergence_StationaryDiffusion_2DFV_Dirichlet_Squares.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Neumann_DelaunayTriangles/convergence_StationaryDiffusion_2DFV_Neumann_DelaunayTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Neumann_RightTriangles/convergence_StationaryDiffusion_2DFV_Neumann_RightTriangles.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/2DFV_Neumann_Squares/convergence_StationaryDiffusion_2DFV_Neumann_Squares.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/3DFE_Dirichlet_DelaunayTetrahedra/convergence_StationaryDiffusion_3DFE_Dirichlet_DelaunayTetrahedra.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/3DFE_Dirichlet_RegularTetrahedra/convergence_StationaryDiffusion_3DFE_Dirichlet_RegularTetrahedra.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/3DFV_Dirichlet_DelaunayTetrahedra/convergence_StationaryDiffusion_3DFV_Dirichlet_DelaunayTetrahedra.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/3DFV_Dirichlet_RegularCubes/convergence_StationaryDiffusion_3DFV_Dirichlet_RegularCubes.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/3DFV_Dirichlet_RegularTetrahedra/convergence_StationaryDiffusion_3DFV_Dirichlet_RegularTetrahedra.py
CoreFlows/examples/Python/Convergence/StationaryDiffusion/validationStationaryDiffusionEquation.py

index 50b1a34470d12aa199dc040bfbe5c7a15a3f6132..06622d2643febdb6c18287b525827fbe5611d8ef 100644 (file)
@@ -31,16 +31,16 @@ def convergence_StationaryDiffusion_2DFE_Dirichlet_DelaunayTriangles():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1 
-               assert max_sol_num<1.2
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-1 
+        assert max_sol_num<1.2
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -66,7 +66,7 @@ def convergence_StationaryDiffusion_2DFE_Dirichlet_DelaunayTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FE for diffusion on 2D Delaunay triangles meshes: scheme order is ", -a
+    print( "FE for diffusion on 2D Delaunay triangles meshes: scheme order is ", -a)
     assert abs(a+2)<0.02
     
     # Plot of convergence curve
index b4414693bf59829655db6bbc4ba4311ee959a367..8d2bd2f3a63fc73335f2edb8db0aeee689640063 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_2DFE_Dirichlet_RightTriangles():
     ### 2D FE right triangles mesh
     method = 'FE' 
     BC = 'Dirichlet'
-    meshList=[5,20,50,100, 200,400]
+    meshList=[5,20,50,100, 200]
     nbMeshes=len(meshList)
     error_tab=[0]*nbMeshes
     mesh_size_tab=[0]*nbMeshes
@@ -30,16 +30,16 @@ def convergence_StationaryDiffusion_2DFE_Dirichlet_RightTriangles():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-0.001 
-               assert max_sol_num<1.003
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-0.001 
+        assert max_sol_num<1.003
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -65,7 +65,7 @@ def convergence_StationaryDiffusion_2DFE_Dirichlet_RightTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FE for diffusion on 2D right triangle meshes: scheme order is ", -a
+    print( "FE for diffusion on 2D right triangle meshes: scheme order is ", -a)
     assert abs(a+2)<0.01
     
     # Plot of convergence curve
index 24d7bd9273c1d3048d4ba87cb3ca1bca50647ca8..fb46acaf8308112de54525ddc0aef0a798f44008 100644 (file)
@@ -28,19 +28,19 @@ def convergence_StationaryDiffusion_2DFE_Neumann_DelaunayTriangles():
     curv_abs=np.linspace(0,sqrt(2),resolution+1)
     plt.close('all')
     i=0
-    testColor="Orange (not order 2), singular matrix"
+    testColor="Red, to be investigated"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1 
-               assert max_sol_num<1.2
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>=-1 
+        assert max_sol_num<1.2
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -66,7 +66,7 @@ def convergence_StationaryDiffusion_2DFE_Neumann_DelaunayTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FE for diffusion on 2D Delaunay triangle meshes: scheme order is ", -a
+    print( "FE for diffusion on 2D Delaunay triangle meshes: scheme order is ", -a)
     assert abs(a+0.82)<0.02
     
     # Plot of convergence curve
index 4e95981f3802b7d06e7d659cdc98cc6e46a896e9..29234f1e7b1e66ee2f8d3b909b28d9860b782a83 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_2DFE_Neumann_RightTriangles():
     ### 2D FE right triangles mesh
     method = 'FE' 
     BC = 'Neumann'
-    meshList=[5,20,50,100, 200,400]
+    meshList=[5,20,50,100, 200]
     nbMeshes=len(meshList)
     error_tab=[0]*nbMeshes
     mesh_size_tab=[0]*nbMeshes
@@ -27,19 +27,19 @@ def convergence_StationaryDiffusion_2DFE_Neumann_RightTriangles():
     curv_abs=np.linspace(0,sqrt(2),resolution+1)
     plt.close('all')
     i=0
-    testColor="Orange (not order 2), singular matrix"
+    testColor="Red, to be investigated"
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1.22
-               assert max_sol_num<1.
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-1.22
+        assert max_sol_num<1.
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -65,7 +65,7 @@ def convergence_StationaryDiffusion_2DFE_Neumann_RightTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FE for diffusion on 2D right triangle meshes: scheme order is ", -a
+    print( "FE for diffusion on 2D right triangle meshes: scheme order is ", -a)
     assert abs(a+0.91)<0.01
     
     # Plot of convergence curve
index abb8bfd47a65ad216f178f3dd4bd77c2ffc68a4a..6c900b10381928493c51d9f75faa8c9e760dc6e2 100644 (file)
@@ -31,16 +31,16 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_DelaunayTriangles():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1 
-               assert max_sol_num<1.2
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-1 
+        assert max_sol_num<1.2
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -66,7 +66,7 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_DelaunayTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D Delaunay triangle meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D Delaunay triangle meshes: scheme order is ", -a)
     assert abs(a+0.6)<0.02
     
     # Plot of convergence curve
index 7c6967f8c60f84813c1f7a0f8a0fe7c221fee891..2821c44d3bd283ad166966e2232dc8a27a748891 100644 (file)
@@ -33,15 +33,15 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_EquilateralTriangles():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
-               assert min_sol_num>-1 
-               assert max_sol_num<1.2
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        assert min_sol_num>-1 
+        assert max_sol_num<1.2
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -67,7 +67,7 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_EquilateralTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D Equilateral triangle meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D Equilateral triangle meshes: scheme order is ", -a)
     assert abs(a+1.97)<0.01
     
     # Plot of convergence curve
index 06cfd1f59699524775477ebf5463d31e9b518596..e6adc3eca1870a21df8ef2de81090de13d552992 100644 (file)
@@ -31,16 +31,16 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_Hexagons():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1 
-               assert max_sol_num<1.2
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-1 
+        assert max_sol_num<1.2
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -66,7 +66,7 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_Hexagons():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D  hexagon meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D  hexagon meshes: scheme order is ", -a)
     assert abs(a+1.94)<0.01
     
     # Plot of convergence curve
index d4e51f96c17a9c0ec43c73ff9249a6e6cdabfe33..02c0d12e75a84daa25d5ada284e83e76fe674b88 100644 (file)
@@ -30,16 +30,16 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_RightTriangles():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-0.001 
-               assert max_sol_num<1.01
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-0.001 
+        assert max_sol_num<1.01
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -65,7 +65,7 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_RightTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D right triangle meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D right triangle meshes: scheme order is ", -a)
     assert abs(a+0.02)<0.01
     
     # Plot of convergence curve
index 14b7b9eb9595a78a4f9502092e05cd8d769f80d0..43d21329dbb3b1c7da19c7c2d7547eb23faaa528 100644 (file)
@@ -27,18 +27,18 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_Squares():
     curv_abs=np.linspace(0,sqrt(2),resolution+1)
     plt.close('all')
     i=0
-    testColor="Green"          
+    testColor="Green"        
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
-               assert min_sol_num>     1e-5 
-               assert max_sol_num<1.04
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        assert min_sol_num>    1e-5 
+        assert max_sol_num<1.04
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
         
     end = time.time()
 
@@ -63,7 +63,7 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_Squares():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D square meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D square meshes: scheme order is ", -a)
     assert abs(a+2)<0.1
     
     # Plot of convergence curve
@@ -107,4 +107,4 @@ def convergence_StationaryDiffusion_2DFV_Dirichlet_Squares():
     with open('Convergence_Poisson_2DFV_'+mesh_name+'.json', 'w') as outfile:  
         json.dump(convergence_synthesis, outfile)
 if __name__ == """__main__""":
-       convergence_StationaryDiffusion_2DFV_Dirichlet_Squares()
+    convergence_StationaryDiffusion_2DFV_Dirichlet_Squares()
index c22b1f3cb9bf5402243fb38b9e15f43e387582d0..b42965f4c74c635947f70710e962119ebe5f47dc 100644 (file)
@@ -31,16 +31,16 @@ def convergence_StationaryDiffusion_2DFV_Neumann_DelaunayTriangles():
     testColor="Red"#Linear solver fails
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1 
-               assert max_sol_num<1.2
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-1 
+        assert max_sol_num<1.2
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -66,7 +66,7 @@ def convergence_StationaryDiffusion_2DFV_Neumann_DelaunayTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D Delaunay triangle meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D Delaunay triangle meshes: scheme order is ", -a)
     assert abs(a+0.6)<0.02
     
     # Plot of convergence curve
index 01eeb8e41c66b3f0874b5f379a33b43d25933e07..0728abf7f7b26f485c6c1c1a6d7645c768781561 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_2DFV_Neumann_RightTriangles():
     ### 2D FV right triangles mesh
     method = 'FV' 
     BC = 'Neumann'
-    meshList=[5,20,50,100, 200,400]
+    meshList=[5,20,50,100, 200]
     nbMeshes=len(meshList)
     error_tab=[0]*nbMeshes
     mesh_size_tab=[0]*nbMeshes
@@ -27,19 +27,19 @@ def convergence_StationaryDiffusion_2DFV_Neumann_RightTriangles():
     curv_abs=np.linspace(0,sqrt(2),resolution+1)
     plt.close('all')
     i=0
-    testColor="Orange \n (suspicious order 0 convergence), singular matrix"#Convergence of the linear solver if direct solver. Scheme seems to diverge (order -0.005)
+    testColor="Red, to be investigated"#Convergence of the linear solver if direct solver. Scheme seems to diverge (order -0.005)
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,1)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>-1.22
-               assert max_sol_num<1.
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>-1.22
+        assert max_sol_num<1.
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -65,7 +65,7 @@ def convergence_StationaryDiffusion_2DFV_Neumann_RightTriangles():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D right triangle meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D right triangle meshes: scheme order is ", -a)
     assert abs(a-0.005)<0.01
     
     # Plot of convergence curve
index cd3c35cae05701aed7e85c6bc2ac058586c89c63..125e2838d814281292938af1ba1c527f2f7201cf 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_2DFV_Neumann_Squares():
     ### 2D FV Square mesh
     method='FV'
     BC = 'Neumann'
-    meshList=[5,20,50,100, 200,400]
+    meshList=[5,20,50,100, 200]
     nbMeshes=len(meshList)
     error_tab=[0]*nbMeshes
     mesh_size_tab=[0]*nbMeshes
@@ -27,18 +27,18 @@ def convergence_StationaryDiffusion_2DFV_Neumann_Squares():
     curv_abs=np.linspace(0,sqrt(2),resolution+1)
     plt.close('all')
     i=0
-    testColor="Green, despite singular matrix"         
+    testColor="Red, to be investigated"        
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
-               assert min_sol_num>     -1.
-               assert max_sol_num<1.
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        assert min_sol_num>    -1.
+        assert max_sol_num<1.
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
         
     end = time.time()
 
@@ -63,7 +63,7 @@ def convergence_StationaryDiffusion_2DFV_Neumann_Squares():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 2D square meshes: scheme order is ", -a
+    print( "FV for diffusion on 2D square meshes: scheme order is ", -a)
     assert abs(a+2)<0.1
     
     # Plot of convergence curve
@@ -107,4 +107,4 @@ def convergence_StationaryDiffusion_2DFV_Neumann_Squares():
     with open('Convergence_Poisson_2DFV_'+mesh_name+'.json', 'w') as outfile:  
         json.dump(convergence_synthesis, outfile)
 if __name__ == """__main__""":
-       convergence_StationaryDiffusion_2DFV_Neumann_Squares()
+    convergence_StationaryDiffusion_2DFV_Neumann_Squares()
index cbcdf63fbf45bc7ae59b9c4113f4aa9d0f6fe0f6..41e7fbca9eef3ca945511986548b600d5fe51c54 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_3DFE_Dirichlet_DelaunayTetrahedra():
     ### 3D FE Delaunay Tetrahedra meshes
     method = 'FE'
     BC = 'Dirichlet'
-    meshList=['meshCubeTetrahedra_0','meshCubeTetrahedra_1','meshCubeTetrahedra_2','meshCubeTetrahedra_3','meshCubeTetrahedra_4','meshCubeTetrahedra_5','meshCubeTetrahedra_6']
+    meshList=['meshCubeTetrahedra_0','meshCubeTetrahedra_1','meshCubeTetrahedra_2','meshCubeTetrahedra_3','meshCubeTetrahedra_4','meshCubeTetrahedra_5']
     mesh_path=os.environ['CDMATH_INSTALL']+'/share/meshes/3DTetrahedra/'
     mesh_name='cubeWithDelaunayTetrahedra'
     meshType="Unstructured_Tetrahedra"
@@ -31,16 +31,16 @@ def convergence_StationaryDiffusion_3DFE_Dirichlet_DelaunayTetrahedra():
     testColor="Orange (not order 2)"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>=0 
-               assert max_sol_num<1
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>=0 
+        assert max_sol_num<1
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -65,7 +65,7 @@ def convergence_StationaryDiffusion_3DFE_Dirichlet_DelaunayTetrahedra():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FE for diffusion on 3D Delaunay tetrahedron meshes: scheme order is ", -a
+    print( "FE for diffusion on 3D Delaunay tetrahedron meshes: scheme order is ", -a)
     assert abs(a+0.627)<0.01
     
     # Plot of convergence curve
index 55c9d78155c344432fad2535770376661f6ee85a..5e144576d6dff4ab4712c12effbb5f6220e0043c 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_3DFE_Dirichlet_RegularTetrahedra():
     ### 3D FE Regular Tetrahedra meshes
     method = 'FE'
     BC = 'Dirichlet'
-    meshList=[5,20,50,70]
+    meshList=[5,10,20]
     mesh_name='cubeWithRegularTetrahedra'
     meshType="Regular_Tetrahedra"
     nbMeshes=len(meshList)
@@ -30,16 +30,16 @@ def convergence_StationaryDiffusion_3DFE_Dirichlet_RegularTetrahedra():
     testColor="Orange (not order 2)"
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,0,1,nx,1)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,0,1,nx,1)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>=0. 
-               assert max_sol_num<1.
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>=0. 
+        assert max_sol_num<1.
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
 
@@ -64,8 +64,8 @@ def convergence_StationaryDiffusion_3DFE_Dirichlet_RegularTetrahedra():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FE for diffusion on 3D regular tetrahedron meshes: scheme order is ", -a
-    assert abs(a+1.34)<0.001
+    print( "FE for diffusion on 3D regular tetrahedron meshes: scheme order is ", -a)
+    assert abs(a+1.34)<0.003
     
     # Plot of convergence curve
     plt.close()
index fe1856f6cdea5aeb62655e27b5cc90b19ec3fa60..7cac0cf75e621f613c0fe88b437fd5e8adf3ba92 100644 (file)
@@ -31,16 +31,16 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_DelaunayTetrahedra():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for filename in meshList:
-               my_mesh=cm.Mesh(mesh_path+filename+".med")
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(mesh_path+filename+".med")
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>=0
-               assert max_sol_num<1
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>=0
+        assert max_sol_num<1
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -66,7 +66,7 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_DelaunayTetrahedra():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 3D Delaunay tetrahedron meshes: scheme order is ", -a
+    print( "FV for diffusion on 3D Delaunay tetrahedron meshes: scheme order is ", -a)
     assert abs(a+0.54)<0.01
     
     # Plot of convergence curve
index 6b34d9d5616ea46aa91c64e7a5b6dc672d4c632c..524a57f0d5b9ffa3a8775a88801c0cb36c54bb79 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_RegularCubes():
     ### 3D FV Regular Cubes meshes
     method = 'FV'
     BC = 'Dirichlet'
-    meshList=[5,20,50,100]
+    meshList=[5,10,20,30]
     mesh_name='cubeWithRegularCubes'
     meshType="Regular_Cubes"
     nbMeshes=len(meshList)
@@ -30,16 +30,16 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_RegularCubes():
     testColor="Orange (not order 2)"
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,0,1,nx)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,0,1,nx)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>0. 
-               assert max_sol_num<1.
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>0. 
+        assert max_sol_num<1.
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
    
@@ -65,7 +65,7 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_RegularCubes():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 3D regular tetrahedron meshes: scheme order is ", -a
+    print( "FV for diffusion on 3D regular tetrahedron meshes: scheme order is ", -a)
     assert abs(a+1.34)<0.01
     
     # Plot of convergence curve
index 71aee7cf82cc62dd0e5d6ae24823d13905438b45..0458f494d0404de634eafda48fa646baa4e66e82 100644 (file)
@@ -15,7 +15,7 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_RegularTetrahedra():
     ### 3D FV Regular Tetrahedra meshes
     method = 'FV'
     BC = 'Dirichlet'
-    meshList=[5,10,20,30]
+    meshList=[5,10,15,20]
     mesh_name='cubeWithRegularTetrahedra'
     meshType="Regular_Tetrahedra"
     nbMeshes=len(meshList)
@@ -30,16 +30,16 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_RegularTetrahedra():
     testColor="Green"
     # Storing of numerical errors, mesh sizes and diagonal values
     for nx in meshList:
-               my_mesh=cm.Mesh(0,1,nx,0,1,nx,0,1,nx,1)
-               error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
+        my_mesh=cm.Mesh(0,1,nx,0,1,nx,0,1,nx,1)
+        error_tab[i], mesh_size_tab[i], diag_data[i], min_sol_num, max_sol_num, time_tab[i] =validationStationaryDiffusionEquation.SolveStationaryDiffusionEquation(my_mesh,resolution,meshType,method,BC)
 
-               assert min_sol_num>0. 
-               assert max_sol_num<1.
-               plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
-               error_tab[i]=log10(error_tab[i])
-               time_tab[i]=log10(time_tab[i])
-               mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
-               i=i+1
+        assert min_sol_num>0. 
+        assert max_sol_num<1.
+        plt.plot(curv_abs, diag_data[i], label= str(mesh_size_tab[i]) + ' cells')
+        error_tab[i]=log10(error_tab[i])
+        time_tab[i]=log10(time_tab[i])
+        mesh_size_tab[i] = 0.5*log10(mesh_size_tab[i])
+        i=i+1
     end = time.time()
         
 
@@ -64,8 +64,8 @@ def convergence_StationaryDiffusion_3DFV_Dirichlet_RegularTetrahedra():
     a=( a3*b1-a2*b2)/det
     b=(-a2*b1+a1*b2)/det
     
-    print "FV for diffusion on 3D regular tetrahedron meshes: scheme order is ", -a
-    assert abs(a+0.006)<0.001
+    print( "FV for diffusion on 3D regular tetrahedron meshes: scheme order is ", -a)
+    assert abs(a+0.0006)<0.001
     
     # Plot of convergence curve
     plt.close()
index a70325657ca642754b6304fe269f419996eb6c6c..d6d869b8a443bacec8b430c41c95ae3b8d8cdffe 100644 (file)
@@ -201,11 +201,11 @@ def SolveStationaryDiffusionEquation(my_mesh,resolution,MeshType,method,BC):
                erreur_abs=0
                if method =='FE':
                        for i in range(my_mesh.getNumberOfNodes()) :
-                               if erreur_abs < abs(my_RHSfield[i]/(spaceDim*pi*pi) - my_ResultField[i]) :
+                               if  erreur_abs < abs(my_RHSfield[i]/(spaceDim*pi*pi) - my_ResultField[i]) :
                                        erreur_abs = abs(my_RHSfield[i]/(spaceDim*pi*pi) - my_ResultField[i])
                else:
                        for i in range(my_mesh.getNumberOfCells()) :
-                               if erreur_abs < abs(my_RHSfield[i]/(spaceDim*pi*pi) - my_ResultField[i]) :
+                               if  erreur_abs < abs(my_RHSfield[i]/(spaceDim*pi*pi) - my_ResultField[i]) :
                                        erreur_abs = abs(my_RHSfield[i]/(spaceDim*pi*pi) - my_ResultField[i])                           
                print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
                print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)