Skip to content
Snippets Groups Projects
Commit 1e2989b8 authored by René Milk's avatar René Milk
Browse files

Merge pull request #96 from wwu-numerik/dune-testtools

Merging this now since it's basically functional and we're about to split the repo.
parents 30c47e68 4654c87f
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,8 @@ Kirsten Weber <k_webe11@wwu.de> Kirsten Weber <k_webe11@pingpong.(none)>
Kirsten Weber <k_webe11@wwu.de> Kirsten Weber <k_webe11@wwu.de>
Stefan Girke <stefan.girke@gmx.de> Stefan Girke <s_girk01@pris.(none)>
Stefan Girke <stefan.girke@gmx.de> Stefan <stefan@stefan.(none)>
Tobias Leibner <tobias.leibner@googlemail.com> tobiasleibner <tobias.leibner@googlemail.com>
Tobias Leibner <tobias.leibner@uni-muenster.de> tobiasleibner <tobias.leibner@googlemail.com>
Tobias Leibner <tobias.leibner@uni-muenster.de> Tobias Leibner <tobias.leibner@googlemail.com>
Barbara Verfürth <b_verf01@uni-muenster.de> b_verf01 <b_verf01@uni-muenster.de>
# geratene duneadm zuordnung
......
......@@ -81,7 +81,7 @@ public:
if (periodic_)
return outside_;
else
return BaseType::outside();
return EntityType(BaseType::outside());
} // ... outside() const
LocalGeometry geometryInOutside() const
......
......@@ -18,7 +18,9 @@
#include <type_traits>
#include <dune/grid/utility/structuredgridfactory.hh>
#if HAVE_ALUGRID
#include <dune/grid/alugrid.hh>
#endif // HAVE_ALUGRID
#include <dune/grid/sgrid.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/gmshreader.hh>
......@@ -56,9 +58,11 @@ public:
static Common::Configuration default_config(const std::string sub_name = "")
{
std::string filename = "g.msh";
#if HAVE_ALUGRID
if (std::is_same<ALUGrid<2, 2, simplex, conforming>, GridType>::value
|| std::is_same<ALUGrid<2, 2, simplex, nonconforming>, GridType>::value)
filename = "gmsh_2d_simplices.msh";
#endif // HAVE_ALUGRID
Common::Configuration config("filename", filename);
if (sub_name.empty())
return config;
......
......@@ -23,12 +23,9 @@ using namespace Dune::Stuff::Common;
using namespace Dune::Stuff::Grid;
using namespace std;
typedef testing::Types<Int<1>, Int<2>, Int<3>> GridDims;
template <class T>
struct GridInfoTest : public ::testing::Test
{
static const size_t griddim = T::value;
static const size_t griddim = TESTGRIDDIM;
static const unsigned int level = 1;
typedef Dune::YaspGrid<griddim, Dune::EquidistantOffsetCoordinates<double, griddim>> GridType;
typedef Dimensions<typename GridType::LeafGridView> DimensionsType;
......@@ -75,8 +72,7 @@ struct GridInfoTest : public ::testing::Test
}
};
TYPED_TEST_CASE(GridInfoTest, GridDims);
TYPED_TEST(GridInfoTest, Misc)
TEST_F(GridInfoTest, Misc)
{
this->check();
this->print(dev_null);
......
__name = grid_information
__exec_suffix = {dimDomain}d
dimDomain = 1, 2, 3 | expand
[__static]
TESTGRIDDIM = {dimDomain}
......@@ -25,20 +25,10 @@
using namespace Dune;
using namespace Stuff;
#define YASPGRIDS \
YaspGrid<1, EquidistantOffsetCoordinates<double, 1>>, YaspGrid<2, EquidistantOffsetCoordinates<double, 2>>, \
YaspGrid<3, EquidistantOffsetCoordinates<double, 3>>
#if HAVE_ALUGRID
#define ALUCUBEGRIDS ALUGrid<2, 2, cube, nonconforming>, ALUGrid<3, 3, cube, nonconforming>
#define ALUSIMPLEXGRIDS ALUGrid<2, 2, simplex, conforming>, ALUGrid<3, 3, simplex, conforming>
#endif // HAVE_ALUGRID
template <class GridImp>
struct PeriodicViewTestYaspCube : public testing::Test
struct PeriodicViewTest : public testing::Test
{
typedef GridImp GridType;
typedef TESTGRIDTYPE GridType;
typedef typename GridType::ctype ctype;
typedef typename GridType::template Codim<0>::Geometry GeometryType;
typedef Dune::Stuff::Grid::Providers::template Cube<GridType> GridProviderType;
......@@ -54,38 +44,51 @@ struct PeriodicViewTestYaspCube : public testing::Test
typedef typename GridViewType::CollectiveCommunication CollectiveCommunication;
static const size_t dimDomain = GridViewType::dimension;
void check(const PeriodicGridViewType periodic_grid_view, const GridViewType& grid_view, const bool is_simplex,
const size_t variant)
static constexpr int factorial(int n)
{
return n > 0 ? n * factorial(n - 1) : 1;
}
static void check()
{
const bool is_cube = !is_simplex;
DomainType lower_left(0);
DomainType upper_right(1);
if (variant >= 3)
upper_right = DSC::fromString<DomainType>("[2.0 3.0 1.0 4.0]");
if (variant >= 6)
lower_left = DSC::fromString<DomainType>("[-0.5 0.5 0.7 -1.3]");
// create grid and get gridview
DSC::Configuration grid_config = DSC_CONFIG.sub("test_grid_periodicview");
GridProviderType grid_provider = *(GridProviderType::create(grid_config));
const std::shared_ptr<const GridType> grid = grid_provider.grid_ptr();
const GridViewType grid_view = grid->leafGridView();
// check whether grid is periodic
const bool is_nonperiodic = grid_config["periodic"] == "no";
const bool is_partially_periodic = grid_config["periodic"] == "partial";
// create periodic grid_view
std::bitset<dimDomain> periodic_directions;
if (is_partially_periodic)
periodic_directions[0] = 1;
else if (!is_nonperiodic)
periodic_directions.set();
const PeriodicGridViewType periodic_grid_view(grid_view, periodic_directions);
const bool is_simplex = DSC::fromString<bool>(grid_config["is_simplex"]);
const bool is_cube = !is_simplex;
const DomainType lower_left = DSC::fromString<DomainType>(grid_config["lower_left"]);
const DomainType upper_right = DSC::fromString<DomainType>(grid_config["upper_right"]);
// check interface
const GridType& DSC_UNUSED(test_grid) = periodic_grid_view.grid();
const IndexSet& DSC_UNUSED(test_indexSet) = periodic_grid_view.indexSet();
const int codim0_size = periodic_grid_view.size(0);
EXPECT_EQ(codim0_size, grid_view.size(0));
if (dimDomain == 1)
EXPECT_EQ(codim0_size, int(8));
if (dimDomain == 2 && is_cube)
EXPECT_EQ(codim0_size, int(8 * 8));
if (dimDomain == 2 && is_simplex)
EXPECT_EQ(codim0_size, int(2 * 8 * 8));
if (dimDomain == 3 && is_cube)
EXPECT_EQ(codim0_size, int(8 * 8 * 8));
if (dimDomain == 3 && is_simplex)
EXPECT_EQ(codim0_size, int(6 * 8 * 8 * 8));
EXPECT_EQ(periodic_grid_view.size(Dune::GeometryType::cube), grid_view.size(Dune::GeometryType::cube));
EXPECT_EQ(periodic_grid_view.size(Dune::GeometryType::simplex), grid_view.size(Dune::GeometryType::simplex));
EXPECT_EQ(periodic_grid_view.overlapSize(0), grid_view.overlapSize(0));
EXPECT_EQ(periodic_grid_view.overlapSize(1), grid_view.overlapSize(1));
EXPECT_EQ(periodic_grid_view.ghostSize(0), grid_view.ghostSize(0));
EXPECT_EQ(periodic_grid_view.ghostSize(1), grid_view.ghostSize(1));
EXPECT_EQ(grid_view.size(0), codim0_size);
if (is_cube)
EXPECT_EQ(std::pow(int(8), dimDomain), codim0_size);
if (is_simplex)
EXPECT_EQ(std::pow(int(8), dimDomain) * factorial(dimDomain), codim0_size);
EXPECT_EQ(grid_view.size(Dune::GeometryType::cube), periodic_grid_view.size(Dune::GeometryType::cube));
EXPECT_EQ(grid_view.size(Dune::GeometryType::simplex), periodic_grid_view.size(Dune::GeometryType::simplex));
EXPECT_EQ(grid_view.overlapSize(0), periodic_grid_view.overlapSize(0));
EXPECT_EQ(grid_view.overlapSize(1), periodic_grid_view.overlapSize(1));
EXPECT_EQ(grid_view.ghostSize(0), periodic_grid_view.ghostSize(0));
EXPECT_EQ(grid_view.ghostSize(1), periodic_grid_view.ghostSize(1));
const CollectiveCommunication& DSC_UNUSED(test_comm) = periodic_grid_view.comm();
size_t neighbor_count = 0;
......@@ -142,7 +145,7 @@ struct PeriodicViewTestYaspCube : public testing::Test
&& Dune::Stuff::Common::FloatCmp::eq(global_intersection_coords[differing_coordinate],
lower_left[differing_coordinate])));
++periodic_count;
if (variant == 1 || variant == 4 || variant == 7)
if (is_partially_periodic)
EXPECT_EQ(size_t(0), differing_coordinate);
}
}
......@@ -152,215 +155,42 @@ struct PeriodicViewTestYaspCube : public testing::Test
}
}
if (dimDomain == 1) {
if (variant == 0 || variant == 3 || variant == 6) {
EXPECT_EQ(size_t(2 * 7), neighbor_count);
EXPECT_EQ(size_t(2), boundary_count);
EXPECT_EQ(size_t(0), periodic_count);
}
if (variant == 1 || variant == 4 || variant == 7) {
EXPECT_EQ(size_t(2 * 7 + 2), neighbor_count);
EXPECT_EQ(size_t(0), boundary_count);
EXPECT_EQ(size_t(2), periodic_count);
}
if (variant == 2 || variant == 5 || variant == 8) {
EXPECT_EQ(size_t(2 * 7 + 2), neighbor_count);
EXPECT_EQ(size_t(0), boundary_count);
EXPECT_EQ(size_t(2), periodic_count);
}
}
if (dimDomain == 2 && is_cube) {
if (variant == 0 || variant == 3 || variant == 6) {
EXPECT_EQ(size_t(2 * 2 * 8 * 7), neighbor_count);
EXPECT_EQ(size_t(2 * 8 * 2), boundary_count);
EXPECT_EQ(size_t(0), periodic_count);
}
if (variant == 1 || variant == 4 || variant == 7) {
EXPECT_EQ(size_t(2 * 2 * 8 * 7 + 2 * 8), neighbor_count);
EXPECT_EQ(size_t(2 * 8 * 2 - 2 * 8), boundary_count);
EXPECT_EQ(size_t(2 * 8), periodic_count);
}
if (variant == 2 || variant == 5 || variant == 8) {
EXPECT_EQ(size_t(2 * 2 * 8 * 7 + 2 * 8 * 2), neighbor_count);
EXPECT_EQ(size_t(0), boundary_count);
EXPECT_EQ(size_t(2 * 8 * 2), periodic_count);
}
}
if (dimDomain == 2 && is_simplex) {
if (variant == 0 || variant == 3 || variant == 6) {
EXPECT_EQ(size_t(2 * 2 * 8 * 7 + 2 * 64), neighbor_count);
EXPECT_EQ(size_t(2 * 8 * 2), boundary_count);
EXPECT_EQ(size_t(0), periodic_count);
}
if (variant == 1 || variant == 4 || variant == 7) {
EXPECT_EQ(size_t(2 * 2 * 8 * 7 + 2 * 8 + 2 * 64), neighbor_count);
EXPECT_EQ(size_t(2 * 8 * 2 - 2 * 8), boundary_count);
EXPECT_EQ(size_t(2 * 8), periodic_count);
}
if (variant == 2 || variant == 5 || variant == 8) {
EXPECT_EQ(size_t(2 * 2 * 8 * 7 + 2 * 8 * 2 + 2 * 64), neighbor_count);
EXPECT_EQ(size_t(0), boundary_count);
EXPECT_EQ(size_t(2 * 8 * 2), periodic_count);
}
}
if (dimDomain == 3 && is_cube) {
if (variant == 0 || variant == 3 || variant == 6) {
EXPECT_EQ(size_t(2 * 3 * 7 * 64), neighbor_count);
EXPECT_EQ(size_t(6 * 64), boundary_count);
EXPECT_EQ(size_t(0), periodic_count);
}
if (variant == 1 || variant == 4 || variant == 7) {
EXPECT_EQ(size_t(2 * 3 * 7 * 64 + 2 * 64), neighbor_count);
EXPECT_EQ(size_t(6 * 64 - 2 * 64), boundary_count);
EXPECT_EQ(size_t(2 * 64), periodic_count);
}
if (variant == 2 || variant == 5 || variant == 8) {
EXPECT_EQ(size_t(2 * 3 * 7 * 64 + 6 * 64), neighbor_count);
EXPECT_EQ(size_t(0), boundary_count);
EXPECT_EQ(size_t(6 * 64), periodic_count);
}
}
if (dimDomain == 3 && is_simplex) {
if (variant == 0 || variant == 3 || variant == 6) {
EXPECT_EQ(size_t(2 * 2 * 3 * 7 * 64 + 2 * 6 * 8 * 8 * 8), neighbor_count);
EXPECT_EQ(size_t(2 * 6 * 64), boundary_count);
EXPECT_EQ(size_t(0), periodic_count);
}
if (variant == 1 || variant == 4 || variant == 7) {
EXPECT_EQ(size_t(2 * 2 * 3 * 7 * 64 + 2 * 2 * 64 + 2 * 6 * 8 * 8 * 8), neighbor_count);
EXPECT_EQ(size_t(2 * 6 * 64 - 2 * 2 * 64), boundary_count);
EXPECT_EQ(size_t(2 * 2 * 64), periodic_count);
}
if (variant == 2 || variant == 5 || variant == 8) {
EXPECT_EQ(size_t(2 * 2 * 3 * 7 * 64 + 2 * 6 * 64 + 2 * 6 * 8 * 8 * 8), neighbor_count);
EXPECT_EQ(size_t(0), boundary_count);
EXPECT_EQ(size_t(2 * 6 * 64), periodic_count);
}
}
// the cube/rectangle grid has 2*dimDomain faces
const size_t num_faces = 2 * dimDomain;
// on each face, there are 8**(dimDomain-1) intersections. For a simplex grid in 3 dimensions, there are twice as
// much.
size_t num_intersections_on_face = std::pow(8, dimDomain - 1);
// use dimDomain from config here to avoid "code will never be executed" warning
assert(dimDomain == DSC::fromString<int>(grid_config["dimDomain"]));
if (is_simplex && DSC::fromString<int>(grid_config["dimDomain"]) == 3)
num_intersections_on_face *= 2;
// In a fully periodic grid, all intersections are periodic. In a partially periodic grid, only the intersections on
// two
// faces are periodic. In a nonperiodic grid, no intersections are periodic.
size_t num_periodic_faces = is_partially_periodic ? 2 : num_faces;
if (is_nonperiodic)
num_periodic_faces *= 0;
const size_t expected_num_periodic_intersections = num_periodic_faces * num_intersections_on_face;
EXPECT_EQ(expected_num_periodic_intersections, periodic_count);
// The boundary count should be the number of interfaces on the boundary without the periodic interfaces
const size_t expected_num_boundary_intersections =
num_faces * num_intersections_on_face - expected_num_periodic_intersections;
EXPECT_EQ(expected_num_boundary_intersections, boundary_count);
// neighbor_count should equal the number of intersections without intersections on non-periodic boundaries
const size_t num_intersections_per_entity = is_cube ? 2 * dimDomain : dimDomain + 1;
const size_t num_entities = grid_view.size(0);
EXPECT_EQ(num_entities * num_intersections_per_entity - expected_num_boundary_intersections, neighbor_count);
} // void check(...)
void checks_for_all_grids(const bool is_simplex)
{
// create grid on unit hypercube
GridProviderType grid_provider = *(GridProviderType::create());
const std::shared_ptr<const GridType> grid = grid_provider.grid_ptr();
const GridViewType grid_view = grid->leafGridView();
// create grid on hyperrectangle
DSC::Configuration grid_config = GridProviderType::default_config();
grid_config["lower_left"] = "[0.0 0.0 0.0 0.0]";
grid_config["upper_right"] = "[2.0 3.0 1.0 4.0]";
GridProviderType hyperrectangle_grid_provider = *(GridProviderType::create(grid_config));
const std::shared_ptr<const GridType> hyperrectangle_grid = hyperrectangle_grid_provider.grid_ptr();
const GridViewType hyperrectangle_grid_view = hyperrectangle_grid->leafGridView();
std::bitset<dimDomain> periodic_directions;
// create PeriodicGridViews that actually are not periodic
const PeriodicGridViewType non_periodic_grid_view(grid_view, periodic_directions);
const PeriodicGridViewType hr_non_periodic_grid_view(hyperrectangle_grid_view, periodic_directions);
// create PeriodicGridViews that are periodic only in x-direction
periodic_directions[0] = 1;
const PeriodicGridViewType partially_periodic_grid_view(grid_view, periodic_directions);
const PeriodicGridViewType hr_partially_periodic_grid_view(hyperrectangle_grid_view, periodic_directions);
// create PeriodicGridViews that are periodic in all directions
periodic_directions.set();
const PeriodicGridViewType fully_periodic_grid_view(grid_view, periodic_directions);
const PeriodicGridViewType hr_fully_periodic_grid_view(hyperrectangle_grid_view, periodic_directions);
// check
this->check(non_periodic_grid_view, grid_view, is_simplex, 0);
this->check(partially_periodic_grid_view, grid_view, is_simplex, 1);
this->check(fully_periodic_grid_view, grid_view, is_simplex, 2);
this->check(hr_non_periodic_grid_view, hyperrectangle_grid_view, is_simplex, 3);
this->check(hr_partially_periodic_grid_view, hyperrectangle_grid_view, is_simplex, 4);
this->check(hr_fully_periodic_grid_view, hyperrectangle_grid_view, is_simplex, 5);
} // void checks_for_all_grids(...)
void non_trivial_origin_checks(const bool is_simplex)
{
// create grid on hyperrectangle with lower_left != 0 (not possible for YaspGrid)
DSC::Configuration grid_config = GridProviderType::default_config();
grid_config["lower_left"] = "[-0.5 0.5 0.7 -1.3]";
grid_config["upper_right"] = "[2.0 3.0 1.0 4.0]";
GridProviderType grid_provider = *(GridProviderType::create(grid_config));
const std::shared_ptr<const GridType> grid = grid_provider.grid_ptr();
const GridViewType grid_view = grid->leafGridView();
std::bitset<dimDomain> periodic_directions;
// create PeriodicGridViewType that actually is not periodic
const PeriodicGridViewType non_periodic_grid_view(grid_view, periodic_directions);
// create PeriodicGridViewType that is periodic only in x-direction
periodic_directions[0] = 1;
const PeriodicGridViewType partially_periodic_grid_view(grid_view, periodic_directions);
// create PeriodicGridViewType that is periodic in all directions
periodic_directions.set();
const PeriodicGridViewType fully_periodic_grid_view(grid_view, periodic_directions);
this->check(non_periodic_grid_view, grid_view, is_simplex, 6);
this->check(partially_periodic_grid_view, grid_view, is_simplex, 7);
this->check(fully_periodic_grid_view, grid_view, is_simplex, 8);
} // void additional_checks_for_alu(...)
}; // ... struct PeriodicViewTestYaspCube ...
template <class GridImp>
struct PeriodicViewTestALUCube : public PeriodicViewTestYaspCube<GridImp>
{
typedef PeriodicViewTestYaspCube<GridImp> BaseType;
typedef typename BaseType::GridProviderType GridProviderType;
typedef typename BaseType::GridType GridType;
typedef typename BaseType::GridViewType GridViewType;
typedef typename BaseType::PeriodicGridViewType PeriodicGridViewType;
static const size_t dimDomain = BaseType::dimDomain;
}; // ... struct PeriodicViewTestALUCube ...
template <class GridImp>
struct PeriodicViewTestALUSimplex : public PeriodicViewTestALUCube<GridImp>
{
};
typedef testing::Types<YASPGRIDS> YaspCubeGridTypes;
TYPED_TEST_CASE(PeriodicViewTestYaspCube, YaspCubeGridTypes);
TYPED_TEST(PeriodicViewTestYaspCube, check_yaspcube)
{
this->checks_for_all_grids(false);
this->non_trivial_origin_checks(false);
}
#if HAVE_ALUGRID
typedef testing::Types<ALUCUBEGRIDS> ALUCubeGridTypes;
typedef testing::Types<ALUSIMPLEXGRIDS> ALUSimplexGridTypes;
TYPED_TEST_CASE(PeriodicViewTestALUCube, ALUCubeGridTypes);
TYPED_TEST(PeriodicViewTestALUCube, check_alucube)
{
this->checks_for_all_grids(false);
this->non_trivial_origin_checks(false);
}
TYPED_TEST_CASE(PeriodicViewTestALUSimplex, ALUSimplexGridTypes);
TYPED_TEST(PeriodicViewTestALUSimplex, check_alusimplex)
{
this->checks_for_all_grids(true);
this->non_trivial_origin_checks(true);
}
#else // HAVE_ALUGRID
TEST(DISABLED_PeriodicViewTestALUCube, check_alucube)
{
}
TEST(DISABLED_PeriodicViewTestALUSimplex, check_alusimplex)
TEST_F(PeriodicViewTest, check_all)
{
this->check();
}
#endif // HAVE_ALUGRID
#else // HAVE_DUNE_GRID
TEST(DISABLED_PeriodicViewTestYaspCube, check_yaspcube)
TEST(DISABLED_PeriodicViewTest, check_all)
{
}
......
__name = grid_periodicview
__exec_suffix = yasp_{dimDomain}d, alu_{__local.geometry}_{__local.refinement}_{dimDomain}d | expand grid
include grids.mini
[test_grid_periodicview]
is_simplex = false, {__local.geometry_is_simplex} | expand grid
lower_left = "[0 0 0 0]", "[0 0 0 0]", "[-0.5 0.5 0.7 -1.3]" | expand coords
upper_right = "[1 1 1 1]", "[2.0 3.0 1.0 4.0]", "[2.0 3.0 1.0 4.0]" | expand coords
gridshape = cube, rectangle, rectangle2 | expand coords
num_elements = "[8 8 8 8]"
periodicity = "no", "partial", "full" | expand
dimDomain = {dimDomain}
[__static]
TESTGRIDTYPE = {grid}
// This file is part of the dune-stuff project:
// https://github.com/wwu-numerik/dune-stuff
// Copyright holders: Rene Milk, Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include "main.hxx"
#include <dune/stuff/grid/provider/cube.hh>
#include <dune/stuff/grid/provider/dgf.hh>
#include <dune/stuff/grid/provider/gmsh.hh>
#include "grid_provider.hh"
#if HAVE_DUNE_GRID
struct TestGridProvider : public GridProviderBase<Dune::Stuff::Grid::Providers::TESTGRIDPROVIDERTYPE<TESTGRIDTYPE>>
{
};
TEST_F(TestGridProvider, is_default_creatable)
{
this->is_default_creatable();
}
TEST_F(TestGridProvider, fulfills_const_interface)
{
this->const_interface();
}
TEST_F(TestGridProvider, is_visualizable)
{
this->visualize();
}
TEST_F(TestGridProvider, fulfills_non_const_interface)
{
this->non_const_interface();
}
#else // HAVE_DUNE_GRID
TEST(DISABLED_TestGridProvider, is_default_creatable)
{
}
TEST(DISABLED_TestGridProvider, fulfills_const_interface)
{
}
TEST(DISABLED_TestGridProvider, is_visualizable)
{
}
#endif // HAVE_DUNE_GRID
......@@ -7,6 +7,9 @@
// Rene Milk (2012 - 2015)
// Tobias Leibner (2014)
#ifndef DUNE_STUFF_TEST_GRID_PROVIDER_HH
#define DUNE_STUFF_TEST_GRID_PROVIDER_HH
#if HAVE_DUNE_GRID
#if HAVE_ALUGRID
#include <dune/grid/alugrid.hh>
......@@ -16,36 +19,6 @@
#include <dune/stuff/common/type_utils.hh>
#include <dune/stuff/grid/provider/interface.hh>
#define SGRIDS /* clang-format off */ \
Dune::SGrid<1, 1> \
, Dune::SGrid<2, 2> \
, Dune::SGrid<3, 3> \
, Dune::SGrid<4, 4> \
/*, Dune::SGrid<1, 2> <- grid provider do not work for these combinations, bc. of the visualization with */ \
/*, Dune::SGrid<2, 3> boundary info, bc. of function based boundary info bc. of global function interface */ \
/*, Dune::SGrid<3, 4> */ \
/*, Dune::SGrid<4, 5> */ /*clang-format on */
#define YASPGRIDS /* clang-format off */ \
Dune::YaspGrid<1, Dune::EquidistantOffsetCoordinates<double, 1>> \
, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordinates<double, 2>> \
, Dune::YaspGrid<3, Dune::EquidistantOffsetCoordinates<double, 3>> \
, Dune::YaspGrid<4, Dune::EquidistantOffsetCoordinates<double, 4>> /* clang-format on */
#if HAVE_ALUGRID
#define ALUGRIDS /* clang-format off */ \
Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming> \
, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming> \
, Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming> \
, Dune::ALUGrid<3, 3, Dune::simplex, Dune::nonconforming> \
, Dune::ALUGrid<2, 2, Dune::simplex, Dune::conforming> \
, Dune::ALUGrid<3, 3, Dune::simplex, Dune::conforming> \
/*, Dune::ALUGrid<2, 3, Dune::cube, Dune::nonconforming> same reasons as above */ \
/*, Dune::ALUGrid<2, 3, Dune::simplex, Dune::nonconforming> */ \
/*, Dune::ALUGrid<2, 3, Dune::simplex, Dune::conforming> */ /* clang-format on */
#endif // HAVE_ALUGRID
#include "gtest/gtest.h"
template <class GridProviderType>
......@@ -159,12 +132,21 @@ private:
using Dune::Stuff::Grid::ChooseLayer;
using Dune::Stuff::Grid::ChoosePartView;
auto& grid_i = grid_provider.grid();
#if HAVE_DUNE_FEM
auto DUNE_UNUSED(leaf_grid_part_1) = grid_provider.template leaf<ChoosePartView::part>();
auto DUNE_UNUSED(leaf_grid_part_2) = grid_provider.leaf_part();
for (int level = 0; level <= grid_i.maxLevel(); ++level) {
auto DUNE_UNUSED(level_grid_part_1) = grid_provider.template level<ChoosePartView::part>(level);
auto DUNE_UNUSED(level_grid_part_2) = grid_provider.level_part(level);
}
#else // HAVE_DUNE_FEM
auto DUNE_UNUSED(leaf_grid_view_1) = grid_provider.template leaf<ChoosePartView::view>();
auto DUNE_UNUSED(leaf_grid_view_2) = grid_provider.leaf_view();
for (int level = 0; level <= grid_i.maxLevel(); ++level) {
auto DUNE_UNUSED(level_grid_view_1) = grid_provider.template level<ChoosePartView::view>(level);
auto DUNE_UNUSED(level_grid_view_2) = grid_provider.level_view(level);
}
#endif
} // ... check_non_const_interface()
public:
......@@ -178,3 +160,4 @@ public:
}; // class GridProviderBase
#endif // HAVE_DUNE_GRID
#endif // DUNE_STUFF_TEST_GRID_PROVIDER_HH
__name = grid_provider
__exec_suffix = {gridprovider}_yasp_{dimDomain}d, {gridprovider}_alu_{__local.geometry}_{__local.refinement}_{dimDomain}d | expand grid
include grids.mini
gridprovider = Cube, DGF, Gmsh | expand
'{gridprovider}' == 'Gmsh' and '{grid}' != 'Dune::ALUGrid<2,2,Dune::simplex,Dune::{__local.refinement}>' | exclude
[__static]
TESTGRIDPROVIDERTYPE = {gridprovider}
TESTGRIDTYPE = {grid}
dimDomain = 1, 2, 3 | expand
__local.geometry = cube, simplex | expand 2
__local.geometry_is_simplex = false, true | expand 2
__local.refinement = nonconforming, conforming | expand
__local.grid_yasp = Dune::YaspGrid<{dimDomain},Dune::EquidistantOffsetCoordinates<double,{dimDomain}>>
__local.grid_alu = Dune::ALUGrid<{dimDomain},{dimDomain},Dune::{__local.geometry},Dune::{__local.refinement}>
grid = {__local.grid_yasp}, {__local.grid_alu} | expand grid
'{grid}' == 'Dune::ALUGrid<1,1,Dune::{__local.geometry},Dune::{__local.refinement}>' | exclude
'{grid}' == 'Dune::ALUGrid<{dimDomain},{dimDomain},Dune::cube,Dune::conforming>' | exclude
entity_type = {grid}::Codim<0>::Entity
1, ALUGRID_FOUND | expand grid | cmake_guard
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment