From 54e742a82a184eab4f06d3396904e43151cbbe52 Mon Sep 17 00:00:00 2001 From: Felix Schindler <felix.schindler@wwu.de> Date: Tue, 12 Apr 2016 15:38:43 +0200 Subject: [PATCH] update names and includes --- dune/gdt/spaces/cg.hh | 4 +-- dune/gdt/spaces/cg/dune-fem-wrapper.hh | 44 ++++++++++++-------------- dune/gdt/test/operators/darcy.hh | 6 ++-- dune/gdt/test/spaces/cg.hh | 2 +- dune/gdt/test/spaces/cg/fem.hh | 18 +++++------ 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/dune/gdt/spaces/cg.hh b/dune/gdt/spaces/cg.hh index 63fad232b..4c2d3e806 100644 --- a/dune/gdt/spaces/cg.hh +++ b/dune/gdt/spaces/cg.hh @@ -19,7 +19,7 @@ #endif #include "interface.hh" -#include "cg/fem.hh" +#include "cg/dune-fem-wrapper.hh" #include "cg/pdelab.hh" @@ -47,7 +47,7 @@ private: template <class G, int p, class R, size_t r, size_t rC> struct SpaceChooser<G, p, R, r, rC, GDT::ChooseSpaceBackend::fem> { - typedef GDT::Spaces::CG::FemBased<GridLayerType, p, R, r> Type; + typedef GDT::DuneFemCgSpaceWrapper<GridLayerType, p, R, r> Type; }; template <class G, int p, class R, size_t r, size_t rC> diff --git a/dune/gdt/spaces/cg/dune-fem-wrapper.hh b/dune/gdt/spaces/cg/dune-fem-wrapper.hh index ec458f922..143da3846 100644 --- a/dune/gdt/spaces/cg/dune-fem-wrapper.hh +++ b/dune/gdt/spaces/cg/dune-fem-wrapper.hh @@ -3,8 +3,8 @@ // Copyright holders: Felix Schindler // License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) -#ifndef DUNE_GDT_SPACES_CG_FEM_HH -#define DUNE_GDT_SPACES_CG_FEM_HH +#ifndef DUNE_GDT_SPACES_CG_DUNE_FEM_WRAPPER_HH +#define DUNE_GDT_SPACES_CG_DUNE_FEM_WRAPPER_HH #include <memory> @@ -19,33 +19,31 @@ #include <dune/gdt/spaces/parallel.hh> -#include "../../mapper/fem.hh" -#include "../../basefunctionset/fem.hh" +#include "../mapper/dune-fem-wrapper.hh" +#include "../basefunctionset/dune-fem-wrapper.hh" #include "interface.hh" #include "../constraints.hh" namespace Dune { namespace GDT { -namespace Spaces { -namespace CG { #if HAVE_DUNE_FEM // forward, to be used in the traits and to allow for specialization template <class GridPartImp, int polynomialOrder, class RangeFieldImp, size_t rangeDim, size_t rangeDimCols = 1> -class FemBased +class DuneFemCgSpaceWrapper { static_assert(Dune::AlwaysFalse<GridPartImp>::value, "Untested for these dimensions!"); }; template <class GridPartImp, int polynomialOrder, class RangeFieldImp, size_t rangeDim, size_t rangeDimCols> -class FemBasedTraits +class DuneFemCgSpaceWrapperTraits { public: - typedef FemBased<GridPartImp, polynomialOrder, RangeFieldImp, rangeDim, rangeDimCols> derived_type; + typedef DuneFemCgSpaceWrapper<GridPartImp, polynomialOrder, RangeFieldImp, rangeDim, rangeDimCols> derived_type; typedef GridPartImp GridPartType; typedef typename GridPartType::GridViewType GridViewType; static const int polOrder = polynomialOrder; @@ -72,21 +70,21 @@ public: static const bool needs_grid_view = false; typedef CommunicationChooser<GridViewType, false> CommunicationChooserType; typedef typename CommunicationChooserType::Type CommunicatorType; -}; // class FemBasedTraits +}; // class DuneFemCgSpaceWrapperTraits // untested for the vector-valued case, especially Spaces::CGInterface template <class GridPartImp, int polynomialOrder, class RangeFieldImp, size_t r> -class FemBased<GridPartImp, polynomialOrder, RangeFieldImp, r, 1> - : public Spaces::CGInterface<FemBasedTraits<GridPartImp, polynomialOrder, RangeFieldImp, r, 1>, +class DuneFemCgSpaceWrapper<GridPartImp, polynomialOrder, RangeFieldImp, r, 1> + : public Spaces::CGInterface<DuneFemCgSpaceWrapperTraits<GridPartImp, polynomialOrder, RangeFieldImp, r, 1>, GridPartImp::dimension, r, 1> { - typedef Spaces::CGInterface<FemBasedTraits<GridPartImp, polynomialOrder, RangeFieldImp, r, 1>, GridPartImp::dimension, - r, 1> BaseType; - typedef FemBased<GridPartImp, polynomialOrder, RangeFieldImp, r, 1> ThisType; + typedef Spaces::CGInterface<DuneFemCgSpaceWrapperTraits<GridPartImp, polynomialOrder, RangeFieldImp, r, 1>, + GridPartImp::dimension, r, 1> BaseType; + typedef DuneFemCgSpaceWrapper<GridPartImp, polynomialOrder, RangeFieldImp, r, 1> ThisType; public: - typedef FemBasedTraits<GridPartImp, polynomialOrder, RangeFieldImp, r, 1> Traits; + typedef DuneFemCgSpaceWrapperTraits<GridPartImp, polynomialOrder, RangeFieldImp, r, 1> Traits; static const int polOrder = Traits::polOrder; static const size_t dimDomain = BaseType::dimDomain; @@ -109,7 +107,7 @@ public: using typename BaseType::DomainType; using typename BaseType::BoundaryInfoType; - explicit FemBased(GridPartType gridP) + explicit DuneFemCgSpaceWrapper(GridPartType gridP) : gridPart_(new GridPartType(gridP)) , gridView_(new GridViewType(gridPart_->gridView())) , backend_(new BackendType(*gridPart_)) @@ -118,8 +116,8 @@ public: { } - FemBased(const ThisType& other) = default; - explicit FemBased(ThisType&& source) = default; + DuneFemCgSpaceWrapper(const ThisType& other) = default; + explicit DuneFemCgSpaceWrapper(ThisType&& source) = default; ThisType& operator=(const ThisType& other) = delete; ThisType& operator=(ThisType&& source) = delete; @@ -171,14 +169,14 @@ private: const std::shared_ptr<const BackendType> backend_; const std::shared_ptr<const MapperType> mapper_; mutable std::shared_ptr<CommunicatorType> communicator_; -}; // class FemBased< ..., 1 > +}; // class DuneFemCgSpaceWrapper< ..., 1 > #else // HAVE_DUNE_FEM template <class GridPartImp, int polynomialOrder, class RangeFieldImp, size_t rangeDim, size_t rangeDimCols = 1> -class FemBased +class DuneFemCgSpaceWrapper { static_assert(Dune::AlwaysFalse<GridPartImp>::value, "You are missing dune-fem!"); }; @@ -187,9 +185,7 @@ class FemBased #endif // HAVE_DUNE_FEM -} // namespace CG -} // namespace Spaces } // namespace GDT } // namespace Dune -#endif // DUNE_GDT_SPACES_CG_FEM_HH +#endif // DUNE_GDT_SPACES_CG_DUNE_FEM_WRAPPER_HH diff --git a/dune/gdt/test/operators/darcy.hh b/dune/gdt/test/operators/darcy.hh index 1c4220e30..4d4de9f4d 100644 --- a/dune/gdt/test/operators/darcy.hh +++ b/dune/gdt/test/operators/darcy.hh @@ -16,7 +16,7 @@ #include <dune/gdt/operators/laplace.hh> #include <dune/gdt/operators/l2.hh> #include <dune/gdt/spaces/tools.hh> -#include <dune/gdt/spaces/cg/fem.hh> +#include <dune/gdt/spaces/cg/dune-fem-wrapper.hh> #include <dune/gdt/spaces/fv/default.hh> #include <dune/gdt/spaces/rt/dune-pdelab-wrapper.hh> @@ -27,7 +27,7 @@ namespace Test { /** * \note This test assumes that DiscreteFunction, Operators::L2Projection, Products::L2, Products::H1Semi, - * Spaces::CG::FemBased, Spaces::RT::PdelabBased and Spaces::FV::Default work correctly. + * DuneFemCgSpaceWrapper, Spaces::RT::PdelabBased and Spaces::FV::Default work correctly. * \todo This test is rather old and could be refactored in terms of the other operator tests. * \todo Missing ctor and make_darcy_operator tests. */ @@ -82,7 +82,7 @@ struct DarcyOperatorTest : public ::testing::Test RangeFieldType expected_result_(const std::string type, const FunctionType& desired_output, const GV& grid_view) const { typedef typename SpaceTools::LeafGridPartView<GridType, RangeSpaceType::needs_grid_view>::Type GPV; - if (std::is_base_of<Spaces::CG::FemBased<GPV, 1, RangeFieldType, dimDomain>, RangeSpaceType>::value) { + if (std::is_base_of<DuneFemCgSpaceWrapper<GPV, 1, RangeFieldType, dimDomain>, RangeSpaceType>::value) { if (type == "l2") return 2.18e-16; else if (type == "h1") diff --git a/dune/gdt/test/spaces/cg.hh b/dune/gdt/test/spaces/cg.hh index e3771248a..2f32cf203 100644 --- a/dune/gdt/test/spaces/cg.hh +++ b/dune/gdt/test/spaces/cg.hh @@ -15,7 +15,7 @@ #include <dune/stuff/common/ranges.hh> #include <dune/stuff/grid/walker.hh> -#include <dune/gdt/spaces/cg/fem.hh> +#include <dune/gdt/spaces/cg/dune-fem-wrapper.hh> #include <dune/gdt/spaces/cg/pdelab.hh> #include <dune/gdt/spaces/mapper/interfaces.hh> #include <dune/gdt/spaces/basefunctionset/interface.hh> diff --git a/dune/gdt/test/spaces/cg/fem.hh b/dune/gdt/test/spaces/cg/fem.hh index 6df0ca0c8..1c467a0ec 100644 --- a/dune/gdt/test/spaces/cg/fem.hh +++ b/dune/gdt/test/spaces/cg/fem.hh @@ -6,16 +6,16 @@ #ifndef DUNE_GDT_TEST_SPACES_CG_FEM_HH #define DUNE_GDT_TEST_SPACES_CG_FEM_HH -#include <dune/gdt/spaces/cg/fem.hh> +#include <dune/gdt/spaces/cg/dune-fem-wrapper.hh> #include <dune/gdt/test/grids.hh> #if HAVE_DUNE_FEM -#define SPACE_CG_FEM_SGRID(dd, rr, pp) Dune::GDT::Spaces::CG::FemBased<S##dd##dLeafGridPartType, pp, double, rr> +#define SPACE_CG_FEM_SGRID(dd, rr, pp) Dune::GDT::DuneFemCgSpaceWrapper<S##dd##dLeafGridPartType, pp, double, rr> -#define SPACE_CG_FEM_YASPGRID(dd, rr, pp) Dune::GDT::Spaces::CG::FemBased<Yasp##dd##dLeafGridPartType, pp, double, rr> +#define SPACE_CG_FEM_YASPGRID(dd, rr, pp) Dune::GDT::DuneFemCgSpaceWrapper<Yasp##dd##dLeafGridPartType, pp, double, rr> #define SPACES_CG_FEM(pp) \ SPACE_CG_FEM_SGRID(1, 1, pp) \ @@ -23,10 +23,10 @@ SPACE_CG_FEM_YASPGRID(2, 1, pp), SPACE_CG_FEM_YASPGRID(3, 1, pp) -#define SPACE_CG_FEM_SGRID_LEVEL(dd, rr, pp) Dune::GDT::Spaces::CG::FemBased<S##dd##dLevelGridPartType, pp, double, rr> +#define SPACE_CG_FEM_SGRID_LEVEL(dd, rr, pp) Dune::GDT::DuneFemCgSpaceWrapper<S##dd##dLevelGridPartType, pp, double, rr> #define SPACE_CG_FEM_YASPGRID_LEVEL(dd, rr, pp) \ - Dune::GDT::Spaces::CG::FemBased<Yasp##dd##dLevelGridPartType, pp, double, rr> + Dune::GDT::DuneFemCgSpaceWrapper<Yasp##dd##dLevelGridPartType, pp, double, rr> #define SPACES_CG_FEM_LEVEL(pp) \ SPACE_CG_FEM_SGRID_LEVEL(1, 1, pp) \ @@ -38,10 +38,10 @@ #define SPACE_CG_FEM_ALUCONFORMGRID(dd, rr, pp) \ - Dune::GDT::Spaces::CG::FemBased<AluConform##dd##dLeafGridPartType, pp, double, rr> + Dune::GDT::DuneFemCgSpaceWrapper<AluConform##dd##dLeafGridPartType, pp, double, rr> #define SPACE_CG_FEM_ALUCUBEGRID(dd, rr, pp) \ - Dune::GDT::Spaces::CG::FemBased<AluCube##dd##dLeafGridPartType, pp, double, rr> + Dune::GDT::DuneFemCgSpaceWrapper<AluCube##dd##dLeafGridPartType, pp, double, rr> #define SPACES_CG_FEM_ALUGRID(pp) \ SPACE_CG_FEM_ALUCONFORMGRID(2, 1, pp) \ @@ -49,10 +49,10 @@ #define SPACE_CG_FEM_ALUCONFORMGRID_LEVEL(dd, rr, pp) \ - Dune::GDT::Spaces::CG::FemBased<AluConform##dd##dLevelGridPartType, pp, double, rr> + Dune::GDT::DuneFemCgSpaceWrapper<AluConform##dd##dLevelGridPartType, pp, double, rr> #define SPACE_CG_FEM_ALUCUBEGRID_LEVEL(dd, rr, pp) \ - Dune::GDT::Spaces::CG::FemBased<AluCube##dd##dLevelGridPartType, pp, double, rr> + Dune::GDT::DuneFemCgSpaceWrapper<AluCube##dd##dLevelGridPartType, pp, double, rr> #define SPACES_CG_FEM_ALUGRID_LEVEL(pp) \ SPACE_CG_FEM_ALUCONFORMGRID_LEVEL(2, 1, pp) \ -- GitLab