treecontainer.cc 1.02 KB
Newer Older
Praetorius, Simon's avatar
Praetorius, Simon committed
1
2
3
4
5
6
7
8
9
#include <amdis/AMDiS.hpp>
#include <amdis/typetree/TreeContainer.hpp>

#include <dune/grid/yaspgrid.hh>
#include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>

using namespace AMDiS;
10
11

int main(int argc, char** argv)
Praetorius, Simon's avatar
Praetorius, Simon committed
12
{
13
14
  Environment env(argc, argv);

Praetorius, Simon's avatar
Praetorius, Simon committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  // create grid
  Dune::YaspGrid<2> grid({1.0,1.0}, {1,1});
  auto gridView = grid.leafGridView();

  // create basis
  using namespace Dune::Functions::BasisFactory;
  auto basis1 = makeBasis(gridView,
    composite(power<2>(lagrange<2>(), flatInterleaved()), lagrange<1>(), flatLexicographic()));
  auto basis2 = makeBasis(gridView,
    power<2>(power<2>(lagrange<2>(), flatInterleaved()), flatLexicographic()));

  auto localView = basis1.localView();

  auto container = makeTreeContainer<double>(localView.tree());
  auto container2 = makeTreeContainer(localView.tree(),
    [&](auto const& node) { return makeTreeContainer<double>(localView.tree()); });
31
}