diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eb05d10f7f1a1434d6c3a41b71930835b0276fe..91506957eb6c7be0a4558da039621f237425c1d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/dumux/io/cakegridcreator.hh b/dumux/io/cakegridcreator.hh new file mode 100644 index 0000000000000000000000000000000000000000..5970ef51a132f0f6c198a0af40672e8e86734ad4 --- /dev/null +++ b/dumux/io/cakegridcreator.hh @@ -0,0 +1,542 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * 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 Provides a grid creator for a piece of cake grid + */ + +#ifndef DUMUX_CAKE_GRID_CREATOR_HH +#define DUMUX_CAKE_GRID_CREATOR_HH + +#include <dune/grid/common/gridfactory.hh> +#include <dumux/common/basicproperties.hh> +#include <dumux/common/propertysystem.hh> +#include <vector> +#include <iostream> +#include <cmath> + +namespace Dumux +{ + +namespace Properties +{ +NEW_PROP_TAG(Scalar); +NEW_PROP_TAG(Grid); +} + +/*! + * \brief Provides a grid creator with a method for creating creating vectors + * with polar Coordinates and one for creating a cartesian grid from + * these polar coordinates. + */ +template <class TypeTag> +class CakeGridCreator +{ + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid; + typedef Dune::GridFactory<Grid> GridFactory; + typedef std::shared_ptr<Grid> GridPointer; + + enum { dim = Grid::dimension, + dimWorld = Grid::dimensionworld + }; + + typedef std::vector<Scalar> ScalarVector; + typedef std::array<unsigned int, dim> CellArray; + typedef Dune::FieldVector<typename Grid::ctype, dimWorld> GlobalPosition; + +public: + /*! + * \brief Make the grid. + */ + static void makeGrid() + { + if (dim < 2) + { + DUNE_THROW(Dune::NotImplemented, "The CakeGridCreator is not implemented for 1D."); + } + std::cout << "makeGrid() starts..." << std::endl; + + std::array<ScalarVector, dim> polarCoordinates; + + // Indices specifing in which direction the piece of cake is oriented + Dune::FieldVector<int, dim> indices; + // Fill with -1 for later checks + indices = int(-1); + + createVectors(polarCoordinates, indices); + gridPtr() = CakeGridCreator<TypeTag>::createCakeGrid(polarCoordinates, indices); + std::cout << "makeGrid() ends..." << std::endl; + } + + /*! + * \brief Create vectors containing polar coordinates of all points. + * + * All keys are expected to be in group GridParameterGroup. + * The following keys are recognized: + * - Radial : min/max value for radial coordinate + * - Angular : min/max value for angular coordinate + * - Axial : min/max value for axial coordinate + * Adding 0, 1 (or 2 in 3D) specifies in which direction (x, y and z, respectively) + * the radial, angular and axial direction are oriented + * - Cells : number of cells array for x-coordinate (Again, an added 0, 1 or 3 specifies x, y or z + * - Grading : grading factor array for x-coordinate (Same here) + * - Verbosity : whether the grid construction should output to standard out + * + * The grading factor \f$ g \f$ specifies the ratio between the next and the current cell size: + * \f$ g = \frac{h_{i+1}}{h_i} \f$. + * Negative grading factors are converted to + * \f$ g = -\frac{1}{g_\textrm{negative}} \f$ + * to avoid issues with imprecise fraction numbers. + */ + static void createVectors(std::array<ScalarVector, dim> &polarCoordinates, Dune::FieldVector<int, dim> &indices) + { + // Only construction from the input file is possible + // Look for the necessary keys to construct from the input file + try + { + typedef typename GET_PROP(TypeTag, ParameterTree) Params; + auto params = Params::tree(); + typedef std::vector<int> IntVector; + + // The positions + std::array<ScalarVector, dim> positions; + + for (int i = 0; i < dim; ++i) + { + std::string paramNameRadial = GET_PROP_VALUE(TypeTag, GridParameterGroup); + paramNameRadial += ".Radial"; + paramNameRadial += std::to_string(i); + try + { + positions[i] = GET_RUNTIME_PARAM_CSTRING(TypeTag, ScalarVector, paramNameRadial.c_str()); + indices[0] = i; // Index specifing radial direction + } + catch (Dumux::ParameterException &e) { } + + std::string paramNameAngular = GET_PROP_VALUE(TypeTag, GridParameterGroup); + paramNameAngular += ".Angular"; + paramNameAngular += std::to_string(i); + try + { + positions[i] = GET_RUNTIME_PARAM_CSTRING(TypeTag, ScalarVector, paramNameAngular.c_str()); + indices[1] = i; // Index specifing angular direction + } + catch (Dumux::ParameterException &e) { } + + if (dim == 3) + { + std::string paramNameAxial = GET_PROP_VALUE(TypeTag, GridParameterGroup); + paramNameAxial += ".Axial"; + paramNameAxial += std::to_string(i); + try + { + positions[i] = GET_RUNTIME_PARAM_CSTRING(TypeTag, ScalarVector, paramNameAxial.c_str()); + indices[2] = i; // Index specifing axial direction + } + catch (Dumux::ParameterException &e) { } + } + } + + if (dim == 3) + { + if ( !( ((3 > indices[0]) && (indices[0] >= 0) + && (3 > indices[1]) && (indices[1] >= 0) + && (3 > indices[2]) && (indices[2] >= 0)) + && ((indices[2] != indices[1]) && (indices[2] != indices[0]) + && (indices[1] != indices[0])) + && (indices[2] + indices[1] + indices[0] == 3) ) ) + { + std::cout << " indices[0] " << indices[0] << std::endl; + std::cout << " indices[1] " << indices[1] << std::endl; + std::cout << " indices[2] " << indices[2] << std::endl; + DUNE_THROW(Dune::RangeError, "Please specify Positions Angular and Radial correctly and unambiguous!" << std::endl); + } + } + else + { + if ( !( ((2 > indices[0]) && (indices[0] >= 0) + && (2 > indices[1]) && (indices[1] >= 0)) + && (indices[1] != indices[0]) + && (indices[1] + indices[0] == 1) ) ) + { + std::cout << " indices[0] " << indices[0] << std::endl; + std::cout << " indices[1] " << indices[1] << std::endl; + DUNE_THROW(Dune::RangeError, "Please specify Positions Angular and Radial correctly and unambiguous!" << std::endl); + } + } + + // the number of cells (has a default) + std::array<IntVector, dim> cells; + for (int i = 0; i < dim; ++i) + { + std::string paramName = GET_PROP_VALUE(TypeTag, GridParameterGroup); + paramName += ".Cells"; + paramName += std::to_string(i); + try { cells[i] = GET_RUNTIME_PARAM_CSTRING(TypeTag, IntVector, paramName.c_str()); } + catch (Dumux::ParameterException &e) { cells[i].resize(positions[i].size()-1, 1.0); } + } + + // grading factor (has a default) + std::array<ScalarVector, dim> grading; + for (int i = 0; i < dim; ++i) + { + std::string paramName = GET_PROP_VALUE(TypeTag, GridParameterGroup); + paramName += ".Grading"; + paramName += std::to_string(i); + try { grading[i] = GET_RUNTIME_PARAM_CSTRING(TypeTag, ScalarVector, paramName.c_str()); } + catch (Dumux::ParameterException &e) { grading[i].resize(positions[i].size()-1, 1.0); } + } + + // make the grid + // sanity check of the input parameters + bool verbose = false; + try { verbose = GET_RUNTIME_PARAM_FROM_GROUP_CSTRING(TypeTag, bool, GET_PROP_VALUE(TypeTag, GridParameterGroup).c_str(), Verbosity);} + catch (Dumux::ParameterException &e) { } + + for (unsigned int dimIdx = 0; dimIdx < dim; ++dimIdx) + { + if (cells[dimIdx].size() + 1 != positions[dimIdx].size()) + { + DUNE_THROW(Dune::RangeError, "Make sure to specify correct \"Cells\" and \"Positions\" arrays"); + } + if (grading[dimIdx].size() + 1 != positions[dimIdx].size()) + { + DUNE_THROW(Dune::RangeError, "Make sure to specify correct \"Grading\" and \"Positions\" arrays"); + } + Scalar temp = std::numeric_limits<Scalar>::lowest(); + for (unsigned int posIdx = 0; posIdx < positions[dimIdx].size(); ++posIdx) + { + if (temp > positions[dimIdx][posIdx]) + { + DUNE_THROW(Dune::RangeError, "Make sure to specify a monotone increasing \"Positions\" array"); + } + temp = positions[dimIdx][posIdx]; + } + } + + std::array<ScalarVector, dim> globalPositions; + for (int dimIdx = 0; dimIdx < dim; dimIdx++) + { + for (int zoneIdx = 0; zoneIdx < cells[dimIdx].size(); ++zoneIdx) + { + Scalar lower = positions[dimIdx][zoneIdx]; + Scalar upper = positions[dimIdx][zoneIdx+1]; + int numCells = cells[dimIdx][zoneIdx]; + Scalar gradingFactor = grading[dimIdx][zoneIdx]; + Scalar length = upper - lower; + Scalar height = 1.0; + bool reverse = false; + + if (verbose) + { + std::cout << "dim " << dimIdx + << " lower " << lower + << " upper " << upper + << " numCells " << numCells + << " grading " << gradingFactor; + } + + if (gradingFactor > 1.0 - 1e-7 && gradingFactor < 1.0 + 1e-7) + { + height = 1.0 / numCells; + if (verbose) + { + std::cout << " -> h " << height * length << std::endl; + } + } + else + { + if (gradingFactor < -1.0) + { + gradingFactor = -gradingFactor; + } + else if (gradingFactor > 0.0 && gradingFactor < 1.0) + { + gradingFactor = 1.0 / gradingFactor; + } + else if (gradingFactor > 1.0) + { + reverse = true; + } + else + { + DUNE_THROW(Dune::NotImplemented, "This grading factor is not implemented."); + } + height = (1.0 - gradingFactor) / (1.0 - std::pow(gradingFactor, numCells)); + + if (verbose) + { + std::cout << " -> grading_eff " << gradingFactor + << " h_min " << height * std::pow(gradingFactor, 0) * length + << " h_max " << height * std::pow(gradingFactor, numCells-1) * length + << std::endl; + } + } + + std::vector<Scalar> localPositions; + localPositions.push_back(0); + for (int i = 0; i < numCells-1; i++) + { + Scalar hI = height; + if (!(gradingFactor < 1.0 + 1e-7 && gradingFactor > 1.0 - 1e-7)) + { + if (reverse) + { + hI *= std::pow(gradingFactor, i); + } + else + { + hI *= std::pow(gradingFactor, numCells-i-1); + } + } + localPositions.push_back(localPositions[i] + hI); + } + + for (int i = 0; i < localPositions.size(); i++) + { + localPositions[i] *= length; + localPositions[i] += lower; + } + + for (unsigned int i = 0; i < localPositions.size(); ++i) + { + globalPositions[dimIdx].push_back(localPositions[i]); + } + } + globalPositions[dimIdx].push_back(positions[dimIdx].back()); + } + + polarCoordinates[0] = globalPositions[indices[0]]; + polarCoordinates[1] = globalPositions[indices[1]]; + if (dim == 3) + polarCoordinates[2] = globalPositions[dim - indices[0] - indices[1]]; + + // convert angular coordinates into radians + for (int i = 0; i< polarCoordinates[1].size(); ++i) + { + polarCoordinates[1][i] = polarCoordinates[1][i]/180*M_PI; + std::cout << "angular coordinate[" << i << "] " << polarCoordinates[1][i] << std::endl; + } + } + catch (Dumux::ParameterException &e) + { + DUNE_THROW(Dumux::ParameterException, "Please supply the mandatory parameters:" << std::endl + << GET_PROP_VALUE(TypeTag, GridParameterGroup) + << ".Positions0, ..." << std::endl); + } + catch (...) { throw; } + } + + /*! + * \brief Creates cartesian grid from polar coordinates. + * + * \param polarCoordinates Vector containing radial, angular and axial coordinates (in this order) + * \param indices Indices specifing the radial, angular and axial direction (in this order) + */ + static std::shared_ptr<Grid> createCakeGrid(std::array<ScalarVector, dim> &polarCoordinates, + Dune::FieldVector<int, dim> &indices) + { + ScalarVector dR = polarCoordinates[0]; + ScalarVector dA = polarCoordinates[1]; + + GridFactory gf; + Dune::GeometryType type; + if (dim == 3) + { + type.makeHexahedron(); + } + else + { + type.makeCube(2); + } + + //create nodes + if (dim == 3) + { + ScalarVector dZ = polarCoordinates[2]; + for (int j = 0; j <= dA.size() - 1; ++j) + { + for (int l = 0; l <= dZ.size() - 1; ++l) + { + for (int i = 0; i <= dR.size()- 1; ++i) + { + // Get radius for the well (= a hole) in the center + Scalar wellRadius = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, WellRadius); + + // transform into cartesian Coordinates + Dune::FieldVector <double, dim> v(0.0); + v[indices[2]] = dZ[l]; + v[indices[0]] = cos(dA[j])*wellRadius + cos(dA[j])*dR[i]; + v[indices[1]] = sin(dA[j])*wellRadius + sin(dA[j])*dR[i]; + std::cout << "Coordinates of : " << v[0] << " " << v[1] << " " << v[2] << std::endl; + gf.insertVertex(v); + } + } + } + + std::cout << "Filled node vector" << std::endl; + + // assign nodes + unsigned int z = 0; + unsigned int t = 0; + for (int j = 0; j < dA.size() - 1; ++j) + { + for (int l = 0; l < dZ.size() - 1; ++l) + { + if (j < dA.size() - 2) + { + for (int i = 0; i < dR.size() - 1; ++i) + { + unsigned int rSize = dR.size(); + unsigned int zSize = dZ.size(); + std::vector<unsigned int> vid({z, z+1, z+rSize*zSize, + z+rSize*zSize+1, z+rSize, z+rSize+1, + z+rSize*zSize+rSize, z+rSize*zSize+rSize+1}); + + gf.insertElement(type, vid); + + z = z+1; + } + z = z+1; + } + else + { + // assign nodes for 360°-cake + for (int i = 0; i < dR.size() - 1; ++i) + { + // z = z + 1; + unsigned int rSize = dR.size(); + std::vector<unsigned int> vid({z, z+1, t, + t+1, z+rSize, z+rSize+1, + t+rSize, t+rSize+1}); + for (int k = 0; k < vid.size(); ++k) + { + std::cout << "vid = " << vid[k] << std::endl; + } + gf.insertElement(type, vid); + t = t + 1; + z = z+1; + } + t = t + 1; + z = z+1; + } + std::cout << "assign nodes 360 ends..." << std::endl; + } + + z = z + dR.size(); + } + } + else + { + for (int j = 0; j <= dA.size() - 1; ++j) + { + for (int i = 0; i <= dR.size()- 1; ++i) + { + // Get radius for the well (= a hole) in the center + Scalar wellRadius = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, WellRadius); + + // transform into cartesian Coordinates + Dune::FieldVector <double, dim> v(0.0); + + v[indices[0]] = cos(dA[j])*wellRadius + cos(dA[j])*dR[i]; + v[indices[1]] = sin(dA[j])*wellRadius + sin(dA[j])*dR[i]; + std::cout << "Coordinates of : " << v[0] << " " << v[1] << std::endl; + gf.insertVertex(v); + } + } + std::cout << "Filled node vector" << std::endl; + + // assign nodes + unsigned int z = 0; + unsigned int t = 0; + for (int j = 0; j < dA.size() - 1; ++j) + { + if (j < dA.size() - 2) + { + for (int i = 0; i < dR.size() - 1; ++i) + { + unsigned int rSize = dR.size(); + std::vector<unsigned int> vid({z, z+1, z+rSize, z+rSize+1}); + for (int k = 0; k < vid.size(); ++k) + { + std::cout << "vid = " << vid[k] << std::endl; + } + gf.insertElement(type, vid); + z = z+1; + } + z = z+1; + } + else + { + // assign nodes for 360°-cake + for (int i = 0; i < dR.size() - 1; ++i) + { + // z = z + 1; + std::vector<unsigned int> vid({z, z+1, t, t+1}); + for (int k = 0; k < vid.size(); ++k) + { + std::cout << "vid = " << vid[k] << std::endl; + } + gf.insertElement(type, vid); + t = t + 1; + z = z+1; + } + t = t + 1; + z = z+1; + } + std::cout << "assign nodes 360 ends..." << std::endl; + } + } + // assign nodes ends... + return std::shared_ptr<Grid>(gf.createGrid()); + + } + + /*! + * \brief Returns a reference to the grid. + */ + static Grid &grid() + { + return *gridPtr(); + } + + /*! + * \brief Distributes the grid on all processes of a parallel + * computation. + */ + static void loadBalance() + { + gridPtr()->loadBalance(); + } + + /*! + * \brief Returns a reference to the shared pointer to the grid. + */ + static GridPointer &gridPtr() + { + static GridPointer cakeGrid; + return cakeGrid; + } +}; + +} + +#endif diff --git a/test/geomechanics/el2p/el2pproblem.hh b/test/geomechanics/el2p/el2pproblem.hh index d0627913fae854b7bb888a2fb7a84bfb752dcfee..6ae8b7e18d00deeb7e35a090c77595af7a29894c 100644 --- a/test/geomechanics/el2p/el2pproblem.hh +++ b/test/geomechanics/el2p/el2pproblem.hh @@ -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) diff --git a/test/io/gridcreator/CMakeLists.txt b/test/io/gridcreator/CMakeLists.txt index db79c4dd5e9d5b5ef2f9a99acfa41e26f988922a..812b7f044173c634237e91ae0840c79079a1248e 100644 --- a/test/io/gridcreator/CMakeLists.txt +++ b/test/io/gridcreator/CMakeLists.txt @@ -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 diff --git a/test/io/gridcreator/test_gridcreator_cake.cc b/test/io/gridcreator/test_gridcreator_cake.cc new file mode 100644 index 0000000000000000000000000000000000000000..cf034176f689021bd807bbf51aa691c923487117 --- /dev/null +++ b/test/io/gridcreator/test_gridcreator_cake.cc @@ -0,0 +1,95 @@ +/***************************************************************************** + * 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 + diff --git a/test/io/gridcreator/test_gridcreator_cake.input b/test/io/gridcreator/test_gridcreator_cake.input new file mode 100644 index 0000000000000000000000000000000000000000..bafe5dc24a27dcd6e19fd13dd13a57214a38be48 --- /dev/null +++ b/test/io/gridcreator/test_gridcreator_cake.input @@ -0,0 +1,11 @@ +[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 diff --git a/test/references/cake-reference.vtu b/test/references/cake-reference.vtu new file mode 100644 index 0000000000000000000000000000000000000000..36b816b47ec35baae73c45b80e877173888f7a36 --- /dev/null +++ b/test/references/cake-reference.vtu @@ -0,0 +1,111 @@ +<?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>