48 Return (time stamp, grid cells per axis, max error, rms error) of the last
51 snapshots = read_snapshots(
52 os.path.join(run_directory,
"solution-EulerSmooth.peano-patch-file")
54 time_stamp, files = snapshots[-1]
57 number_of_grid_cells = 0
58 min_grid_cell_size = math.inf
59 for file_name
in files:
62 for attributes
in parser.unknown_attributes.values():
64 for patch
in attributes.cell_data:
65 offset, size =
snap(patch.offset, patch.size)
67 min_grid_cell_size = min(min_grid_cell_size, h[0])
68 shape = [dofs] * attributes.dimensions + [attributes.unknowns]
70 density = patch.values.reshape(shape)[..., 0]
71 x = offset[0] + (np.arange(dofs) + 0.5) * h[0]
73 if not np.all(np.isfinite(error)):
74 return time_stamp,
None, math.nan, math.nan
75 max_error = max(max_error, float(np.max(error)))
76 squared_error += float(np.sum(error * error))
77 number_of_grid_cells += error.size
80 round(DOMAIN_WIDTH / min_grid_cell_size),
82 math.sqrt(squared_error / number_of_grid_cells),