7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
13#include <dune/common/hybridutilities.hh>
14#include <dune/common/reservedvector.hh>
15#include <dune/common/typeutilities.hh>
16#include <dune/common/hybridutilities.hh>
18#include <dune/typetree/compositenode.hh>
19#include <dune/typetree/utility.hh>
32namespace Experimental {
53template<
class RPB,
class T>
56 using Transformation = T;
65 using GridView =
typename RawPreBasis::GridView;
71 using Node =
typename RawPreBasis::Node;
82 template<
class RPB_R,
class T_R>
124 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
128 template<
class SizePrefix>
162 template<
class MultiIndex>
168 template<
typename It>
172 for(std::size_t i=0; i<node.size(); ++i)
185template<
class RPB,
class T>
192namespace BasisFactory {
193namespace Experimental {
206template<
class RawPreBasisFactory,
class Transformation>
208 RawPreBasisFactory&& preBasisFactory,
209 Transformation&& transformation)
212 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
213 transformation =std::forward<Transformation>(transformation)
214 ](
const auto& gridView) {
239template<
class IndexTransformation,
class SizeImplementation,
class ContainerDescriptorImplementation, std::
size_t minIS, std::
size_t maxIS>
247 template<
class IT_R,
class SI_R,
class CD_R>
250 sizeImplementation_(std::forward<SI_R>(sizeImplementation)),
251 containerDescriptorImplementation_(std::forward<CD_R>(containerDescriptorImplementation))
254 template<
class MultiIndex,
class PreBasis>
257 indexTransformation_(multiIndex, preBasis);
260 template<
class Prefix,
class PreBasis>
261 auto size(
const Prefix& prefix,
const PreBasis& preBasis)
const
263 return sizeImplementation_(prefix, preBasis);
266 template<
class PreBasis>
269 return preBasis.dimension();
272 template<
class PreBasis>
275 return containerDescriptorImplementation_(preBasis);
279 IndexTransformation indexTransformation_;
280 SizeImplementation sizeImplementation_;
281 ContainerDescriptorImplementation containerDescriptorImplementation_;
305template<
class IndexTransformation,
class SizeImplementation,
class ContainerDescriptorImplementation, std::
size_t minIndexSize, std::
size_t maxIndexSize>
307 SizeImplementation&& sizeImplementation,
308 ContainerDescriptorImplementation&& containerDescriptorImplementation,
309 Dune::index_constant<minIndexSize>,
310 Dune::index_constant<maxIndexSize>)
313 std::decay_t<IndexTransformation>,
314 std::decay_t<SizeImplementation>,
315 std::decay_t<ContainerDescriptorImplementation>,
316 minIndexSize, maxIndexSize>(
318 std::forward<SizeImplementation>(sizeImplementation),
319 std::forward<ContainerDescriptorImplementation>(containerDescriptorImplementation));
323template<
class IndexTransformation,
class SizeImplementation,
324 std::size_t minIndexSize, std::size_t maxIndexSize>
326 SizeImplementation&& sizeImpl,
327 Dune::index_constant<minIndexSize> minSize,
328 Dune::index_constant<maxIndexSize> maxSize)
Definition polynomial.hh:17
auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, ContainerDescriptorImplementation &&containerDescriptorImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
A generic implementation of a transformation.
Definition transformedindexbasis.hh:306
auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
Create a TransformedIndexPreBasisFactory.
Definition transformedindexbasis.hh:207
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:50
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:55
It indices(const Node &node, It it) const
Definition transformedindexbasis.hh:169
Transformation transformation_
Definition transformedindexbasis.hh:182
void initializeIndices()
Initialize the global indices.
Definition transformedindexbasis.hh:89
typename RawPreBasis::GridView GridView
The grid view that the FE basis is defined on.
Definition transformedindexbasis.hh:65
void transformIndex(MultiIndex &multiIndex) const
Definition transformedindexbasis.hh:163
RawPreBasis rawPreBasis_
Definition transformedindexbasis.hh:181
typename RawPreBasis::Node Node
Template mapping root tree path to type of created tree node.
Definition transformedindexbasis.hh:71
TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)
Constructor for given child pre-basis objects.
Definition transformedindexbasis.hh:83
RawPreBasis & rawPreBasis()
Definition transformedindexbasis.hh:157
static constexpr size_type maxMultiIndexSize
Definition transformedindexbasis.hh:73
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition transformedindexbasis.hh:101
Node makeNode() const
Create tree node with given root tree path.
Definition transformedindexbasis.hh:116
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition transformedindexbasis.hh:95
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition transformedindexbasis.hh:129
RPB RawPreBasis
Definition transformedindexbasis.hh:62
size_type size() const
Same as size(prefix) with empty prefix.
Definition transformedindexbasis.hh:122
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition transformedindexbasis.hh:147
std::size_t size_type
Type used for indices and size information.
Definition transformedindexbasis.hh:68
static constexpr size_type multiIndexBufferSize
Definition transformedindexbasis.hh:75
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition transformedindexbasis.hh:141
const RawPreBasis & rawPreBasis() const
Definition transformedindexbasis.hh:152
static constexpr size_type minMultiIndexSize
Definition transformedindexbasis.hh:74
auto containerDescriptor() const
Return the container descriptor of the transformed pre-basis.
Definition transformedindexbasis.hh:135
A generic implementation of a transformation.
Definition transformedindexbasis.hh:241
GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation, CD_R &&containerDescriptorImplementation)
Definition transformedindexbasis.hh:248
static constexpr std::size_t maxIndexSize
Definition transformedindexbasis.hh:245
auto containerDescriptor(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:273
auto dimension(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:267
auto size(const Prefix &prefix, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:261
static constexpr std::size_t minIndexSize
Definition transformedindexbasis.hh:244
void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:255