Skip to content
Snippets Groups Projects
Commit cb02772e authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

A unit test for the BrezziDouglasMariniBasis class

parent 74e30b38
Branches
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@
# Path to the example grid files in dune-grid
add_definitions(-DDUNE_GRID_EXAMPLE_GRIDS_PATH=\"${DUNE_GRID_EXAMPLE_GRIDS_PATH}\")
dune_add_test(SOURCES brezzidouglasmarinibasistest.cc)
dune_add_test(SOURCES gridviewfunctionspacebasistest.cc)
dune_add_test(SOURCES taylorhoodbasistest.cc)
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#include <config.h>
#include <dune/common/exceptions.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/functions/functionspacebases/brezzidouglasmarinibasis.hh>
#include <dune/functions/functionspacebases/test/basistest.hh>
using namespace Dune;
int main (int argc, char* argv[])
{
MPIHelper::instance(argc, argv);
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 RaviartThomasBasis created 'manually'
{
typedef GridType::LeafGridView GridView;
const GridView& gridView = grid.leafGridView();
Functions::BrezziDouglasMariniBasis<GridView,1,GeometryType::BasicType::cube> basis(gridView);
test.subTest(checkBasis(basis));
}
// check RaviartThomasBasis created using basis builder mechanism
{
using namespace Functions::BasisBuilder;
auto basis = makeBasis(grid.leafGridView(), bdm<1, GeometryType::BasicType::cube>());
test.subTest(checkBasis(basis));
}
return test.exit();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment