4from postProcess
import parse_patch_file
9Execute test1.py -m release,
10Run ./peano4matrixfree > out.txt
15subprocess.run([
"git",
"clean",
"-xdf"], check=
True)
19subprocess.run([
"python3",
"test1.py",
"-m",
"release",
"-p", str(poly_degree)], check=
True)
22exec_path = os.path.join(os.getcwd(),
"peano4matrixfree")
25output = subprocess.run([exec_path], capture_output=
True, text=
True, check=
True)
26output_filename =
"out.txt"
27with open(output_filename,
"w")
as outfile:
28 outfile.write(output.stdout)
29 print(
"Executable output saved to out.txt")
33v_solution = parse_patch_file(
"DGPoisson.solution-1.peano-patch-file",
"DG")
34v_random = parse_patch_file(
"DGPoisson.rand-0.peano-patch-file",
"DG")
40for key
in v_solution.keys():
41 cell_values_solution = np.asarray(v_solution[key])
43 cell_values_random = np.asarray(v_random[key])
45 diff_norm = max( diff_norm, np.max(np.abs(cell_values_solution - cell_values_random)) )
49if diff_norm < pass_tolerance:
50 print(f
'Test 1: \033[{ "32" }m{ "PASSED" }\033[0m')
52 print(f
'Test 1: \033[{ "31" }m{ "FAILED" }\033[0m')