Peano
Loading...
Searching...
No Matches
parseTest5.py
Go to the documentation of this file.
1import numpy as np
2from postProcess import parse_patch_file, reorder_array, plot_field, plot_field_dg
3
4if __name__ == "__main__":
5 # Read v_ACG = A_CG * u_cg_random
6 v_ACG = parse_patch_file("Test5CG.acg-1.peano-patch-file", "CG")
7 # Read v_restrict_ADG = R * A_DG * P * u_cg_random
8 v_restricted_ADG = parse_patch_file("Test5CG.vrestrictADG-1.peano-patch-file", "CG")
9
10 # Read v_MCG = M_CG * u_cg_random
11 v_MCG = parse_patch_file("Test5CG.mcg-1.peano-patch-file", "CG")
12 # Read v_restricted_MDG = R * M_DG * P * u_cg_random
13 v_restricted_MDG = parse_patch_file("Test5CG.vrestrictMDG-1.peano-patch-file", "CG")
14
15 # Align the arrays to a consistent order of vertices
16 v_restricted_ADG = reorder_array(v_ACG, v_restricted_ADG)
17 v_restricted_MDG = reorder_array(v_MCG, v_restricted_MDG)
18
19 print(f'|R*A_DG*P*u_cg_random - A_CG*u_cg_random|_max = {np.max(np.abs(v_restricted_ADG[:,2] - v_ACG[:,2]))}')
20 print(f'|R*M_DG*P*u_cg_random - M_CG*u_cg_random|_max = {np.max(np.abs(v_restricted_MDG[:,2] - v_MCG[:,2]))}')
21
22 #plot_field( parse_patch_file("Test5CG.rand-0.peano-patch-file","CG"))