Peano
Loading...
Searching...
No Matches
parseTest1.py
Go to the documentation of this file.
1import numpy as np
2from postProcess import parse_patch_file
3
4if __name__ == "__main__":
5 v_solution = parse_patch_file("DGPoisson.solution-1.peano-patch-file", "DG")
6 v_random = parse_patch_file("DGPoisson.rand-0.peano-patch-file", "DG")
7
8 diff_norm = 0.0 # |v_solution - v_random|_{max}
9
10 # Iterate over all cell keys in the solution dictionary
11 # keys are coordinates of the left-bottom vertex of each cell
12 i = 0
13 for key in v_solution.keys():
14 cell_values_solution = np.asarray(v_solution[key])
15 # Access the same key in v_random
16 cell_values_random = np.asarray(v_random[key])
17
18 # Update global max norm with local cell max norm
19 diff_norm = max( diff_norm, np.max(np.abs(cell_values_solution - cell_values_random)) )
20
21 print(f'|v_solution - v_random|_max = {diff_norm}')