Skip to content
Snippets Groups Projects
Commit 890e8089 authored by Timo Koch's avatar Timo Koch
Browse files

[test] Make fv geometry test work again. Move it to discretization/../tpfa

parent 14b2c966
No related branches found
No related tags found
1 merge request!617[WIP] Next
...@@ -5,4 +5,4 @@ add_subdirectory("io") ...@@ -5,4 +5,4 @@ add_subdirectory("io")
add_subdirectory("material") add_subdirectory("material")
add_subdirectory("multidomain") add_subdirectory("multidomain")
add_subdirectory("porousmediumflow") add_subdirectory("porousmediumflow")
add_subdirectory("implicit") add_subdirectory("discretization")
add_subdirectory("cellcentered")
add_subdirectory("tpfa")
add_dumux_test(test_tpfafvgeometry test_tpfafvgeometry test_tpfafvgeometry.cc
${CMAKE_CURRENT_BINARY_DIR}/test_tpfafvgeometry)
...@@ -32,10 +32,10 @@ ...@@ -32,10 +32,10 @@
#include <dune/grid/common/mcmgmapper.hh> #include <dune/grid/common/mcmgmapper.hh>
#include <dumux/implicit/cellcentered/tpfa/properties.hh> #include <dumux/implicit/cellcentered/tpfa/properties.hh>
#include <dumux/implicit/cellcentered/tpfa/globalfvgeometry.hh> #include <dumux/discretization/cellcentered/tpfa/globalfvgeometry.hh>
#include <dumux/implicit/fvelementgeometry.hh> #include <dumux/discretization/cellcentered/tpfa/fvelementgeometry.hh>
#include <dumux/implicit/subcontrolvolume.hh> #include <dumux/discretization/cellcentered/tpfa/subcontrolvolume.hh>
#include <dumux/implicit/subcontrolvolumeface.hh> #include <dumux/discretization/cellcentered/tpfa/subcontrolvolumeface.hh>
namespace Dumux namespace Dumux
{ {
...@@ -91,8 +91,7 @@ int main (int argc, char *argv[]) try ...@@ -91,8 +91,7 @@ int main (int argc, char *argv[]) try
using GlobalPosition = Dune::FieldVector<Scalar, dimworld>; using GlobalPosition = Dune::FieldVector<Scalar, dimworld>;
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); 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); using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
// make a grid // make a grid
...@@ -104,15 +103,16 @@ int main (int argc, char *argv[]) try ...@@ -104,15 +103,16 @@ int main (int argc, char *argv[]) try
Problem problem(leafGridView); Problem problem(leafGridView);
FVElementGeometryVector fvGeometries(leafGridView); GlobalFVGeometry global(leafGridView);
fvGeometries.update(problem); global.update(problem);
// iterate over elements. For every element get fv geometry and loop over scvs and scvfaces // iterate over elements. For every element get fv geometry and loop over scvs and scvfaces
for (const auto& element : elements(leafGridView)) for (const auto& element : elements(leafGridView))
{ {
auto eIdx = problem.elementMapper().index(element); auto eIdx = problem.elementMapper().index(element);
std::cout << std::endl << "Checking fvGeometry of element " << eIdx << std::endl; 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); auto range = scvs(fvGeometry);
NoopFunctor<SubControlVolume> op; NoopFunctor<SubControlVolume> op;
...@@ -121,7 +121,7 @@ int main (int argc, char *argv[]) try ...@@ -121,7 +121,7 @@ int main (int argc, char *argv[]) try
for (auto&& scv : scvs(fvGeometry)) 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); auto range2 = scvfs(fvGeometry);
...@@ -131,7 +131,7 @@ int main (int argc, char *argv[]) try ...@@ -131,7 +131,7 @@ int main (int argc, char *argv[]) try
for (auto&& scvf : scvfs(fvGeometry)) 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)."; if (scvf.boundary()) std::cout << " (on boundary).";
std::cout << std::endl; std::cout << std::endl;
} }
......
add_dumux_test(test_fvelementgeometry test_fvelementgeometry test_fvelementgeometry.cc
${CMAKE_CURRENT_BINARY_DIR}/test_fvelementgeometry)
set(CMAKE_BUILD_TYPE Debug)
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