diff --git a/amdis/DOFVector.hpp b/amdis/DOFVector.hpp index ececc17c520f8e73fe74fac64eaa8d79588ea834..555245157040e4d01671590f82e47c8f544aba08 100644 --- a/amdis/DOFVector.hpp +++ b/amdis/DOFVector.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -74,12 +75,11 @@ namespace AMDiS : DOFVector(Dune::wrap_or_move(FWD(basis)), op) {} - /// (3) Constructor. Forwards to (1) by creating a new basis from a dune-functions basis. - template ), - REQUIRES(Concepts::GlobalBasis)> - DOFVector(GB_&& basis, DataTransferOperation op = DataTransferOperation::INTERPOLATE) - : DOFVector(std::make_shared(std::move(basis)), op) + /// (3) Constructor. Forwards to (1) by creating a new basis from a dune-functions pre-basis factory. + template >)> + DOFVector(GV const& gridView, PBF const& preBasisFactory, DataTransferOperation op = DataTransferOperation::INTERPOLATE) + : DOFVector(std::make_shared(gridView, preBasisFactory), op) {} std::shared_ptr const& basis() const { return basis_; } @@ -224,6 +224,10 @@ namespace AMDiS DOFVector(GB&& basis, DataTransferOperation op = DataTransferOperation::INTERPOLATE) -> DOFVector::PreBasis>>; + template + DOFVector(GV const& gridView, PBF const& pbf, DataTransferOperation op = DataTransferOperation::INTERPOLATE) + -> DOFVector; + /// \brief Create a DOFVector from a basis. /** diff --git a/amdis/ProblemStat.hpp b/amdis/ProblemStat.hpp index 5471a940ecc92ae111cee87e504c55d0b043bc9f..0f154450b156294e7b8689e0672555bdcf2316d0 100644 --- a/amdis/ProblemStat.hpp +++ b/amdis/ProblemStat.hpp @@ -116,7 +116,7 @@ namespace AMDiS /// on the fly. template ::LeafGridView, - REQUIRES(Concepts::PreBasisFactory)> + REQUIRES(Concepts::PreBasisFactory>)> ProblemStat(std::string const& name, Grid_&& grid, PBF_ const& preBasisFactory) : ProblemStat(name, FWD(grid)) { @@ -536,7 +536,7 @@ namespace AMDiS template struct DeducedProblemTraits>> + std::enable_if_t>>> { using Grid = AdaptiveGrid_t; using GridView = typename Grid::LeafGridView; diff --git a/amdis/common/Concepts.hpp b/amdis/common/Concepts.hpp index d772544b358c6d1d8adf589bcae4854598084619..67183b81921aa3e63e17e8eb2fe52a24eb4bde9d 100644 --- a/amdis/common/Concepts.hpp +++ b/amdis/common/Concepts.hpp @@ -192,11 +192,11 @@ namespace AMDiS template using GlobalBasis_t = models_t(GB)>; - template > - constexpr bool PreBasisFactory = models(PBF,GV)>; + template > + constexpr bool PreBasisFactory = models(PBF,GV)>; - template > - using PreBasisFactory_t = models_t(PBF,GV)>; + template > + using PreBasisFactory_t = models_t(PBF,GV)>; /** @} **/ diff --git a/amdis/functions/ParallelGlobalBasis.hpp b/amdis/functions/ParallelGlobalBasis.hpp index fe29ff08b3c4e9b1de24e846e03008b18a7491ca..bcd63d2b3d60429cd823aa6a27ee2922d0c73e70 100644 --- a/amdis/functions/ParallelGlobalBasis.hpp +++ b/amdis/functions/ParallelGlobalBasis.hpp @@ -38,7 +38,7 @@ namespace AMDiS { template - using MultiIndex = std::conditional_t< + using MultiIndex_t = std::conditional_t< (remove_cvref_t::requiredMultiIndexSize == 1), Dune::Functions::FlatMultiIndex, Dune::ReservedVector::requiredMultiIndexSize>>; @@ -101,9 +101,9 @@ namespace AMDiS /// Construct this global basis with a preBasisFactory template - ParallelGlobalBasis(std::string const& name, GridView const& gridView, PBF&& preBasisFactory) + ParallelGlobalBasis(std::string const& name, GridView const& gridView, PBF const& preBasisFactory) : ParallelGlobalBasis(name, gridView.grid(), - preBasisFactory.template makePreBasis>(gridView)) + preBasisFactory.template makePreBasis>(gridView)) {} /// Construct this global basis with empty name @@ -181,11 +181,11 @@ namespace AMDiS template ParallelGlobalBasis(std::string const& name, GV const& gridView, PBF&& preBasisFactory) -> ParallelGlobalBasis>(gridView))>; + preBasisFactory.template makePreBasis>(gridView))>; template ParallelGlobalBasis(GV const& gridView, PBF&& preBasisFactory) -> ParallelGlobalBasis>(gridView))>; + preBasisFactory.template makePreBasis>(gridView))>; } // end namespace AMDiS diff --git a/test/DOFVectorTest.cpp b/test/DOFVectorTest.cpp index a8faf178c463125c684ce54b180591701b991901..5ecfc92b65ff43371668ba704744a7c6ad654490 100644 --- a/test/DOFVectorTest.cpp +++ b/test/DOFVectorTest.cpp @@ -98,7 +98,7 @@ int main(int argc, char** argv) DOFVector vec1(basis); // Conversion from Dune::Functions::DefaultGlobalBasis - auto vec2 = makeDOFVector(makeBasis(gridView, preBasis)); + DOFVector vec2(gridView, preBasis); for (auto const& e : elements(gridView)) grid.mark(1, e);