From 890e8089c31239fe2268880e9bcdd5e590ba2f29 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Mon, 18 Jul 2016 14:41:03 +0200 Subject: [PATCH] [test] Make fv geometry test work again. Move it to discretization/../tpfa --- test/CMakeLists.txt | 2 +- test/discretization/CMakeLists.txt | 1 + .../cellcentered/CMakeLists.txt | 1 + .../cellcentered/tpfa/CMakeLists.txt | 2 ++ .../cellcentered/tpfa/test_tpfafvgeometry.cc} | 22 +++++++++---------- test/implicit/CMakeLists.txt | 3 --- 6 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 test/discretization/CMakeLists.txt create mode 100644 test/discretization/cellcentered/CMakeLists.txt create mode 100644 test/discretization/cellcentered/tpfa/CMakeLists.txt rename test/{implicit/test_fvelementgeometry.cc => discretization/cellcentered/tpfa/test_tpfafvgeometry.cc} (87%) delete mode 100644 test/implicit/CMakeLists.txt diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f22a624f48..d3206b905d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,4 +5,4 @@ add_subdirectory("io") add_subdirectory("material") add_subdirectory("multidomain") add_subdirectory("porousmediumflow") -add_subdirectory("implicit") +add_subdirectory("discretization") diff --git a/test/discretization/CMakeLists.txt b/test/discretization/CMakeLists.txt new file mode 100644 index 0000000000..a2f10ebf0a --- /dev/null +++ b/test/discretization/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory("cellcentered") diff --git a/test/discretization/cellcentered/CMakeLists.txt b/test/discretization/cellcentered/CMakeLists.txt new file mode 100644 index 0000000000..5ac953e3e2 --- /dev/null +++ b/test/discretization/cellcentered/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory("tpfa") diff --git a/test/discretization/cellcentered/tpfa/CMakeLists.txt b/test/discretization/cellcentered/tpfa/CMakeLists.txt new file mode 100644 index 0000000000..56fa30fede --- /dev/null +++ b/test/discretization/cellcentered/tpfa/CMakeLists.txt @@ -0,0 +1,2 @@ +add_dumux_test(test_tpfafvgeometry test_tpfafvgeometry test_tpfafvgeometry.cc + ${CMAKE_CURRENT_BINARY_DIR}/test_tpfafvgeometry) diff --git a/test/implicit/test_fvelementgeometry.cc b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc similarity index 87% rename from test/implicit/test_fvelementgeometry.cc rename to test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc index ab4e30f4e0..f92d6c215b 100644 --- a/test/implicit/test_fvelementgeometry.cc +++ b/test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc @@ -32,10 +32,10 @@ #include <dune/grid/common/mcmgmapper.hh> #include <dumux/implicit/cellcentered/tpfa/properties.hh> -#include <dumux/implicit/cellcentered/tpfa/globalfvgeometry.hh> -#include <dumux/implicit/fvelementgeometry.hh> -#include <dumux/implicit/subcontrolvolume.hh> -#include <dumux/implicit/subcontrolvolumeface.hh> +#include <dumux/discretization/cellcentered/tpfa/globalfvgeometry.hh> +#include <dumux/discretization/cellcentered/tpfa/fvelementgeometry.hh> +#include <dumux/discretization/cellcentered/tpfa/subcontrolvolume.hh> +#include <dumux/discretization/cellcentered/tpfa/subcontrolvolumeface.hh> namespace Dumux { @@ -91,8 +91,7 @@ int main (int argc, char *argv[]) try using GlobalPosition = Dune::FieldVector<Scalar, dimworld>; using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); - using FVElementGeometryVector = typename GET_PROP_TYPE(TypeTag, FVElementGeometryVector); - + using GlobalFVGeometry = typename GET_PROP_TYPE(TypeTag, GlobalFVGeometry); using Problem = typename GET_PROP_TYPE(TypeTag, Problem); // make a grid @@ -104,15 +103,16 @@ int main (int argc, char *argv[]) try Problem problem(leafGridView); - FVElementGeometryVector fvGeometries(leafGridView); - fvGeometries.update(problem); + GlobalFVGeometry global(leafGridView); + global.update(problem); // iterate over elements. For every element get fv geometry and loop over scvs and scvfaces for (const auto& element : elements(leafGridView)) { auto eIdx = problem.elementMapper().index(element); std::cout << std::endl << "Checking fvGeometry of element " << eIdx << std::endl; - auto fvGeometry = fvGeometries.fvGeometry(eIdx); + auto fvGeometry = localView(global); + fvGeometry.bind(element); auto range = scvs(fvGeometry); NoopFunctor<SubControlVolume> op; @@ -121,7 +121,7 @@ int main (int argc, char *argv[]) try for (auto&& scv : scvs(fvGeometry)) { - std::cout << "-- scv center at: " << scv.center() << std::endl; + std::cout << "-- scv " << scv.index() << " center at: " << scv.center() << std::endl; } auto range2 = scvfs(fvGeometry); @@ -131,7 +131,7 @@ int main (int argc, char *argv[]) try for (auto&& scvf : scvfs(fvGeometry)) { - std::cout << "-- scvf center at: " << scvf.center(); + std::cout << "-- scvf " << scvf.index() << " ip at: " << scvf.ipGlobal(); if (scvf.boundary()) std::cout << " (on boundary)."; std::cout << std::endl; } diff --git a/test/implicit/CMakeLists.txt b/test/implicit/CMakeLists.txt deleted file mode 100644 index 33078f426d..0000000000 --- a/test/implicit/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_dumux_test(test_fvelementgeometry test_fvelementgeometry test_fvelementgeometry.cc - ${CMAKE_CURRENT_BINARY_DIR}/test_fvelementgeometry) -set(CMAKE_BUILD_TYPE Debug) -- GitLab