Skip to content
Snippets Groups Projects
Commit 5957a1b6 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

update instructions

parent 8e12899e
No related branches found
No related tags found
No related merge requests found
...@@ -7,8 +7,8 @@ This folder contains several Matlab scripts which can be used to evaluate a solu ...@@ -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: 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. * `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`. * `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 cell-wise solution values with respect to the numbering induced by `T`. * `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. 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 ...@@ -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) 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 Comparison of the solution in the fractures
#### 2.1 Preparation of the solution data #### 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 #### 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`.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment