Skip to content
Snippets Groups Projects
Commit c3a24db8 authored by Porrmann, Maik's avatar Porrmann, Maik
Browse files

add testfile with standart basistest

add includefile (required for test to compile)
parent 22dc9e60
Branches addBasisTest
No related tags found
1 merge request!2basis test
add_subdirectory("test")
#install headers
install(FILES
scalarbasis.hh
......
......@@ -9,7 +9,7 @@
#include <dune/localfunctions/lagrange/p0.hh>
#include <dune/functions/functionspacebases/nodes.hh>
#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
namespace Dune {
namespace Functions {
......
dune_add_test(SOURCES scalarbasistest.cc LABELS quick)
// -*- 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/bitsetvector.hh>
#include <dune/common/test/testsuite.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/functions/functionspacebases/scalarbasis.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/functions/functionspacebases/powerbasis.hh>
#include <dune/functions/functionspacebases/compositebasis.hh>
#include <dune/functions/functionspacebases/test/basistest.hh>
using namespace Dune;
int main(int argc, char *argv[]) try
{
// Set up MPI, if available
MPIHelper::instance(argc, argv);
Dune::TestSuite test;
///////////////////////////////////
// Generate the grid
///////////////////////////////////
const int dim = 2;
typedef YaspGrid<dim> GridType;
FieldVector<double, dim> l(1);
std::array<int, dim> elements = {{4, 4}};
GridType grid(l, elements);
typedef GridType::LeafGridView GridView;
GridView gridView = grid.leafGridView();
/////////////////////////////////////////////////////////
// Choose a finite element space
/////////////////////////////////////////////////////////
using namespace Functions::BasisFactory;
{
auto basis = makeBasis(
gridView,
scalar());
test.subTest(checkBasis(basis, EnableContinuityCheck()));
}
{
auto basis = Dune::Functions::DefaultGlobalBasis(
gridView,
composite(
scalar(),
scalar()));
test.subTest(checkBasis(basis, EnableContinuityCheck()));
}
{
auto basis = Dune::Functions::DefaultGlobalBasis(
gridView,
power<2>(
scalar(), flatLexicographic()));
test.subTest(checkBasis(basis, EnableContinuityCheck()));
}
{
auto basis = Dune::Functions::DefaultGlobalBasis(
gridView,
power<2>(
scalar(), flatInterleaved()));
test.subTest(checkBasis(basis, EnableContinuityCheck()));
}
// test fails, either via assertion in Debug mode or due to inconsistent multiindices
// {
// auto basis = Dune::Functions::DefaultGlobalBasis(
// gridView, composite(
// power<2>(
// scalar(), flatInterleaved()), lagrange<1>(), flatLexicographic()));
// test.subTest(checkBasis(basis, EnableContinuityCheck()));
// }
return test.exit();
}
// Error handling
catch (Exception &e)
{
std::cout << e.what() << std::endl;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment