...
  View open merge request
Commits (4)
......@@ -25,4 +25,5 @@ install(FILES
subspacebasis.hh
subspacelocalview.hh
taylorhoodbasis.hh
transformedindexbasis.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/functions/functionspacebases)
This diff is collapsed.
......@@ -30,6 +30,7 @@
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/subspacebasis.hh>
#include <dune/functions/functionspacebases/boundarydofs.hh>
#include <dune/functions/functionspacebases/transformedindexbasis.hh>
#include <dune/functions/gridfunctions/discreteglobalbasisfunction.hh>
#include <dune/functions/gridfunctions/gridviewfunction.hh>
......@@ -339,15 +340,40 @@ int main (int argc, char *argv[]) try
#else
using namespace Functions::BasisFactory;
static const std::size_t p = 1; // pressure order for Taylor-Hood
// Create an index transformation that transforms
// the BlockedInterleaved indices of the power pre-basis
// to FlatInterleaved indices.
auto transformation = Experimental::indexTransformation(
[](auto& multiIndex, const auto& basis) {
if (multiIndex[0] == 0)
{
multiIndex[1] = multiIndex[1]*dim + multiIndex[2];
multiIndex.resize(2);
}
},
[](const auto& prefix, const auto& basis) -> std::size_t {
if (prefix.size()>1)
return 0;
if ((prefix.size()==1) and (prefix[0]==0))
return basis.size(prefix) * dim;
return basis.size(prefix);
},
Dune::Indices::_2, Dune::Indices::_3);
// This basis should behave like the basis created
// with the FlatInterleaved index merging strategy
// in the commented code above.
auto taylorHoodBasis = makeBasis(
gridView,
composite(
power<dim>(
lagrange<p+1>(),
flatInterleaved()),
lagrange<p>()
));
gridView,
Experimental::transformIndices(
composite(
power<dim>(
lagrange<K+1>()
),
lagrange<K>()),
transformation));
#endif
......