]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Corrected error in tests (indentation and mesh location)
authormichael <michael@localhost.localdomain>
Mon, 5 Oct 2020 17:31:02 +0000 (19:31 +0200)
committermichael <michael@localhost.localdomain>
Mon, 5 Oct 2020 17:31:02 +0000 (19:31 +0200)
CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/CMakeLists.txt
CDMATH/tests/examples/Poisson2DEF_DISK_StiffBC/FiniteElements2DPoisson_DISK_StiffBC.py
CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/CMakeLists.txt
CDMATH/tests/examples/Poisson2DEF_SQUARE_StiffBC/FiniteElements2DPoisson_SQUARE_StiffBC.py
CDMATH/tests/examples/Poisson3DCubeSkinEF/CMakeLists.txt
CDMATH/tests/examples/Poisson3DCubeSkinEF/FiniteElements3DPoissonCubeSkin.py
CDMATH/tests/examples/Poisson3DSphereEF/CMakeLists.txt
CDMATH/tests/examples/Poisson3DSphereEF/FiniteElements3DPoissonSphere.py
CDMATH/tests/examples/Poisson3DTorusEF/CMakeLists.txt
CDMATH/tests/examples/Poisson3DTorusEF/FiniteElements3DPoissonTorus.py

index 0bfab07baf60455a0d06c674bb750429be8f94be..fb390a043d2e5890cd475d50838d07f9698ecdd0 100755 (executable)
@@ -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)
index d7e4ca27739f1efa6b534db32241ac2dccb50df6..46e9c35490df18b477469ac845d457d2c6efddf4 100755 (executable)
@@ -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")
index 0ac4c9c3ccc927d04729c48ec57c0f88c100238a..99f13a447f091d060b544b219d672aca11fbc7c2 100755 (executable)
@@ -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)
index 19112382225c925498823fbb306174768025e40c..d58fb6b11a5a02252e59df58b7e11db1ed911bd3 100755 (executable)
@@ -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")
index 4ceac67c9f6a7ccd5c8975e53ed15591ce793f3c..37652302ad3b33524c2e39a81afb73fbf22c6332 100755 (executable)
@@ -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)
index ecaf232c8b39e3839a697e816ae8a95bc825b27f..3573c2a8ff54b6c9d67270d515d2c0ed3642e232 100644 (file)
@@ -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}
index e4e0eb5f967c3f8f9e08e70d84dbc5738bf8218e..4d64cd12341ef4c94c343418ecbdaf65f6e5d1a8 100755 (executable)
@@ -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)
index 690b867210e6b479402b5fd64f126f17a6c4453e..274586a261f0868fc69bf88bd9a97a55bcd64359 100644 (file)
@@ -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}
index a4fd34f4621b9287f7b9c088144220330f91da58..7da0838b074dbab0ab94c0e43a375fab5af0d045 100755 (executable)
@@ -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)
index d99fc8700950a374eb6fc7d85fccd2b24129035d..0b7612c91f5406f8d871639a7671897f3c357550 100755 (executable)
@@ -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}