Commit 063745a0 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

Merge branch 'feature/pieceofcake' into 'master'

Feature/pieceofcake

See merge request !354
parent a098c6e4
......@@ -17,6 +17,10 @@ Differences Between DuMuX 2.10 and DuMuX 2.11
* IMPROVEMENTS and ENHANCEMENTS:
* IMMEDIATE INTERFACE CHANGES not allowing/requiring a deprecation period:
- A gridcreator for piece-of-cake-type grids has been added. It is capable
of creating meshes with gradually in- and decreasing distances between nodes.
It also allows the creation of a 360° cake where the last elements are
connected to the first elements.
- shouldWriteRestartFile() is now, as shouldWriteOutput() already was,
called before the time level is advanced. So it might be necessary to use
...WillBeFinished instead of ...IsFinished for writing restart files at
......
This diff is collapsed.
......@@ -54,7 +54,7 @@ NEW_PROP_TAG(InitialDisplacement); //!< The initial displacement function
NEW_PROP_TAG(InitialPressSat); //!< The initial pressure and saturation function
// Set the grid type
SET_TYPE_PROP(El2P_TestProblem, Grid, Dune::YaspGrid<3>);
SET_TYPE_PROP(El2P_TestProblem, Grid, Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming>);
SET_PROP(El2P_TestProblem, PressureFEM)
......
......@@ -6,3 +6,10 @@ add_dumux_test(test_gridcreator_gmsh test_gridcreator_gmsh test_gridcreator_gmsh
${CMAKE_CURRENT_BINARY_DIR}/bifurcation-00000.vtu
${CMAKE_SOURCE_DIR}/test/references/bifurcation-reference-refined.vtu
${CMAKE_CURRENT_BINARY_DIR}/bifurcation-00001.vtu)
add_dumux_test(test_gridcreator_cake test_gridcreator_cake test_gridcreator_cake.cc
python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
--script fuzzy
--command "${CMAKE_CURRENT_BINARY_DIR}/test_gridcreator_cake"
--files ${CMAKE_SOURCE_DIR}/test/references/cake-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/cake-00000.vtu)
\ No newline at end of file
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief Test for the cake grid creator
*/
#include "config.h"
#include <iostream>
#include <dune/common/parametertreeparser.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/geometry/referenceelements.hh>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/io/file/vtk.hh>
#include <dumux/common/start.hh>
#include <dumux/common/basicproperties.hh>
#include <dumux/io/cakegridcreator.hh>
namespace Dumux
{
namespace Properties
{
NEW_TYPE_TAG(GridCreatorCakeTest, INHERITS_FROM(NumericModel));
// Set the grid type
#if HAVE_DUNE_ALUGRID
SET_TYPE_PROP(GridCreatorCakeTest, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>);
#elif HAVE_UG
SET_TYPE_PROP(GridCreatorCakeTest, Grid, Dune::UGGrid<3>);
#endif
}
}
int main(int argc, char** argv)
{
#if HAVE_DUNE_ALUGRID || HAVE_UG
try {
// initialize MPI, finalize is done automatically on exit
Dune::MPIHelper::instance(argc, argv);
// Some typedefs
typedef typename TTAG(GridCreatorCakeTest) TypeTag;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename Dumux::CakeGridCreator<TypeTag> GridCreator;
// Read the parameters from the input file
typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree;
//First read parameters from input file
Dune::ParameterTreeParser::readINITree("test_gridcreator_cake.input", ParameterTree::tree());
// Make the grid
GridCreator::makeGrid();
// construct a vtk output writer and attach the boundaryMakers
Dune::VTKSequenceWriter<Grid::LeafGridView> vtkWriter(GridCreator::grid().leafGridView(), "cake", ".", "");
vtkWriter.write(0);
return 0;
}
catch (Dumux::ParameterException &e) {
typedef typename TTAG(GridCreatorCakeTest) TypeTag;
Dumux::Parameters::print<TypeTag>();
std::cerr << e << ". Abort!\n";
return 1;
}
catch (Dune::Exception &e) {
std::cerr << "Dune reported error: " << e << std::endl;
return 3;
}
catch (...) {
std::cerr << "Unknown exception thrown!\n";
return 4;
}
#else
#warning "You need to have ALUGrid or UGGrid installed to run this test."
std::cerr << "You need to have ALUGrid or UGGrid installed to run this test\n";
return 77;
#endif
} //closing main
//} //closing namespace dumux
[Grid]
Cells0 = 3
Cells1 = 8
Cells2 = 3
Grading0 = 1.5
Grading1 = 1.0
Grading2 = 1.5
Radial0 = 0.0 1.0
Angular1 = 0.0 360.0
Axial2 = 0.0 1.0
WellRadius = 0.005
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfCells="72" NumberOfPoints="128">
<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.375697 -0.375697 0.210526 -0.710642 -0.710642 0.210526 -9.76011e-17 -0.531316 0.210526 -1.84616e-16 -1.005 0.210526
-0.531316 6.50674e-17 0 -1.005 1.23077e-16 0 -0.531316 6.50674e-17 0.210526 -1.005 1.23077e-16 0.210526
-0.1524 -0.1524 0 -3.95915e-17 -0.215526 0 -0.1524 -0.1524 0.210526 -3.95915e-17 -0.215526 0.210526
-0.215526 2.63944e-17 0 -0.215526 2.63944e-17 0.210526 -0.00353553 -0.00353553 0 -9.18485e-19 -0.005 0
-0.00353553 -0.00353553 0.210526 -9.18485e-19 -0.005 0.210526 -0.005 6.12323e-19 0 -0.005 6.12323e-19 0.210526
-0.375697 -0.375697 0.526316 -0.710642 -0.710642 0.526316 -9.76011e-17 -0.531316 0.526316 -1.84616e-16 -1.005 0.526316
-0.531316 6.50674e-17 0.526316 -1.005 1.23077e-16 0.526316 -0.1524 -0.1524 0.526316 -3.95915e-17 -0.215526 0.526316
-0.215526 2.63944e-17 0.526316 -0.00353553 -0.00353553 0.526316 -9.18485e-19 -0.005 0.526316 -0.005 6.12323e-19 0.526316
0.375697 -0.375697 0 0.710642 -0.710642 0 0.375697 -0.375697 0.210526 0.710642 -0.710642 0.210526
0.1524 -0.1524 0 0.1524 -0.1524 0.210526 0.00353553 -0.00353553 0 0.00353553 -0.00353553 0.210526
0.005 0 0 0.215526 0 0 0.005 0 0.210526 0.215526 0 0.210526
0.531316 0 0 0.531316 0 0.210526 1.005 0 0 1.005 0 0.210526
0.375697 -0.375697 0.526316 0.710642 -0.710642 0.526316 0.1524 -0.1524 0.526316 0.00353553 -0.00353553 0.526316
0.005 0 0.526316 0.215526 0 0.526316 0.531316 0 0.526316 1.005 0 0.526316
-0.375697 0.375697 0 -0.710642 0.710642 0 -0.375697 0.375697 0.210526 -0.710642 0.710642 0.210526
-0.1524 0.1524 0 -0.1524 0.1524 0.210526 -0.00353553 0.00353553 0 -0.00353553 0.00353553 0.210526
3.06162e-19 0.005 0 1.31972e-17 0.215526 0 3.06162e-19 0.005 0.210526 1.31972e-17 0.215526 0.210526
3.25337e-17 0.531316 0 3.25337e-17 0.531316 0.210526 6.15385e-17 1.005 0 6.15385e-17 1.005 0.210526
-0.375697 0.375697 0.526316 -0.710642 0.710642 0.526316 -0.1524 0.1524 0.526316 -0.00353553 0.00353553 0.526316
3.06162e-19 0.005 0.526316 1.31972e-17 0.215526 0.526316 3.25337e-17 0.531316 0.526316 6.15385e-17 1.005 0.526316
0.00353553 0.00353553 0 0.1524 0.1524 0 0.00353553 0.00353553 0.210526 0.1524 0.1524 0.210526
0.375697 0.375697 0 0.375697 0.375697 0.210526 0.710642 0.710642 0 0.710642 0.710642 0.210526
0.00353553 0.00353553 0.526316 0.1524 0.1524 0.526316 0.375697 0.375697 0.526316 0.710642 0.710642 0.526316
-0.375697 -0.375697 1 -0.710642 -0.710642 1 -9.76011e-17 -0.531316 1 -1.84616e-16 -1.005 1
-0.531316 6.50674e-17 1 -1.005 1.23077e-16 1 -0.1524 -0.1524 1 -3.95915e-17 -0.215526 1
-0.215526 2.63944e-17 1 -0.00353553 -0.00353553 1 -9.18485e-19 -0.005 1 -0.005 6.12323e-19 1
0.375697 -0.375697 1 0.710642 -0.710642 1 0.1524 -0.1524 1 0.00353553 -0.00353553 1
0.005 0 1 0.215526 0 1 0.531316 0 1 1.005 0 1
-0.375697 0.375697 1 -0.710642 0.710642 1 -0.1524 0.1524 1 -0.00353553 0.00353553 1
3.06162e-19 0.005 1 1.31972e-17 0.215526 1 3.25337e-17 0.531316 1 6.15385e-17 1.005 1
0.00353553 0.00353553 1 0.1524 0.1524 1 0.375697 0.375697 1 0.710642 0.710642 1
</DataArray>
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
0 1 3 2 4 5 7 6 8 9 1 0
10 11 5 4 12 0 2 13 14 4 6 15
16 8 0 12 17 10 4 14 18 12 13 19
20 14 15 21 22 16 12 18 23 17 14 20
4 5 7 6 24 25 27 26 10 11 5 4
28 29 25 24 14 4 6 15 30 24 26 31
17 10 4 14 32 28 24 30 20 14 15 21
33 30 31 34 23 17 14 20 35 32 30 33
2 3 37 36 6 7 39 38 13 2 36 40
15 6 38 41 19 13 40 42 21 15 41 43
42 40 45 44 43 41 47 46 40 36 48 45
41 38 49 47 36 37 50 48 38 39 51 49
6 7 39 38 26 27 53 52 15 6 38 41
31 26 52 54 21 15 41 43 34 31 54 55
43 41 47 46 55 54 57 56 41 38 49 47
54 52 58 57 38 39 51 49 52 53 59 58
60 61 9 8 62 63 11 10 64 60 8 16
65 62 10 17 66 64 16 22 67 65 17 23
68 69 64 66 70 71 65 67 69 72 60 64
71 73 62 65 72 74 61 60 73 75 63 62
62 63 11 10 76 77 29 28 65 62 10 17
78 76 28 32 67 65 17 23 79 78 32 35
70 71 65 67 80 81 78 79 71 73 62 65
81 82 76 78 73 75 63 62 82 83 77 76
44 45 85 84 46 47 87 86 84 85 69 68
86 87 71 70 45 48 88 85 47 49 89 87
85 88 72 69 87 89 73 71 48 50 90 88
49 51 91 89 88 90 74 72 89 91 75 73
46 47 87 86 56 57 93 92 86 87 71 70
92 93 81 80 47 49 89 87 57 58 94 93
87 89 73 71 93 94 82 81 49 51 91 89
58 59 95 94 89 91 75 73 94 95 83 82
24 25 27 26 96 97 99 98 28 29 25 24
100 101 97 96 30 24 26 31 102 96 98 103
32 28 24 30 104 100 96 102 33 30 31 34
105 102 103 106 35 32 30 33 107 104 102 105
26 27 53 52 98 99 109 108 31 26 52 54
103 98 108 110 34 31 54 55 106 103 110 111
55 54 57 56 111 110 113 112 54 52 58 57
110 108 114 113 52 53 59 58 108 109 115 114
76 77 29 28 116 117 101 100 78 76 28 32
118 116 100 104 79 78 32 35 119 118 104 107
80 81 78 79 120 121 118 119 81 82 76 78
121 122 116 118 82 83 77 76 122 123 117 116
56 57 93 92 112 113 125 124 92 93 81 80
124 125 121 120 57 58 94 93 113 114 126 125
93 94 82 81 125 126 122 121 58 59 95 94
114 115 127 126 94 95 83 82 126 127 123 122
</DataArray>
<DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii">
8 16 24 32 40 48 56 64 72 80 88 96
104 112 120 128 136 144 152 160 168 176 184 192
200 208 216 224 232 240 248 256 264 272 280 288
296 304 312 320 328 336 344 352 360 368 376 384
392 400 408 416 424 432 440 448 456 464 472 480
488 496 504 512 520 528 536 544 552 560 568 576
</DataArray>
<DataArray type="UInt8" Name="types" NumberOfComponents="1" format="ascii">
12 12 12 12 12 12 12 12 12 12 12 12
12 12 12 12 12 12 12 12 12 12 12 12
12 12 12 12 12 12 12 12 12 12 12 12
12 12 12 12 12 12 12 12 12 12 12 12
12 12 12 12 12 12 12 12 12 12 12 12
12 12 12 12 12 12 12 12 12 12 12 12
</DataArray>
</Cells>
</Piece>
</UnstructuredGrid>
</VTKFile>
Markdown is supported
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