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>
50template<
class RPB,
class T>
53 using Transformation = T;
62 using GridView =
typename RawPreBasis::GridView;
68 using Node =
typename RawPreBasis::Node;
79 template<
class RPB_R,
class T_R>
114 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
118 template<
class SizePrefix>
152 template<
class MultiIndex>
158 template<
typename It>
162 for(std::size_t i=0; i<node.size(); ++i)
175template<
class RPB,
class T>
196template<
class RawPreBasisFactory,
class Transformation>
198 RawPreBasisFactory&& preBasisFactory,
199 Transformation&& transformation)
202 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
203 transformation =std::forward<Transformation>(transformation)
204 ](
const auto& gridView) {
229template<
class IndexTransformation,
class SizeImplementation,
class ContainerDescriptorImplementation, std::
size_t minIS, std::
size_t maxIS>
237 template<
class IT_R,
class SI_R,
class CD_R>
240 sizeImplementation_(std::forward<SI_R>(sizeImplementation)),
241 containerDescriptorImplementation_(std::forward<CD_R>(containerDescriptorImplementation))
244 template<
class MultiIndex,
class PreBasis>
247 indexTransformation_(multiIndex, preBasis);
250 template<
class Prefix,
class PreBasis>
251 auto size(
const Prefix& prefix,
const PreBasis& preBasis)
const
253 return sizeImplementation_(prefix, preBasis);
256 template<
class PreBasis>
259 return preBasis.dimension();
262 template<
class PreBasis>
265 return containerDescriptorImplementation_(preBasis);
269 IndexTransformation indexTransformation_;
270 SizeImplementation sizeImplementation_;
271 ContainerDescriptorImplementation containerDescriptorImplementation_;
295template<
class IndexTransformation,
class SizeImplementation,
class ContainerDescriptorImplementation, std::
size_t minIndexSize, std::
size_t maxIndexSize>
297 SizeImplementation&& sizeImplementation,
298 ContainerDescriptorImplementation&& containerDescriptorImplementation,
299 Dune::index_constant<minIndexSize>,
300 Dune::index_constant<maxIndexSize>)
303 std::decay_t<IndexTransformation>,
304 std::decay_t<SizeImplementation>,
305 std::decay_t<ContainerDescriptorImplementation>,
306 minIndexSize, maxIndexSize>(
308 std::forward<SizeImplementation>(sizeImplementation),
309 std::forward<ContainerDescriptorImplementation>(containerDescriptorImplementation));
313template<
class IndexTransformation,
class SizeImplementation,
314 std::size_t minIndexSize, std::size_t maxIndexSize>
316 SizeImplementation&& sizeImpl,
317 Dune::index_constant<minIndexSize> minSize,
318 Dune::index_constant<maxIndexSize> maxSize)
Definition monomialset.hh:19
Definition monomialset.hh:19
Definition subdomain.hh:28
TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
Definition argyrisbasis.hh:926
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:296
auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
Create a TransformedIndexPreBasisFactory.
Definition transformedindexbasis.hh:197
Fallback container descriptor if nothing else fits.
Definition containerdescriptors.hh:52
A pre-basis transforming multi-indices.
Definition transformedindexbasis.hh:52
It indices(const Node &node, It it) const
Definition transformedindexbasis.hh:159
Transformation transformation_
Definition transformedindexbasis.hh:172
void initializeIndices()
Initialize the global indices.
Definition transformedindexbasis.hh:86
typename RawPreBasis::GridView GridView
The grid view that the FE basis is defined on.
Definition transformedindexbasis.hh:62
void transformIndex(MultiIndex &multiIndex) const
Definition transformedindexbasis.hh:153
RawPreBasis rawPreBasis_
Definition transformedindexbasis.hh:171
typename RawPreBasis::Node Node
Template mapping root tree path to type of created tree node.
Definition transformedindexbasis.hh:68
TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)
Constructor for given child pre-basis objects.
Definition transformedindexbasis.hh:80
RawPreBasis & rawPreBasis()
Definition transformedindexbasis.hh:147
static constexpr size_type maxMultiIndexSize
Definition transformedindexbasis.hh:70
void update(const GridView &gv)
Update the stored grid view, to be called if the grid has changed.
Definition transformedindexbasis.hh:98
Node makeNode() const
Create tree node.
Definition transformedindexbasis.hh:106
const GridView & gridView() const
Obtain the grid view that the basis is defined on.
Definition transformedindexbasis.hh:92
size_type size(const SizePrefix &prefix) const
Return number of possible values for next position in multi index.
Definition transformedindexbasis.hh:119
RPB RawPreBasis
Definition transformedindexbasis.hh:59
size_type size() const
Same as size(prefix) with empty prefix.
Definition transformedindexbasis.hh:112
size_type maxNodeSize() const
Get the maximal number of DOFs associated to node for any element.
Definition transformedindexbasis.hh:137
std::size_t size_type
Type used for indices and size information.
Definition transformedindexbasis.hh:65
static constexpr size_type multiIndexBufferSize
Definition transformedindexbasis.hh:72
size_type dimension() const
Get the total dimension of the space spanned by this basis.
Definition transformedindexbasis.hh:131
const RawPreBasis & rawPreBasis() const
Definition transformedindexbasis.hh:142
static constexpr size_type minMultiIndexSize
Definition transformedindexbasis.hh:71
auto containerDescriptor() const
Return the container descriptor of the transformed pre-basis.
Definition transformedindexbasis.hh:125
A generic implementation of a transformation.
Definition transformedindexbasis.hh:231
GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation, CD_R &&containerDescriptorImplementation)
Definition transformedindexbasis.hh:238
static constexpr std::size_t maxIndexSize
Definition transformedindexbasis.hh:235
auto containerDescriptor(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:263
auto dimension(const PreBasis &preBasis) const
Definition transformedindexbasis.hh:257
auto size(const Prefix &prefix, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:251
static constexpr std::size_t minIndexSize
Definition transformedindexbasis.hh:234
void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
Definition transformedindexbasis.hh:245