9#include <dune/common/concept.hh>
10#include <dune/common/reservedvector.hh>
11#include <dune/common/shared_ptr.hh>
12#include <dune/common/typeutilities.hh>
13#include <dune/common/version.hh>
14#include <dune/functions/common/multiindex.hh>
15#include <dune/functions/common/type_traits.hh>
16#include <dune/functions/functionspacebases/concepts.hh>
17#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
18#include <dune/grid/common/adaptcallback.hh>
19#include <dune/typetree/treepath.hh>
21#include <amdis/AdaptiveGrid.hpp>
22#include <amdis/Observer.hpp>
23#include <amdis/Output.hpp>
24#include <amdis/common/Concepts.hpp>
25#include <amdis/common/TypeTraits.hpp>
26#include <amdis/functions/FlatPreBasis.hpp>
27#include <amdis/functions/LocalView.hpp>
28#include <amdis/linearalgebra/IndexDistribution.hpp>
29#include <amdis/linearalgebra/Traits.hpp>
30#include <amdis/typetree/MultiIndex.hpp>
45 :
public Dune::Functions::DefaultGlobalBasis<PB>
50 using Super = Dune::Functions::DefaultGlobalBasis<PB>;
58 using Grid =
typename GridView::Grid;
67 using ADH = Dune::AdaptDataHandle<Grid, DummyImpl>;
78 template <
class... Args,
79 Dune::Functions::enableIfConstructible<
PreBasis, Args...> = 0>
80 GlobalBasis(std::string
const& name, Grid
const& grid, Args&&... args)
83 , indexDist_(static_cast<Super const&>(*this))
89 PBF
const& preBasisFactory)
90 :
GlobalBasis(name, gridView.grid(), flatPreBasis(preBasisFactory(gridView)))
94 template <
class Arg,
class... Args,
95 REQUIRES(!std::is_same_v<std::string, remove_cvref_t<Arg>>)>
97 :
GlobalBasis(std::string(
""), FWD(arg), FWD(args)...)
114 Super::preBasis().update(gv);
115 Super::preBasis().initializeIndices();
116 indexDist_.update(*
this);
128 return std::make_shared<LocalView>(*
this);
134 return elements(this->gridView(), BackendTraits::PartitionSet{});
151 ADH globalRefineCallback()
const
154 error_exit(
"Not implemented: GlobalBasis::globalRefineCallback()");
163 update(Super::gridView());
176 template <
class GV,
class PBF>
177 GlobalBasis(std::string
const& name, GV
const& gridView, PBF
const& preBasisFactory)
178 ->
GlobalBasis<std::decay_t<
decltype(flatPreBasis(preBasisFactory(gridView)))>>;
180 template <
class GV,
class PBF>
181 GlobalBasis(GV
const& gridView, PBF
const& preBasisFactory)
182 ->
GlobalBasis<std::decay_t<
decltype(flatPreBasis(preBasisFactory(gridView)))>>;
Dummy implementation for sequential index "distribution".
Definition: IndexDistribution.hpp:7
Global basis defined on a pre-basis.
Definition: GlobalBasis.hpp:48
GlobalBasis(std::string const &name, Grid const &grid, Args &&... args)
Construct this global basis with given name and grid, and constructing a preBasis.
Definition: GlobalBasis.hpp:80
GlobalBasis(std::string const &name, GridView const &gridView, PBF const &preBasisFactory)
Construct this global basis with a preBasisFactory.
Definition: GlobalBasis.hpp:88
IndexDist const & indexDistribution() const
Return the index distribution.
Definition: GlobalBasis.hpp:148
GlobalBasis(GlobalBasis const &)=delete
Copy constructor.
void update(GridView const &gv)
Update the stored grid view.
Definition: GlobalBasis.hpp:112
LocalView localView() const
Return local view for basis.
Definition: GlobalBasis.hpp:120
AMDiS::LocalView< Self > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition: GlobalBasis.hpp:61
PB PreBasis
Pre-basis providing the implementation details.
Definition: GlobalBasis.hpp:54
auto entitySet() const
Return the set of entities this basis can be bound to.
Definition: GlobalBasis.hpp:132
GlobalBasis const & rootBasis() const
Return *this because we are not embedded in a larger basis.
Definition: GlobalBasis.hpp:138
GlobalBasis(Arg &&arg, Args &&... args)
Construct this global basis with empty name.
Definition: GlobalBasis.hpp:96
GlobalBasis(GlobalBasis &&)=default
Move constructor.
void updateImpl(event::adapt e) override
Updates the underlying basis when event::adapt is triggered by the observed grid.
Definition: GlobalBasis.hpp:160
typename PreBasis::GridView GridView
The grid view that the FE space is defined on.
Definition: GlobalBasis.hpp:57
std::shared_ptr< LocalView > localViewPtr() const
Return local view as shared_ptr to prevent from copy construction.
Definition: GlobalBasis.hpp:126
BackendTraits::IndexDist< Self > IndexDist
Type of the communicator.
Definition: GlobalBasis.hpp:64
The restriction of a finite element basis to a single element.
Definition: LocalView.hpp:16
Mixin for signaling of certain events.
Definition: Observer.hpp:57
Implementation of the ObserverInterface.
Definition: Observer.hpp:104
constexpr bool GlobalBasis
A Dune::Functions::GlobalBasis type.
Definition: Concepts.hpp:189
Definition: GlobalBasis.hpp:66
Definition: Observer.hpp:25