diff --git a/dumux/common/start.hh b/dumux/common/start.hh index 815a937a3e1d8882f0a9466a1197d213d126ed01..2da828911700d5620984dbac6b29e3e286566806 100644 --- a/dumux/common/start.hh +++ b/dumux/common/start.hh @@ -21,8 +21,8 @@ * \ingroup Common * \brief Provides a few default main functions for convenience. */ -#ifndef DUMUX_START_HH -#define DUMUX_START_HH +#ifndef DUMUX_COMMON_START_HH +#define DUMUX_COMMON_START_HH #include <ctime> #include <iostream> @@ -34,6 +34,7 @@ #include <dumux/common/parameters.hh> #include <dumux/common/dumuxmessage.hh> #include <dumux/common/defaultusagemessage.hh> +#include <dumux/io/grid/gridmanager.hh> #warning "start.hh is deprecated. Use new style main files see e.g. /test/porousmediumflow/1p." @@ -64,7 +65,6 @@ int start_(int argc, { // some aliases for better readability using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); using Problem = typename GET_PROP_TYPE(TypeTag, Problem); using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager); @@ -86,8 +86,8 @@ int start_(int argc, // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); ////////////////////////////////////////////////////////////////////// // run the simulation @@ -108,7 +108,7 @@ int start_(int argc, // instantiate and run the problem TimeManager timeManager; - Problem problem(timeManager, GridCreator::grid()); + Problem problem(timeManager, gridManager.grid()); timeManager.init(problem, restartTime, dt, tEnd, restart); timeManager.run(); diff --git a/dumux/freeflow/compositional/CMakeLists.txt b/dumux/freeflow/compositional/CMakeLists.txt index ddd32e167c4c7415e6ebe3af2afed6b63c02f05a..11209cfdcd29a954a40067a637e9d0ad3b2ad26d 100644 --- a/dumux/freeflow/compositional/CMakeLists.txt +++ b/dumux/freeflow/compositional/CMakeLists.txt @@ -3,6 +3,8 @@ add_subdirectory(staggered) install(FILES fluxvariables.hh indices.hh +kepsilonncmodel.hh +komegancmodel.hh localresidual.hh lowrekepsilonncmodel.hh navierstokesncmodel.hh diff --git a/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt b/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt index e6ef83c51b2fed49a92d4d1b15260958cf50561d..e6d5c4dc0305cac2463a5b66def96319831c234e 100644 --- a/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt +++ b/dumux/freeflow/rans/twoeq/komega/CMakeLists.txt @@ -5,7 +5,6 @@ fluxvariables.hh indices.hh localresidual.hh model.hh -models.hh problem.hh volumevariables.hh vtkoutputfields.hh diff --git a/dumux/io/CMakeLists.txt b/dumux/io/CMakeLists.txt index d617dc5ef7541da43320b739ef7433186caceed1..9ed3307f44d1925187f1ccacf63fcec7d80b0e7f 100644 --- a/dumux/io/CMakeLists.txt +++ b/dumux/io/CMakeLists.txt @@ -1,8 +1,8 @@ +add_subdirectory(grid) + install(FILES adaptivegridrestart.hh -cakegridcreator.hh container.hh -cpgridcreator.hh defaultvtkoutputfields.hh gnuplotinterface.hh gridcreator.hh @@ -13,7 +13,6 @@ plotthermalconductivitymodel.hh pointcloudvtkwriter.hh restart.hh staggeredvtkoutputmodule.hh -subgridgridcreator.hh vtkfunction.hh vtkmultiwriter.hh vtknestedfunction.hh diff --git a/dumux/io/grid/CMakeLists.txt b/dumux/io/grid/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4b60d65fddd73ae1110a3869b8689a9a353d7bd9 --- /dev/null +++ b/dumux/io/grid/CMakeLists.txt @@ -0,0 +1,8 @@ +install(FILES +cakegridcreator.hh +cpgridcreator.hh +gmshgriddatahandle.hh +griddata.hh +gridmanager.hh +subgridgridcreator.hh +DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/io/grid) diff --git a/dumux/io/cakegridcreator.hh b/dumux/io/grid/cakegridcreator.hh similarity index 96% rename from dumux/io/cakegridcreator.hh rename to dumux/io/grid/cakegridcreator.hh index 08b92566f64ae5057af383326d83bcfac71d1c18..eb787e12afdd325dfd50b5852c13f4931e2ea2f4 100644 --- a/dumux/io/cakegridcreator.hh +++ b/dumux/io/grid/cakegridcreator.hh @@ -58,7 +58,7 @@ public: /*! * \brief Make the grid. */ - static void makeGrid(const std::string& modelParamGroup = "") + void init(const std::string& modelParamGroup = "") { static_assert(dim == 2 || dim == 3, "The CakeGridCreator is only implemented for 2D and 3D."); @@ -70,6 +70,7 @@ public: createVectors(polarCoordinates, indices, modelParamGroup, verbose); gridPtr() = createCakeGrid(polarCoordinates, indices, modelParamGroup, verbose); + loadBalance(); } /*! @@ -264,10 +265,10 @@ public: * \param polarCoordinates Vector containing radial, angular and axial coordinates (in this order) * \param indices Indices specifing the radial, angular and axial direction (in this order) */ - static std::shared_ptr<Grid> createCakeGrid(std::array<std::vector<Scalar>, dim> &polarCoordinates, - Dune::FieldVector<int, dim> &indices, - const std::string& modelParamGroup, - bool verbose = false) + std::unique_ptr<Grid> createCakeGrid(std::array<std::vector<Scalar>, dim> &polarCoordinates, + Dune::FieldVector<int, dim> &indices, + const std::string& modelParamGroup, + bool verbose = false) { std::vector<Scalar> dR = polarCoordinates[0]; std::vector<Scalar> dA = polarCoordinates[1]; @@ -446,14 +447,13 @@ public: } } // return the grid pointer - return std::shared_ptr<Grid>(gridFactory.createGrid()); - + return std::unique_ptr<Grid>(gridFactory.createGrid()); } /*! * \brief Returns a reference to the grid. */ - static Grid &grid() + Grid& grid() { return *gridPtr(); } @@ -462,19 +462,23 @@ public: * \brief Distributes the grid on all processes of a parallel * computation. */ - static void loadBalance() + void loadBalance() { gridPtr()->loadBalance(); } +protected: + /*! * \brief Returns a reference to the shared pointer to the grid. */ - static GridPointer &gridPtr() + GridPointer& gridPtr() { - static GridPointer cakeGrid; - return cakeGrid; + return cakeGrid_; } + +private: + GridPointer cakeGrid_; }; } // end namespace Dumux diff --git a/dumux/io/cpgridcreator.hh b/dumux/io/grid/cpgridcreator.hh similarity index 100% rename from dumux/io/cpgridcreator.hh rename to dumux/io/grid/cpgridcreator.hh diff --git a/dumux/io/subgridgridcreator.hh b/dumux/io/grid/subgridgridcreator.hh similarity index 100% rename from dumux/io/subgridgridcreator.hh rename to dumux/io/grid/subgridgridcreator.hh diff --git a/test/freeflow/navierstokes/angelitestproblem.hh b/test/freeflow/navierstokes/angelitestproblem.hh index 2febcd530f90c7488cd384bab764e6bbacac1293..fe3ef822123a369dd769c90a61545e3d507ecb87 100644 --- a/test/freeflow/navierstokes/angelitestproblem.hh +++ b/test/freeflow/navierstokes/angelitestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_ANGELI_TEST_PROBLEM_HH #define DUMUX_ANGELI_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/constant.hh> diff --git a/test/freeflow/navierstokes/channeltestproblem.hh b/test/freeflow/navierstokes/channeltestproblem.hh index 2c45fdd6da28d27d932038532a564bf7d099bea5..cf323d7905dcdda0bb6185ad3b8dcfe39750f255 100644 --- a/test/freeflow/navierstokes/channeltestproblem.hh +++ b/test/freeflow/navierstokes/channeltestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_CHANNEL_TEST_PROBLEM_HH #define DUMUX_CHANNEL_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/components/constant.hh> diff --git a/test/freeflow/navierstokes/closedsystemtestproblem.hh b/test/freeflow/navierstokes/closedsystemtestproblem.hh index 0fa6beb09a481e5122ab5016eb935ba8d4b5b576..1030ac73c7cf222ba4861ff2619c6548671c21de 100644 --- a/test/freeflow/navierstokes/closedsystemtestproblem.hh +++ b/test/freeflow/navierstokes/closedsystemtestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_CLOSEDSYSTEM_TEST_PROBLEM_HH #define DUMUX_CLOSEDSYSTEM_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/constant.hh> diff --git a/test/freeflow/navierstokes/doneatestproblem.hh b/test/freeflow/navierstokes/doneatestproblem.hh index 451a2ac32b98f53b008c2a622b34607a7d2f6fbd..74b67e2a6cb98b215f939a53b567c51b527543be 100644 --- a/test/freeflow/navierstokes/doneatestproblem.hh +++ b/test/freeflow/navierstokes/doneatestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_DONEA_TEST_PROBLEM_HH #define DUMUX_DONEA_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/constant.hh> diff --git a/test/freeflow/navierstokes/kovasznaytestproblem.hh b/test/freeflow/navierstokes/kovasznaytestproblem.hh index 6bc2bfce6196faf81191c88d242011591fba0023..e56c8a48bcf08af80ba6114618a2a2a84f9279a4 100644 --- a/test/freeflow/navierstokes/kovasznaytestproblem.hh +++ b/test/freeflow/navierstokes/kovasznaytestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_KOVASZNAY_TEST_PROBLEM_HH #define DUMUX_KOVASZNAY_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/constant.hh> diff --git a/test/freeflow/navierstokes/navierstokesanalyticproblem.hh b/test/freeflow/navierstokes/navierstokesanalyticproblem.hh index 23305e94665cda2bf0f01f38211771de5baf4519..38833db5d1f5872c0d83d4a28c09609a158e6a9c 100644 --- a/test/freeflow/navierstokes/navierstokesanalyticproblem.hh +++ b/test/freeflow/navierstokes/navierstokesanalyticproblem.hh @@ -26,6 +26,8 @@ #ifndef DUMUX_DONEA_TEST_PROBLEM_HH #define DUMUX_DONEA_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/components/constant.hh> #include <dumux/material/fluidsystems/1pliquid.hh> diff --git a/test/freeflow/navierstokes/stokeschannel3dproblem.hh b/test/freeflow/navierstokes/stokeschannel3dproblem.hh index b757d830a90254237b6f211ae8614a18b293bcbf..e82f8f0c31b156337dedf8cd88d36d311aa7aed6 100644 --- a/test/freeflow/navierstokes/stokeschannel3dproblem.hh +++ b/test/freeflow/navierstokes/stokeschannel3dproblem.hh @@ -28,6 +28,8 @@ #ifndef DUMUX_3D_CHANNEL_PROBLEM_HH #define DUMUX_3D_CHANNEL_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/constant.hh> diff --git a/test/freeflow/navierstokes/test_angeli.cc b/test/freeflow/navierstokes/test_angeli.cc index 8ced7b487033e8b2d1f36cfeedcfa8b1eb522a48..707536c3c401477a704222984ce6c156e1e490a5 100644 --- a/test/freeflow/navierstokes/test_angeli.cc +++ b/test/freeflow/navierstokes/test_angeli.cc @@ -50,6 +50,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -101,16 +102,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokes/test_channel.cc b/test/freeflow/navierstokes/test_channel.cc index 39f706fb94e597c27a4af5183fa9ac4651430342..6717818d7783e1c6ae5fd37fd7ecb6e5baed5056 100644 --- a/test/freeflow/navierstokes/test_channel.cc +++ b/test/freeflow/navierstokes/test_channel.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include <dumux/freeflow/navierstokes/staggered/fluxoversurface.hh> @@ -102,16 +103,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokes/test_closedsystem.cc b/test/freeflow/navierstokes/test_closedsystem.cc index 0fdd3bd631a8a7648fe9a84599b46f2621a31d40..a29b3bb4765535292028f5966d4872ed2fa35ae8 100644 --- a/test/freeflow/navierstokes/test_closedsystem.cc +++ b/test/freeflow/navierstokes/test_closedsystem.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokes/test_donea.cc b/test/freeflow/navierstokes/test_donea.cc index 5e062798d60172861a98d1bb26a149f2f2130fa5..7b168e83eeab8ee802aac745cde844231ad5be86 100644 --- a/test/freeflow/navierstokes/test_donea.cc +++ b/test/freeflow/navierstokes/test_donea.cc @@ -51,6 +51,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include <dumux/io/grid/gridmanager.hh> @@ -104,18 +105,16 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridManager = Dumux::GridManager<typename GET_PROP_TYPE(TypeTag, Grid), GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod>; - GridManager gridMgr; - gridMgr.makeGrid(); - const auto& grid = gridMgr.grid(); - gridMgr.loadBalance(); + using GridManager = Dumux::GridManager<typename GET_PROP_TYPE(TypeTag, Grid)>; + GridManager gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = grid.leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokes/test_kovasznay.cc b/test/freeflow/navierstokes/test_kovasznay.cc index 019bd257e2b1b7b16f5572d80e0cfc827073d55a..95de8b519b92579692bd5255a7bc6137462f6730 100644 --- a/test/freeflow/navierstokes/test_kovasznay.cc +++ b/test/freeflow/navierstokes/test_kovasznay.cc @@ -50,6 +50,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -101,16 +102,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokes/test_navierstokes_1d.cc b/test/freeflow/navierstokes/test_navierstokes_1d.cc index 4d8c4598ea6f7bec49abb8153b098e27f709c9eb..91edf0498ffbccad51d6a875876aff0f5c70f2b2 100644 --- a/test/freeflow/navierstokes/test_navierstokes_1d.cc +++ b/test/freeflow/navierstokes/test_navierstokes_1d.cc @@ -43,6 +43,7 @@ #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> @@ -89,16 +90,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokes/test_stokes_channel_3d.cc b/test/freeflow/navierstokes/test_stokes_channel_3d.cc index bffaab16dac9f7384178ae88e1c7e042fc37540b..3d69225f2179f896fa7aa13c1c371adadb8489a7 100644 --- a/test/freeflow/navierstokes/test_stokes_channel_3d.cc +++ b/test/freeflow/navierstokes/test_stokes_channel_3d.cc @@ -43,6 +43,7 @@ #include <dumux/assembly/diffmethod.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include <dumux/freeflow/navierstokes/staggered/fluxoversurface.hh> /*! @@ -95,16 +96,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokesnc/channeltestproblem.hh b/test/freeflow/navierstokesnc/channeltestproblem.hh index bd48143b6766ccc95d8417987414cc5ab97b25a8..dfce1847115370e8b346a30405ca746da29df86b 100644 --- a/test/freeflow/navierstokesnc/channeltestproblem.hh +++ b/test/freeflow/navierstokesnc/channeltestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_CHANNEL_NC_TEST_PROBLEM_HH #define DUMUX_CHANNEL_NC_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/fluidsystems/h2oair.hh> diff --git a/test/freeflow/navierstokesnc/densityflowproblem.hh b/test/freeflow/navierstokesnc/densityflowproblem.hh index 38959ede9d2cbeee18a8885506bdc484c6f49f46..4e6141443681e87487d475aa5a56b8b743e84371 100644 --- a/test/freeflow/navierstokesnc/densityflowproblem.hh +++ b/test/freeflow/navierstokesnc/densityflowproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH #define DUMUX_DENSITY_FLOW_NC_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/fluidsystems/h2oair.hh> diff --git a/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh b/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh index 93978c823046c1c418659ce24736012cff6148a1..4920d19494a1b0f3834aa946b5102f1e489b8a30 100644 --- a/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh +++ b/test/freeflow/navierstokesnc/msfreeflowtestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_CHANNEL_MAXWELL_STEFAN_TEST_PROBLEM_HH #define DUMUX_CHANNEL_MAXWELL_STEFAN_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/freeflow/compositional/navierstokesncmodel.hh> #include <dumux/freeflow/navierstokes/problem.hh> diff --git a/test/freeflow/navierstokesnc/test_channel.cc b/test/freeflow/navierstokesnc/test_channel.cc index 9198f5df82b599af9b7837ac1db0b8f30518ae17..066444114b30b2f2c522f9fb6a3349d62446ff9d 100644 --- a/test/freeflow/navierstokesnc/test_channel.cc +++ b/test/freeflow/navierstokesnc/test_channel.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc index 614df58447027d2ccc0522e1f458c7d88acd1792..25fd54d6f6173c2feb0e229b8b0a37154c8d6883 100644 --- a/test/freeflow/navierstokesnc/test_densitydrivenflow.cc +++ b/test/freeflow/navierstokesnc/test_densitydrivenflow.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/navierstokesnc/test_msfreeflow.cc b/test/freeflow/navierstokesnc/test_msfreeflow.cc index 88c23a75a6304f3901075b590db2183b2cb2b2cc..d19b6e6960d66c0b30572e9104256c068decd14a 100644 --- a/test/freeflow/navierstokesnc/test_msfreeflow.cc +++ b/test/freeflow/navierstokesnc/test_msfreeflow.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/rans/pipelauferproblem.hh b/test/freeflow/rans/pipelauferproblem.hh index d69ba41ddc91e8ba33077e13d7cd228d9b991b73..379b9139c3b2b4c5deccd7a1345ee36395ba983a 100644 --- a/test/freeflow/rans/pipelauferproblem.hh +++ b/test/freeflow/rans/pipelauferproblem.hh @@ -27,6 +27,8 @@ #ifndef DUMUX_PIPE_LAUFER_PROBLEM_HH #define DUMUX_PIPE_LAUFER_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/staggered/freeflow/properties.hh> #include <dumux/freeflow/turbulenceproperties.hh> #include <dumux/material/fluidsystems/1pgas.hh> diff --git a/test/freeflow/rans/test_pipe_laufer.cc b/test/freeflow/rans/test_pipe_laufer.cc index 62e9d82f500fd18891a1cc1c09b37455734d157c..56825467c7e8514814d19b9ea85bee7539586b4d 100644 --- a/test/freeflow/rans/test_pipe_laufer.cc +++ b/test/freeflow/rans/test_pipe_laufer.cc @@ -53,6 +53,7 @@ #include <dumux/io/gnuplotinterface.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/freeflow/ransnc/flatplatetestproblem.hh b/test/freeflow/ransnc/flatplatetestproblem.hh index e51fec4c7bb618ac8e50cbc71e025ee7eeabba1b..c0111ec6b4cb4584cc4aa54aff130bb6bbd0b439 100644 --- a/test/freeflow/ransnc/flatplatetestproblem.hh +++ b/test/freeflow/ransnc/flatplatetestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_RANS_NC_TEST_PROBLEM_HH #define DUMUX_RANS_NC_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/staggered/freeflow/properties.hh> #include <dumux/material/fluidsystems/h2oair.hh> #include <dumux/freeflow/turbulenceproperties.hh> diff --git a/test/freeflow/ransnc/test_flatplate.cc b/test/freeflow/ransnc/test_flatplate.cc index 2c8475437366dfe733a87add53f573df536bd60e..2767ea5126481b716f900684206053fca418bcbe 100644 --- a/test/freeflow/ransnc/test_flatplate.cc +++ b/test/freeflow/ransnc/test_flatplate.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -89,16 +90,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/geomechanics/elastic/problem.hh b/test/geomechanics/elastic/problem.hh index b7fab27f9bbb99b286e07d182b903665e581bf92..9762336500325cafcaa8139463a4420475def5b0 100644 --- a/test/geomechanics/elastic/problem.hh +++ b/test/geomechanics/elastic/problem.hh @@ -24,6 +24,7 @@ #define DUMUX_ELASTICPROBLEM_HH #include <dune/common/fmatrix.hh> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/geomechanics/elastic/model.hh> diff --git a/test/geomechanics/elastic/test_elastic.cc b/test/geomechanics/elastic/test_elastic.cc index 005a0682eca9b145d91e60ce274f1a6787f03cac..74ae58761f9f7d6673e9d59a31ce28da934f7d14 100644 --- a/test/geomechanics/elastic/test_elastic.cc +++ b/test/geomechanics/elastic/test_elastic.cc @@ -47,6 +47,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // main function int main(int argc, char** argv) try @@ -70,16 +71,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/geomechanics/poroelastic/problem.hh b/test/geomechanics/poroelastic/problem.hh index 887e4313ef703c42220ffd0ec2ff9b0041f64860..fc675b5db9f961f62b18d63c4cbc3fda0ec258c3 100644 --- a/test/geomechanics/poroelastic/problem.hh +++ b/test/geomechanics/poroelastic/problem.hh @@ -24,6 +24,7 @@ #define DUMUX_POROELASTIC_PROBLEM_HH #include <dune/common/fmatrix.hh> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/geomechanics/poroelastic/model.hh> diff --git a/test/geomechanics/poroelastic/test_poroelastic.cc b/test/geomechanics/poroelastic/test_poroelastic.cc index dba038fe79d08e4335790a5630071d8c2405989c..2f82bd8f59f9b90ded277a989fdc78ec2b2234f0 100644 --- a/test/geomechanics/poroelastic/test_poroelastic.cc +++ b/test/geomechanics/poroelastic/test_poroelastic.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // function to evaluate the element stresses template< class StressType, @@ -113,16 +114,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/io/gridcreator/gridcreatortests.hh b/test/io/gridcreator/gridmanagertests.hh similarity index 97% rename from test/io/gridcreator/gridcreatortests.hh rename to test/io/gridcreator/gridmanagertests.hh index e88caf62a55ffbd8f44bb729aec418eef6c6fa6f..2cf7aad31522b4c9d7b1aec4c608c4f327f325fb 100644 --- a/test/io/gridcreator/gridcreatortests.hh +++ b/test/io/gridcreator/gridmanagertests.hh @@ -21,8 +21,8 @@ * \note This can/should be extended */ -#ifndef DUMUX_GRIDCREATOR_TESTS_HH -#define DUMUX_GRIDCREATOR_TESTS_HH +#ifndef DUMUX_TEST_IO_GRIDMANAGER_TESTS_HH +#define DUMUX_TEST_IO_GRIDMANAGER_TESTS_HH #include <dune/common/version.hh> #include <dune/geometry/referenceelements.hh> @@ -100,7 +100,7 @@ private: }; template<class Grid> -class GridCreatorTests +class GridManagerTests { using GridView = typename Grid::LeafGridView; using Scalar = double; @@ -116,8 +116,7 @@ public: { // make the grid manager and initialize the grid GridManager gridManager; - gridManager.makeGrid(); - gridManager.loadBalance(); + gridManager.init(); auto gridData = gridManager.getGridData(); const auto& leafGridView = gridManager.grid().leafGridView(); @@ -151,8 +150,7 @@ public: { // make the grid manager and initialize the grid GridManager gridManager; - gridManager.makeGrid(); - gridManager.loadBalance(); + gridManager.init(); auto gridData = gridManager.getGridData(); // read the element markers and the rank diff --git a/test/io/gridcreator/test_gridcreator_cake.cc b/test/io/gridcreator/test_gridcreator_cake.cc index 41ef55e5e6c6eca4fcca815639b554a24ba2e4bf..7ecfee27bfb42f599de17a91b0f0179a4108d34d 100644 --- a/test/io/gridcreator/test_gridcreator_cake.cc +++ b/test/io/gridcreator/test_gridcreator_cake.cc @@ -26,7 +26,8 @@ #include <dune/grid/io/file/vtk.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/io/cakegridcreator.hh> +#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/cakegridcreator.hh> #if HAVE_UG #include <dune/grid/uggrid.hh> @@ -59,18 +60,19 @@ int main(int argc, char** argv) try // using declarations using TypeTag = TTAG(GridCreatorCakeTest); using Grid = typename GET_PROP_TYPE(TypeTag, Grid); - using GridCreator = typename Dumux::CakeGridCreator<Grid>; + using GridManager = typename Dumux::CakeGridCreator<Grid>; + GridManager gridManager; // first read parameters from input file Dumux::Parameters::init(argc, argv, "test_gridcreator_cake.input"); // make the grid Dune::Timer timer; - GridCreator::makeGrid(); - std::cout << "Constructing cake grid with " << GridCreator::grid().leafGridView().size(0) << " elements took " + gridManager.init(); + std::cout << "Constructing cake grid with " << gridManager.grid().leafGridView().size(0) << " elements took " << timer.elapsed() << " seconds.\n"; // construct a vtk output writer and attach the boundaryMakers - Dune::VTKWriter<Grid::LeafGridView> vtkWriter(GridCreator::grid().leafGridView()); + Dune::VTKWriter<Grid::LeafGridView> vtkWriter(gridManager.grid().leafGridView()); vtkWriter.write("cake-00000"); return 0; diff --git a/test/io/gridcreator/test_gridcreator_dgf_e_markers.cc b/test/io/gridcreator/test_gridcreator_dgf_e_markers.cc index e1e9ada10e8af29f085dc216bc858ea0989b070a..3f5b245a15a62e4d96904384c41bf8a255a8c0ed 100644 --- a/test/io/gridcreator/test_gridcreator_dgf_e_markers.cc +++ b/test/io/gridcreator/test_gridcreator_dgf_e_markers.cc @@ -25,7 +25,7 @@ #include <dune/common/parallel/mpihelper.hh> #include <dumux/common/parameters.hh> -#include "gridcreatortests.hh" +#include "gridmanagertests.hh" int main(int argc, char** argv) try { @@ -34,7 +34,7 @@ int main(int argc, char** argv) try Dumux::Parameters::init(argc, argv, "test_gridcreator_dgf_e_markers.input"); auto name = Dumux::getParam<std::string>("Problem.Name"); - Dumux::GridCreatorTests<GRIDTYPE>::testElementMarkers("dgf", name); + Dumux::GridManagerTests<GRIDTYPE>::testElementMarkers("dgf", name); return 0; } diff --git a/test/io/gridcreator/test_gridcreator_gmsh_3d.cc b/test/io/gridcreator/test_gridcreator_gmsh_3d.cc index 9d2eb30e257c4bdc8f9b28ae714a535c3c456638..2ae6aadf1f166003b2bae9b3bf3227c5ce7ed50a 100644 --- a/test/io/gridcreator/test_gridcreator_gmsh_3d.cc +++ b/test/io/gridcreator/test_gridcreator_gmsh_3d.cc @@ -25,7 +25,7 @@ #include <dune/common/parallel/mpihelper.hh> #include <dumux/common/parameters.hh> -#include "gridcreatortests.hh" +#include "gridmanagertests.hh" int main(int argc, char** argv) try { @@ -35,7 +35,7 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, "test_gridcreator_gmsh_3d.input"); const auto name = getParam<std::string>("Problem.Name"); const auto refine = Dumux::getParam<bool>("Grid.Refine", true); - GridCreatorTests<GRIDTYPE>::testBoundaryAndElementMarkers("gmsh", name, refine); + GridManagerTests<GRIDTYPE>::testBoundaryAndElementMarkers("gmsh", name, refine); return 0; } diff --git a/test/io/gridcreator/test_gridcreator_gmsh_e_markers.cc b/test/io/gridcreator/test_gridcreator_gmsh_e_markers.cc index f39dd3d6e95d5ca7bb70b1b875ad1a5c28e60993..47dfb3ebcf3fc88d63be4d6e055d34d5f6a2339a 100644 --- a/test/io/gridcreator/test_gridcreator_gmsh_e_markers.cc +++ b/test/io/gridcreator/test_gridcreator_gmsh_e_markers.cc @@ -25,7 +25,7 @@ #include <dune/common/parallel/mpihelper.hh> #include <dumux/common/parameters.hh> -#include "gridcreatortests.hh" +#include "gridmanagertests.hh" int main(int argc, char** argv) try { @@ -34,7 +34,7 @@ int main(int argc, char** argv) try Dumux::Parameters::init(argc, argv, "test_gridcreator_gmsh_e_markers.input"); auto name = Dumux::getParam<std::string>("Problem.Name"); - Dumux::GridCreatorTests<GRIDTYPE>::testElementMarkers("gmsh", name); + Dumux::GridManagerTests<GRIDTYPE>::testElementMarkers("gmsh", name); return 0; } diff --git a/test/io/gridcreator/test_gridcreator_subgrid.cc b/test/io/gridcreator/test_gridcreator_subgrid.cc index 61dfc31f5b9c6516281fd816ab095ebff76560f3..370c2f82cddcc07e83bb0c172ec18b83fbf174ef 100644 --- a/test/io/gridcreator/test_gridcreator_subgrid.cc +++ b/test/io/gridcreator/test_gridcreator_subgrid.cc @@ -25,10 +25,11 @@ #include <dune/common/fvector.hh> #include <dune/common/timer.hh> #include <dune/grid/io/file/vtk.hh> +#include <dune/grid/yaspgrid.hh> #include <dumux/common/parameters.hh> -#include <dumux/io/gridcreator.hh> -#include <dumux/io/subgridgridcreator.hh> +#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/subgridgridcreator.hh> #include <dumux/discretization/methods.hh> /*! @@ -67,13 +68,16 @@ int main(int argc, char** argv) try Dune::Timer timer; using HostGrid = Dune::YaspGrid<dim, Dune::TensorProductCoordinates<double, dim> >; - using HostGridCreator = GridCreatorImpl<HostGrid, DiscretizationMethod::none>; - HostGridCreator::makeGrid(); + + using HostGridManager = Dumux::GridManager<HostGrid>; + HostGridManager hostGridManager; + hostGridManager.init(); + auto& hostGrid = hostGridManager.grid(); // Calculate the bounding box of the host grid view. GlobalPosition bBoxMin(std::numeric_limits<double>::max()); GlobalPosition bBoxMax(std::numeric_limits<double>::min()); - for (const auto& vertex : vertices(HostGridCreator::grid().leafGridView())) + for (const auto& vertex : vertices(hostGrid.leafGridView())) { for (int i=0; i<dim; i++) { @@ -105,14 +109,14 @@ int main(int argc, char** argv) try CircleSelector<GlobalPosition> elementSelectorThree(center); // Create three different subgrids from the same hostgrid. - auto subgridPtrOne = SubgridGridCreator<HostGrid>::makeGrid(HostGridCreator::grid(), elementSelectorOne, "SubGridOne"); - auto subgridPtrTwo = SubgridGridCreator<HostGrid>::makeGrid(HostGridCreator::grid(), elementSelectorTwo, "SubGridTwo"); - auto subgridPtrThree = SubgridGridCreator<HostGrid>::makeGrid(HostGridCreator::grid(), elementSelectorThree, "SubGridThree"); + auto subgridPtrOne = SubgridGridCreator<HostGrid>::makeGrid(hostGrid, elementSelectorOne, "SubGridOne"); + auto subgridPtrTwo = SubgridGridCreator<HostGrid>::makeGrid(hostGrid, elementSelectorTwo, "SubGridTwo"); + auto subgridPtrThree = SubgridGridCreator<HostGrid>::makeGrid(hostGrid, elementSelectorThree, "SubGridThree"); std::cout << "Constructing a host grid and three subgrids took " << timer.elapsed() << " seconds.\n"; // Write out the host grid and the subgrids. - Dune::VTKWriter<HostGrid::LeafGridView> vtkWriter(HostGridCreator::grid().leafGridView()); + Dune::VTKWriter<HostGrid::LeafGridView> vtkWriter(hostGrid.leafGridView()); vtkWriter.write("hostgrid"); return 0; diff --git a/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh b/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh index 193d3c7c89ca4307e494d64cd2e95e68a3bac73f..3ba1bdd20804e3683859b522075c060fa888abbe 100644 --- a/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh +++ b/test/porousmediumflow/1p/implicit/1pniconductionproblem.hh @@ -25,7 +25,8 @@ #ifndef DUMUX_1PNI_CONDUCTION_PROBLEM_HH #define DUMUX_1PNI_CONDUCTION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh b/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh index 9d0aca9b4aae11bc8e0ed2fae8b08aed953fb6f4..af9064770c4c1d0a2f14e81ac35fc7ec1d1c700b 100644 --- a/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh +++ b/test/porousmediumflow/1p/implicit/1pniconvectionproblem.hh @@ -26,7 +26,8 @@ #ifndef DUMUX_1PNI_CONVECTION_PROBLEM_HH #define DUMUX_1PNI_CONVECTION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/1p/implicit/1ptestproblem.hh b/test/porousmediumflow/1p/implicit/1ptestproblem.hh index 7165e9d4a398e74224bbdc39785fb99ce1e837cc..d33123e9de38042d82b262080071de40d6c78725 100644 --- a/test/porousmediumflow/1p/implicit/1ptestproblem.hh +++ b/test/porousmediumflow/1p/implicit/1ptestproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_1PTEST_PROBLEM_HH #define DUMUX_1PTEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/1p/implicit/compressible/problem.hh b/test/porousmediumflow/1p/implicit/compressible/problem.hh index 57cb404c286fb803643a1962c231ea25f2c1a8e6..f0d4bc70bc6f68ab9c5757d886b659536f97b5f6 100644 --- a/test/porousmediumflow/1p/implicit/compressible/problem.hh +++ b/test/porousmediumflow/1p/implicit/compressible/problem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_PROBLEM_HH #define DUMUX_INCOMPRESSIBLE_ONEP_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/components/h2o.hh> #include <dumux/material/components/tabulatedcomponent.hh> #include <dumux/material/fluidsystems/1pliquid.hh> diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc index 0681e6b11993174f06fbe0de52d61b06ecc6a40c..1408949eadbefca13c79e8923ce7f02f46415b4f 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p.cc @@ -47,6 +47,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> int main(int argc, char** argv) try { @@ -72,16 +73,15 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc index 61a955a939b6bbd8df9013b8e1ada7eb6837ac69..723cf74e240e32ac6a4fd7f77d7a3eb0545b3f54 100644 --- a/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc +++ b/test/porousmediumflow/1p/implicit/compressible/test_1p_stationary.cc @@ -45,6 +45,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> int main(int argc, char** argv) try { @@ -70,16 +71,15 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/incompressible/problem.hh b/test/porousmediumflow/1p/implicit/incompressible/problem.hh index f7d379dc559ff4cd2e00900ba744275fdefa8349..0d7ae66f7706c91bb2b504a46302f512a68768c0 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/problem.hh +++ b/test/porousmediumflow/1p/implicit/incompressible/problem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_PROBLEM_HH #define DUMUX_INCOMPRESSIBLE_ONEP_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc index 35eaadff20c7091c66f78d5df38238d1ee9610e1..2754ab3a4d0a16cf4866b67ba4f4c804b4168a75 100644 --- a/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/incompressible/test_1pfv.cc @@ -42,6 +42,9 @@ #include <dumux/common/dumuxmessage.hh> #include <dumux/common/defaultusagemessage.hh> +#include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> + #include <dumux/assembly/fvassembler.hh> #include "problem.hh" @@ -70,12 +73,11 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh b/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh index a52d270b454808251497bb0261d1695900349636..e77b07c1fc20afd1757d854b08f18d405f768428 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh +++ b/test/porousmediumflow/1p/implicit/pointsources/1psingularityproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_1P_SINGULARITY_PROBLEM_HH #define DUMUX_1P_SINGULARITY_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/1p/model.hh> diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc index 92abc5b34e108093d2e5e708dc9aefe59d1791fb..75f38d634207ae54059ceec9a5fc83b9960200ab 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> int main(int argc, char** argv) try { @@ -68,16 +69,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc index f0fbf2fe90b19ae767f1c45f5d39728762de4da7..7603390e6b6da23fb847a789a9cbfca25a52e8f5 100644 --- a/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc +++ b/test/porousmediumflow/1p/implicit/pointsources/test_1pfv_pointsources_timedependent.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> int main(int argc, char** argv) try { @@ -68,16 +69,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv.cc b/test/porousmediumflow/1p/implicit/test_1pfv.cc index 20b487087d3487e380ae631a3caf3c199d9119b4..f021f8408ddfa8798e6a34dc9d4d63103f937c3e 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -99,16 +100,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc index 661a2eacd5451bde016255477413c9f10318e14b..65a1a9c23b560f61b5db0c87501891f44b1a0493 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_fracture2d3d.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with * reading in parameters. @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc index 8002c628157d72f13e7f9e306b962a84ddbc5497..edd24f310b7c7de23f3f420901527095796509bd 100644 --- a/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc +++ b/test/porousmediumflow/1p/implicit/test_1pfv_network1d3d.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with * reading in parameters. @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/implicit/test_1pnifv.cc b/test/porousmediumflow/1p/implicit/test_1pnifv.cc index 936c8e7dd64e46fbfeb17e72484e7fb5c73be1a7..cceb83f2ad4a5632713bb381d108e42cb6ee606e 100644 --- a/test/porousmediumflow/1p/implicit/test_1pnifv.cc +++ b/test/porousmediumflow/1p/implicit/test_1pnifv.cc @@ -50,6 +50,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -95,16 +96,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1p/sequential/test_1pproblem.hh b/test/porousmediumflow/1p/sequential/test_1pproblem.hh index cdc0c03c2d6dcbf8e56cc852bfbd6f9cbaa9256f..03709cca98970d9ed7d98478a88bb2bba7d4ee56 100644 --- a/test/porousmediumflow/1p/sequential/test_1pproblem.hh +++ b/test/porousmediumflow/1p/sequential/test_1pproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_TEST_1P_PROBLEM_HH #define DUMUX_TEST_1P_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/constant.hh> diff --git a/test/porousmediumflow/1p/sequential/test_diffusion.cc b/test/porousmediumflow/1p/sequential/test_diffusion.cc index e8e5c19d98528a35eb7c2d09174436750d64e6df..89a23a4dd9a73a314a524a8658f2e96d38dcb2b2 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusion.cc +++ b/test/porousmediumflow/1p/sequential/test_diffusion.cc @@ -28,6 +28,8 @@ #include <dune/common/exceptions.hh> #include <dune/common/parallel/mpihelper.hh> +#include <dumux/io/grid/gridmanager.hh> + #include "test_diffusionproblem.hh" #include "resultevaluation.hh" @@ -62,9 +64,9 @@ int main(int argc, char** argv) //////////////////////////////////////////////////////////// // create the grid //////////////////////////////////////////////////////////// - using GridCreator = GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - auto& grid = GridCreator::grid(); + Dumux::GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); + auto& grid = gridManager.grid(); //////////////////////////////////////////////////////////// // instantiate and run the concrete problem diff --git a/test/porousmediumflow/1p/sequential/test_diffusion3d.cc b/test/porousmediumflow/1p/sequential/test_diffusion3d.cc index def411851314dff7b96a726f208ee874605e392e..f9a15a2f437210b32f097a95ab30d070a129d8ff 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusion3d.cc +++ b/test/porousmediumflow/1p/sequential/test_diffusion3d.cc @@ -37,6 +37,8 @@ #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> +#include <dumux/io/grid/gridmanager.hh> + #include "test_diffusionproblem3d.hh" #include "resultevaluation3d.hh" @@ -86,18 +88,17 @@ int start(int argc, // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - try { GridCreator::makeGrid(); } + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + try { gridManager.init(); } catch (...) { std::string usageMessage = "\n\t -> Creation of the grid failed! <- \n\n"; usageMessage += defaultUsageMessage(argv[0]); usage(argv[0], usageMessage); throw; } - GridCreator::loadBalance(); // print grid info - auto& grid = GridCreator::grid(); + auto& grid = gridManager.grid(); Dune::gridinfo(grid); ////////////////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh index 509d3c6915b26594cc180ac040ff4c9abe619084..28412467280b84f21d755b6213a00720a401d50d 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh @@ -22,6 +22,14 @@ #ifndef DUMUX_TEST_DIFFUSION_3D_PROBLEM_HH #define DUMUX_TEST_DIFFUSION_3D_PROBLEM_HH +#if HAVE_DUNE_ALUGRID +#include <dune/alugrid/grid.hh> +#endif +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/components/constant.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh> diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh index 53237741f0ae6d725b4695bc692ee978bb296607..d86da0cb0e6362f6cd3f46fa28250d97706cb773 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2cniconductionproblem.hh @@ -25,6 +25,11 @@ #ifndef DUMUX_1P2CNI_CONDUCTION_TEST_PROBLEM_HH #define DUMUX_1P2CNI_CONDUCTION_TEST_PROBLEM_HH +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> diff --git a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh index 635b657e10bb940ebbc7af69324bbfe513b661b4..70d397f051ee4c08e0e8cf57b7062da46793dec8 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2cniconvectionproblem.hh @@ -25,6 +25,11 @@ #ifndef DUMUX_1P2CNI_CONVECTION_TEST_PROBLEM_HH #define DUMUX_1P2CNI_CONVECTION_TEST_PROBLEM_HH +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> diff --git a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh b/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh index ae77a6c9dbaf240af749381ff84844d0fe0d6a41..c044501577e71defa0a20af36a6d4f98f62aaf2b 100644 --- a/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh +++ b/test/porousmediumflow/1pnc/implicit/1p2ctestproblem.hh @@ -25,6 +25,11 @@ #ifndef DUMUX_1P2C_TEST_PROBLEM_HH #define DUMUX_1P2C_TEST_PROBLEM_HH +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc index d9bb15ae6442ab0714a135338485aa40319776de..86133ee13d6ea3cf46a160c0f156baf15f4039e5 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2c_fv.cc @@ -21,176 +21,176 @@ * * \brief test for the 1pnc model */ - #include <config.h> +#include <config.h> - #include "1p2ctestproblem.hh" +#include "1p2ctestproblem.hh" - #include <ctime> - #include <iostream> +#include <ctime> +#include <iostream> - #include <dune/common/parallel/mpihelper.hh> - #include <dune/common/timer.hh> - #include <dune/grid/io/file/dgfparser/dgfexception.hh> - #include <dune/grid/io/file/vtk.hh> - #include <dune/istl/io.hh> +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/timer.hh> +#include <dune/grid/io/file/dgfparser/dgfexception.hh> +#include <dune/grid/io/file/vtk.hh> +#include <dune/istl/io.hh> - #include <dumux/discretization/methods.hh> +#include <dumux/discretization/methods.hh> - #include <dumux/common/properties.hh> - #include <dumux/common/parameters.hh> - #include <dumux/common/dumuxmessage.hh> - #include <dumux/common/defaultusagemessage.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/dumuxmessage.hh> +#include <dumux/common/defaultusagemessage.hh> - #include <dumux/linear/seqsolverbackend.hh> - #include <dumux/nonlinear/newtonsolver.hh> +#include <dumux/linear/seqsolverbackend.hh> +#include <dumux/nonlinear/newtonsolver.hh> - #include <dumux/assembly/fvassembler.hh> +#include <dumux/assembly/fvassembler.hh> - #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> - int main(int argc, char** argv) try - { - using namespace Dumux; +int main(int argc, char** argv) try +{ + using namespace Dumux; - // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + // define the type tag for this problem + using TypeTag = TTAG(TYPETAG); - //////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - // print dumux start message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/true); + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); - // initialize parameter tree - Parameters::init(argc, argv); + // initialize parameter tree + Parameters::init(argc, argv); - ////////////////////////////////////////////////////////////////////// - // try to create a grid (from the given grid file or the input file) - ///////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // try to create a grid (from the given grid file or the input file) + ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); - //////////////////////////////////////////////////////////// - // run instationary non-linear problem on this grid - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + // run instationary non-linear problem on this grid + //////////////////////////////////////////////////////////// - // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + // we compute on the leaf grid view + const auto& leafGridView = gridManager.grid().leafGridView(); - // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); - fvGridGeometry->update(); + // create the finite volume grid geometry + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); + fvGridGeometry->update(); - // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - auto problem = std::make_shared<Problem>(fvGridGeometry); - - // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - SolutionVector x(fvGridGeometry->numDofs()); - problem->applyInitialSolution(x); - auto xOld = x; - - // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); - gridVariables->init(x, xOld); - - // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); - auto dt = getParam<Scalar>("TimeLoop.DtInitial"); - auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); - - // intialize the vtk output module - VtkOutputModule<TypeTag, GET_PROP_VALUE(TypeTag, PhaseIdx)> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields - vtkWriter.write(0.0); - - // instantiate time loop - auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); - timeLoop->setMaxTimeStepSize(maxDt); - - // the assembler with time loop for instationary problem - using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; - auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); - - // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); - - // the non-linear solver - NewtonSolver<Assembler, LinearSolver> nonLinearSolver(assembler, linearSolver); - - // time loop - timeLoop->start(); do - { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - // solve the non-linear system with time step control - nonLinearSolver.solve(x, *timeLoop); - - // make the new solution the old solution - xOld = x; - gridVariables->advanceTimeStep(); - - // advance to the time loop to the next step - timeLoop->advanceTimeStep(); - - // write vtk output - vtkWriter.write(timeLoop->time()); - - // report statistics of this time step - timeLoop->reportTimeStep(); - - // set new dt as suggested by the newton solver - timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); - - } while (!timeLoop->finished()); - - timeLoop->finalize(leafGridView.comm()); - - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/false); - - return 0; - - } - catch (Dumux::ParameterException &e) - { - std::cerr << std::endl << e << " ---> Abort!" << std::endl; - return 1; - } - catch (Dune::DGFException & e) - { - std::cerr << "DGF exception thrown (" << e << - "). Most likely, the DGF file name is wrong " - "or the DGF file is corrupted, " - "e.g. missing hash at end of file or wrong number (dimensions) of entries." - << " ---> Abort!" << std::endl; - return 2; - } - catch (Dune::Exception &e) - { - std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; - return 3; - } - catch (...) - { - std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; - return 4; - } + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared<Problem>(fvGridGeometry); + + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector x(fvGridGeometry->numDofs()); + problem->applyInitialSolution(x); + auto xOld = x; + + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); + gridVariables->init(x, xOld); + + // get some time loop parameters + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); + auto dt = getParam<Scalar>("TimeLoop.DtInitial"); + auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); + + // intialize the vtk output module + VtkOutputModule<TypeTag, GET_PROP_VALUE(TypeTag, PhaseIdx)> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + vtkWriter.write(0.0); + + // instantiate time loop + auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); + timeLoop->setMaxTimeStepSize(maxDt); + + // the assembler with time loop for instationary problem + using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; + auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); + + // the linear solver + using LinearSolver = ILU0BiCGSTABBackend; + auto linearSolver = std::make_shared<LinearSolver>(); + + // the non-linear solver + NewtonSolver<Assembler, LinearSolver> nonLinearSolver(assembler, linearSolver); + + // time loop + timeLoop->start(); do + { + // set previous solution for storage evaluations + assembler->setPreviousSolution(xOld); + + // solve the non-linear system with time step control + nonLinearSolver.solve(x, *timeLoop); + + // make the new solution the old solution + xOld = x; + gridVariables->advanceTimeStep(); + + // advance to the time loop to the next step + timeLoop->advanceTimeStep(); + + // write vtk output + vtkWriter.write(timeLoop->time()); + + // report statistics of this time step + timeLoop->reportTimeStep(); + + // set new dt as suggested by the newton solver + timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); + + } while (!timeLoop->finished()); + + timeLoop->finalize(leafGridView.comm()); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/false); + + return 0; +} + +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::DGFException & e) +{ + std::cerr << "DGF exception thrown (" << e << + "). Most likely, the DGF file name is wrong " + "or the DGF file is corrupted, " + "e.g. missing hash at end of file or wrong number (dimensions) of entries." + << " ---> Abort!" << std::endl; + return 2; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 3; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 4; +} diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc index d259b5725782e5ec79c47929b0a35b41e183e947..f61f996cc770a3f09b52bfc78af7b6da0ffd5cd0 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_conduction_fv.cc @@ -21,185 +21,185 @@ * * \brief test for the 1pnc model */ - #include <config.h> +#include <config.h> - #include "1p2cniconductionproblem.hh" +#include "1p2cniconductionproblem.hh" - #include <ctime> - #include <iostream> +#include <ctime> +#include <iostream> - #include <dune/common/parallel/mpihelper.hh> - #include <dune/common/timer.hh> - #include <dune/grid/io/file/dgfparser/dgfexception.hh> - #include <dune/grid/io/file/vtk.hh> - #include <dune/istl/io.hh> +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/timer.hh> +#include <dune/grid/io/file/dgfparser/dgfexception.hh> +#include <dune/grid/io/file/vtk.hh> +#include <dune/istl/io.hh> - #include <dumux/discretization/methods.hh> +#include <dumux/discretization/methods.hh> - #include <dumux/common/properties.hh> - #include <dumux/common/parameters.hh> - #include <dumux/common/dumuxmessage.hh> - #include <dumux/common/defaultusagemessage.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/dumuxmessage.hh> +#include <dumux/common/defaultusagemessage.hh> - #include <dumux/nonlinear/newtonsolver.hh> - #include <dumux/linear/seqsolverbackend.hh> +#include <dumux/nonlinear/newtonsolver.hh> +#include <dumux/linear/seqsolverbackend.hh> - #include <dumux/assembly/fvassembler.hh> +#include <dumux/assembly/fvassembler.hh> - #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> - int main(int argc, char** argv) try - { - using namespace Dumux; +int main(int argc, char** argv) try +{ + using namespace Dumux; - // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + // define the type tag for this problem + using TypeTag = TTAG(TYPETAG); - //////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - // print dumux start message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/true); + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); - // initialize parameter tree - Parameters::init(argc, argv); + // initialize parameter tree + Parameters::init(argc, argv); - ////////////////////////////////////////////////////////////////////// - // try to create a grid (from the given grid file or the input file) - ///////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // try to create a grid (from the given grid file or the input file) + ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); - //////////////////////////////////////////////////////////// - // run instationary non-linear problem on this grid - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + // run instationary non-linear problem on this grid + //////////////////////////////////////////////////////////// - // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + // we compute on the leaf grid view + const auto& leafGridView = gridManager.grid().leafGridView(); - // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); - fvGridGeometry->update(); + // create the finite volume grid geometry + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); + fvGridGeometry->update(); - // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - auto problem = std::make_shared<Problem>(fvGridGeometry); + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared<Problem>(fvGridGeometry); - // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - SolutionVector x(fvGridGeometry->numDofs()); - problem->applyInitialSolution(x); - auto xOld = x; + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector x(fvGridGeometry->numDofs()); + problem->applyInitialSolution(x); + auto xOld = x; - // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); - gridVariables->init(x, xOld); + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); + gridVariables->init(x, xOld); - // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); - auto dt = getParam<Scalar>("TimeLoop.DtInitial"); - auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); + // get some time loop parameters + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); + auto dt = getParam<Scalar>("TimeLoop.DtInitial"); + auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); - // intialize the vtk output module - VtkOutputModule<TypeTag, GET_PROP_VALUE(TypeTag, PhaseIdx)> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields - vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); - vtkWriter.write(0.0); - // output every vtkOutputInterval time step - const auto vtkOutputInterval = getParam<int>("Problem.OutputInterval"); + // intialize the vtk output module + VtkOutputModule<TypeTag, GET_PROP_VALUE(TypeTag, PhaseIdx)> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); + vtkWriter.write(0.0); + // output every vtkOutputInterval time step + const auto vtkOutputInterval = getParam<int>("Problem.OutputInterval"); - // instantiate time loop - auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); - timeLoop->setMaxTimeStepSize(maxDt); + // instantiate time loop + auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); + timeLoop->setMaxTimeStepSize(maxDt); - // the assembler with time loop for instationary problem - using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; - auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); + // the assembler with time loop for instationary problem + using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; + auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); - // the linear solver + // the linear solver // using LinearSolver = UMFPackBackend; - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); - - // the non-linear solver - using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; - NewtonSolver nonLinearSolver(assembler, linearSolver); - - // time loop - timeLoop->start(); do - { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - // linearize & solve - nonLinearSolver.solve(x, *timeLoop); - - // update the exact time temperature - problem->updateExactTemperature(x, timeLoop->time()+timeLoop->timeStepSize()); - - // make the new solution the old solution - xOld = x; - gridVariables->advanceTimeStep(); - - // advance to the time loop to the next step - timeLoop->advanceTimeStep(); - - // write vtk output - if (timeLoop->timeStepIndex()==0 || timeLoop->timeStepIndex() % vtkOutputInterval == 0 || timeLoop->willBeFinished()) - vtkWriter.write(timeLoop->time()); - - // report statistics of this time step - timeLoop->reportTimeStep(); - - // set new dt as suggested by the newton solver - timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); - - } while (!timeLoop->finished()); - - timeLoop->finalize(leafGridView.comm()); - - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/false); - - return 0; - - } - catch (Dumux::ParameterException &e) - { - std::cerr << std::endl << e << " ---> Abort!" << std::endl; - return 1; - } - catch (Dune::DGFException & e) - { - std::cerr << "DGF exception thrown (" << e << - "). Most likely, the DGF file name is wrong " - "or the DGF file is corrupted, " - "e.g. missing hash at end of file or wrong number (dimensions) of entries." - << " ---> Abort!" << std::endl; - return 2; - } - catch (Dune::Exception &e) - { - std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; - return 3; - } - catch (...) - { - std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; - return 4; - } + using LinearSolver = ILU0BiCGSTABBackend; + auto linearSolver = std::make_shared<LinearSolver>(); + + // the non-linear solver + using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; + NewtonSolver nonLinearSolver(assembler, linearSolver); + + // time loop + timeLoop->start(); do + { + // set previous solution for storage evaluations + assembler->setPreviousSolution(xOld); + + // linearize & solve + nonLinearSolver.solve(x, *timeLoop); + + // update the exact time temperature + problem->updateExactTemperature(x, timeLoop->time()+timeLoop->timeStepSize()); + + // make the new solution the old solution + xOld = x; + gridVariables->advanceTimeStep(); + + // advance to the time loop to the next step + timeLoop->advanceTimeStep(); + + // write vtk output + if (timeLoop->timeStepIndex()==0 || timeLoop->timeStepIndex() % vtkOutputInterval == 0 || timeLoop->willBeFinished()) + vtkWriter.write(timeLoop->time()); + + // report statistics of this time step + timeLoop->reportTimeStep(); + + // set new dt as suggested by the newton solver + timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); + + } while (!timeLoop->finished()); + + timeLoop->finalize(leafGridView.comm()); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/false); + + return 0; + +} +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::DGFException & e) +{ + std::cerr << "DGF exception thrown (" << e << + "). Most likely, the DGF file name is wrong " + "or the DGF file is corrupted, " + "e.g. missing hash at end of file or wrong number (dimensions) of entries." + << " ---> Abort!" << std::endl; + return 2; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 3; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 4; +} diff --git a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc index 8bfdfd015db407ae1e8ac9c08cbff03e79ceb90f..1a555df69cff3ad1f2b8d70860e3ecf3ca3ef261 100644 --- a/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc +++ b/test/porousmediumflow/1pnc/implicit/test_1p2cni_convection_fv.cc @@ -21,185 +21,185 @@ * * \brief test for the 1pnc model */ - #include <config.h> +#include <config.h> - #include "1p2cniconvectionproblem.hh" +#include "1p2cniconvectionproblem.hh" - #include <ctime> - #include <iostream> +#include <ctime> +#include <iostream> - #include <dune/common/parallel/mpihelper.hh> - #include <dune/common/timer.hh> - #include <dune/grid/io/file/dgfparser/dgfexception.hh> - #include <dune/grid/io/file/vtk.hh> - #include <dune/istl/io.hh> +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/timer.hh> +#include <dune/grid/io/file/dgfparser/dgfexception.hh> +#include <dune/grid/io/file/vtk.hh> +#include <dune/istl/io.hh> - #include <dumux/discretization/methods.hh> +#include <dumux/discretization/methods.hh> - #include <dumux/common/properties.hh> - #include <dumux/common/parameters.hh> - #include <dumux/common/dumuxmessage.hh> - #include <dumux/common/defaultusagemessage.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/dumuxmessage.hh> +#include <dumux/common/defaultusagemessage.hh> - #include <dumux/nonlinear/newtonsolver.hh> - #include <dumux/linear/seqsolverbackend.hh> +#include <dumux/nonlinear/newtonsolver.hh> +#include <dumux/linear/seqsolverbackend.hh> - #include <dumux/assembly/fvassembler.hh> +#include <dumux/assembly/fvassembler.hh> - #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> - int main(int argc, char** argv) try - { - using namespace Dumux; +int main(int argc, char** argv) try +{ + using namespace Dumux; - // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + // define the type tag for this problem + using TypeTag = TTAG(TYPETAG); - //////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - // print dumux start message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/true); + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); - // initialize parameter tree - Parameters::init(argc, argv); + // initialize parameter tree + Parameters::init(argc, argv); - ////////////////////////////////////////////////////////////////////// - // try to create a grid (from the given grid file or the input file) - ///////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // try to create a grid (from the given grid file or the input file) + ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); - //////////////////////////////////////////////////////////// - // run instationary non-linear problem on this grid - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + // run instationary non-linear problem on this grid + //////////////////////////////////////////////////////////// - // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + // we compute on the leaf grid view + const auto& leafGridView = gridManager.grid().leafGridView(); - // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); - fvGridGeometry->update(); + // create the finite volume grid geometry + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); + fvGridGeometry->update(); - // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - auto problem = std::make_shared<Problem>(fvGridGeometry); + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared<Problem>(fvGridGeometry); - // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - SolutionVector x(fvGridGeometry->numDofs()); - problem->applyInitialSolution(x); - auto xOld = x; + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector x(fvGridGeometry->numDofs()); + problem->applyInitialSolution(x); + auto xOld = x; - // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); - gridVariables->init(x, xOld); + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); + gridVariables->init(x, xOld); - // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); - auto dt = getParam<Scalar>("TimeLoop.DtInitial"); - auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); + // get some time loop parameters + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); + auto dt = getParam<Scalar>("TimeLoop.DtInitial"); + auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); - // intialize the vtk output module - VtkOutputModule<TypeTag, GET_PROP_VALUE(TypeTag, PhaseIdx)> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields - vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); - vtkWriter.write(0.0); - // output every vtkOutputInterval time step - const auto vtkOutputInterval = getParam<int>("Problem.OutputInterval"); + // intialize the vtk output module + VtkOutputModule<TypeTag, GET_PROP_VALUE(TypeTag, PhaseIdx)> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + vtkWriter.addField(problem->getExactTemperature(), "temperatureExact"); + vtkWriter.write(0.0); + // output every vtkOutputInterval time step + const auto vtkOutputInterval = getParam<int>("Problem.OutputInterval"); - // instantiate time loop - auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); - timeLoop->setMaxTimeStepSize(maxDt); + // instantiate time loop + auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); + timeLoop->setMaxTimeStepSize(maxDt); - // the assembler with time loop for instationary problem - using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; - auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); + // the assembler with time loop for instationary problem + using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; + auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); - // the linear solver + // the linear solver // using LinearSolver = UMFPackBackend; - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); - - // the non-linear solver - using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; - NewtonSolver nonLinearSolver(assembler, linearSolver); - - // time loop - timeLoop->start(); do - { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - // linearize & solve - nonLinearSolver.solve(x, *timeLoop); - - // update the exact time temperature - problem->updateExactTemperature(x, timeLoop->time()+timeLoop->timeStepSize()); - - // make the new solution the old solution - xOld = x; - gridVariables->advanceTimeStep(); - - // advance to the time loop to the next step - timeLoop->advanceTimeStep(); - - // write vtk output - if (timeLoop->timeStepIndex()==0 || timeLoop->timeStepIndex() % vtkOutputInterval == 0 || timeLoop->willBeFinished()) - vtkWriter.write(timeLoop->time()); - - // report statistics of this time step - timeLoop->reportTimeStep(); - - // set new dt as suggested by the newton solver - timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); - - } while (!timeLoop->finished()); - - timeLoop->finalize(leafGridView.comm()); - - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/false); - - return 0; - - } - catch (Dumux::ParameterException &e) - { - std::cerr << std::endl << e << " ---> Abort!" << std::endl; - return 1; - } - catch (Dune::DGFException & e) - { - std::cerr << "DGF exception thrown (" << e << - "). Most likely, the DGF file name is wrong " - "or the DGF file is corrupted, " - "e.g. missing hash at end of file or wrong number (dimensions) of entries." - << " ---> Abort!" << std::endl; - return 2; - } - catch (Dune::Exception &e) - { - std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; - return 3; - } - catch (...) - { - std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; - return 4; - } + using LinearSolver = ILU0BiCGSTABBackend; + auto linearSolver = std::make_shared<LinearSolver>(); + + // the non-linear solver + using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; + NewtonSolver nonLinearSolver(assembler, linearSolver); + + // time loop + timeLoop->start(); do + { + // set previous solution for storage evaluations + assembler->setPreviousSolution(xOld); + + // linearize & solve + nonLinearSolver.solve(x, *timeLoop); + + // update the exact time temperature + problem->updateExactTemperature(x, timeLoop->time()+timeLoop->timeStepSize()); + + // make the new solution the old solution + xOld = x; + gridVariables->advanceTimeStep(); + + // advance to the time loop to the next step + timeLoop->advanceTimeStep(); + + // write vtk output + if (timeLoop->timeStepIndex()==0 || timeLoop->timeStepIndex() % vtkOutputInterval == 0 || timeLoop->willBeFinished()) + vtkWriter.write(timeLoop->time()); + + // report statistics of this time step + timeLoop->reportTimeStep(); + + // set new dt as suggested by the newton solver + timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); + + } while (!timeLoop->finished()); + + timeLoop->finalize(leafGridView.comm()); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/false); + + return 0; + +} +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::DGFException & e) +{ + std::cerr << "DGF exception thrown (" << e << + "). Most likely, the DGF file name is wrong " + "or the DGF file is corrupted, " + "e.g. missing hash at end of file or wrong number (dimensions) of entries." + << " ---> Abort!" << std::endl; + return 2; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 3; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 4; +} diff --git a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc index 1c2903a3fe5f399126a9e4b70a918ee2c523165e..12a429b089c7188832b8067b3d2c1322927e7aba 100644 --- a/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc +++ b/test/porousmediumflow/1pncmin/implicit/test_1pncminni_fv.cc @@ -36,6 +36,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "thermochemproblem.hh" @@ -98,16 +99,15 @@ int main(int argc, char** argv) try // try to create a grid (from the given grid file or the input file) ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh b/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh index 47eca4d035ca4c6d52d9a360fcf328618e8fbefe..6f49329b1c81bdb7beaf6d9c14b4cdae2c43f8ed 100644 --- a/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh +++ b/test/porousmediumflow/1pncmin/implicit/thermochemproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_THERMOCHEM_PROBLEM_HH #define DUMUX_THERMOCHEM_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/porousmediumflow/1pncmin/model.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc index a2704d6b02dfad7cefceac1d537a2b3383c65626..e17049b166566a46a810d8b6befd15612e4929ee 100644 --- a/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc +++ b/test/porousmediumflow/2p/implicit/adaptive/test_2p_adaptive_fv.cc @@ -46,6 +46,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include <dumux/adaptive/adapt.hh> #include <dumux/adaptive/markelements.hh> @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); @@ -149,8 +149,8 @@ int main(int argc, char** argv) try initIndicator.calculate(x); bool wasAdapted = false; - if (markElements(GridCreator::grid(), initIndicator)) - wasAdapted = adapt(GridCreator::grid(), dataTransfer); + if (markElements(gridManager.grid(), initIndicator)) + wasAdapted = adapt(gridManager.grid(), dataTransfer); // update grid data after adaption if (wasAdapted) @@ -165,8 +165,8 @@ int main(int argc, char** argv) try indicator.calculate(x, refineTol, coarsenTol); bool wasAdapted = false; - if (markElements(GridCreator::grid(), indicator)) - wasAdapted = adapt(GridCreator::grid(), dataTransfer); + if (markElements(gridManager.grid(), indicator)) + wasAdapted = adapt(gridManager.grid(), dataTransfer); // update grid data after adaption if (wasAdapted) @@ -220,8 +220,8 @@ int main(int argc, char** argv) try // mark elements and maybe adapt grid bool wasAdapted = false; - if (markElements(GridCreator::grid(), indicator)) - wasAdapted = adapt(GridCreator::grid(), dataTransfer); + if (markElements(gridManager.grid(), indicator)) + wasAdapted = adapt(gridManager.grid(), dataTransfer); if (wasAdapted) { diff --git a/test/porousmediumflow/2p/implicit/boxdfm/problem.hh b/test/porousmediumflow/2p/implicit/boxdfm/problem.hh index 258385a9d707ae236995e982d43b10f871fd58cc..f09456fef0a9ff93acddfcb5a11b8ef744621f26 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/problem.hh +++ b/test/porousmediumflow/2p/implicit/boxdfm/problem.hh @@ -23,6 +23,14 @@ #ifndef DUMUX_INCOMPRESSIBLE_TWOPBOXDFM_TEST_PROBLEM_HH #define DUMUX_INCOMPRESSIBLE_TWOPBOXDFM_TEST_PROBLEM_HH +#if HAVE_DUNE_ALUGRID +#include <dune/alugrid/grid.hh> +#endif +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/components/trichloroethene.hh> #include <dumux/material/components/simpleh2o.hh> #include <dumux/material/fluidsystems/1pliquid.hh> diff --git a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc index dac6d77ed3842b4a0f8d533649035775ea691d43..cc85df984411b095ee4353eb463edd72a47fafa1 100644 --- a/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc +++ b/test/porousmediumflow/2p/implicit/boxdfm/test_2pboxdfm.cc @@ -47,6 +47,7 @@ #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/methods.hh> +#include <dumux/io/grid/gridmanager.hh> #include <dumux/porousmediumflow/boxdfm/vtkoutputmodule.hh> @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh b/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh index dd80e513066eeed9819cf73b4be454581355eab1..5850c3b1f660ce0de375f35f098daac655221230 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh +++ b/test/porousmediumflow/2p/implicit/cornerpoint/problem.hh @@ -25,7 +25,6 @@ #include <opm/grid/CpGrid.hpp> -#include <dumux/io/cpgridcreator.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/material/components/trichloroethene.hh> @@ -74,9 +73,6 @@ public: using type = TwoPCornerPointTestSpatialParams<FVGridGeometry, Scalar>; }; -// Set the grid creator -SET_TYPE_PROP(TwoPCornerPoint, GridCreator, CpGridCreator); - // Enable caching SET_BOOL_PROP(TwoPCornerPoint, EnableGridVolumeVariablesCache, false); SET_BOOL_PROP(TwoPCornerPoint, EnableGridFluxVariablesCache, false); @@ -105,7 +101,6 @@ class TwoPCornerPointTestProblem : public PorousMediumFlowProblem<TypeTag> using GlobalPosition = typename Element::Geometry::GlobalCoordinate; using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector); using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices; - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); enum { dimWorld = GridView::dimensionworld }; public: @@ -178,7 +173,7 @@ public: { NumEqVector values(0.0); - int eIdx = GridCreator::grid().leafGridView().indexSet().index(element); + int eIdx = this->fvGridGeometry().gridView().indexSet().index(element); if (eIdx == injectionElement_) values[FluidSystem::phase1Idx] = injectionRate_/element.geometry().volume(); diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/spatialparams.hh b/test/porousmediumflow/2p/implicit/cornerpoint/spatialparams.hh index 66daf1148bbe29aa4f6113a3699ab4696221fd6a..1e8ee307f76f4eddb6c8a18b4f7265467d4b42cb 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/spatialparams.hh +++ b/test/porousmediumflow/2p/implicit/cornerpoint/spatialparams.hh @@ -23,7 +23,7 @@ #ifndef DUMUX_TWOP_CORNERPOINT_TEST_SPATIAL_PARAMS_HH #define DUMUX_TWOP_CORNERPOINT_TEST_SPATIAL_PARAMS_HH -#include <dumux/io/cpgridcreator.hh> +#include <dumux/io/grid/cpgridcreator.hh> #include <dumux/material/spatialparams/fv.hh> #include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh> #include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh> @@ -44,7 +44,6 @@ class TwoPCornerPointTestSpatialParams using SubControlVolume = typename FVElementGeometry::SubControlVolume; using ThisType = TwoPCornerPointTestSpatialParams<FVGridGeometry, Scalar>; using ParentType = FVSpatialParams<FVGridGeometry, Scalar, ThisType>; - using GridCreator = CpGridCreator; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; @@ -63,11 +62,11 @@ public: { homogeneous_ = getParam<bool>("Problem.Homogeneous"); - const std::vector<int>& globalCell = GridCreator::grid().globalCell(); + const std::vector<int>& globalCell = this->fvGridGeometry().grid().globalCell(); - if (GridCreator::deck().hasKeyword("PORO")) { + if (CpGridCreator::deck().hasKeyword("PORO")) { std::cout << "Found PORO..." << std::endl; - std::vector<double> eclVector = GridCreator::deck().getKeyword("PORO").getRawDoubleData(); + std::vector<double> eclVector = CpGridCreator::deck().getKeyword("PORO").getRawDoubleData(); porosity_.resize(globalCell.size()); for (size_t i = 0; i < globalCell.size(); ++i) { @@ -78,9 +77,9 @@ public: } } - if (GridCreator::deck().hasKeyword("PERMX")) { + if (CpGridCreator::deck().hasKeyword("PERMX")) { std::cout << "Found PERMX..." << std::endl; - std::vector<double> eclVector = GridCreator::deck().getKeyword("PERMX").getRawDoubleData(); + std::vector<double> eclVector = CpGridCreator::deck().getKeyword("PERMX").getRawDoubleData(); permX_.resize(globalCell.size()); for (size_t i = 0; i < globalCell.size(); ++i) { @@ -92,9 +91,9 @@ public: } } - if (GridCreator::deck().hasKeyword("PERMZ")) { + if (CpGridCreator::deck().hasKeyword("PERMZ")) { std::cout << "Found PERMZ..." << std::endl; - std::vector<double> eclVector = GridCreator::deck().getKeyword("PERMZ").getRawDoubleData(); + std::vector<double> eclVector = CpGridCreator::deck().getKeyword("PERMZ").getRawDoubleData(); permZ_.resize(globalCell.size()); for (size_t i = 0; i < globalCell.size(); ++i) { @@ -129,7 +128,7 @@ public: const SubControlVolume& scv, const ElementSolution& elemSol) const { - int eIdx = GridCreator::grid().leafGridView().indexSet().index(element); + int eIdx = this->fvGridGeometry().gridView().indexSet().index(element); PermeabilityType K(0); K[0][0] = K[1][1] = permX_[eIdx]; @@ -151,7 +150,7 @@ public: const SubControlVolume& scv, const ElementSolution& elemSol) const { - int eIdx = GridCreator::grid().leafGridView().indexSet().index(element); + int eIdx = this->fvGridGeometry().gridView().indexSet().index(element); return porosity_[eIdx]; } diff --git a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc index b291a8eef661ea81e9c9da28389ff61cd4556b5f..eb7436cc7aab1645ef295a51136ea7d484202f87 100644 --- a/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc +++ b/test/porousmediumflow/2p/implicit/cornerpoint/test_2p_cornerpoint.cc @@ -56,6 +56,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/cpgridcreator.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -107,16 +108,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + CpGridCreator::makeGrid(); + CpGridCreator::loadBalance(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = CpGridCreator::grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc index 6090dc310d7054ba982bd8740ca3e91eb2aa1186..ca4bbbc07f2a6a0779e64fb16979021ff720d424 100644 --- a/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc +++ b/test/porousmediumflow/2p/implicit/fracture/test_2p_fracture_fv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -82,16 +83,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p/implicit/incompressible/problem.hh b/test/porousmediumflow/2p/implicit/incompressible/problem.hh index bf8cb8a6b767d09cfff1d3234e22e2c0ba054c69..5d630ec5953c05dc6cb4c51916c101732d4f64db 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/problem.hh +++ b/test/porousmediumflow/2p/implicit/incompressible/problem.hh @@ -23,6 +23,8 @@ #ifndef DUMUX_INCOMPRESSIBLE_TWOP_TEST_PROBLEM_HH #define DUMUX_INCOMPRESSIBLE_TWOP_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/box/properties.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> diff --git a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc index daac6cf940a40adec59f2530569db2aa503375e8..4df2e90942f7a9e15789156babb72b1700acea48 100644 --- a/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc +++ b/test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh b/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh index c75513a24919307b26da354e738c6d1bcb2032a6..b94828c3efd62c3f24e171a5932fdfd8166a0991 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh +++ b/test/porousmediumflow/2p/implicit/nonisothermal/problem.hh @@ -27,6 +27,14 @@ #ifndef DUMUX_INJECTION_PROBLEM_2PNI_HH #define DUMUX_INJECTION_PROBLEM_2PNI_HH +#if HAVE_DUNE_ALUGRID +#include <dune/alugrid/grid.hh> +#endif +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/common/properties.hh> #include <dumux/porousmediumflow/2p/model.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc index 22b8215f5ec39379dcaa08e241f8b835cd691a55..81228335c8177c1177126ae840fad3a22eadf215 100644 --- a/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc +++ b/test/porousmediumflow/2p/implicit/nonisothermal/test_2pni_fv.cc @@ -43,6 +43,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "problem.hh" @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh index ec8494cf5bd31f2ac54fe19c8239d40c3782a4d7..f79049eec1204eac6455d649e720e616157d750c 100644 --- a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh @@ -24,6 +24,9 @@ #ifndef DUMUX_TEST_3D2P_PROBLEM_HH #define DUMUX_TEST_3D2P_PROBLEM_HH +#if HAVE_DUNE_ALUGRID +#include <dune/alugrid/grid.hh> +#endif #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/fluidsystems/1pgas.hh> diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh index 76e27426be8ba54f925dc1058afaa68a7a1ecc91..a71ae2f09d390ce0c4c6df68cb346396423fe8f2 100644 --- a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh @@ -24,6 +24,9 @@ #ifndef DUMUX_TEST_IMPES_ADAPTIVE_PROBLEM_HH #define DUMUX_TEST_IMPES_ADAPTIVE_PROBLEM_HH +#if HAVE_DUNE_ALUGRID +#include <dune/alugrid/grid.hh> +#endif #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/simpleh2o.hh> diff --git a/test/porousmediumflow/2p/sequential/test_impesproblem.hh b/test/porousmediumflow/2p/sequential/test_impesproblem.hh index 24b57e8a43d689dc61832a688648351e4d7bfd56..7dafa1e5ca979aff8efe1639ee91b334ede66796 100644 --- a/test/porousmediumflow/2p/sequential/test_impesproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_TEST_IMPES_PROBLEM_HH #define DUMUX_TEST_IMPES_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/simpleh2o.hh> @@ -98,9 +100,8 @@ NEW_TYPE_TAG(IMPESTestWithAMGTypeTag, INHERITS_FROM(IMPESTestTypeTag)); SET_TYPE_PROP(IMPESTestWithAMGTypeTag, LinearSolver, AMGBackend<TypeTag>); // Set the grid type SET_TYPE_PROP(IMPESTestWithAMGTypeTag, Grid, Dune::YaspGrid<2>); -// Set the grid creator -SET_TYPE_PROP(IMPESTestWithAMGTypeTag, GridCreator, GridCreator<TypeTag>); -} + +} // end namespace Properties /*! * \ingroup SequentialTwoPTests diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh index 302c32854fbf533689185ad009be1cceb53c983a..dc8fe92c859f88be6a89b3128335655f704bb9c1 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh @@ -24,6 +24,11 @@ #ifndef DUMUX_TEST_MPFA2P_PROBLEM_HH #define DUMUX_TEST_MPFA2P_PROBLEM_HH +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/2pimmiscible.hh> #include <dumux/material/fluidsystems/1pliquid.hh> #include <dumux/material/components/simpleh2o.hh> diff --git a/test/porousmediumflow/2p/sequential/test_transportproblem.hh b/test/porousmediumflow/2p/sequential/test_transportproblem.hh index c8c80c786369dc0627a97558f2a8e8cfe9d59131..bd08a4799ae875a96f031db535149d6e1ba964e1 100644 --- a/test/porousmediumflow/2p/sequential/test_transportproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_transportproblem.hh @@ -24,6 +24,7 @@ #ifndef DUMUX_TEST_TRANSPORT_PROBLEM_HH #define DUMUX_TEST_TRANSPORT_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> #include <dune/grid/io/file/dgfparser/dgfyasp.hh> #include <dumux/material/fluidsystems/1pliquid.hh> diff --git a/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh b/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh index 6baa7d3514bda26023255a56af6e0e8efff7871b..1ca802b5a2b78b32f4ae3be005440567848d979c 100644 --- a/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh +++ b/test/porousmediumflow/2p1c/implicit/steaminjectionproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_STEAM_INJECTIONPROBLEM_HH #define DUMUX_STEAM_INJECTIONPROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/2p1c/model.hh> diff --git a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc index f6ec0b61d786ab39e0aef9b6e4e7a04899e6badd..9f869544a52fdea9ae96715dfdcaeca717a7b72c 100644 --- a/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc +++ b/test/porousmediumflow/2p1c/implicit/test_2p1c_fv.cc @@ -20,135 +20,135 @@ * \file * * \brief test for the 1pnc model - */ - #include <config.h> +*/ +#include <config.h> - #include "steaminjectionproblem.hh" +#include "steaminjectionproblem.hh" - #include <ctime> - #include <iostream> +#include <ctime> +#include <iostream> - #include <dune/common/parallel/mpihelper.hh> - #include <dune/common/timer.hh> - #include <dune/grid/io/file/dgfparser/dgfexception.hh> - #include <dune/grid/io/file/vtk.hh> - #include <dune/istl/io.hh> +#include <dune/common/parallel/mpihelper.hh> +#include <dune/common/timer.hh> +#include <dune/grid/io/file/dgfparser/dgfexception.hh> +#include <dune/grid/io/file/vtk.hh> +#include <dune/istl/io.hh> - #include <dumux/discretization/methods.hh> +#include <dumux/discretization/methods.hh> - #include <dumux/common/properties.hh> - #include <dumux/common/parameters.hh> - #include <dumux/common/dumuxmessage.hh> - #include <dumux/common/defaultusagemessage.hh> +#include <dumux/common/properties.hh> +#include <dumux/common/parameters.hh> +#include <dumux/common/dumuxmessage.hh> +#include <dumux/common/defaultusagemessage.hh> - #include <dumux/linear/seqsolverbackend.hh> - #include <dumux/nonlinear/privarswitchnewtonsolver.hh> +#include <dumux/linear/seqsolverbackend.hh> +#include <dumux/nonlinear/privarswitchnewtonsolver.hh> - #include <dumux/assembly/fvassembler.hh> +#include <dumux/assembly/fvassembler.hh> - #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> - int main(int argc, char** argv) try - { - using namespace Dumux; +int main(int argc, char** argv) try +{ + using namespace Dumux; - // define the type tag for this problem - using TypeTag = TTAG(TYPETAG); + // define the type tag for this problem + using TypeTag = TTAG(TYPETAG); - //////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); + // initialize MPI, finalize is done automatically on exit + const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - // print dumux start message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/true); + // print dumux start message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/true); - // initialize parameter tree - Parameters::init(argc, argv); + // initialize parameter tree + Parameters::init(argc, argv); - ////////////////////////////////////////////////////////////////////// - // try to create a grid (from the given grid file or the input file) - ///////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // try to create a grid (from the given grid file or the input file) + ///////////////////////////////////////////////////////////////////// - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); - //////////////////////////////////////////////////////////// - // run instationary non-linear problem on this grid - //////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////// + // run instationary non-linear problem on this grid + //////////////////////////////////////////////////////////// - // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + // we compute on the leaf grid view + const auto& leafGridView = gridManager.grid().leafGridView(); - // create the finite volume grid geometry - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); - auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); - fvGridGeometry->update(); + // create the finite volume grid geometry + using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); + fvGridGeometry->update(); - // the problem (initial and boundary conditions) - using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - auto problem = std::make_shared<Problem>(fvGridGeometry); + // the problem (initial and boundary conditions) + using Problem = typename GET_PROP_TYPE(TypeTag, Problem); + auto problem = std::make_shared<Problem>(fvGridGeometry); - // the solution vector - using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); - SolutionVector x(fvGridGeometry->numDofs()); - problem->applyInitialSolution(x); - auto xOld = x; + // the solution vector + using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); + SolutionVector x(fvGridGeometry->numDofs()); + problem->applyInitialSolution(x); + auto xOld = x; - // the grid variables - using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); - auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); - gridVariables->init(x, xOld); + // the grid variables + using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); + auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry); + gridVariables->init(x, xOld); - // get some time loop parameters - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); - auto dt = getParam<Scalar>("TimeLoop.DtInitial"); - auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); + // get some time loop parameters + using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); + auto tEnd = getParam<Scalar>("TimeLoop.TEnd"); + auto dt = getParam<Scalar>("TimeLoop.DtInitial"); + auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize"); - // intialize the vtk output module - VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); - using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); - VtkOutputFields::init(vtkWriter); //!< Add model specific output fields - vtkWriter.write(0.0); + // intialize the vtk output module + VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name()); + using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields); + VtkOutputFields::init(vtkWriter); //!< Add model specific output fields + vtkWriter.write(0.0); - // instantiate time loop - auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); - timeLoop->setMaxTimeStepSize(maxDt); + // instantiate time loop + auto timeLoop = std::make_shared<TimeLoop<Scalar>>(0.0, dt, tEnd); + timeLoop->setMaxTimeStepSize(maxDt); - // the assembler with time loop for instationary problem - using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; - auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); + // the assembler with time loop for instationary problem + using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>; + auto assembler = std::make_shared<Assembler>(problem, fvGridGeometry, gridVariables, timeLoop); - // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); + // the linear solver + using LinearSolver = ILU0BiCGSTABBackend; + auto linearSolver = std::make_shared<LinearSolver>(); - // the non-linear solver - using PrimaryVariableSwitch = typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch); - using NewtonSolver = Dumux::PriVarSwitchNewtonSolver<Assembler, LinearSolver, PrimaryVariableSwitch>; - NewtonSolver nonLinearSolver(assembler, linearSolver); + // the non-linear solver + using PrimaryVariableSwitch = typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch); + using NewtonSolver = Dumux::PriVarSwitchNewtonSolver<Assembler, LinearSolver, PrimaryVariableSwitch>; + NewtonSolver nonLinearSolver(assembler, linearSolver); - // time loop - timeLoop->start(); do - { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); + // time loop + timeLoop->start(); do + { + // set previous solution for storage evaluations + assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control - nonLinearSolver.solve(x, *timeLoop); + // solve the non-linear system with time step control + nonLinearSolver.solve(x, *timeLoop); - // make the new solution the old solution - xOld = x; - gridVariables->advanceTimeStep(); + // make the new solution the old solution + xOld = x; + gridVariables->advanceTimeStep(); - // advance to the time loop to the next step - timeLoop->advanceTimeStep(); + // advance to the time loop to the next step + timeLoop->advanceTimeStep(); - // write vtk output + // write vtk output vtkWriter.write(timeLoop->time()); // report statistics of this time step @@ -157,42 +157,42 @@ // set new dt as suggested by the newton solver timeLoop->setTimeStepSize(nonLinearSolver.suggestTimeStepSize(timeLoop->timeStepSize())); - } while (!timeLoop->finished()); - - timeLoop->finalize(leafGridView.comm()); - - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - DumuxMessage::print(/*firstCall=*/false); - - return 0; - - } - catch (Dumux::ParameterException &e) - { - std::cerr << std::endl << e << " ---> Abort!" << std::endl; - return 1; - } - catch (Dune::DGFException & e) - { - std::cerr << "DGF exception thrown (" << e << - "). Most likely, the DGF file name is wrong " - "or the DGF file is corrupted, " - "e.g. missing hash at end of file or wrong number (dimensions) of entries." - << " ---> Abort!" << std::endl; - return 2; - } - catch (Dune::Exception &e) - { - std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; - return 3; - } - catch (...) - { - std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; - return 4; - } + } while (!timeLoop->finished()); + + timeLoop->finalize(leafGridView.comm()); + + //////////////////////////////////////////////////////////// + // finalize, print dumux message to say goodbye + //////////////////////////////////////////////////////////// + + // print dumux end message + if (mpiHelper.rank() == 0) + DumuxMessage::print(/*firstCall=*/false); + + return 0; + +} +catch (Dumux::ParameterException &e) +{ + std::cerr << std::endl << e << " ---> Abort!" << std::endl; + return 1; +} +catch (Dune::DGFException & e) +{ + std::cerr << "DGF exception thrown (" << e << + "). Most likely, the DGF file name is wrong " + "or the DGF file is corrupted, " + "e.g. missing hash at end of file or wrong number (dimensions) of entries." + << " ---> Abort!" << std::endl; + return 2; +} +catch (Dune::Exception &e) +{ + std::cerr << "Dune reported error: " << e << " ---> Abort!" << std::endl; + return 3; +} +catch (...) +{ + std::cerr << "Unknown exception thrown! ---> Abort!" << std::endl; + return 4; +} diff --git a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh index a68d033caf3db25e64b12cbb732e9ea7730c0e11..b1664984861e68700e295a4a4f14eede046dd451 100644 --- a/test/porousmediumflow/2p2c/implicit/injectionproblem.hh +++ b/test/porousmediumflow/2p2c/implicit/injectionproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_INJECTION_PROBLEM_HH #define DUMUX_INJECTION_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/mpfa/properties.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc index 6d481bae8a91015375be13b0530b793d6c3441c8..1aeb4f518ddd850ebf299cf8e6c8995a0072c024 100644 --- a/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/mpnccomparison/test_2p2c_comparison_fv.cc @@ -44,6 +44,7 @@ #include <dumux/assembly/diffmethod.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "2p2c_comparison_problem.hh" @@ -94,16 +95,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc index 1b86e04ba7cc00ff355e3f9513ed3c0ede80ef9b..2e6f3fe159a3691cecc4ab6d09bfc446bc02f7dc 100644 --- a/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc +++ b/test/porousmediumflow/2p2c/implicit/test_2p2c_fv.cc @@ -46,6 +46,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // the problem definitions #include "injectionproblem.hh" @@ -69,16 +70,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2p2c/implicit/waterairproblem.hh b/test/porousmediumflow/2p2c/implicit/waterairproblem.hh index cfbc5518d399f6712b97e3cc7cdafd43aabae9bd..4842f3329a3703be0673d08290c28f70efc6b6ab 100644 --- a/test/porousmediumflow/2p2c/implicit/waterairproblem.hh +++ b/test/porousmediumflow/2p2c/implicit/waterairproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_WATER_AIR_PROBLEM_HH #define DUMUX_WATER_AIR_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/discretization/methods.hh> diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh index 9d7965b0fda8426ba4a4c3b9c4754387beacb204..8e93d1e7214d6af5c677cc07bdf5ec40ff5c885b 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh @@ -24,6 +24,11 @@ #ifndef DUMUX_TEST_ADAPTIVE2D_2P2C_PROBLEM_HH #define DUMUX_TEST_ADAPTIVE2D_2P2C_PROBLEM_HH +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/common/math.hh> #include <dumux/porousmediumflow/2p2c/sequential/adaptiveproperties.hh> #include <dumux/porousmediumflow/2p2c/sequential/problem.hh> diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh index 4657fded674b90fd7eba71a448fbbf241cdc3e0e..cff99b2e3d933308893191cdf8c4f6d2e9ebdbb0 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh @@ -24,6 +24,11 @@ #ifndef DUMUX_TEST_ADAPTIVE3D_2P2C_PROBLEM_HH #define DUMUX_TEST_ADAPTIVE3D_2P2C_PROBLEM_HH +#if HAVE_UG +#include <dune/grid/uggrid.hh> +#endif +#include <dune/grid/yaspgrid.hh> + #include <dumux/common/math.hh> #include <dumux/porousmediumflow/2p2c/sequential/adaptiveproperties.hh> #include <dumux/porousmediumflow/2p2c/sequential/problem.hh> diff --git a/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh index 7f208d5bea02817295954ec88ce9a8e50fe3b2d7..6148999c241e90f6a224485e9cf5da8189f1b23e 100644 --- a/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_dec2p2cproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_TEST_2P2C_PROBLEM_HH #define DUMUX_TEST_2P2C_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/porousmediumflow/2p2c/sequential/problem.hh> #include <dumux/porousmediumflow/2p2c/sequential/fvpressure.hh> #include <dumux/porousmediumflow/2p2c/sequential/fvtransport.hh> diff --git a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh index f1527b6086d1ec214e96aaeb1e5e42143704ba5c..619ede2893e313191d8b17db09487c90b352bba2 100644 --- a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_TEST_2P2C_PROBLEM_HH #define DUMUX_TEST_2P2C_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/porousmediumflow/2p2c/sequential/problem.hh> #include <dumux/porousmediumflow/2p2c/sequential/fvpressuremultiphysics.hh> #include <dumux/porousmediumflow/2p2c/sequential/fvtransportmultiphysics.hh> diff --git a/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh b/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh index cd1f3a0ac42a4968268e9c01e1158c57a7f30294..5296da54883ec581f996c64fbb27da7cf69720cf 100644 --- a/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh +++ b/test/porousmediumflow/2pnc/implicit/2pncdiffusionproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_TWOPNC_DIFFUSION_PROBLEM_HH #define DUMUX_TWOPNC_DIFFUSION_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> #include <dumux/porousmediumflow/2pnc/model.hh> diff --git a/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh b/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh index c4f2e2037d3501a2a6400b5746fecae5d1e59d9d..f6fec3a4f98d8ee394d4f83569a0594998d8206c 100644 --- a/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh +++ b/test/porousmediumflow/2pnc/implicit/fuelcellproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_FUELCELL_PROBLEM_HH #define DUMUX_FUELCELL_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc index 21750d4981c2680cb3fca3793e36fdd17fa8a795..8b4349cbb69d44f3251fcfadef8ca870a9dcb5a4 100644 --- a/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc +++ b/test/porousmediumflow/2pnc/implicit/test_2pnc_fv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "fuelcellproblem.hh" @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc index 31870b972c8c13143b81ff9cbfb81d2d8e9296ea..eaa00f5ba116f21c5a72a74596f0da8a70ea7e40 100644 --- a/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc +++ b/test/porousmediumflow/2pnc/implicit/test_cc2pnc_diffusion.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -91,16 +92,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh b/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh index de3a9490692bedacc9a80ef7ce34b28d7644c8a3..d64422a5485815e65fe8cdcf372adbcc63521305 100644 --- a/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh +++ b/test/porousmediumflow/2pncmin/implicit/dissolutionproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_DISSOLUTION_PROBLEM_HH #define DUMUX_DISSOLUTION_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/methods.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc index 1ccc7b74a2a18bc6bca8b7b1e58e3fa2f759b190..47c64c82c140f314f2b6516188fb74473a0e664a 100644 --- a/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc +++ b/test/porousmediumflow/2pncmin/implicit/test_2pncmin_fv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -91,16 +92,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh b/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh index 87f1f03db67b7fcdf59b0713d1b17cc036029a14..49fc43ed7979d763d28f89a966301fece2b81596 100644 --- a/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh +++ b/test/porousmediumflow/3p/implicit/3pniconductionproblem.hh @@ -25,7 +25,8 @@ #ifndef DUMUX_3PNI_CONDUCTION_PROBLEM_HH #define DUMUX_3PNI_CONDUCTION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh b/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh index a08cfca359d363015cba9899e5eda1ee65f23048..8e3f52422bea2d0b1a1dcd687dee1fa42667a146 100644 --- a/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh +++ b/test/porousmediumflow/3p/implicit/3pniconvectionproblem.hh @@ -25,7 +25,8 @@ #ifndef DUMUX_3PNI_CONVECTION_PROBLEM_HH #define DUMUX_3PNI_CONVECTION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/3p/implicit/test_3p_fv.cc b/test/porousmediumflow/3p/implicit/test_3p_fv.cc index 6a17a142b3806e16db6dd03e1ccc42b79202c405..de385c23203bd4b5a70cd5300359607400585dd5 100644 --- a/test/porousmediumflow/3p/implicit/test_3p_fv.cc +++ b/test/porousmediumflow/3p/implicit/test_3p_fv.cc @@ -47,6 +47,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -98,16 +99,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc index 7ea429bfedf02c61fa632761c3d5943c2e562df7..d04de7bf5e34b6155cec61d1148fabc3131f8dc7 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_conduction.cc @@ -47,6 +47,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -98,16 +99,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc index dcaf2bcac876a466e0ed91a20cad72ae5a7accde..b36e7ffd66d623c92b126ce1a7fbf35324f1017d 100644 --- a/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc +++ b/test/porousmediumflow/3p/implicit/test_3pni_fv_convection.cc @@ -47,6 +47,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -98,16 +99,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh b/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh index 1afb0749bafb3b350c7a9274880806294f2fd5f5..10c08741bc5982fec5119b8bb9d60f425dc0c14b 100644 --- a/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh +++ b/test/porousmediumflow/3p3c/implicit/columnxylolproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_COLUMNXYLOLPROBLEM_HH #define DUMUX_COLUMNXYLOLPROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/material/fluidsystems/h2oairxylene.hh> #include <dumux/material/solidstates/compositionalsolidstate.hh> #include <dumux/material/solidsystems/compositionalsolidphase.hh> diff --git a/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh b/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh index 711383004d287b0019a0a6366e1c9fd7f484fbde..55bd88117da47e1df17a111d7d9d87d1b34720f5 100644 --- a/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh +++ b/test/porousmediumflow/3p3c/implicit/infiltration3p3cproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_INFILTRATION_THREEPTHREEC_PROBLEM_HH #define DUMUX_INFILTRATION_THREEPTHREEC_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh b/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh index 0fbc105e51bf2fdadc4d62cac184e5b32966f826..88c7601ee4aff42e25be3ec8017be57a2d561df9 100644 --- a/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh +++ b/test/porousmediumflow/3p3c/implicit/kuevetteproblem.hh @@ -27,6 +27,7 @@ #define DUMUX_KUEVETTE3P3CNIPROBLEM_HH #include <dune/common/float_cmp.hh> +#include <dune/grid/yaspgrid.hh> #include <dumux/material/fluidsystems/h2oairmesitylene.hh> #include <dumux/material/components/constant.hh> diff --git a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc index d656cad00b0712e86d79e25f0fc4f1232f8669f8..86c7031199f2bdcb6ca3877f7071646a93a5dcc0 100644 --- a/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc +++ b/test/porousmediumflow/3p3c/implicit/test_3p3c_fv.cc @@ -45,6 +45,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "infiltration3p3cproblem.hh" #include "kuevetteproblem.hh" @@ -98,16 +99,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh index 6e6e7c5f2b7fd1efce118c7775db9d4e505319ce..a5733fecd71ebd4e422a4234770fe6d216f4f013 100644 --- a/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh +++ b/test/porousmediumflow/3pwateroil/implicit/3pwateroilsagdproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_SAGDPROBLEM_HH #define DUMUX_SAGDPROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/porousmediumflow/problem.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc index bbf72d26335a1ffa26e950b4122b69ca3bbd6e13..e809fc4149804e8de78b5283883a94edbde4adff 100644 --- a/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc +++ b/test/porousmediumflow/3pwateroil/implicit/test_box3pwateroil.cc @@ -45,6 +45,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "3pwateroilsagdproblem.hh" @@ -95,16 +96,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh index 6a0765938acaf8e0e469accc84f7601b95a4b1c1..9447df13b1f2519808f8d2cf79c35c3ef3caf5fd 100644 --- a/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh +++ b/test/porousmediumflow/co2/implicit/heterogeneousproblem.hh @@ -24,6 +24,10 @@ #ifndef DUMUX_HETEROGENEOUS_PROBLEM_HH #define DUMUX_HETEROGENEOUS_PROBLEM_HH +#if HAVE_DUNE_ALUGRID +#include <dune/alugrid/grid.hh> +#endif + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> @@ -55,15 +59,14 @@ NEW_TYPE_TAG(HeterogeneousBoxTypeTag, INHERITS_FROM(BoxModel, HeterogeneousTypeT NEW_TYPE_TAG(HeterogeneousCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, HeterogeneousTypeTag)); //Set the grid type -#if HAVE_DUNE_ALUGRID SET_TYPE_PROP(HeterogeneousTypeTag, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>); -#endif // Set the problem property SET_TYPE_PROP(HeterogeneousTypeTag, Problem, HeterogeneousProblem<TypeTag>); // Set the spatial parameters -SET_TYPE_PROP(HeterogeneousTypeTag, SpatialParams, HeterogeneousSpatialParams<TypeTag>); +SET_TYPE_PROP(HeterogeneousTypeTag, SpatialParams, HeterogeneousSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), + typename GET_PROP_TYPE(TypeTag, Scalar)>); // Set fluid configuration SET_TYPE_PROP(HeterogeneousTypeTag, FluidSystem, FluidSystems::BrineCO2<typename GET_PROP_TYPE(TypeTag, Scalar), @@ -84,7 +87,8 @@ SET_TYPE_PROP(HeterogeneousNITypeTag, Grid, Dune::ALUGrid<2, 2, Dune::cube, Dune SET_TYPE_PROP(HeterogeneousNITypeTag, Problem, HeterogeneousProblem<TypeTag>); // Set the spatial parameters -SET_TYPE_PROP(HeterogeneousNITypeTag, SpatialParams, HeterogeneousSpatialParams<TypeTag>); +SET_TYPE_PROP(HeterogeneousNITypeTag, SpatialParams,HeterogeneousSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), + typename GET_PROP_TYPE(TypeTag, Scalar)>); // Set fluid configuration SET_TYPE_PROP(HeterogeneousNITypeTag, FluidSystem, FluidSystems::BrineCO2<typename GET_PROP_TYPE(TypeTag, Scalar), @@ -185,8 +189,9 @@ public: * \param timeManager The time manager * \param gridView The grid view */ - HeterogeneousProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry) + template<class SpatialParams> + HeterogeneousProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, std::shared_ptr<SpatialParams> spatialParams) + : ParentType(fvGridGeometry, spatialParams) , injectionTop_(1) , injectionBottom_(2) , dirichletBoundary_(3) diff --git a/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh b/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh index dd7ce0edea38d9c9ebfa01f5e350cb4f8ad21c53..1f685f89398447c65899c731bf2c9bad76907284 100644 --- a/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh +++ b/test/porousmediumflow/co2/implicit/heterogeneousspatialparameters.hh @@ -27,6 +27,7 @@ #ifndef DUMUX_HETEROGENEOUS_SPATIAL_PARAMS_HH #define DUMUX_HETEROGENEOUS_SPATIAL_PARAMS_HH +#include <dumux/io/grid/griddata.hh> #include <dumux/material/spatialparams/fv.hh> #include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh> #include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh> @@ -42,21 +43,19 @@ namespace Dumux { * problem which uses the non-isothermal or isothermal CO2 * fully implicit model. */ -template<class TypeTag> +template<class FVGridGeometry, class Scalar> class HeterogeneousSpatialParams -: public FVSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar), - HeterogeneousSpatialParams<TypeTag>> +: public FVSpatialParams<FVGridGeometry, + Scalar, + HeterogeneousSpatialParams<FVGridGeometry, Scalar>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using Grid = typename FVGridGeometry::Grid; using GridView = typename FVGridGeometry::GridView; using FVElementGeometry = typename FVGridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using Element = typename GridView::template Codim<0>::Entity; - using ParentType = FVSpatialParams<FVGridGeometry, Scalar, HeterogeneousSpatialParams<TypeTag>>; + using ParentType = FVSpatialParams<FVGridGeometry, Scalar, HeterogeneousSpatialParams<FVGridGeometry, Scalar>>; - enum { dimWorld = GridView::dimensionworld }; using GlobalPosition = typename SubControlVolume::GlobalPosition; using EffectiveLaw = RegularizedBrooksCorey<Scalar>; @@ -71,8 +70,9 @@ public: * * \param gridView The grid view */ - HeterogeneousSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry) + HeterogeneousSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry, + std::shared_ptr<const GridData<Grid>> gridData) + : ParentType(fvGridGeometry), gridData_(gridData) { //Set the permeability for the layers @@ -101,11 +101,10 @@ public: const auto& gridView = this->fvGridGeometry().gridView(); paramIdx_.resize(gridView.size(0)); - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); for (const auto& element : elements(gridView)) { const auto eIdx = this->fvGridGeometry().elementMapper().index(element); - paramIdx_[eIdx] = GridCreator::parameters(element)[0]; + paramIdx_[eIdx] = gridData_->parameters(element)[0]; } } @@ -203,6 +202,9 @@ public: { return FluidSystem::BrineIdx; } private: + + std::shared_ptr<const GridData<Grid>> gridData_; + int barrierTop_ = 1; int barrierMiddle_ = 2; int reservoir_ = 3; diff --git a/test/porousmediumflow/co2/implicit/test_co2_fv.cc b/test/porousmediumflow/co2/implicit/test_co2_fv.cc index c9e2297ebec09eee239847eaaf193c411d45a88c..85ddce197d22be6f8963e3807ef08ebfbdf68c44 100644 --- a/test/porousmediumflow/co2/implicit/test_co2_fv.cc +++ b/test/porousmediumflow/co2/implicit/test_co2_fv.cc @@ -46,6 +46,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // the problem definitions #include "heterogeneousproblem.hh" @@ -68,25 +69,28 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView); fvGridGeometry->update(); + // the spatial parameters + using SpatialParams = typename GET_PROP_TYPE(TypeTag, SpatialParams); + auto spatialParams = std::make_shared<SpatialParams>(fvGridGeometry, gridManager.getGridData()); + // the problem (initial and boundary conditions) using Problem = typename GET_PROP_TYPE(TypeTag, Problem); - auto problem = std::make_shared<Problem>(fvGridGeometry); + auto problem = std::make_shared<Problem>(fvGridGeometry, spatialParams); // the solution vector using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector); diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh index 46f94f47ca9ef3e8fc69b76fdc94ffbcb5385b43..5ddb383b6dd4c44e4881e989353f03a1ea3526ce 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/mpnc_comparison_problem.hh @@ -25,6 +25,7 @@ #define DUMUX_MPNC_TWOPTWOC_COMPARISON_OBSTACLEPROBLEM_HH #include <dune/common/parametertreeparser.hh> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc index 4b01fdd4f908a32686c378aec52b5d744945c4a8..26324226ba8426b497b6502ce1900d73bd053b5d 100644 --- a/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/2p2ccomparison/test_mpnc_comparison_fv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh b/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh index 3f78d47867097a9c9347622d93ab74f27a852269..ca4b2ec94c191560db0e7c876e6bf6c3e8eca799 100644 --- a/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh +++ b/test/porousmediumflow/mpnc/implicit/combustionproblem1c.hh @@ -27,6 +27,8 @@ #ifndef DUMUX_COMBUSTION_PROBLEM_ONE_COMPONENT_HH #define DUMUX_COMBUSTION_PROBLEM_ONE_COMPONENT_HH +#include <dune/grid/onedgrid.hh> + #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh b/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh index 8727ae7733fc687fba4fb2ad2e85936c3a64f8a9..43f7dcec1e98cd61c290739db157d40c0286b1d2 100644 --- a/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh +++ b/test/porousmediumflow/mpnc/implicit/evaporationatmosphereproblem.hh @@ -39,6 +39,8 @@ // setting it here, because it impacts volume variables and spatialparameters #define USE_PCMAX 1 +#include <dune/grid/yaspgrid.hh> + #include <dumux/common/properties.hh> #include <dumux/discretization/box/properties.hh> diff --git a/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh b/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh index 87136c78ee5248ee41d87a1826c2d82164df6641..1c37becb4626ea56640cdb0f8cb74ed1df3c9058 100644 --- a/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh +++ b/test/porousmediumflow/mpnc/implicit/obstacleproblem.hh @@ -27,6 +27,7 @@ #define DUMUX_OBSTACLEPROBLEM_HH #include <dune/common/parametertreeparser.hh> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc index 2f6e9f2ef03e7a99a21e99b61d24fab545df1e9f..4d0fdb57172ac18b72d2628d81854df3df7a3c90 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpnckinetic.cc @@ -48,6 +48,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -97,16 +98,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc index 7501c698c7c12e55683a6e5e56d95ca81c033a5f..c0a6070ae6d9031719b59ce8e732012a9ffe8294 100644 --- a/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc +++ b/test/porousmediumflow/mpnc/implicit/test_boxmpncthermalnonequil.cc @@ -48,6 +48,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -97,16 +98,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc index 86bdae2d55617673846ec7e4dc7ff17c93c18dcc..6176146751f548feba0b571b553f81d84ae2a111 100644 --- a/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc +++ b/test/porousmediumflow/mpnc/implicit/test_mpnc_obstacle_fv.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh b/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh index f0db44035b39111c2020aa55604af4e24f701da4..993db884bd318298afa9d32f9659aa5257f5d427 100644 --- a/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardsanalyticalproblem.hh @@ -30,6 +30,8 @@ #include <cmath> #include <dune/geometry/quadraturerules.hh> +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/richards/implicit/richardslensproblem.hh b/test/porousmediumflow/richards/implicit/richardslensproblem.hh index 43b022246425c086267e260407f37e00b2dc8c6c..034d0634c6c4c97f5003586e8d66796fc3281d34 100644 --- a/test/porousmediumflow/richards/implicit/richardslensproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardslensproblem.hh @@ -26,6 +26,8 @@ #ifndef DUMUX_RICHARDS_LENSPROBLEM_HH #define DUMUX_RICHARDS_LENSPROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/problem.hh> @@ -60,7 +62,8 @@ SET_TYPE_PROP(RichardsLensTypeTag, Grid, Dune::YaspGrid<2>); SET_TYPE_PROP(RichardsLensTypeTag, Problem, RichardsLensProblem<TypeTag>); // Set the spatial parameters -SET_TYPE_PROP(RichardsLensTypeTag, SpatialParams, RichardsLensSpatialParams<TypeTag>); +SET_TYPE_PROP(RichardsLensTypeTag, SpatialParams, RichardsLensSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), + typename GET_PROP_TYPE(TypeTag, Scalar)>); } // end namespace Dumux /*! diff --git a/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh b/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh index ac19cf890b8dec2d2e05e9d35291b0699adb5150..87cc492cd838b7c3f9291d783e962d49bbada89d 100644 --- a/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh +++ b/test/porousmediumflow/richards/implicit/richardslensspatialparams.hh @@ -37,31 +37,26 @@ namespace Dumux { * \ingroup ImplicitTestProblems * \brief The spatial parameters for the RichardsLensProblem */ -template<class TypeTag> +template<class FVGridGeometry, class Scalar> class RichardsLensSpatialParams -: public FVSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry), - typename GET_PROP_TYPE(TypeTag, Scalar), - RichardsLensSpatialParams<TypeTag>> +: public FVSpatialParams<FVGridGeometry, Scalar, RichardsLensSpatialParams<FVGridGeometry, Scalar>> { - using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); - using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); + using ThisType = RichardsLensSpatialParams<FVGridGeometry, Scalar>; + using ParentType = FVSpatialParams<FVGridGeometry, Scalar, ThisType>; using GridView = typename FVGridGeometry::GridView; - using ParentType = FVSpatialParams<FVGridGeometry, Scalar, RichardsLensSpatialParams<TypeTag>>; - - enum { dimWorld=GridView::dimensionworld }; using Element = typename GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; - using EffectiveLaw = RegularizedVanGenuchten<Scalar>; + enum { dimWorld = GridView::dimensionworld }; public: - using MaterialLaw = EffToAbsLaw<EffectiveLaw>; + using MaterialLaw = EffToAbsLaw<RegularizedVanGenuchten<Scalar>>; using MaterialLawParams = typename MaterialLaw::Params; // export permeability type using PermeabilityType = Scalar; RichardsLensSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry) - : ParentType(fvGridGeometry) + : ParentType(fvGridGeometry) { lensLowerLeft_ = {1.0, 2.0}; diff --git a/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh b/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh index 4679e2a76c847e5c6665abf68098cbd6cb90a00a..8a7fe6dc066bae1ee9cfec1ecf80b6f95c457b78 100644 --- a/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardsniconductionproblem.hh @@ -25,7 +25,8 @@ #ifndef DUMUX_RICHARDS_CONDUCTION_PROBLEM_HH #define DUMUX_RICHARDS_CONDUCTION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh b/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh index c077dc8e02819961fb82ce3041ce5d18e65e5f2c..98491eb70d5ae9fc09c22d6e6aa3f7e2fc9de1ea 100644 --- a/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardsniconvectionproblem.hh @@ -26,7 +26,8 @@ #ifndef DUMUX_RICHARDS_CONVECTION_PROBLEM_HH #define DUMUX_RICHARDS_CONVECTION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh b/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh index 51ba223a93a2b32d78f71e63b16c1607018c89c4..c4d572cbfda8c8967cc5d630fdd405cb9fe4280c 100644 --- a/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh +++ b/test/porousmediumflow/richards/implicit/richardsnievaporationproblem.hh @@ -25,7 +25,8 @@ #ifndef DUMUX_RICHARDS_EVAPORATION_PROBLEM_HH #define DUMUX_RICHARDS_EVAPORATION_PROBLEM_HH -#include <math.h> +#include <cmath> +#include <dune/grid/yaspgrid.hh> #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc index 8b9be9df435726b7c1f96153589fcdcd9d7eb885..a39faff519ce811a807d1188b6b5272bdf2e29f9 100644 --- a/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc +++ b/test/porousmediumflow/richards/implicit/test_ccrichardsanalytical.cc @@ -46,6 +46,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with * reading in parameters. @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc index 1550ec49da78fe7301c5ce8b9cdbbb6deb171409..d6190f237dea57abc423c42f9c7f817a3c2f016b 100644 --- a/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardslens_fv.cc @@ -23,8 +23,6 @@ */ #include <config.h> -#include "richardslensproblem.hh" - #include <ctime> #include <iostream> @@ -46,31 +44,9 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> -/*! - * \brief Provides an interface for customizing error messages associated with - * reading in parameters. - * - * \param progName The name of the program, that was tried to be started. - * \param errorMsg The error message that was issued by the start function. - * Comprises the thing that went wrong and a general help message. - */ -void usage(const char *progName, const std::string &errorMsg) -{ - if (errorMsg.size() > 0) { - std::string errorMessageOut = "\nUsage: "; - errorMessageOut += progName; - errorMessageOut += " [options]\n"; - errorMessageOut += errorMsg; - errorMessageOut += "\n\nThe list of mandatory options for this program is:\n" - "\t-TimeManager.TEnd End of the simulation [s] \n" - "\t-TimeManager.DtInitial Initial timestep size [s] \n" - "\t-Grid.File Name of the file containing the grid \n" - "\t definition in DGF format\n"; - - std::cout << errorMessageOut - << "\n"; - } -} +#include <dumux/io/grid/gridmanager.hh> + +#include "richardslensproblem.hh" //////////////////////// // the main function @@ -90,19 +66,18 @@ int main(int argc, char** argv) try DumuxMessage::print(/*firstCall=*/true); // parse command line arguments and input file - Parameters::init(argc, argv, usage); + Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc index 82f3c629c1ff7fe3cec09ff145c205a5b7294605..d0fd30addaf62db84650e0d11c38bd12a20cb2c6 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconduction_fv.cc @@ -46,6 +46,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with * reading in parameters. @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc index ba18b9ce986dedf404ac039b60b0934e6807aea4..99015535579c703189dc8394b46e25ec4b727571 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsniconvection_fv.cc @@ -46,6 +46,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with * reading in parameters. @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc index 3464a371f31613bbdf685ae0bc61f7e8b2c419cb..b2ba91688d93074f014a8cf7e3ad4ca2a016680a 100644 --- a/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc +++ b/test/porousmediumflow/richards/implicit/test_richardsnievaporation_fv.cc @@ -44,6 +44,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> //////////////////////// // the main function @@ -66,16 +67,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh b/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh index d86975d0d1430f72390ba43bcd6f118856440c26..bff137ae0a9d3bd8700720fdc153054a644f189b 100644 --- a/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh +++ b/test/porousmediumflow/richardsnc/implicit/richardswelltracerproblem.hh @@ -26,6 +26,8 @@ #ifndef DUMUX_RICHARDS_NC_WELL_TRACER_PROBLEM_HH #define DUMUX_RICHARDS_NC_WELL_TRACER_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc index 22decb0f0484c57307e9089684e7a29ae2732523..76d815c63e82b05e2bee644b67e3ac57911b460e 100644 --- a/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc +++ b/test/porousmediumflow/richardsnc/implicit/test_richardsnc_fv.cc @@ -46,6 +46,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with * reading in parameters. @@ -93,16 +94,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/tracer/1ptracer/1ptestproblem.hh b/test/porousmediumflow/tracer/1ptracer/1ptestproblem.hh index dc40f8b3d76cfc7628df38839919fd5834e45bde..c29f31dc47cc7a98f10719d803964766f179dbc6 100644 --- a/test/porousmediumflow/tracer/1ptracer/1ptestproblem.hh +++ b/test/porousmediumflow/tracer/1ptracer/1ptestproblem.hh @@ -24,6 +24,8 @@ #ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_PROBLEM_HH #define DUMUX_INCOMPRESSIBLE_ONEP_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/porousmediumflow/1p/model.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc index 010fa973806c4bfdd533c387f3d10841f41993ab..605be207521441abfa29c6101ffeb0869d12c5b7 100644 --- a/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc +++ b/test/porousmediumflow/tracer/1ptracer/test_cctracer.cc @@ -44,6 +44,7 @@ #include <dumux/assembly/diffmethod.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> int main(int argc, char** argv) try { @@ -72,16 +73,11 @@ int main(int argc, char** argv) try ///////////////////////////////////////////////////////////////////// // only create the grid once using the 1p type tag - using GridCreator = typename GET_PROP_TYPE(OnePTypeTag, GridCreator); - try { GridCreator::makeGrid(); } - catch (...) { - std::cout << "\n\t -> Creation of the grid failed! <- \n\n"; - throw; - } - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(OnePTypeTag, Grid)> gridManager; + gridManager.init(); //! we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); //////////////////////////////////////////////////////////// // setup & solve 1p problem on this grid diff --git a/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh b/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh index 1b8aee0b7a6c5b218750ce46646d7dd0c0c008c6..d60e7ebac3bfa3e3f4257e1ac50a24e6a90deed7 100644 --- a/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh +++ b/test/porousmediumflow/tracer/1ptracer/tracertestproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_TRACER_TEST_PROBLEM_HH #define DUMUX_TRACER_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/porousmediumflow/tracer/model.hh> #include <dumux/porousmediumflow/problem.hh> diff --git a/test/porousmediumflow/tracer/constvel/test_tracer.cc b/test/porousmediumflow/tracer/constvel/test_tracer.cc index b710725758a67fa11365ef8b161f5635e390f695..fafc94e10eb28c9dd89edc4059f762f59807ad90 100644 --- a/test/porousmediumflow/tracer/constvel/test_tracer.cc +++ b/test/porousmediumflow/tracer/constvel/test_tracer.cc @@ -40,6 +40,7 @@ #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "tracertestproblem.hh" @@ -61,20 +62,19 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - try { GridCreator::makeGrid(); } + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + try { gridManager.init(); } catch (...) { std::cout << "\n\t -> Creation of the grid failed! <- \n\n"; throw; } - GridCreator::loadBalance(); //////////////////////////////////////////////////////////// // setup instationary non-linear problem on this grid //////////////////////////////////////////////////////////// //! we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); //! create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/test/porousmediumflow/tracer/constvel/tracertestproblem.hh b/test/porousmediumflow/tracer/constvel/tracertestproblem.hh index 0d47a990986d7e7a5d57207fa0b49ad949b5db4b..74646019a02bb34ed0842a067fda419e649ed08a 100644 --- a/test/porousmediumflow/tracer/constvel/tracertestproblem.hh +++ b/test/porousmediumflow/tracer/constvel/tracertestproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_TRACER_TEST_PROBLEM_HH #define DUMUX_TRACER_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/box/properties.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> #include <dumux/discretization/cellcentered/mpfa/properties.hh> diff --git a/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh b/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh index a44270018b3002979e551a058102d907088eb753..7fba519f3593ba1311f53bb497adfc6052c54564 100644 --- a/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh +++ b/test/porousmediumflow/tracer/multicomp/maxwellstefantestproblem.hh @@ -25,6 +25,8 @@ #ifndef DUMUX_MAXWELL_STEFAN_TEST_PROBLEM_HH #define DUMUX_MAXWELL_STEFAN_TEST_PROBLEM_HH +#include <dune/grid/yaspgrid.hh> + #include <dumux/discretization/elementsolution.hh> #include <dumux/discretization/box/properties.hh> #include <dumux/discretization/cellcentered/tpfa/properties.hh> diff --git a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc index a03b1a28a8ea0f57010f1c869fe4199256d67a6a..da2bd4a0c1ad4bbec7f05ac7b21ca4f533bc7ca9 100644 --- a/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc +++ b/test/porousmediumflow/tracer/multicomp/test_tracer_maxwellstefan.cc @@ -49,6 +49,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -100,16 +101,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/ex1/exercise1.cc b/tutorial/ex1/exercise1.cc index d6bb2599a084c7f1bad7d919d712ae5984dd3015..3bf3e8d87c4cc32d2f4db34d9ecef6ade0aee790 100644 --- a/tutorial/ex1/exercise1.cc +++ b/tutorial/ex1/exercise1.cc @@ -44,6 +44,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "injection2pproblem.hh" @@ -68,16 +69,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/ex1/exercise1_2p.cc b/tutorial/ex1/exercise1_2p.cc index 7ae3bca427fb0c6c88341a0cd7ef04937b148ea2..558f2d0f3373ed23df1fefbb0af5c296a698484a 100644 --- a/tutorial/ex1/exercise1_2p.cc +++ b/tutorial/ex1/exercise1_2p.cc @@ -44,6 +44,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // The problem file, where setup-specific boundary and initial conditions are defined. #include "injection2pproblem.hh" @@ -69,16 +70,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/ex1/exercise1_2p2c.cc b/tutorial/ex1/exercise1_2p2c.cc index 6f7e515c043a634b3673b4fe554f22a46a8cc3e1..c2b46ea15fcab30a078f85acf0f8d07b122b8209 100644 --- a/tutorial/ex1/exercise1_2p2c.cc +++ b/tutorial/ex1/exercise1_2p2c.cc @@ -44,6 +44,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // The problem file, where setup-specific boundary and initial conditions are defined. #include "injection2p2cproblem.hh" @@ -69,16 +70,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/ex2/exercise2.cc b/tutorial/ex2/exercise2.cc index d031e8753b39eba25ae4979d5cdb563ba534608e..2a7493e6771bb5620efc20f21eb95683485ab42e 100644 --- a/tutorial/ex2/exercise2.cc +++ b/tutorial/ex2/exercise2.cc @@ -45,6 +45,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "injection2p2cproblem.hh" @@ -66,16 +67,15 @@ int main(int argc, char** argv)try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/ex3/exercise3.cc b/tutorial/ex3/exercise3.cc index 4669ea7f18988da5a659b439437820b1aff4f84c..acfc230b5ff53cb4de42a955a3bdba04799d5a1e 100644 --- a/tutorial/ex3/exercise3.cc +++ b/tutorial/ex3/exercise3.cc @@ -50,6 +50,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> /*! * \brief Provides an interface for customizing error messages associated with @@ -105,16 +106,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv, usage); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/solution/ex1/exercise1_2p2c.cc b/tutorial/solution/ex1/exercise1_2p2c.cc index 779a668a6196d5518f716d04dfd7fb43d6daa0df..55496aad06bae940e473fa8ad013a27d23be5444 100644 --- a/tutorial/solution/ex1/exercise1_2p2c.cc +++ b/tutorial/solution/ex1/exercise1_2p2c.cc @@ -44,6 +44,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "injection2p2cproblem.hh" @@ -68,16 +69,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/solution/ex1/exercise1_2pni_solution.cc b/tutorial/solution/ex1/exercise1_2pni_solution.cc index d8e6af7ba5a46a78a29393954872acc65cd5d10e..68f9d3b50ffa07c4aedf2e9843174da557e1544d 100644 --- a/tutorial/solution/ex1/exercise1_2pni_solution.cc +++ b/tutorial/solution/ex1/exercise1_2pni_solution.cc @@ -44,6 +44,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> // The problem file, where setup-specific boundary and initial conditions are defined. #include "injection2pniproblem.hh" @@ -69,16 +70,15 @@ int main(int argc, char** argv) try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); diff --git a/tutorial/solution/ex2/exercise2_solution.cc b/tutorial/solution/ex2/exercise2_solution.cc index d031e8753b39eba25ae4979d5cdb563ba534608e..2a7493e6771bb5620efc20f21eb95683485ab42e 100644 --- a/tutorial/solution/ex2/exercise2_solution.cc +++ b/tutorial/solution/ex2/exercise2_solution.cc @@ -45,6 +45,7 @@ #include <dumux/discretization/methods.hh> #include <dumux/io/vtkoutputmodule.hh> +#include <dumux/io/grid/gridmanager.hh> #include "injection2p2cproblem.hh" @@ -66,16 +67,15 @@ int main(int argc, char** argv)try Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) - using GridCreator = typename GET_PROP_TYPE(TypeTag, GridCreator); - GridCreator::makeGrid(); - GridCreator::loadBalance(); + GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager; + gridManager.init(); //////////////////////////////////////////////////////////// // run instationary non-linear problem on this grid //////////////////////////////////////////////////////////// // we compute on the leaf grid view - const auto& leafGridView = GridCreator::grid().leafGridView(); + const auto& leafGridView = gridManager.grid().leafGridView(); // create the finite volume grid geometry using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);