This folder contains several Matlab scripts which can be used to evaluate a solution to one of the benchmark cases with the corresponding reference solution. ### 1 Comparison of the solution in the matrix #### 1.1 Preparation of the solution data The solution data has to be provided in form of a Matlab `mat`-file which has to contain the following variables: * `Points`: an `np x 2` matrix that contains the x and y coordinates of the `np` vertices of the employed computational grid in columns `1` and `2`, respectively. * `T`: an `nt x nvelem` connectivity matrix which contains in each row the `nvelem` vertex indices with respect to the numbering induced by `Points`. * `P`: an `nt`-size vector containing the solution value for each cell with respect to the numbering induced by `T`. The original solution data is available as a VTK file? A helper function `hdf5_to_mat.m` is provided which extracts the required `mat`-file from an HDF5-file, which in turn can be exported from Paraview: select `File` -> `Save Data...` -> `Files of type: Xdmf Data File`, use the produced `h5`-file. #### 1.2 Performing the comparison The function [compute_2d_error](compute_2d_error.m) can be used to calculate a relative L2-error of the matrix solution. It has the signature ``` function [relativeMatrixError] = compute_2d_error(coarseFile, referenceFile) ``` `coarseFile` is the `mat`-file explained above, `referenceFile` is one of the `mat`-files found in the `results/mfd`-subfolders, for example `../hydrocoin/results/mfd/mfd_hydrocoin.mat`.