Skip to content
Snippets Groups Projects
Commit 43ed102f authored by Timo Koch's avatar Timo Koch
Browse files

[example][diffusion] Test the diffusion example

parent ddc1161a
No related branches found
No related tags found
1 merge request!3380[example] Add simple diffusion eqution including full model
dune_symlink_to_source_files(FILES "params.input")
dumux_add_test(NAME example_diffusion SOURCES main.cc)
# To add an example it would be enough to have
# dumux_add_test(NAME example_diffusion SOURCES main.cc)
# But we also make sure with automated testing that the example keep compiling
# and produce the same result, so here is a regression test:
dumux_add_test(NAME example_diffusion
LABELS example
SOURCES main.cc
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/example_diffusion-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/diffusion-00050.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/example_diffusion params.input
-Grid.Cells \"6 6\" -Problem.DiffusionCoefficient 0.001")
# We also add a parallel test to make sure the parallel version also works
dumux_add_test(NAME example_diffusion_parallel
LABELS example
CMAKE_GUARD MPI_FOUND
TARGET example_diffusion
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/example_diffusion_parallel_p0-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/s0002-p0000-diffusion_parallel-00050.vtu
${CMAKE_SOURCE_DIR}/test/references/example_diffusion_parallel_p1-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/s0002-p0001-diffusion_parallel-00050.vtu
--command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/example_diffusion params.input
-Grid.Cells \"6 6\" -Problem.DiffusionCoefficient 0.001 -Problem.Name diffusion_parallel")
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="36" NumberOfPoints="49">
<PointData Scalars="c">
<DataArray type="Float32" Name="c" NumberOfComponents="1" format="ascii">
0.573644 0.594092 0.709256 0.498368 0.674927 0.61297 0.741987 0.615632 0.593599 0.452598 0.69915 0.477316
0.53875 0.41387 0.720189 0.302494 0.751592 0.392863 0.425794 0.517298 0.702481 0.653806 0.501159 0.476217
0.514364 0.429345 0.763388 0.774239 0.286512 0.388567 0.2551 0.561912 0.2726 0.487823 0.757131 0.805291
0.667609 0.310247 0.716878 0.767391 0.81094 0.548676 0.790928 0.732083 0.4973 0.571787 0.768192 0.682043
0.356806
</DataArray>
</PointData>
<CellData Scalars="process rank">
<DataArray type="Float32" Name="process rank" NumberOfComponents="1" format="ascii">
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
</DataArray>
</CellData>
<Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii">
0 0 0 0.166667 0 0 0 0.166667 0 0.166667 0.166667 0
0.333333 0 0 0.333333 0.166667 0 0.5 0 0 0.5 0.166667 0
0.666667 0 0 0.666667 0.166667 0 0.833333 0 0 0.833333 0.166667 0
1 0 0 1 0.166667 0 0 0.333333 0 0.166667 0.333333 0
0.333333 0.333333 0 0.5 0.333333 0 0.666667 0.333333 0 0.833333 0.333333 0
1 0.333333 0 0 0.5 0 0.166667 0.5 0 0.333333 0.5 0
0.5 0.5 0 0.666667 0.5 0 0.833333 0.5 0 1 0.5 0
0 0.666667 0 0.166667 0.666667 0 0.333333 0.666667 0 0.5 0.666667 0
0.666667 0.666667 0 0.833333 0.666667 0 1 0.666667 0 0 0.833333 0
0.166667 0.833333 0 0.333333 0.833333 0 0.5 0.833333 0 0.666667 0.833333 0
0.833333 0.833333 0 1 0.833333 0 0 1 0 0.166667 1 0
0.333333 1 0 0.5 1 0 0.666667 1 0 0.833333 1 0
1 1 0
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
0 1 3 2 1 4 5 3 4 6 7 5
6 8 9 7 8 10 11 9 10 12 13 11
2 3 15 14 3 5 16 15 5 7 17 16
7 9 18 17 9 11 19 18 11 13 20 19
14 15 22 21 15 16 23 22 16 17 24 23
17 18 25 24 18 19 26 25 19 20 27 26
21 22 29 28 22 23 30 29 23 24 31 30
24 25 32 31 25 26 33 32 26 27 34 33
28 29 36 35 29 30 37 36 30 31 38 37
31 32 39 38 32 33 40 39 33 34 41 40
35 36 43 42 36 37 44 43 37 38 45 44
38 39 46 45 39 40 47 46 40 41 48 47
</DataArray>
<DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii">
4 8 12 16 20 24 28 32 36 40 44 48
52 56 60 64 68 72 76 80 84 88 92 96
100 104 108 112 116 120 124 128 132 136 140 144
</DataArray>
<DataArray type="UInt8" Name="types" NumberOfComponents="1" format="ascii">
9 9 9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9 9 9
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="18" NumberOfPoints="28">
<PointData Scalars="c">
<DataArray type="Float32" Name="c" NumberOfComponents="1" format="ascii">
0.600795 0.628791 0.619313 0.751779 0.708185 0.607276 0.7937 0.767298 0.486278 0.603874 0.617154 0.463888
0.463939 0.407136 0.694774 0.240767 0.77346 0.411375 0.434334 0.460175 0.724304 0.715433 0.555488 0.526637
0.606071 0.523224 0.790582 0.739017
</DataArray>
</PointData>
<CellData Scalars="process rank">
<DataArray type="Float32" Name="process rank" NumberOfComponents="1" format="ascii">
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0
</DataArray>
</CellData>
<Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii">
0 0 0 0.166667 0 0 0 0.166667 0 0.166667 0.166667 0
0.333333 0 0 0.333333 0.166667 0 0.5 0 0 0.5 0.166667 0
0 0.333333 0 0.166667 0.333333 0 0.333333 0.333333 0 0.5 0.333333 0
0 0.5 0 0.166667 0.5 0 0.333333 0.5 0 0.5 0.5 0
0 0.666667 0 0.166667 0.666667 0 0.333333 0.666667 0 0.5 0.666667 0
0 0.833333 0 0.166667 0.833333 0 0.333333 0.833333 0 0.5 0.833333 0
0 1 0 0.166667 1 0 0.333333 1 0 0.5 1 0
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
0 1 3 2 1 4 5 3 4 6 7 5
2 3 9 8 3 5 10 9 5 7 11 10
8 9 13 12 9 10 14 13 10 11 15 14
12 13 17 16 13 14 18 17 14 15 19 18
16 17 21 20 17 18 22 21 18 19 23 22
20 21 25 24 21 22 26 25 22 23 27 26
</DataArray>
<DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii">
4 8 12 16 20 24 28 32 36 40 44 48
52 56 60 64 68 72
</DataArray>
<DataArray type="UInt8" Name="types" NumberOfComponents="1" format="ascii">
9 9 9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="18" NumberOfPoints="28">
<PointData Scalars="c">
<DataArray type="Float32" Name="c" NumberOfComponents="1" format="ascii">
0.7937 0.659834 0.767298 0.772924 0.709495 0.608217 0.782586 0.755256 0.463888 0.597787 0.617481 0.473542
0.240767 0.370738 0.694056 0.275299 0.460175 0.363768 0.432353 0.475921 0.526637 0.689418 0.553917 0.530383
0.739017 0.517034 0.789881 0.751804
</DataArray>
</PointData>
<CellData Scalars="process rank">
<DataArray type="Float32" Name="process rank" NumberOfComponents="1" format="ascii">
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1
</DataArray>
</CellData>
<Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii">
0.5 0 0 0.666667 0 0 0.5 0.166667 0 0.666667 0.166667 0
0.833333 0 0 0.833333 0.166667 0 1 0 0 1 0.166667 0
0.5 0.333333 0 0.666667 0.333333 0 0.833333 0.333333 0 1 0.333333 0
0.5 0.5 0 0.666667 0.5 0 0.833333 0.5 0 1 0.5 0
0.5 0.666667 0 0.666667 0.666667 0 0.833333 0.666667 0 1 0.666667 0
0.5 0.833333 0 0.666667 0.833333 0 0.833333 0.833333 0 1 0.833333 0
0.5 1 0 0.666667 1 0 0.833333 1 0 1 1 0
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
0 1 3 2 1 4 5 3 4 6 7 5
2 3 9 8 3 5 10 9 5 7 11 10
8 9 13 12 9 10 14 13 10 11 15 14
12 13 17 16 13 14 18 17 14 15 19 18
16 17 21 20 17 18 22 21 18 19 23 22
20 21 25 24 21 22 26 25 22 23 27 26
</DataArray>
<DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii">
4 8 12 16 20 24 28 32 36 40 44 48
52 56 60 64 68 72
</DataArray>
<DataArray type="UInt8" Name="types" NumberOfComponents="1" format="ascii">
9 9 9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
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