From: michael Date: Mon, 5 Oct 2020 17:31:02 +0000 (+0200) Subject: Corrected error in tests (indentation and mesh location) X-Git-Tag: V9_6_0~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a300c8d4109871411423667f77abf14d28178c7c;p=tools%2Fsolverlab.git Corrected error in tests (indentation and mesh location) --- diff --git a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt b/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt index 0bfab07..fb390a0 100755 --- a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt +++ b/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt @@ -3,7 +3,7 @@ SET(MESH_MED ../../ressources/diskWithTriangles.med ) -file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson2DEF_DISK_StiffBC) +file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/Poisson2DEF_DISK_StiffBC) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py b/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py index d7e4ca2..46e9c35 100755 --- a/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py +++ b/CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py @@ -129,9 +129,9 @@ for i in range(nbCells): 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} @@ -164,7 +164,7 @@ for i in range(nbCells): 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/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt b/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt index 0ac4c9c..99f13a4 100755 --- a/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt +++ b/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt @@ -3,7 +3,7 @@ SET(MESH_MED ../../ressources/squareWithTriangles.med ) -file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson2DEF_SQUARE_StiffBC) +file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/Poisson2DEF_SQUARE_StiffBC) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py b/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py index 1911238..d58fb6b 100755 --- a/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py +++ b/CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py @@ -128,9 +128,9 @@ for i in range(nbCells): 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} @@ -163,7 +163,7 @@ for i in range(nbCells): 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/examples/Poisson3DCubeSkinEF/CMakeLists.txt b/CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt index 4ceac67..3765230 100755 --- a/CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt +++ b/CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt @@ -3,7 +3,7 @@ SET(MESH_MED ../../ressources/meshCubeSkin.med ) -file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson3DCubeSkinEF) +file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DCubeSkinEF) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py b/CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py index ecaf232..3573c2a 100644 --- a/CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py +++ b/CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py @@ -102,7 +102,7 @@ for i in range(nbCells): normalFace1[2]=Ci.getNormalVector(1,2) normalCell = normalFace0.crossProduct(normalFace1) - normalCell = normalCell/normalCell.norm() + normalCell = normalCell*(1/normalCell.norm()) cellMat=cdmath.Matrix(4) cellMat[0,0]=N0.x() @@ -123,15 +123,15 @@ for i in range(nbCells): cellMat[3,3]=0 #Formule des gradients voir EF P1 -> calcul déterminants - GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()/2 - GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()/2 - GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()/2 - GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()/2 - GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()/2 - GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()/2 - GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()/2 - GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()/2 - GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()/2 + GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()*0.5 + GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()*0.5 + GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()*0.5 + GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()*0.5 + GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()*0.5 + GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()*0.5 + GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()*0.5 + GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()*0.5 + GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()*0.5 #Création d'un tableau (numéro du noeud, gradient de la fonction de forme GradShapeFuncs={nodeId0 : GradShapeFunc0} diff --git a/CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt b/CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt index e4e0eb5..4d64cd1 100755 --- a/CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt +++ b/CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt @@ -3,7 +3,7 @@ SET(MESH_MED ../../ressources/meshSphere.med ) -file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson3DSphereEF) +file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tests/examples/Poisson3DSphereEF) install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DSphereEF) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py b/CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py index 690b867..274586a 100644 --- a/CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py +++ b/CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py @@ -92,7 +92,7 @@ for i in range(nbCells): normalFace1[2]=Ci.getNormalVector(1,2) normalCell = normalFace0.crossProduct(normalFace1) - normalCell = normalCell/normalCell.norm() + normalCell = normalCell*(1/normalCell.norm()) cellMat=cdmath.Matrix(4) cellMat[0,0]=N0.x() @@ -113,15 +113,15 @@ for i in range(nbCells): cellMat[3,3]=0 #Formule des gradients voir EF P1 -> calcul déterminants - GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()/2 - GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()/2 - GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()/2 - GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()/2 - GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()/2 - GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()/2 - GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()/2 - GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()/2 - GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()/2 + GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()*0.5 + GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()*0.5 + GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()*0.5 + GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()*0.5 + GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()*0.5 + GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()*0.5 + GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()*0.5 + GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()*0.5 + GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()*0.5 #Création d'un tableau (numéro du noeud, gradient de la fonction de forme GradShapeFuncs={nodeId0 : GradShapeFunc0} diff --git a/CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt b/CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt index a4fd34f..7da0838 100755 --- a/CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt +++ b/CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt @@ -3,7 +3,7 @@ SET(MESH_MED ../../ressources/meshTorus.med ) -file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson3DTorusEF) +file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DTorusEF) if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) diff --git a/CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py b/CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py index d99fc87..0b7612c 100755 --- a/CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py +++ b/CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py @@ -100,7 +100,7 @@ for i in range(nbCells): normalFace1[2]=Ci.getNormalVector(1,2) normalCell = normalFace0.crossProduct(normalFace1) - normalCell = normalCell/normalCell.norm() + normalCell = normalCell*(1/normalCell.norm()) cellMat=cdmath.Matrix(4) cellMat[0,0]=N0.x() @@ -121,15 +121,15 @@ for i in range(nbCells): cellMat[3,3]=0 #Formule des gradients voir EF P1 -> calcul déterminants - GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()/2 - GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()/2 - GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()/2 - GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()/2 - GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()/2 - GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()/2 - GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()/2 - GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()/2 - GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()/2 + GradShapeFunc0[0]= cellMat.partMatrix(0,0).determinant()*0.5 + GradShapeFunc0[1]=-cellMat.partMatrix(0,1).determinant()*0.5 + GradShapeFunc0[2]= cellMat.partMatrix(0,2).determinant()*0.5 + GradShapeFunc1[0]=-cellMat.partMatrix(1,0).determinant()*0.5 + GradShapeFunc1[1]= cellMat.partMatrix(1,1).determinant()*0.5 + GradShapeFunc1[2]=-cellMat.partMatrix(1,2).determinant()*0.5 + GradShapeFunc2[0]= cellMat.partMatrix(2,0).determinant()*0.5 + GradShapeFunc2[1]=-cellMat.partMatrix(2,1).determinant()*0.5 + GradShapeFunc2[2]= cellMat.partMatrix(2,2).determinant()*0.5 #Création d'un tableau (numéro du noeud, gradient de la fonction de forme GradShapeFuncs={nodeId0 : GradShapeFunc0}