Commit 7532daf2 authored by Martin Schneider's avatar Martin Schneider Committed by Timo Koch
Browse files

[cakegrid] Update testing

* Change input params such that more features are tested
* Test alu and ug separately
* Test if it works for zero well radius, i.e. line or point source
parent d9503e3d
add_input_file_links()
dune_symlink_to_source_files(FILES grids)
add_executable(test_gridmanager_cake EXCLUDE_FROM_ALL test_gridmanager_cake.cc)
add_executable(test_gridmanager_cake_ug EXCLUDE_FROM_ALL test_gridmanager_cake.cc)
target_compile_definitions(test_gridmanager_cake_ug PUBLIC "USEUG=1")
dune_add_test(NAME test_gridmanager_cake_360
TARGET test_gridmanager_cake
add_executable(test_gridmanager_cake_alu EXCLUDE_FROM_ALL test_gridmanager_cake.cc)
dune_add_test(NAME test_gridmanager_cake_360_ug
TARGET test_gridmanager_cake_ug
LABELS unit io
CMAKE_GUARD dune-uggrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake_ug -Grid.Name ug-360"
--files ${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_3d_360-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-ug-360.vtu
${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_2d_360-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-ug-360.vtu
--relative 1e-6)
# the compare script does not work when alu does an element reoerdering, which is why this test fails
dune_add_test(NAME test_gridmanager_cake_360_alu
TARGET test_gridmanager_cake_alu
LABELS unit io
CMAKE_GUARD "( dune-uggrid_FOUND OR dune-alugrid_FOUND )"
CMAKE_GUARD dune-alugrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake -Grid.Name 360"
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake_360_alu -Grid.Name alu-360"
--files ${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_3d_360-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-360.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-alu-360.vtu
${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_2d_360-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-360.vtu)
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-alu-360.vtu
--relative 1e-6)
dune_add_test(NAME test_gridmanager_cake_210_ug
TARGET test_gridmanager_cake_ug
LABELS unit io
CMAKE_GUARD dune-uggrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake_ug -Grid.Name ug-210 -Grid.Angular1 '0.0 210.0'"
--files ${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_3d_210-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-ug-210.vtu
${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_2d_210-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-ug-210.vtu
--relative 1e-6)
dune_add_test(NAME test_gridmanager_cake_210
TARGET test_gridmanager_cake
# the compare script does not work when alu does an element reoerdering, which is why this test fails
dune_add_test(NAME test_gridmanager_cake_210_alu
TARGET test_gridmanager_cake_alu
LABELS unit io
CMAKE_GUARD "( dune-uggrid_FOUND OR dune-alugrid_FOUND )"
CMAKE_GUARD dune-alugrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake -Grid.Name 210 -Grid.Angular1 '0.0 210.0'"
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake_alu -Grid.Name alu-210 -Grid.Angular1 '0.0 210.0'"
--files ${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_3d_210-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-210.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-alu-210.vtu
${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_2d_210-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-210.vtu)
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-alu-210.vtu
--relative 1e-6)
dune_add_test(NAME test_gridmanager_cake_360_nowell
TARGET test_gridmanager_cake_ug
LABELS unit io
CMAKE_GUARD dune-uggrid_FOUND
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridmanager_cake_ug -Grid.Name nowell-360"
--files ${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_3d_360-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-3d-nowell-360.vtu
${CMAKE_SOURCE_DIR}/test/references/test_gridmanager_cake_2d_360-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-2d-nowell-360.vtu
--relative 1e-6)
dune_add_test(NAME test_gridmanager_subgrid
SOURCES test_gridmanager_subgrid.cc
......
......@@ -40,15 +40,17 @@
#include <dune/alugrid/grid.hh>
#endif
#ifndef USEUG
#define USEUG false
#endif
// The grid type
#if HAVE_DUNE_ALUGRID
template<int dim>
using Grid = Dune::ALUGrid<dim, dim, Dune::cube, Dune::nonconforming>;
#elif HAVE_UG
#if HAVE_UG && USEUG==1
template<int dim>
using Grid = Dune::UGGrid<dim>;
#elif HAVE_DUNE_ALUGRID
template<int dim>
using Grid = Dune::ALUGrid<dim, dim, Dune::cube, Dune::nonconforming>;
#endif
template<int dim>
......
[Grid]
Cells0 = 3
Cells0 = 3 1
Cells1 = 8
Cells2 = 3
Grading0 = 1.5
Cells2 = 3 5 3
Grading0 = 1.5 1.0
Grading1 = 1.0
Grading2 = 1.5
Radial0 = 0.005 1.0
Grading2 = -1.5 1.0 1.5
Radial0 = 0.05 0.3 1.0
Angular1 = 0.0 360.0
Axial2 = 0.0 1.0
Axial2 = 0.0 0.4 0.6 1.0
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="24" NumberOfPoints="36">
<Piece NumberOfCells="32" NumberOfPoints="45">
<Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii">
-0.530178 -0.0347497 0 -1.00285 -0.0657301 0 -0.460133 -0.265658 0 -0.870356 -0.5025 0
-0.490872 0.203326 0 -0.928499 0.384597 0 -0.215065 -0.0140961 0 -0.186651 -0.107763 0
-0.00498929 -0.000327016 0 -0.00433013 -0.0025 0 -0.0046194 0.00191342 0 -0.19912 0.0824784 0
-0.142106 0.162041 0 -0.350321 0.399464 0 -0.00329673 0.0037592 0 -0.0012941 0.00482963 0
-0.0557823 0.208182 0 0.000975452 0.00490393 0 0.0420471 0.211385 0 0.005 0 0
0.215526 0 0 0.00448436 0.00221144 0 0.1933 0.0953249 0 0.00304381 0.00396677 0
0.131204 0.170989 0 0.531316 0 0 0.476523 0.234995 0 0.323445 0.421521 0
1.005 0 0 0.901357 0.4445 0 -0.662643 0.755599 0 -0.137515 0.513212 0
0.103655 0.521107 0 -0.260113 0.970755 0 0.196066 0.985689 0 0.611805 0.79732 0
0.05 0 0 0.102632 0 0 0.0448436 0.0221144 0 0.0920475 0.0453928 0
0.181579 0 0 0.162853 0.0803103 0 0.3 0 0 0.269062 0.132687 0
1 0 0 0.896873 0.442289 0 0.0304381 0.0396677 0 0.0624781 0.0814231 0
0.110538 0.144056 0 0.182628 0.238006 0 0.608761 0.793353 0 0.00975452 0.0490393 0
0.0200224 0.10066 0 0.0354243 0.17809 0 0.0585271 0.294236 0 0.19509 0.980785 0
-0.012941 0.0482963 0 -0.026563 0.0991345 0 -0.0469961 0.175392 0 -0.0776457 0.289778 0
-0.258819 0.965926 0 -0.0329673 0.037592 0 -0.0676697 0.0771625 0 -0.119723 0.136518 0
-0.197804 0.225552 0 -0.659346 0.75184 0 -0.046194 0.0191342 0 -0.0948192 0.0392754 0
-0.167757 0.0694873 0 -0.277164 0.114805 0 -0.92388 0.382683 0 -0.0498929 -0.00327016 0
-0.102412 -0.00671243 0 -0.18119 -0.0118758 0 -0.299358 -0.0196209 0 -0.997859 -0.0654031 0
-0.0433013 -0.025 0 -0.0888816 -0.0513158 0 -0.157252 -0.0907895 0 -0.259808 -0.15 0
-0.866025 -0.5 0
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
0 1 3 2 4 5 1 0 6 0 2 7
8 6 7 9 10 11 6 8 11 4 0 6
12 13 4 11 14 12 11 10 15 16 12 14
17 18 16 15 19 20 22 21 23 24 18 17
21 22 24 23 20 25 26 22 22 26 27 24
25 28 29 26 13 30 5 4 16 31 13 12
18 32 31 16 31 33 30 13 32 34 33 31
24 27 32 18 26 29 35 27 27 35 34 32
0 1 3 2 1 4 5 3 4 6 7 5
6 8 9 7 2 3 11 10 3 5 12 11
5 7 13 12 7 9 14 13 10 11 16 15
11 12 17 16 12 13 18 17 13 14 19 18
15 16 21 20 16 17 22 21 17 18 23 22
18 19 24 23 20 21 26 25 21 22 27 26
22 23 28 27 23 24 29 28 25 26 31 30
26 27 32 31 27 28 33 32 28 29 34 33
30 31 36 35 31 32 37 36 32 33 38 37
33 34 39 38 35 36 41 40 36 37 42 41
37 38 43 42 38 39 44 43
</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
</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
</DataArray>
</Cells>
</Piece>
......
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="24" NumberOfPoints="36">
<Piece NumberOfCells="32" NumberOfPoints="40">
<Points>
<DataArray type="Float32" Name="Coordinates" NumberOfComponents="3" format="ascii">
-0.375697 -0.375697 0 -0.710642 -0.710642 0 -9.76011e-17 -0.531316 0 -1.84616e-16 -1.005 0
-0.531316 6.50674e-17 0 -1.005 1.23077e-16 0 -0.1524 -0.1524 0 -3.95915e-17 -0.215526 0
-0.215526 2.63944e-17 0 -0.00353553 -0.00353553 0 -9.18485e-19 -0.005 0 -0.005 6.12323e-19 0
0.375697 -0.375697 0 0.710642 -0.710642 0 0.1524 -0.1524 0 0.00353553 -0.00353553 0
0.005 -1.22465e-18 0 0.215526 -5.27887e-17 0 0.531316 -1.30135e-16 0 1.005 -2.46154e-16 0
-0.375697 0.375697 0 -0.710642 0.710642 0 -0.1524 0.1524 0 -0.00353553 0.00353553 0
3.06162e-19 0.005 0 1.31972e-17 0.215526 0 3.25337e-17 0.531316 0 6.15385e-17 1.005 0
0.005 0 0 0.215526 0 0 0.00353553 0.00353553 0 0.1524 0.1524 0
0.531316 0 0 0.375697 0.375697 0 1.005 0 0 0.710642 0.710642 0
0.05 0 0 0.102632 0 0 0.0353553 0.0353553 0 0.0725715 0.0725715 0
0.181579 0 0 0.128396 0.128396 0 0.3 0 0 0.212132 0.212132 0
1 0 0 0.707107 0.707107 0 3.06162e-18 0.05 0 6.28437e-18 0.102632 0
1.11185e-17 0.181579 0 1.83697e-17 0.3 0 6.12323e-17 1 0 -0.0353553 0.0353553 0
-0.0725715 0.0725715 0 -0.128396 0.128396 0 -0.212132 0.212132 0 -0.707107 0.707107 0
-0.05 6.12323e-18 0 -0.102632 1.25687e-17 0 -0.181579 2.2237e-17 0 -0.3 3.67394e-17 0
-1 1.22465e-16 0 -0.0353553 -0.0353553 0 -0.0725715 -0.0725715 0 -0.128396 -0.128396 0
-0.212132 -0.212132 0 -0.707107 -0.707107 0 -9.18485e-18 -0.05 0 -1.88531e-17 -0.102632 0
-3.33555e-17 -0.181579 0 -5.51091e-17 -0.3 0 -1.83697e-16 -1 0 0.0353553 -0.0353553 0
0.0725715 -0.0725715 0 0.128396 -0.128396 0 0.212132 -0.212132 0 0.707107 -0.707107 0
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
0 1 3 2 4 5 1 0 6 0 2 7
8 4 0 6 9 6 7 10 11 8 6 9
2 3 13 12 7 2 12 14 10 7 14 15
15 14 17 16 14 12 18 17 12 13 19 18
20 21 5 4 22 20 4 8 23 22 8 11
24 25 22 23 25 26 20 22 26 27 21 20
28 29 31 30 30 31 25 24 29 32 33 31
31 33 26 25 32 34 35 33 33 35 27 26
0 1 3 2 1 4 5 3 4 6 7 5
6 8 9 7 2 3 11 10 3 5 12 11
5 7 13 12 7 9 14 13 10 11 16 15
11 12 17 16 12 13 18 17 13 14 19 18
15 16 21 20 16 17 22 21 17 18 23 22
18 19 24 23 20 21 26 25 21 22 27 26
22 23 28 27 23 24 29 28 25 26 31 30
26 27 32 31 27 28 33 32 28 29 34 33
30 31 36 35 31 32 37 36 32 33 38 37
33 34 39 38 35 36 1 0 36 37 4 1
37 38 6 4 38 39 8 6
</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
</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
</DataArray>
</Cells>
</Piece>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment