../../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)
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}
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")
../../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)
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}
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")
../../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)
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()
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}
../../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)
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()
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}
../../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)
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()
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}