M.setGroupAtPlan(ysup,1,eps,"Bord3")
M.setGroupAtPlan(yinf,1,eps,"Bord4")
- print "Built a regular triangular 2D mesh from a square mesh with ", nx,"x" ,ny, " cells"
+ print( "Built a regular triangular 2D mesh from a square mesh with ", nx,"x" ,ny, " cells")
FEComputation=True
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
xsup = 1.0;
yinf = 0.0;
ysup = 1.0;
- nx=20;
- ny=20;
+ nx=3;
+ ny=3;
M=cm.Mesh(xinf,xsup,nx,yinf,ysup,ny,0)#Regular triangular mesh
# set the limit field for each boundary
eps=1e-6;
M.setGroupAtPlan(ysup,1,eps,"Bord3")
M.setGroupAtPlan(yinf,1,eps,"Bord4")
- print "Built a regular triangular 2D mesh from a square mesh with ", nx,"x" ,ny, " cells"
+ print( "Built a regular triangular 2D mesh from a square mesh with ", nx,"x" ,ny, " cells")
FEComputation=True
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
M.setGroupAtPlan(ysup,1,eps,"Bord3")
M.setGroupAtPlan(yinf,1,eps,"Bord4")
- print "Built a regular 2D square mesh with ", nx,"x" ,ny, " cells"
+ print( "Built a regular 2D square mesh with ", nx,"x" ,ny, " cells")
FEComputation=False
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
M.setGroupAtPlan(ysup,1,eps,"Bord3")
M.setGroupAtPlan(yinf,1,eps,"Bord4")
- print "Built a regular 2D square mesh with ", nx,"x" ,ny, " cells"
+ print( "Built a regular 2D square mesh with ", nx,"x" ,ny, " cells")
FEComputation=False
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
myProblem.setMesh(M);
- # set the limit value for each boundary
- T1=0;
- T2=0;
- T3=0;
- T4=0;
-
myProblem.setNeumannBoundaryCondition("Bord1")
myProblem.setNeumannBoundaryCondition("Bord2")
myProblem.setNeumannBoundaryCondition("Bord3")
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
M.setGroupAtPlan(ysup,1,eps,"Bord3")
M.setGroupAtPlan(yinf,1,eps,"Bord4")
- print "Built a regular triangular 2D mesh from a square mesh with ", nx,"x" ,ny, " cells"
+ print( "Built a regular triangular 2D mesh from a square mesh with ", nx,"x" ,ny, " cells")
FEComputation=False
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
M.setGroupAtPlan(zsup,2,eps,"Bord5")
M.setGroupAtPlan(zinf,2,eps,"Bord6")
- print "Built a regular tetrahedra 3D mesh from a cube mesh with ", nx,"x" ,ny,"x" ,nz, " cells"
+ print( "Built a regular tetrahedra 3D mesh from a cube mesh with ", nx,"x" ,ny,"x" ,nz, " cells")
FEComputation=True
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
#==============================================
my_mesh = cdmath.Mesh("../resources/RoomWithTetras2488.med")
- print "Loaded unstructured 3D mesh"
+ print( "Loaded unstructured 3D mesh")
#Conditions limites
Tmur=20
M.setGroupAtPlan(zsup,2,eps,"Bord5")
M.setGroupAtPlan(zinf,2,eps,"Bord6")
- print "Built a regular 3D cube mesh with ", nx,"x" ,ny,"x" ,nz, " cells"
+ print( "Built a regular 3D cube mesh with ", nx,"x" ,ny,"x" ,nz, " cells")
FEComputation=False
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
M.setGroupAtPlan(zsup,2,eps,"Bord5")
M.setGroupAtPlan(zinf,2,eps,"Bord6")
- print "Built a regular 3D tetrahedral mesh from ", nx,"x" ,ny,"x" ,nz, " cubic cells"
+ print( "Built a regular 3D tetrahedral mesh from ", nx,"x" ,ny,"x" ,nz, " cubic cells")
FEComputation=False
myProblem = cf.StationaryDiffusionEquation(spaceDim,FEComputation);
print("Absolute error = max(| exact solution - numerical solution |) = ",erreur_abs )
print("Relative error = max(| exact solution - numerical solution |)/max(| exact solution |) = ",erreur_abs/max_abs_sol_exacte)
- print ("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
+ print("Maximum numerical solution = ", max_sol_num, " Minimum numerical solution = ", min_sol_num)
assert erreur_abs/max_abs_sol_exacte <1.
- pass
+ pass
print( "------------ !!! End of calculation !!! -----------" );
#==============================================
my_mesh = cdmath.Mesh("../resources/RoomWithCubes480.med")
- print "Loaded Structured 3D mesh"
+ print( "Loaded Structured 3D mesh")
#Conditions limites
Tmur=20
#==============================================
my_mesh = cdmath.Mesh("../resources/RoomWithTetras2488.med")
- print "Loaded Structured 3D mesh"
+ print( "Loaded Structured 3D mesh")
#Conditions limites
Tmur=20