| 1 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 2 |
// vi: set et ts=4 sw=2 sts=2: |
| 3 |
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 4 |
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception |
| 5 |
|
| 6 |
#include <dune/geometry/type.hh> |
| 7 |
|
| 8 |
#include <dune/common/test/testsuite.hh> |
| 9 |
#include <dune/localfunctions/lagrange/cache.hh> |
| 10 |
|
| 11 |
|
| 12 |
int main ( int argc, char **argv ) |
| 13 |
{ |
| 14 |
using namespace Dune; |
| 15 |
|
| 16 |
TestSuite tests; |
| 17 |
|
| 18 |
{ |
| 19 |
DynamicLagrangeLocalFiniteElementCache<double,double,2> cache(3); |
| 20 |
const auto& fe1 = cache.get(Dune::GeometryTypes::simplex(2)); |
| 21 |
const auto& fe2 = cache.get(Dune::GeometryTypes::cube(2)); |
| 22 |
tests.check(fe1.localBasis().size() == 10); |
| 23 |
tests.check(fe2.localBasis().size() == 16); |
| 24 |
} |
| 25 |
{ |
| 26 |
DynamicLagrangeLocalFiniteElementCache<double,double,3> cache(2); |
| 27 |
const auto& fe1 = cache.get(Dune::GeometryTypes::simplex(3)); |
| 28 |
const auto& fe2 = cache.get(Dune::GeometryTypes::cube(3)); |
| 29 |
const auto& fe3 = cache.get(Dune::GeometryTypes::prism); |
| 30 |
const auto& fe4 = cache.get(Dune::GeometryTypes::pyramid); |
| 31 |
tests.check(fe1.localBasis().size() == 10); |
| 32 |
tests.check(fe2.localBasis().size() == 27); |
| 33 |
tests.check(fe3.localBasis().size() == 18); |
| 34 |
tests.check(fe4.localBasis().size() == 14); |
| 35 |
} |
| 36 |
|
| 37 |
return tests.exit(); |
| 38 |
} |