diff --git a/dumux/python/discretization/gridgeometry.hh b/dumux/python/discretization/gridgeometry.hh index fae252ecb1be5a6475ceceba030f4908745e84fd..0c9ab5261589a7af23777114811188e61f901e3d 100644 --- a/dumux/python/discretization/gridgeometry.hh +++ b/dumux/python/discretization/gridgeometry.hh @@ -125,10 +125,17 @@ void registerGridGeometry(pybind11::handle scope, pybind11::class_<GG, Options.. using GridView = typename GG::GridView; cls.def(pybind11::init([](const GridView& gridView){ - return std::make_shared<GG>(gridView); + auto gg = std::make_shared<GG>(gridView); + // remove this once the interface is changed on the C++ side (see #1056) + gg->update(); + return gg; }), "gridView"_a); - cls.def("update", &GG::update); + // update this once the interface is changed on the C++ side (see #1056) + cls.def("update", [](GG& self, const GridView& gridView){ + return self.update(); + }, "gridView"_a); + cls.def_property_readonly("numDofs", &GG::numDofs); cls.def_property_readonly("numScv", &GG::numScv); cls.def_property_readonly("numScvf", &GG::numScvf); diff --git a/test/python/test_1p.py b/test/python/test_1p.py index 872d10123a340e36dd439e5c9a960b21db103189..b416b205533e382d9887e4f0917e9582091cf100 100755 --- a/test/python/test_1p.py +++ b/test/python/test_1p.py @@ -38,7 +38,6 @@ parameters = Parameters(dict={ # Set up the grid and the grid geometry gridView = structuredGrid([0,0], [1,1], [10,10]) gridGeometry = GridGeometry(gridView=gridView, discMethod=discMethod) -gridGeometry.update() # Set up the model model = Model(inheritsFrom=['OneP'], gridGeometry=gridGeometry) diff --git a/test/python/test_explicit_transport_cctpfa.py b/test/python/test_explicit_transport_cctpfa.py index efa9282389480e67c3227232d3ae73ce37692721..beb2f03dc37a89b0534fdfde7b373ed39f79f7a2 100755 --- a/test/python/test_explicit_transport_cctpfa.py +++ b/test/python/test_explicit_transport_cctpfa.py @@ -24,7 +24,6 @@ cells = 20 gridView = structuredGrid([0]*dimension, [1]*dimension, [cells]*dimension) gridGeometry = GridGeometry(gridView, discMethod="cctpfa") -gridGeometry.update() elementMapper = gridView.indexSet diff --git a/test/python/test_fvproblem.py b/test/python/test_fvproblem.py index cb3a64bb0a72ef23cdd56c15c3e9ae8d6ca59e36..95b9e22f532d5c34b663e08a719bb140a1dd893a 100644 --- a/test/python/test_fvproblem.py +++ b/test/python/test_fvproblem.py @@ -24,7 +24,6 @@ from dumux.common import BoundaryTypes, FVProblem gridView = structuredGrid([0,0,0],[1,1,1],[3,3,3]) gridGeometry = GridGeometry(gridView, discMethod="box") -gridGeometry.update() @FVProblem(gridGeometry) class Problem: diff --git a/test/python/test_gridgeometry.py b/test/python/test_gridgeometry.py index ca25ba36a1b50bd4d463f7f44be0eb15cfaae392..409f57115e8b99ab8fd96a5f643ef494be81b7b9 100755 --- a/test/python/test_gridgeometry.py +++ b/test/python/test_gridgeometry.py @@ -6,7 +6,6 @@ from dumux.discretization import GridGeometry gridView = structuredGrid([0,0],[1,1],[5,5]) gridGeometry = GridGeometry(gridView, discMethod="cctpfa") -gridGeometry.update() print("The total number of scvs is {}".format(gridGeometry.numScv())) print("The total number of scvfs is {}".format(gridGeometry.numScvf()))