diff --git a/dumux/discretization/CMakeLists.txt b/dumux/discretization/CMakeLists.txt index b2a12576239b166f62735478ce043d1f0d021718..356c29ab317b53ac5c63ce2fcb3597656d175e07 100644 --- a/dumux/discretization/CMakeLists.txt +++ b/dumux/discretization/CMakeLists.txt @@ -21,6 +21,7 @@ fvproperties.hh localview.hh method.hh rotationpolicy.hh +rotationsymmetricgridgeometrytraits.hh rotationsymmetricscv.hh rotationsymmetricscvf.hh scvandscvfiterators.hh diff --git a/dumux/discretization/rotationsymmetricgridgeometrytraits.hh b/dumux/discretization/rotationsymmetricgridgeometrytraits.hh new file mode 100644 index 0000000000000000000000000000000000000000..2186adff21e2cd3d507b5d6884e44e7715f47728 --- /dev/null +++ b/dumux/discretization/rotationsymmetricgridgeometrytraits.hh @@ -0,0 +1,46 @@ +// -*- 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 3 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 + * \ingroup Discretization + * \brief Rotation policy for defining rotational symmetric grid geometries + */ +#ifndef DUMUX_DISCRETIZATION_ROTATION_SYMMETRIC_GG_TRAITS_HH +#define DUMUX_DISCRETIZATION_ROTATION_SYMMETRIC_GG_TRAITS_HH + +#include <dumux/discretization/rotationpolicy.hh> + +namespace Dumux { + +/*! + * \ingroup Discretization + * \brief Traits for rotation symmetric grid geometries + * \tparam BaseTraits The traits type to turn into rotation symmetric traits + * \tparam rotPolicy The rotation policy (see RotationPolicy enum class) + */ +template<class BaseTraits, RotationPolicy rotPolicy> +struct RotationSymmetricGridGeometryTraits : public BaseTraits +{ + using SubControlVolume = RotationSymmetricSubControlVolume<typename BaseTraits::SubControlVolume, rotPolicy>; + using SubControlVolumeFace = RotationSymmetricSubControlVolumeFace<typename BaseTraits::SubControlVolumeFace, rotPolicy>; +}; + +} // end namespace Dumux + +#endif diff --git a/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc b/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc index 15072fb5227dfca3f54eb95dc4881cb5d35ca793..b400bd8ec3197ffbe25eb9fde86ed845f8e03b84 100644 --- a/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc +++ b/test/discretization/rotationsymmetry/test_rotationsymmetric_gridgeometry.cc @@ -34,16 +34,10 @@ #include <dumux/discretization/rotationpolicy.hh> #include <dumux/discretization/rotationsymmetricscv.hh> #include <dumux/discretization/rotationsymmetricscvf.hh> +#include <dumux/discretization/rotationsymmetricgridgeometrytraits.hh> namespace Dumux { -template<class BaseTraits, RotationPolicy rotPolicy> -struct GGRotSymTraits : public BaseTraits -{ - using SubControlVolume = RotationSymmetricSubControlVolume<typename BaseTraits::SubControlVolume, rotPolicy>; - using SubControlVolumeFace = RotationSymmetricSubControlVolumeFace<typename BaseTraits::SubControlVolumeFace, rotPolicy>; -}; - template<class GG> void runTest(const GG& gg, const double refVolume, const double refSurface) { @@ -81,7 +75,7 @@ int main (int argc, char *argv[]) try // test the disc policy { using Grid = Dune::YaspGrid<1, Dune::EquidistantOffsetCoordinates<double, 1>>; - using GGTraits = GGRotSymTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::disc>; + using GGTraits = RotationSymmetricGridGeometryTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::disc>; using GridGeometry = CCTpfaFVGridGeometry<typename Grid::LeafGridView, /*caching=*/false, GGTraits>; using GlobalPosition = typename GridGeometry::SubControlVolume::GlobalPosition; @@ -110,7 +104,7 @@ int main (int argc, char *argv[]) try // test the ball policy { using Grid = Dune::YaspGrid<1, Dune::EquidistantOffsetCoordinates<double, 1>>; - using GGTraits = GGRotSymTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::ball>; + using GGTraits = RotationSymmetricGridGeometryTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::ball>; using GridGeometry = CCTpfaFVGridGeometry<typename Grid::LeafGridView, /*caching=*/false, GGTraits>; using GlobalPosition = typename GridGeometry::SubControlVolume::GlobalPosition; @@ -139,7 +133,7 @@ int main (int argc, char *argv[]) try // test the toroid policy { using Grid = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; - using GGTraits = GGRotSymTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::toroid>; + using GGTraits = RotationSymmetricGridGeometryTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::toroid>; using GridGeometry = CCTpfaFVGridGeometry<typename Grid::LeafGridView, /*caching=*/false, GGTraits>; using GlobalPosition = typename GridGeometry::SubControlVolume::GlobalPosition; @@ -170,7 +164,7 @@ int main (int argc, char *argv[]) try // test the toroid policy for perfect cylinder { using Grid = Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>>; - using GGTraits = GGRotSymTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::toroid>; + using GGTraits = RotationSymmetricGridGeometryTraits<CCTpfaDefaultGridGeometryTraits<typename Grid::LeafGridView>, RotationPolicy::toroid>; using GridGeometry = CCTpfaFVGridGeometry<typename Grid::LeafGridView, /*caching=*/false, GGTraits>; using GlobalPosition = typename GridGeometry::SubControlVolume::GlobalPosition;