A[0,i+1]= c0*normal[i]*coeff
A[i+1,0]= c0*normal[i]*coeff
- return A/2
+ return A*0.5
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt,scaling,test_bc):
LS=cdmath.LinearSolver(divMat,Un+S*dt,iterGMRESMax, precision, "GMRES","ILU")
else:
LS=cdmath.LinearSolver(divMat,Vn+S*dt,iterGMRESMax, precision, "GMRES","ILU")
- LS.setComputeConditionNumber()
test_desc["Linear_solver_algorithm"]=LS.getNameOfMethod()
test_desc["Linear_solver_preconditioner"]=LS.getNameOfPc()
test_desc["Linear_system_max_actual_iterations_number"]=max(LS.getNumberOfIter(),test_desc["Linear_system_max_actual_iterations_number"])
test_desc["Linear_system_max_actual_error"]=max(LS.getResidu(),test_desc["Linear_system_max_actual_error"])
- test_desc["Linear_system_max_actual_condition number"]=max(LS.getConditionNumber(),test_desc["Linear_system_max_actual_condition number"])
maxVector=dUn.maxVector(dim+1)
#Sauvegardes
if(it==1 or it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
- print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
+ print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
if(with_source):
print("Variation temporelle relative : pressure ", maxVector[0] ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0)
else:
else:
print("Ecart au stationnaire exact : error_p= ",delta_press/p0," error_||u||= ",delta_v.maxVector()[0])
print
- print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
+ print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
if(with_source):
print("Variation temporelle relative : pressure ", maxVector[0] ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0)
else:
absA[0,i+1]= signun*A[0,i+1]
absA[i+1,0]=-signun*A[i+1,0]
- return (A-absA)/2
+ return (A-absA)*0.5
def computeDivergenceMatrix(my_mesh,nbVoisinsMax,dt,scaling,test_bc):
LS=cdmath.LinearSolver(divMat,Un+S*dt,iterGMRESMax, precision, "GMRES","ILU")
else:
LS=cdmath.LinearSolver(divMat,Vn+S*dt,iterGMRESMax, precision, "GMRES","ILU")
- LS.setComputeConditionNumber()
test_desc["Linear_solver_algorithm"]=LS.getNameOfMethod()
test_desc["Linear_solver_preconditioner"]=LS.getNameOfPc()
test_desc["Linear_system_max_actual_iterations_number"]=max(LS.getNumberOfIter(),test_desc["Linear_system_max_actual_iterations_number"])
test_desc["Linear_system_max_actual_error"]=max(LS.getResidu(),test_desc["Linear_system_max_actual_error"])
- test_desc["Linear_system_max_actual_condition number"]=max(LS.getConditionNumber(),test_desc["Linear_system_max_actual_condition number"])
maxVector=dUn.maxVector(dim+1)
#Sauvegardes
if(it==1 or it%output_freq==0 or it>=ntmax or isStationary or time >=tmax):
- print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
+ print( "-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt) )
if(with_source):
print("Variation temporelle relative : pressure ", maxVector[0] ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0)
else:
else:
print("Ecart au stationnaire exact : error_p= ",delta_press/p0," error_||u||= ",delta_v.maxVector()[0])
print
- print"-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt)
+ print("-- Iter: " + str(it) + ", Time: " + str(time) + ", dt: " + str(dt))
if(with_source):
print("Variation temporelle relative : pressure ", maxVector[0] ,", velocity x", maxVector[1]/rho0 ,", velocity y", maxVector[2]/rho0)
else: