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>
20#include <amdis/AdaptiveGrid.hpp>
21#include <amdis/Observer.hpp>
22#include <amdis/Output.hpp>
23#include <amdis/common/Concepts.hpp>
24#include <amdis/common/TypeTraits.hpp>
25#include <amdis/functions/FlatPreBasis.hpp>
26#include <amdis/functions/LocalView.hpp>
27#include <amdis/linearalgebra/IndexDistribution.hpp>
28#include <amdis/linearalgebra/Traits.hpp>
29#include <amdis/typetree/MultiIndex.hpp>
44 :
public Dune::Functions::DefaultGlobalBasis<PB>
49 using Super = Dune::Functions::DefaultGlobalBasis<PB>;
57 using Grid =
typename GridView::Grid;
66 using ADH = Dune::AdaptDataHandle<Grid, DummyImpl>;
79 : Super(flatPreBasis(preBasis))
80 ,
Observer<event::adapt>(preBasis.gridView().grid())
81 , indexDist_(static_cast<Super const&>(*this))
104 Super::preBasis().update(gv);
105 Super::preBasis().initializeIndices();
106 indexDist_.update(*
this);
118 return std::make_shared<LocalView>(*
this);
124 return elements(this->gridView(), BackendTraits::PartitionSet{});
141 ADH globalRefineCallback()
const
144 error_exit(
"Not implemented: GlobalBasis::globalRefineCallback()");
153 update(Super::gridView());
166 template <
class GV,
class PBF>
167 GlobalBasis(GV
const& gridView, PBF
const& preBasisFactory)
168 -> GlobalBasis<std::decay_t<
decltype(flatPreBasis(preBasisFactory(gridView)))>>;
171 GlobalBasis(PB
const& preBasis)
172 -> GlobalBasis<std::decay_t<
decltype(flatPreBasis(preBasis))>>;
Dummy implementation for sequential index "distribution".
Definition IndexDistribution.hpp:7
Global basis defined on a pre-basis.
Definition GlobalBasis.hpp:47
IndexDist const & indexDistribution() const
Return the index distribution.
Definition GlobalBasis.hpp:138
GlobalBasis(GlobalBasis const &)=delete
Copy constructor.
void update(GridView const &gv)
Update the stored grid view.
Definition GlobalBasis.hpp:102
LocalView localView() const
Return local view for basis.
Definition GlobalBasis.hpp:110
AMDiS::LocalView< Self > LocalView
Type of the local view on the restriction of the basis to a single element.
Definition GlobalBasis.hpp:60
PB PreBasis
Pre-basis providing the implementation details.
Definition GlobalBasis.hpp:53
auto entitySet() const
Return the set of entities this basis can be bound to.
Definition GlobalBasis.hpp:122
GlobalBasis const & rootBasis() const
Return *this because we are not embedded in a larger basis.
Definition GlobalBasis.hpp:128
GlobalBasis(GridView const &gridView, PBF const &preBasisFactory)
Construct this global basis with a preBasisFactory.
Definition GlobalBasis.hpp:86
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:150
typename PreBasis::GridView GridView
The grid view that the FE space is defined on.
Definition GlobalBasis.hpp:56
std::shared_ptr< LocalView > localViewPtr() const
Return local view as shared_ptr to prevent from copy construction.
Definition GlobalBasis.hpp:116
BackendTraits::IndexDist< Self > IndexDist
Type of the communicator.
Definition GlobalBasis.hpp:63
GlobalBasis(PB_ const &preBasis)
Construct this global basis with given name and grid, and constructing a preBasis.
Definition GlobalBasis.hpp:78
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
Definition GlobalBasis.hpp:65
Definition Observer.hpp:25