Commit 77894488 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Rename parallel global basis

parent 0efb1d15
......@@ -5,7 +5,6 @@
#include <dune/common/concept.hh>
#include <dune/common/shared_ptr.hh>
#include <dune/functions/functionspacebases/concepts.hh>
#include <amdis/DataTransfer.hpp>
......@@ -13,16 +12,11 @@
#include <amdis/Observer.hpp>
#include <amdis/common/Concepts.hpp>
#include <amdis/common/TypeTraits.hpp>
#include <amdis/functions/ParallelGlobalBasis.hpp>
#include <amdis/functions/GlobalBasis.hpp>
#include <amdis/typetree/TreePath.hpp>
namespace AMDiS
{
// Forward declarations
template <class PB>
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<GB> 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 <class GV, class PBF,
REQUIRES(Concepts::PreBasisFactory<PBF, GV, MultiIndex_t<PBF>>)>
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<GB>(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<Underlying_t<GB>>;
template <class GV, class PBF>
DOFVector(GV const& gridView, PBF const& pbf, DataTransferOperation op = DataTransferOperation::INTERPOLATE)
-> DOFVector<decltype(ParallelGlobalBasis{gridView,pbf})>;
DOFVector(GV const& gridView, PBF const& pbf,
DataTransferOperation op = DataTransferOperation::INTERPOLATE)
-> DOFVector<decltype(GlobalBasis{gridView,pbf})>;
/// \brief Create a DOFVector from a basis.
......
......@@ -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 <class Grid, class PB>
struct DeducedProblemTraits<Grid,ParallelGlobalBasis<PB>,void>
struct DeducedProblemTraits<Grid,GlobalBasis<PB>,void>
{
using type = DefaultProblemTraits<ParallelGlobalBasis<PB>>;
using type = DefaultProblemTraits<GlobalBasis<PB>>;
};
template <class G, class PBF>
......@@ -540,7 +540,7 @@ namespace AMDiS
{
using Grid = AdaptiveGrid_t<G>;
using GridView = typename Grid::LeafGridView;
using Basis = decltype(ParallelGlobalBasis{std::declval<GridView>(),std::declval<PBF>()});
using Basis = decltype(GlobalBasis{std::declval<GridView>(),std::declval<PBF>()});
using type = DefaultProblemTraits<Basis>;
};
......
......@@ -9,7 +9,7 @@
#include <amdis/AdaptiveGrid.hpp>
#include <amdis/common/Logical.hpp>
#include <amdis/common/TypeTraits.hpp>
#include <amdis/functions/ParallelGlobalBasis.hpp>
#include <amdis/functions/GlobalBasis.hpp>
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<GridView>()));
......
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)
#pragma once
#include <algorithm>
#include <list>
#include <memory>
......@@ -12,14 +11,11 @@
#include <dune/common/shared_ptr.hh>
#include <dune/common/typeutilities.hh>
#include <dune/common/version.hh>
#include <dune/functions/common/type_traits.hh>
#include <dune/functions/functionspacebases/concepts.hh>
#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
#include <dune/functions/functionspacebases/flatmultiindex.hh>
#include <dune/grid/common/adaptcallback.hh>
#include <dune/typetree/treepath.hh>
#include <amdis/AdaptiveGrid.hpp>
......@@ -38,28 +34,28 @@
namespace AMDiS
{
template <class PreBasisFactory>
using MultiIndex_t = std::conditional_t<
(remove_cvref_t<PreBasisFactory>::requiredMultiIndexSize == 1),
template <class PreBasisFactory, class PBF = remove_cvref_t<PreBasisFactory>>
using MultiIndex_t = std::conditional_t<(PBF::requiredMultiIndexSize == 1),
Dune::Functions::FlatMultiIndex<std::size_t>,
Dune::ReservedVector<std::size_t, remove_cvref_t<PreBasisFactory>::requiredMultiIndexSize>>;
Dune::ReservedVector<std::size_t, PBF::requiredMultiIndexSize>>;
/**
* \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<PB>. 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<PB>.
* 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 PB>
class ParallelGlobalBasis
class GlobalBasis
: public Dune::Functions::DefaultGlobalBasis<PB>
, public Notifier<event::adapt>
, private Observer<event::adapt>
{
using Self = ParallelGlobalBasis<PB>;
using Self = GlobalBasis<PB>;
using Super = Dune::Functions::DefaultGlobalBasis<PB>;
public:
......@@ -81,9 +77,7 @@ namespace AMDiS
struct DummyImpl {};
using ADH = Dune::AdaptDataHandle<Grid, DummyImpl>;
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 <class... Args,
Dune::Functions::enableIfConstructible<PreBasis, Args...> = 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<event::adapt>(grid)
, comm_(CommunicationCreator<Comm>::create(static_cast<Super const&>(*this), name + "->solver"))
......@@ -102,30 +96,30 @@ namespace AMDiS
/// Construct this global basis with a preBasisFactory
template <class PBF>
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<MultiIndex_t<PBF>>(gridView)))
{}
/// Construct this global basis with empty name
template <class Arg, class... Args,
REQUIRES(!std::is_same_v<std::string, remove_cvref_t<Arg>>)>
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 <class GV, class PBF>
ParallelGlobalBasis(std::string const& name, GV const& gridView, PBF const& preBasisFactory)
-> ParallelGlobalBasis<decltype(flatPreBasis(
GlobalBasis(std::string const& name, GV const& gridView, PBF const& preBasisFactory)
-> GlobalBasis<decltype(flatPreBasis(
preBasisFactory.template makePreBasis<MultiIndex_t<PBF>>(gridView)))>;
template <class GV, class PBF>
ParallelGlobalBasis(GV const& gridView, PBF const& preBasisFactory)
-> ParallelGlobalBasis<decltype(flatPreBasis(
GlobalBasis(GV const& gridView, PBF const& preBasisFactory)
-> GlobalBasis<decltype(flatPreBasis(
preBasisFactory.template makePreBasis<MultiIndex_t<PBF>>(gridView)))>;
} // end namespace AMDiS
......@@ -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<decltype(basis1)> 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<Underlying_t<decltype(basis2)>> 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<GlobalBasis, T>` with `GlobalBasis = ParallelGlobalBasis<typename Underlying_t<Basis>::PreBasis>`. The
Returns a `DOFVector<GB, T>` with `GB = GlobalBasis<typename Underlying_t<Basis>::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<double>(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<double,3>
......
# 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<Impl>` 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<Impl>` 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<k>())`). 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 <class... Args>
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 <class... Args>
ParallelGlobalBasis(Grid const& grid, Args&&... args);
GlobalBasis(Grid const& grid, Args&&... args);
// Name, GridView and PreBasisFactory
template <class PBF>
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 <class PBF>
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.
......@@ -112,14 +112,14 @@ of dune-functions:
```c++
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <amdis/functions/ParallelGlobalBasis.hpp>
#include <amdis/functions/GlobalBasis.hpp>
// 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.
......
......@@ -12,7 +12,7 @@
#include <amdis/AdaptiveGrid.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/LinearAlgebra.hpp>
#include <amdis/functions/ParallelGlobalBasis.hpp>
#include <amdis/functions/GlobalBasis.hpp>
#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);
......
#include <amdis/AMDiS.hpp>
#include <amdis/DOFVector.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/functions/ParallelGlobalBasis.hpp>
#include <amdis/functions/GlobalBasis.hpp>
#include <dune/grid/yaspgrid.hh>
......@@ -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;
}
......
......@@ -4,7 +4,7 @@
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp>
#include <amdis/common/QuadMath.hpp>
#include <amdis/functions/ParallelGlobalBasis.hpp>
#include <amdis/functions/GlobalBasis.hpp>
#include <dune/common/version.hh>
#include <dune/grid/yaspgrid.hh>
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment