Salome HOME
Corrected error in all Poisson tests (indentation and mesh location)
authormichael <michael@localhost.localdomain>
Mon, 5 Oct 2020 17:46:35 +0000 (19:46 +0200)
committermichael <michael@localhost.localdomain>
Mon, 5 Oct 2020 17:46:35 +0000 (19:46 +0200)
CDMATH/tests/examples/Poisson3DEF/CMakeLists.txt
CDMATH/tests/examples/Poisson3DEF/FiniteElements3DPoisson_CUBE.py
CDMATH/tests/examples/Poisson3DEF_BALL/CMakeLists.txt
CDMATH/tests/examples/Poisson3DEF_BALL/FiniteElements3DPoisson_BALL.py
CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/CMakeLists.txt
CDMATH/tests/examples/Poisson3DEF_RadiatorAndWindow/FiniteElements3DPoisson_CUBE_RadiatorAndWindow.py
CDMATH/tests/examples/Poisson3DVF_BALL/FiniteVolumes3DPoisson_BALL.py
CDMATH/tests/examples/SpectrumLaplace2DEF/SpectrumLaplace2DEF_SQUARE.py
CDMATH/tests/examples/SpectrumLaplaceBeltrami3DEF/SpectrumFiniteElements3DLaplace-Beltrami.py

index b55c3edad28a093a039b699a391bb0483275d971..286cc1a0d8886f7d9c629a457a6085075dcabc86 100755 (executable)
@@ -3,7 +3,7 @@ SET(MESH_MED
   ../../ressources/meshCube.med
   )
 
-file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson3DEF)
+file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DEF)
 
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
index 3aed331854c41ffa6242dcc264a4f421a0bc7945..6317e942aa537463a1380afc9c606ad35982deb5 100644 (file)
@@ -121,7 +121,7 @@ for i in range(nbCells):
                        #Ajout de la contribution de la cellule triangulaire i au second membre du noeud j 
                        RHS[j_int]=Ci.getMeasure()/4*my_RHSfield[j]+RHS[j_int] # intégrale dans le triangle du produit f x fonction de base
                        #Contribution de la cellule tétraédrique i à la ligne j_int du système linéaire
-                       for k in [nodeId0,nodeId1,nodeId2,nodeId3] :
+                       for k in [nodeId0,nodeId1,nodeId2,nodeId3] :
                                if boundaryNodes.count(k)==0 : #seuls les noeuds intérieurs contribuent à la matrice du système linéaire
                                        k_int=interiorNodes.index(k)#indice du noeud k en tant que noeud intérieur
                                        Rigidite.addValue(j_int,k_int,GradShapeFuncs[j]*GradShapeFuncs[k]/Ci.getMeasure())
index 7790282f5027512684427e397a73bebe18de10fc..1a05b09db6eba0765e37069e00aef89fde6c360b 100755 (executable)
@@ -3,7 +3,7 @@ SET(MESH_MED
   ../../ressources/ballWithTetrahedra.med
   )
 
-file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson3DEF_BALL)
+file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DEF_BALL)
 
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
index b53f1e009543d14ba221c85ff4e14268e9f7a3e0..b9f0f142fc675a4b3950fb3ac3a0397c609236a7 100755 (executable)
@@ -119,7 +119,7 @@ for i in range(nbCells):
                        #Ajout de la contribution de la cellule triangulaire i au second membre du noeud j 
                        RHS[j_int]=Ci.getMeasure()/4*my_RHSfield[j]+RHS[j_int] # intégrale dans le triangle du produit f x fonction de base
                        #Contribution de la cellule triangulaire i à la ligne j_int du système linéaire
-                       for k in [nodeId0,nodeId1,nodeId2,nodeId3] :
+                       for k in [nodeId0,nodeId1,nodeId2,nodeId3] :
                                if boundaryNodes.count(k)==0 : #seuls les noeuds intérieurs contribuent à la matrice du système linéaire
                                        k_int=interiorNodes.index(k)#indice du noeud k en tant que noeud intérieur
                                        Rigidite.addValue(j_int,k_int,GradShapeFuncs[j]*GradShapeFuncs[k]/Ci.getMeasure())
index 545bd5f968fa3af8300f3fc1a75119dc0898706a..f628489685f9faff8199e4993f6cb00d6faaef11 100755 (executable)
@@ -3,7 +3,7 @@ SET(MESH_MED
   ./Mesh_RadiatorAndWindow.med
   )
 
-file(COPY ${MESH_MED} DESTINATION ${CMAKE_BINARY_DIR}/tests/examples/Poisson3DEF_RadiatorAndWindow)
+file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DEF_RadiatorAndWindow)
 
 if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
index 3ec911c84063e479a5d042eaeb4cafdb21ca3e5f..f58010b697b7f2a2117bcdbd1e3a14629b7e3f8f 100755 (executable)
@@ -140,10 +140,10 @@ for i in range(nbCells):
        values2=[0,0,1,0]
        values3=[0,0,0,1]
 
-       GradShapeFunc0 = gradientNodal(M,values0)/6
-       GradShapeFunc1 = gradientNodal(M,values1)/6
-       GradShapeFunc2 = gradientNodal(M,values2)/6
-       GradShapeFunc3 = gradientNodal(M,values3)/6
+       GradShapeFunc0 = gradientNodal(M,values0)*(1./6)
+       GradShapeFunc1 = gradientNodal(M,values1)*(1./6)
+       GradShapeFunc2 = gradientNodal(M,values2)*(1./6)
+       GradShapeFunc3 = gradientNodal(M,values3)*(1./6)
        
        #Création d'un tableau (numéro du noeud, gradient de la fonction de forme)
        GradShapeFuncs={nodeId0 : GradShapeFunc0}
@@ -168,7 +168,7 @@ for i in range(nbCells):
                                        T2 = boundaryValue(nodeId2)
                                        T3 = boundaryValue(nodeId3)
                                        boundaryContributionAdded=True#Contribution from the boundary to matrix line j is done in one step
-                                       GradGh = gradientNodal(M,[T0,T1,T2,T3])/6
+                                       GradGh = gradientNodal(M,[T0,T1,T2,T3])*(1./6)
                                        RHS[j_int] += -(GradGh*GradShapeFuncs[j])/Ci.getMeasure()
             
 
index 940eb2c0edbfcf02e466a690de871162a1445226..a09d3fda72a4933266fb02a18334d26c561b2d56 100755 (executable)
@@ -78,7 +78,7 @@ for i in range(nbCells):
                        Ck=my_mesh.getCell(k)
                        distance=Ci.getBarryCenter().distance(Ck.getBarryCenter())
                        coeff=Fj.getMeasure()/Ci.getMeasure()/distance
-                       Rigidite.setValue(i,k,-coeff) # terme extradiagonal
+                       Rigidite.addValue(i,k,-coeff) # terme extradiagonal
                else:
                        coeff=Fj.getMeasure()/Ci.getMeasure()/Ci.getBarryCenter().distance(Fj.getBarryCenter())
                Rigidite.addValue(i,i,coeff) # terme diagonal
index 5443f211dc565cf045f94dbb2fc09712674a36e0..f34f58aaf1783ab4bc02d3162178af71feee817e 100755 (executable)
@@ -110,7 +110,7 @@ for i in range(nbCells):
                        j_int=interiorNodes.index(j)#indice du noeud j en tant que noeud intérieur
                        nodal_volumes[j_int]+=Ci.getMeasure()/3
                        #Contribution de la cellule triangulaire i à la ligne j_int du système linéaire
-                       for k in [nodeId0,nodeId1,nodeId2] : 
+                       for k in [nodeId0,nodeId1,nodeId2] : 
                                if boundaryNodes.count(k)==0 : #seuls les noeuds intérieurs contribuent à la matrice du système linéaire
                                        k_int=interiorNodes.index(k)#indice du noeud k en tant que noeud intérieur
                                        Rigidite.addValue(j_int,k_int,GradShapeFuncs[j]*GradShapeFuncs[k]/Ci.getMeasure())
index 59439bbc2679664af26321ccdf59a4826122be24..a6b3f3efcc6e003210fd3b445917b278ee968970 100755 (executable)
@@ -66,7 +66,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()
@@ -87,15 +87,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}