../../ressources/meshSphere.med
)
-file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tests/examples/Poisson3DSphereEF)
+file(COPY ${MESH_MED} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
install(FILES ${MESH_MED} DESTINATION share/examples/Poisson3DSphereEF)
if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO)
S1,S2 = staggeredMatrices(dt/dx,scaling)
for k in range(nbCells):#On parcourt les cellules
if ( k==0) :
- implMat.addValue(k*nbComp, (k+1)*nbComp, S1)
- implMat.addValue(k*nbComp, k *nbComp, S1*(-1.))
+ implMat.addValue(k*nbComp, (k+1)*nbComp, S1)
+ implMat.addValue(k*nbComp, k *nbComp, S1*(-1.))
elif ( k==nbCells-1) :
- implMat.addValue(k*nbComp, k *nbComp, S2)
- implMat.addValue(k*nbComp, (k-1)*nbComp, S2*(-1.))
+ implMat.addValue(k*nbComp, k *nbComp, S2)
+ implMat.addValue(k*nbComp, (k-1)*nbComp, S2*(-1.))
else :
- implMat.addValue(k*nbComp, (k+1)*nbComp, S1)
- implMat.addValue(k*nbComp, k *nbComp, S1*(-1.))
+ implMat.addValue(k*nbComp, (k+1)*nbComp, S1)
+ implMat.addValue(k*nbComp, k *nbComp, S1*(-1.))
- implMat.addValue(k*nbComp, k *nbComp, S2)
- implMat.addValue(k*nbComp, (k-1)*nbComp, S2*(-1.))
+ implMat.addValue(k*nbComp, k *nbComp, S2)
+ implMat.addValue(k*nbComp, (k-1)*nbComp, S2*(-1.))
return implMat
Fr=numericalFlux(Uj,Ujp1,absA)
Fl=numericalFlux(Ujm1,Uj,absA)
- sumFluxCourant = (Fr - Fl)*0.5/Cj.getMeasure()
+ sumFluxCourant = (Fr - Fl)*0.5*(1./Cj.getMeasure())
#On divise par le volume de la cellule la contribution des flux au snd membre
for i in range(nbComp):
A,absA= jacobianMatrices(dt/dx,scaling)
for j in range(nbCells):#On parcourt les cellules
if ( j==0) :
- implMat.addValue(j*nbComp,(j+1)*nbComp,(A-absA)/2)
- implMat.addValue(j*nbComp, j*nbComp,(A-absA)/2*(-1.))
+ implMat.addValue(j*nbComp,(j+1)*nbComp,(A-absA)*(1./2))
+ implMat.addValue(j*nbComp, j*nbComp,(A-absA)*(-1./2))
elif ( j==nbCells-1) :
- implMat.addValue(j*nbComp, j*nbComp,(A+absA)/2)
- implMat.addValue(j*nbComp,(j-1)*nbComp,(A+absA)/2*(-1.))
+ implMat.addValue(j*nbComp, j*nbComp,(A+absA)*(1./2))
+ implMat.addValue(j*nbComp,(j-1)*nbComp,(A+absA)*(-1./2))
else :
- implMat.addValue(j*nbComp,(j+1)*nbComp,(A-absA)/2)
- implMat.addValue(j*nbComp, j*nbComp,(A-absA)/2*(-1.))
+ implMat.addValue(j*nbComp,(j+1)*nbComp,(A-absA)*(1./2))
+ implMat.addValue(j*nbComp, j*nbComp,(A-absA)*(-1./2))
- implMat.addValue(j*nbComp, j*nbComp,(A+absA)/2)
- implMat.addValue(j*nbComp,(j-1)*nbComp,(A+absA)/2*(-1.))
+ implMat.addValue(j*nbComp, j*nbComp,(A+absA)*(1./2))
+ implMat.addValue(j*nbComp,(j-1)*nbComp,(A+absA)*(-1./2))
return implMat
for j in range(dim):
absA[i+1,j+1]=c0*normal[i]*normal[j]*coeff
- return (A - absA)/2
+ return (A - absA)*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
nbCells = my_mesh.getNumberOfCells()
A[i+1,0]=normal[i]*coeff
A[0,i+1]=c0*c0*normal[i]*coeff
- return A/2
+ return A*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
A[0,i+1]=c0*c0*normal[i]*coeff
absA[0,i+1]=signun*A[0,i+1]
- return (A-absA)/2
+ return (A-absA)*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
for j in range(dim):
absA[i+1,j+1]=c0*normal[i]*normal[j]*coeff
- return (A - absA)/2
+ return (A - absA)*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
nbCells = my_mesh.getNumberOfCells()
A[i+1,0]=normal[i]*coeff
A[0,i+1]=c0*c0*normal[i]*coeff
- return A/2
+ return A*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
A[0,i+1]=c0*c0*normal[i]*coeff
absA[0,i+1]=signun*A[0,i+1]
- return (A-absA)/2
+ return (A-absA)*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
for j in range(dim):
absA[i+1,j+1]=c0*normal[i]*normal[j]*coeff
- return (A - absA)/2
+ return (A - absA)*(1./2)
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt):
nbCells = my_mesh.getNumberOfCells()