diff --git a/dune/functions/functionspacebases/test/CMakeLists.txt b/dune/functions/functionspacebases/test/CMakeLists.txt index 5061b2ce4907cb6dd225eea3367c0fa11b83ddce..5da78ff4e5d4269bd8d56df30adfc4b0f2669a64 100644 --- a/dune/functions/functionspacebases/test/CMakeLists.txt +++ b/dune/functions/functionspacebases/test/CMakeLists.txt @@ -7,6 +7,8 @@ dune_add_test(SOURCES brezzidouglasmarinibasistest.cc) dune_add_test(SOURCES gridviewfunctionspacebasistest.cc) +dune_add_test(SOURCES lagrangedgbasistest.cc) + dune_add_test(SOURCES pq1nodalbasistest.cc) dune_add_test(SOURCES taylorhoodbasistest.cc) diff --git a/dune/functions/functionspacebases/test/lagrangedgbasistest.cc b/dune/functions/functionspacebases/test/lagrangedgbasistest.cc new file mode 100644 index 0000000000000000000000000000000000000000..0ad61be724a65f32bb52404c317a94c87d2b575b --- /dev/null +++ b/dune/functions/functionspacebases/test/lagrangedgbasistest.cc @@ -0,0 +1,56 @@ +// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- +// vi: set et ts=4 sw=2 sts=2: +#include <config.h> + +#include <iostream> + +#include <dune/common/exceptions.hh> +#include <dune/common/parallel/mpihelper.hh> + +#include <dune/grid/yaspgrid.hh> + +#include <dune/functions/functionspacebases/lagrangedgbasis.hh> + +#include <dune/functions/functionspacebases/test/basistest.hh> + +using namespace Dune; +using namespace Dune::Functions; + +int main (int argc, char* argv[]) +{ + Dune::MPIHelper::instance(argc, argv); + + Dune::TestSuite test; + + + + // Generate grid for testing + const int dim = 2; + typedef YaspGrid<dim> GridType; + FieldVector<double,dim> l(1); + std::array<int,dim> elements = {{10, 10}}; + GridType grid(l,elements); + + + + // check LagrangeDGBasis created 'manually' + { + typedef GridType::LeafGridView GridView; + const GridView& gridView = grid.leafGridView(); + LagrangeDGBasis<GridView,2> basis(gridView); + test.subTest(checkBasis(basis)); + } + + + + // check LagrangeDGBasis created using basis builder mechanism + { + using namespace Functions::BasisBuilder; + auto basis = makeBasis(grid.leafGridView(), lagrangeDG<2>()); + test.subTest(checkBasis(basis)); + } + + + + return test.exit(); +}