From 305d033b3e97506bdc2720f689ced8d1333aabc0 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 29 Nov 2020 00:03:22 +0100 Subject: [PATCH] Replaced /2 by *0.5 --- .../FiniteElements2DPoissonStiffBC_DISK.py | 8 ++++---- .../FiniteElements2DPoissonStiffBC_SQUARE.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_DISK/FiniteElements2DPoissonStiffBC_DISK.py mode change 100644 => 100755 CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_SQUARE/FiniteElements2DPoissonStiffBC_SQUARE.py diff --git a/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_DISK/FiniteElements2DPoissonStiffBC_DISK.py b/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_DISK/FiniteElements2DPoissonStiffBC_DISK.py old mode 100644 new mode 100755 index 497dbf1..cd1775d --- a/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_DISK/FiniteElements2DPoissonStiffBC_DISK.py +++ b/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_DISK/FiniteElements2DPoissonStiffBC_DISK.py @@ -154,9 +154,9 @@ def solve(filename,resolution,meshName, testColor): values1=[0,1,0] values2=[0,0,1] - GradShapeFunc0 = gradientNodal(M,values0)/2 - GradShapeFunc1 = gradientNodal(M,values1)/2 - GradShapeFunc2 = gradientNodal(M,values2)/2 + GradShapeFunc0 = gradientNodal(M,values0)*0.5 + GradShapeFunc1 = gradientNodal(M,values1)*0.5 + GradShapeFunc2 = gradientNodal(M,values2)*0.5 #Création d'un tableau (numéro du noeud, gradient de la fonction de forme) GradShapeFuncs={nodeId0 : GradShapeFunc0} @@ -189,7 +189,7 @@ def solve(filename,resolution,meshName, testColor): else: u2=0 boundaryContributionAdded=True#Contribution from the boundary to matrix line j is done in one step - GradGh = gradientNodal(M,[u0,u1,u2])/2 + GradGh = gradientNodal(M,[u0,u1,u2])*0.5 RHS[j_int] += -(GradGh*GradShapeFuncs[j])/Ci.getMeasure() print("Linear system matrix building done") diff --git a/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_SQUARE/FiniteElements2DPoissonStiffBC_SQUARE.py b/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_SQUARE/FiniteElements2DPoissonStiffBC_SQUARE.py old mode 100644 new mode 100755 index 2b72d89..6824858 --- a/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_SQUARE/FiniteElements2DPoissonStiffBC_SQUARE.py +++ b/CDMATH/tests/validation/scripts/Poisson2DEF_StiffBC_SQUARE/FiniteElements2DPoissonStiffBC_SQUARE.py @@ -152,9 +152,9 @@ def solve(filename,resolution,meshName, testColor): values1=[0,1,0] values2=[0,0,1] - GradShapeFunc0 = gradientNodal(M,values0)/2 - GradShapeFunc1 = gradientNodal(M,values1)/2 - GradShapeFunc2 = gradientNodal(M,values2)/2 + GradShapeFunc0 = gradientNodal(M,values0)*0.5 + GradShapeFunc1 = gradientNodal(M,values1)*0.5 + GradShapeFunc2 = gradientNodal(M,values2)*0.5 #Création d'un tableau (numéro du noeud, gradient de la fonction de forme) GradShapeFuncs={nodeId0 : GradShapeFunc0} @@ -187,7 +187,7 @@ def solve(filename,resolution,meshName, testColor): else: u2=0 boundaryContributionAdded=True#Contribution from the boundary to matrix line j is done in one step - GradGh = gradientNodal(M,[u0,u1,u2])/2 + GradGh = gradientNodal(M,[u0,u1,u2])*0.5 RHS[j_int] += -(GradGh*GradShapeFuncs[j])/Ci.getMeasure() print("Linear system matrix building done") -- 2.39.2