Get expected rate - print error rate inconsistency
@@ -110,6 +110,7 @@ def run_convergence(mesh, test_name, problem_folder, param):
iterations = numpy.zeros(len(mesh))
Cext = numpy.zeros(len(mesh))
Time = numpy.zeros(len(mesh))
+
for i in range(len(mesh)):
try:
print('Start run for mesh '+mesh[i])
@@ -125,10 +126,20 @@ def run_convergence(mesh, test_name, problem_folder, param):
Cext[i] = results.get('Cext', 0)
Time[i] = results['total_time']
+ mesh_ratio = mesh_ratio(N)
+
+ if all(ratio==mesh_ratio[0] for ratio in mesh_ratio):
+ expected_rate = mesh_ratio[0]
+ else:
+ print('Mesh ratio inconsistency. \nCheck that the mesh ratio'
+ 'remains constant along refinement'
+ 'Convergence test report will bad convergence for this reason')
+ expected_rate = 0
+
except (pycuda._driver.MemoryError, pycuda._driver.LaunchError) as e:
print('Mesh {} failed due to insufficient memory.'
'Skipping this test, but convergence test should still complete'.format(mesh[i]))
time.sleep(4)
- return(N, iterations, Esolv, Esurf, Ecoul, Time)
+ return(N, iterations, expected_rate, Cext, Time)
