diff --git a/amdis/DOFVector.hpp b/amdis/DOFVector.hpp index 060254029454f1872abab49fef4014290d0d432c..fecfdaad533ca9df54b6ac753c306b4cea402e26 100644 --- a/amdis/DOFVector.hpp +++ b/amdis/DOFVector.hpp @@ -5,7 +5,6 @@ #include #include - #include #include @@ -13,16 +12,11 @@ #include #include #include -#include +#include #include namespace AMDiS { - // Forward declarations - template - class ParallelGlobalBasis; - - /// \brief The basic container that stores a base vector and a corresponding basis /** * \tparam GB Basis of the vector @@ -58,7 +52,8 @@ namespace AMDiS using Traits = TraitsType; public: - /// (1) Constructor. Stores the shared_ptr of the basis and creates a new DataTransfer. + /// (1) Constructor. Stores the shared_ptr of the basis and creates a new + /// DataTransfer. DOFVector(std::shared_ptr const& basis, DataTransferOperation op = DataTransferOperation::INTERPOLATE) : Coefficients(*basis) @@ -77,10 +72,12 @@ namespace AMDiS : DOFVector(Dune::wrap_or_move(FWD(basis)), op) {} - /// (3) Constructor. Forwards to (1) by creating a new basis from a dune-functions pre-basis factory. + /// (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(GV const& gridView, PBF const& preBasisFactory, + DataTransferOperation op = DataTransferOperation::INTERPOLATE) : DOFVector(std::make_shared(gridView, preBasisFactory), op) {} @@ -151,15 +148,15 @@ namespace AMDiS protected: - /// Override of Observer update(event::preAdapt) method. Redirects to preAdapt method of the - /// \ref DataTransfer object. + /// Override of Observer update(event::preAdapt) method. Redirects to preAdapt + /// method of the \ref DataTransfer object. void updateImpl(event::preAdapt e) override { dataTransfer_.preAdapt(*this, e.value); } - /// Override of Observer update(event::adapt) method. Redirects to adapt method of the - /// \ref DataTransfer object. + /// Override of Observer update(event::adapt) method. Redirects to adapt method + /// of the \ref DataTransfer object. void updateImpl(event::adapt e) override { assert(e.value); @@ -167,8 +164,8 @@ namespace AMDiS dataTransfer_.adapt(*this); } - /// Override of Observer update(event::postAdapt) method. Redirects to postAdapt method of the - /// \ref DataTransfer object. + /// Override of Observer update(event::postAdapt) method. Redirects to postAdapt + /// method of the \ref DataTransfer object. void updateImpl(event::postAdapt) override { dataTransfer_.postAdapt(*this); @@ -189,8 +186,9 @@ namespace AMDiS -> DOFVector>; template - DOFVector(GV const& gridView, PBF const& pbf, DataTransferOperation op = DataTransferOperation::INTERPOLATE) - -> DOFVector; + 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 494d33a617614b4863ed986fdb601ec772939606..2204d296ea3392720d9cabe6939a91b427ef730e 100644 --- a/amdis/ProblemStat.hpp +++ b/amdis/ProblemStat.hpp @@ -120,7 +120,7 @@ namespace AMDiS ProblemStat(std::string const& name, Grid_&& grid, PBF_ const& preBasisFactory) : ProblemStat(name, FWD(grid)) { - adoptGlobalBasis(makeSharedPtr(ParallelGlobalBasis{grid_->leafGridView(), preBasisFactory})); + adoptGlobalBasis(makeSharedPtr(GlobalBasis{grid_->leafGridView(), preBasisFactory})); } /// \brief Initialisation of the problem. @@ -529,9 +529,9 @@ namespace AMDiS struct DeducedProblemTraits; template - struct DeducedProblemTraits,void> + struct DeducedProblemTraits,void> { - using type = DefaultProblemTraits>; + using type = DefaultProblemTraits>; }; template @@ -540,7 +540,7 @@ namespace AMDiS { using Grid = AdaptiveGrid_t; using GridView = typename Grid::LeafGridView; - using Basis = decltype(ParallelGlobalBasis{std::declval(),std::declval()}); + using Basis = decltype(GlobalBasis{std::declval(),std::declval()}); using type = DefaultProblemTraits; }; diff --git a/amdis/ProblemStatTraits.hpp b/amdis/ProblemStatTraits.hpp index 0c03e12e097e6977fb3e5ac64c20b19b2219400f..9014df3de907268fdff5e421f09ee5f46a7ecc54 100644 --- a/amdis/ProblemStatTraits.hpp +++ b/amdis/ProblemStatTraits.hpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include namespace AMDiS { @@ -91,12 +91,12 @@ namespace AMDiS static auto create(std::string const& name, GridView const& gridView) { - return ParallelGlobalBasis(name, gridView, PreBasisCreator::create()); + return AMDiS::GlobalBasis{name, gridView, PreBasisCreator::create()}; } static auto create(GridView const& gridView) { - return ParallelGlobalBasis(gridView, PreBasisCreator::create()); + return AMDiS::GlobalBasis{gridView, PreBasisCreator::create()}; } using GlobalBasis = decltype(create(std::declval())); diff --git a/amdis/functions/CMakeLists.txt b/amdis/functions/CMakeLists.txt index ae38d21546721af6ed9e3a5e95547224b365f7dc..2ea13a79b386770e8c4126f75fdfb017bfeecd64 100644 --- a/amdis/functions/CMakeLists.txt +++ b/amdis/functions/CMakeLists.txt @@ -1,6 +1,7 @@ install(FILES FlatPreBasis.hpp FunctionFromCallable.hpp + GlobalBasis.hpp GlobalIdSet.hpp HierarchicNodeToRangeMap.hpp Interpolate.hpp @@ -9,5 +10,4 @@ install(FILES NodeIndices.hpp Nodes.hpp Order.hpp - ParallelGlobalBasis.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/functions) diff --git a/amdis/functions/ParallelGlobalBasis.hpp b/amdis/functions/GlobalBasis.hpp similarity index 76% rename from amdis/functions/ParallelGlobalBasis.hpp rename to amdis/functions/GlobalBasis.hpp index b9328587bb36339faf95773d5273c3246950bb72..73e74954c7f4fbcb51c83ebf6fe430f5578f5fe1 100644 --- a/amdis/functions/ParallelGlobalBasis.hpp +++ b/amdis/functions/GlobalBasis.hpp @@ -1,6 +1,5 @@ #pragma once - #include #include #include @@ -12,14 +11,11 @@ #include #include #include - #include #include #include #include - #include - #include #include @@ -38,28 +34,28 @@ namespace AMDiS { - template - using MultiIndex_t = std::conditional_t< - (remove_cvref_t::requiredMultiIndexSize == 1), + template > + using MultiIndex_t = std::conditional_t<(PBF::requiredMultiIndexSize == 1), Dune::Functions::FlatMultiIndex, - Dune::ReservedVector::requiredMultiIndexSize>>; + Dune::ReservedVector>; /** - * \brief Parallel global basis defined on a (sequential) pre-basis + * \brief Global basis defined on a pre-basis * - * This class is an expansion to Dune::Functions::DefaultGlobalBasis. It adds a communicator - * to use the basis in parallel as well as automatic update functionality. + * This class is an expansion to Dune::Functions::DefaultGlobalBasis. + * It adds a communicator to use the basis in parallel as well as automatic + * update functionality. * * \tparam PB Pre-basis providing the implementation details */ template - class ParallelGlobalBasis + class GlobalBasis : public Dune::Functions::DefaultGlobalBasis , public Notifier , private Observer { - using Self = ParallelGlobalBasis; + using Self = GlobalBasis; using Super = Dune::Functions::DefaultGlobalBasis; public: @@ -81,9 +77,7 @@ namespace AMDiS struct DummyImpl {}; using ADH = Dune::AdaptDataHandle; - public: - /// Construct this global basis with given name and grid, and constructing a preBasis. /** * \param name Name associated with this basis for initfile parameter attachment. @@ -94,7 +88,7 @@ namespace AMDiS */ template = 0> - ParallelGlobalBasis(std::string const& name, Grid const& grid, Args&&... args) + GlobalBasis(std::string const& name, Grid const& grid, Args&&... args) : Super(FWD(args)...) , Observer(grid) , comm_(CommunicationCreator::create(static_cast(*this), name + "->solver")) @@ -102,30 +96,30 @@ namespace AMDiS /// Construct this global basis with a preBasisFactory template - ParallelGlobalBasis(std::string const& name, GridView const& gridView, PBF const& preBasisFactory) - : ParallelGlobalBasis(name, gridView.grid(), + GlobalBasis(std::string const& name, GridView const& gridView, + PBF const& preBasisFactory) + : GlobalBasis(name, gridView.grid(), flatPreBasis(preBasisFactory.template makePreBasis>(gridView))) {} /// Construct this global basis with empty name template >)> - ParallelGlobalBasis(Arg&& arg, Args&&... args) - : ParallelGlobalBasis(std::string(""), FWD(arg), FWD(args)...) + GlobalBasis(Arg&& arg, Args&&... args) + : GlobalBasis(std::string(""), FWD(arg), FWD(args)...) {} /// Copy constructor - ParallelGlobalBasis(ParallelGlobalBasis const&) = delete; + GlobalBasis(GlobalBasis const&) = delete; /// Move constructor - ParallelGlobalBasis(ParallelGlobalBasis&&) = default; + GlobalBasis(GlobalBasis&&) = default; public: - /// \brief Update the stored grid view /** - * This will update the indexing information of the global basis as well as the communicator. - * It is called automatically if the grid has changed. + * This will update the indexing information of the global basis as well as + * the communicator. It is called automatically if the grid has changed. */ void update(GridView const& gv) { @@ -141,7 +135,7 @@ namespace AMDiS } /// Return *this because we are not embedded in a larger basis - ParallelGlobalBasis const& rootBasis() const + GlobalBasis const& rootBasis() const { return *this; } @@ -157,7 +151,7 @@ namespace AMDiS ADH globalRefineCallback() const { // TODO(FM): Implement - error_exit("Not implemented: ParallelGlobalBasis::globalRefineCallback()"); + error_exit("Not implemented: GlobalBasis::globalRefineCallback()"); return ADH{}; } @@ -180,13 +174,13 @@ namespace AMDiS // Deduction guides template - ParallelGlobalBasis(std::string const& name, GV const& gridView, PBF const& preBasisFactory) - -> ParallelGlobalBasis GlobalBasis>(gridView)))>; template - ParallelGlobalBasis(GV const& gridView, PBF const& preBasisFactory) - -> ParallelGlobalBasis GlobalBasis>(gridView)))>; } // end namespace AMDiS diff --git a/docs/reference/DOFVector.md b/docs/reference/DOFVector.md index 74aea54bb604c3b0abcdf38898995782f6a48cb5..271e34596911cc492670b014db3bf89dc07762e6 100644 --- a/docs/reference/DOFVector.md +++ b/docs/reference/DOFVector.md @@ -104,12 +104,12 @@ using Grid = Dune::YaspGrid<2>; Grid grid({1.0, 1.0}, {2, 2}); using namespace Dune::Functions::BasisFactory; -ParallelGlobalBasis basis1(grid.leafGridView(), lagrange<2>()); +GlobalBasis basis1(grid.leafGridView(), lagrange<2>()); DOFVector vec0(basis1); DOFVector vec1(basis1); // C++17 only -auto basis2 = makeUniquePtr(ParallelGlobalBasis(grid.leafGridView(), lagrange<2>())); +auto basis2 = makeUniquePtr(GlobalBasis{grid.leafGridView(), lagrange<2>()}); DOFVector> vec2(std::move(basis2)); ``` @@ -162,7 +162,7 @@ DOFVector. The default is interpolation of the data to the new grid. #### Arguments `Basis basis` -: Reference, temporary, or `shared_ptr` to dune global basis or `ParallelGlobalBasis` +: Reference, temporary, or `shared_ptr` to dune global basis or `GlobalBasis` `DataTransferOperation op` : The operation performed during data-transfer, either `DataTransferOperation::INTERPOLATE` or `DataTransferOperation::NO_OPERATION` @@ -172,7 +172,7 @@ DOFVector. The default is interpolation of the data to the new grid. : The type of the coefficients to store in the DOFVector #### Return value -Returns a `DOFVector` with `GlobalBasis = ParallelGlobalBasis::PreBasis>`. The +Returns a `DOFVector` with `GB = GlobalBasis::PreBasis>`. The underlying type is either the `remove_cvref_t` for references, or the pointed-to type for smart pointers. #### Example @@ -180,7 +180,7 @@ underlying type is either the `remove_cvref_t` for references, or the pointed-to using namespace Dune::Functions::BasisFactory; // pass a reference to the basis -ParallelGlobalBasis basis1(gridView, lagrange<2>()); +GlobalBasis basis1(gridView, lagrange<2>()); auto vec1 = makeDOFVector(basis1); // pass a smart pointer @@ -320,7 +320,7 @@ Returns the const (1) or mutable (2) sub-range view of the stored DOFVector. #### Example ```c++ -ParallelGlobalBasis basis(gridView, power<3>(lagrange<1>())); +GlobalBasis basis{gridView, power<3>(lagrange<1>())}; auto vec = makeDOFVector(basis); auto df = valueOf(vec); @@ -383,7 +383,7 @@ Note, the range type of the expression must be compatible with the `Range` type #### Example ```c++ -ParallelGlobalBasis basis(gridView, power<3>(lagrange<1>())); +GlobalBasis basis{gridView, power<3>(lagrange<1>())}; auto vec = makeDOFVector(basis); // Range type is FieldVector diff --git a/docs/reference/GlobalBasis.md b/docs/reference/GlobalBasis.md index a8f0007156b64215b9e947558f78de8355c5f710..5136f74fb76649aa8afdf8201958389c29afea87 100644 --- a/docs/reference/GlobalBasis.md +++ b/docs/reference/GlobalBasis.md @@ -1,12 +1,12 @@ # Global Basis {: #group-globalbasis } ## Summary -In the context of the finite-element method we use a finite-element space $`V`$ with the set of basis functions $`\{\phi_i\}`$. Within AMDiS this concept is realized by the class `ParallelGlobalBasis`, contained in the header file `amdis/functions/ParallelGlobalBasis.hpp`. This extends the interface of the underlying `Dune::Functions::DefaultGlobalBasis` with an automatic update mechanism used in several places within AMDiS. We strongly advice to always use an `AMDiS::ParallelGlobalBasis` or a user-defined derived class instead of the DUNE data structure for the update mechanism to work properly. +In the context of the finite-element method we use a finite-element space $`V`$ with the set of basis functions $`\{\phi_i\}`$. Within AMDiS this concept is realized by the class `GlobalBasis`, contained in the header file `amdis/functions/GlobalBasis.hpp`. This extends the interface of the underlying `Dune::Functions::DefaultGlobalBasis` with an automatic update mechanism used in several places within AMDiS. We strongly advice to always use an `AMDiS::GlobalBasis` or a user-defined derived class instead of the DUNE data structure for the update mechanism to work properly. For more information on the class interface visit the API documentation. ## PreBasis classes and basis trees Many finite-element spaces in applications can be constructed as a product of simple spaces $`V = V_1 \times V_2 \times \dots \times V_k`$. For example the Taylor-Hood-Element can be constructed as $`V_{TH} = V_{v} \times V_{p}`$ with the space of velocity functions $`V_v`$ and pressure functions $`V_p`$. The velocity space can again be decomposed into the vector components $`V_v = V_{v_1} \times \dots \times V_{v_n}`$. If we use second-degree lagrange basis functions for the velocity space and first-order lagrange basis functions for the pressure we get a decomposition $`V_{TH} = V_{v_1} \times V_{v_n} \times V_p = L_2^n \times L_1`$. -The underlying numerics environment of AMDiS, DUNE, attempts to model the situation above. Hence a `ParallelGlobalBasis` in AMDiS can be defined by a tree structure using the Dune-PreBasis class, which itself is composed of nodes in a tree. The leaf nodes in this tree contain the implementation details of the simple basis, while inner nodes indicate composition of either identical children (called power nodes) or arbitrary children (called composite nodes). +The underlying numerics environment of AMDiS, DUNE, attempts to model the situation above. Hence a `GlobalBasis` in AMDiS can be defined by a tree structure using the Dune-PreBasis class, which itself is composed of nodes in a tree. The leaf nodes in this tree contain the implementation details of the simple basis, while inner nodes indicate composition of either identical children (called power nodes) or arbitrary children (called composite nodes). ### Making a PreBasis When we want to build a `PreBasis` we must first identify the structure of the basis we want to construct with a tree. We can then build that structure in AMDiS by nesting the functions `Dune::Functions::BasisFactory::composite(Nodes...[, MergingStrategy])` for composite nodes, `Dune::Functions::BasisFactory::power(Node[, MergingStrategy])` for power nodes and implementations (e.g. `Dune::Functions::BasisFactory::lagrange())`). The second optional argument `MergingStrategy` provides merging strategies to the inner nodes, specifying how the indices of the simple leaf basis should be merged to obtain the indexing of the global basis. Currently only flat indexing is supported by AMDiS. @@ -37,24 +37,24 @@ auto taylorHoodPreBasisFactoryWithMergingStrategy = ``` ## Making a global basis -Using a PreBasisFactory we can easily make a global basis by defining the set of grid elements on which the basis functions of the FE-space should live. This can be done by providing a GridView and using the `ParallelGlobalBasis` constructors. An optional name can be provided that can be used to pass initfile parameters to the parallel communication class. +Using a PreBasisFactory we can easily make a global basis by defining the set of grid elements on which the basis functions of the FE-space should live. This can be done by providing a GridView and using the `GlobalBasis` constructors. An optional name can be provided that can be used to pass initfile parameters to the parallel communication class. ```c++ // Name, Grid and Dune::DefaultGlobalBasis arguments template - ParallelGlobalBasis(std::string const& name, Grid const& grid, Args&&... args); + GlobalBasis(std::string const& name, Grid const& grid, Args&&... args); // As above with name defaulting to "" template - ParallelGlobalBasis(Grid const& grid, Args&&... args); + GlobalBasis(Grid const& grid, Args&&... args); // Name, GridView and PreBasisFactory template - ParallelGlobalBasis(std::string const& name, GridView const& gridView, PBF const& preBasisFactory); + GlobalBasis(std::string const& name, GridView const& gridView, PBF const& preBasisFactory); // As above with name defaulting to "" template - ParallelGlobalBasis(GridView const& gridView, PBF const& preBasisFactory); + GlobalBasis(GridView const& gridView, PBF const& preBasisFactory); ``` If we use a ProblemStat object most of the work will be done automatically for us. The PreBasis is specified via a Traits template parameter with the most frequently used cases already included in `amdis/ProblemStatTraits.hpp`. Those include @@ -83,7 +83,7 @@ auto& basis = *prob.globalBasis(); ``` ## Using the global basis -The `ParallelGlobalBasis` provides access to element indices and basis functions in the same way as a Dune-basis does, it is even derived from the Dune::DefaultGlobalBasis. +The `GlobalBasis` provides access to element indices and basis functions in the same way as a Dune-basis does, it is even derived from the Dune::DefaultGlobalBasis. ### Getting the total number of DOFs If we are simple interested in getting the total number of DOFs the basis contains we can simply call `basis.dimension()`. This can be useful for preparing matrices and vectors for insertion. @@ -198,4 +198,4 @@ For this purpose the update method exists, which takes a GridView of the Grid af Usually we do not need to call this function - out of the box AMDiS with a ProblemStat doing most of the work will automatically call it for us. If user code is working with the underlying Dune-Grid directly there is no way for AMDiS to detect if any changes happen to it, therefore update must be called manually in such a scenario. ### The globalRefineCallback function -Certain grid managers support the use of a callback function when doing global refinement. Using a ParallelGlobalBasis in this context is currently not supported. +Certain grid managers support the use of a callback function when doing global refinement. Using a GlobalBasis in this context is currently not supported. diff --git a/docs/tutorials/grids-and-discretefunctions.md b/docs/tutorials/grids-and-discretefunctions.md index 90713fd9426dfada9468e050dc58142d257274a7..a3a7559d602c5b52710c895f34559dc2010d1f2f 100644 --- a/docs/tutorials/grids-and-discretefunctions.md +++ b/docs/tutorials/grids-and-discretefunctions.md @@ -112,14 +112,14 @@ of dune-functions: ```c++ #include #include -#include +#include // the factory functions are defined in this namespace using namespace Dune::Functions::BasisFactory; // create a power basis of 3 lagrange bases with local polynomial degree 2 // on the leaf elements of the grid -ParallelGlobalBasis basis1(grid2->leafGridView(), power<3>(lagrange<2>())); +GlobalBasis basis1{grid2->leafGridView(), power<3>(lagrange<2>())}; ``` or by using some predefined wrappers: @@ -139,7 +139,7 @@ auto basis2 = BasisCreator::create(grid2->leafGridView()); grid refinement or by repartitioning. Additionally, it stores a communication object to construct global DOFMappings for distributed data structured. - This `ParallelGlobalBasis` can be converted from a `DefaultGlobalBasis` of dune-functions. + This `GlobalBasis` can be converted from a `DefaultGlobalBasis` of dune-functions. A [`DOFVector`](../reference/DOFVector.md) takes a global basis and provides the coefficient vector as data member. diff --git a/test/DOFVectorTest.cpp b/test/DOFVectorTest.cpp index 93aaa667cad37f82631e8bfc190be3f5223682bd..083b7d9fca420d5428c61db9fbe3c917a7d65ad6 100644 --- a/test/DOFVectorTest.cpp +++ b/test/DOFVectorTest.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include "Tests.hpp" @@ -62,7 +62,7 @@ int main(int argc, char** argv) auto preBasis = composite(power<2>(lagrange<2>(), flatInterleaved()), lagrange<1>(), flatLexicographic()); - ParallelGlobalBasis basis(gridView, preBasis); + GlobalBasis basis{gridView, preBasis}; using Basis = decltype(basis); diff --git a/test/FlatPreBasisTest.cpp b/test/FlatPreBasisTest.cpp index 18fd12a5723a9809f1a4b8a9f191c992ab05236a..0864fe4234aa0e0a6761070cf84a9b480f50dfed 100644 --- a/test/FlatPreBasisTest.cpp +++ b/test/FlatPreBasisTest.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include @@ -15,28 +15,28 @@ int test() auto gridView = grid.leafGridView(); // construct a basis - ParallelGlobalBasis basis1(gridView, power<2>(lagrange<1>(), blockedInterleaved())); - ParallelGlobalBasis basis2(gridView, power<2>(lagrange<1>(), blockedLexicographic())); - ParallelGlobalBasis basis3(gridView, power<2>(lagrange<1>(), flatInterleaved())); - ParallelGlobalBasis basis4(gridView, power<2>(lagrange<1>(), flatLexicographic())); - ParallelGlobalBasis basis5(gridView, power<2>(lagrange<1>())); - ParallelGlobalBasis basis6(gridView, composite(lagrange<1>())); + GlobalBasis basis1{gridView, power<2>(lagrange<1>(), blockedInterleaved())}; + GlobalBasis basis2{gridView, power<2>(lagrange<1>(), blockedLexicographic())}; + GlobalBasis basis3{gridView, power<2>(lagrange<1>(), flatInterleaved())}; + GlobalBasis basis4{gridView, power<2>(lagrange<1>(), flatLexicographic())}; + GlobalBasis basis5{gridView, power<2>(lagrange<1>())}; + GlobalBasis basis6{gridView, composite(lagrange<1>())}; // construct a ProblemStat - ProblemStat prob1("prob1", grid, power<2>(lagrange<1>(), blockedInterleaved())); - ProblemStat prob2("prob2", grid, power<2>(lagrange<1>(), blockedLexicographic())); - ProblemStat prob3("prob3", grid, power<2>(lagrange<1>(), flatInterleaved())); - ProblemStat prob4("prob4", grid, power<2>(lagrange<1>(), flatLexicographic())); - ProblemStat prob5("prob5", grid, power<2>(lagrange<1>())); - ProblemStat prob6("prob6", grid, composite(lagrange<1>())); + ProblemStat prob1{"prob1", grid, power<2>(lagrange<1>(), blockedInterleaved())}; + ProblemStat prob2{"prob2", grid, power<2>(lagrange<1>(), blockedLexicographic())}; + ProblemStat prob3{"prob3", grid, power<2>(lagrange<1>(), flatInterleaved())}; + ProblemStat prob4{"prob4", grid, power<2>(lagrange<1>(), flatLexicographic())}; + ProblemStat prob5{"prob5", grid, power<2>(lagrange<1>())}; + ProblemStat prob6{"prob6", grid, composite(lagrange<1>())}; // construct a DOFVector - DOFVector vec1(gridView, power<2>(lagrange<1>(), blockedInterleaved())); - DOFVector vec2(gridView, power<2>(lagrange<1>(), blockedLexicographic())); - DOFVector vec3(gridView, power<2>(lagrange<1>(), flatInterleaved())); - DOFVector vec4(gridView, power<2>(lagrange<1>(), flatLexicographic())); - DOFVector vec5(gridView, power<2>(lagrange<1>())); - DOFVector vec6(gridView, composite(lagrange<1>())); + DOFVector vec1{gridView, power<2>(lagrange<1>(), blockedInterleaved())}; + DOFVector vec2{gridView, power<2>(lagrange<1>(), blockedLexicographic())}; + DOFVector vec3{gridView, power<2>(lagrange<1>(), flatInterleaved())}; + DOFVector vec4{gridView, power<2>(lagrange<1>(), flatLexicographic())}; + DOFVector vec5{gridView, power<2>(lagrange<1>())}; + DOFVector vec6{gridView, composite(lagrange<1>())}; return 0; } diff --git a/test/ProblemStatTest.cpp b/test/ProblemStatTest.cpp index 120db1156fbb0779a712192895bec5c81f09cf4c..65c1c237d16c5d58b62dfc82e0ddd5cc5f824b5f 100644 --- a/test/ProblemStatTest.cpp +++ b/test/ProblemStatTest.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -22,9 +22,9 @@ void test() // use T as range type for basis using namespace Dune::Functions::BasisFactory; #if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7) - ParallelGlobalBasis basis(grid.leafGridView(), power<1>(lagrange<1>(), flatLexicographic())); + GlobalBasis basis{grid.leafGridView(), power<1>(lagrange<1>(), flatLexicographic())}; #else - ParallelGlobalBasis basis(grid.leafGridView(), power<1>(lagrange<1,T>(), flatLexicographic())); + GlobalBasis basis{grid.leafGridView(), power<1>(lagrange<1,T>(), flatLexicographic())}; #endif using Basis = decltype(basis);