From 5957a1b67021c11845e39c67904b0845045f4a53 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch <bernd@iws.uni-stuttgart.de> Date: Fri, 20 Jan 2017 15:31:02 +0100 Subject: [PATCH] update instructions --- scripts/README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index a5c2073..8aae317 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -7,8 +7,8 @@ This folder contains several Matlab scripts which can be used to evaluate a solu The matrix solution 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 computational grid in columns `1` and `2`, respectively. -* `T`: an `nt x nvcell` cell connectivity matrix which contains in each row a cell's `nvcell` vertex indices with respect to the numbering induced by `Points`. -* `P`: an `nt`-size vector containing the cell-wise solution values with respect to the numbering induced by `T`. +* `T`: an `nt x nvelem` element connectivity matrix which contains in each row an element's `nvelem` vertex indices with respect to the numbering induced by `Points`. +* `P`: an `nt`-size vector containing the element-wise solution values with respect to the numbering induced by `T`. Is your original solution data 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. @@ -18,11 +18,18 @@ The function [compute_2d_error](compute_2d_error.m) can be used to calculate a r ``` 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`. +`coarseFile` is the `mat`-file as described in 1.1, `referenceFile` is one of the `mat`-files found in the `results/mfd`-subfolders, for example `../hydrocoin/results/mfd/mfd_hydrocoin.mat`. ### 2 Comparison of the solution in the fractures #### 2.1 Preparation of the solution data +The fracture solution has to be provided in form of a Matlab `mat`-file which has to contain a Matlab cell array `fracXAndPCell`. Each cell `fracXAndPCell{i}` provides the solution on fracture branch `i` in form of a `3 x (2.nc)` matrix. As 3x2 block `fracXAndPCell{i}(2*e-1:2*e, :)` describes the solution on fracture element `e` in form of `[xStart, yStart, pStart; xEnd yEnd, pEnd]`. + #### 2.2 Performing the comparison +The function [compute_1d_error](compute_1d_error.m) can be used to calculate a relative L2-error of the matrix solution. It has the signature +``` +function [totalRelativeFractureError] = compute_1d_error(coarseFile, referenceFile) +``` +`coarseFile` is the `mat`-file as described in 2.1, `referenceFile` is one of the `mat`-files found in the `results/mfd`-subfolders, for example `../hydrocoin/results/mfd/mfd_hydrocoin.mat`. -- GitLab