From c19d5f00bbc96f7aa4f993af6996072faa1bfa0d Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt Date: Fri, 26 Jan 2018 11:44:04 +0100 Subject: [PATCH] [io][gridcreator] Make construction of tensorgrid more flexible * Add a public method taking the positions, cells and the grading vectors as arguments. * The general makeGrid() method now extracts the necessary parameters from the input file and calls the new method with them * The new method can be useful in cases where a tensorgrid should be constructed not based on input file data, but on different ones, e.g. evalutated by a user specified algorithm --- dumux/io/gridcreator.hh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dumux/io/gridcreator.hh b/dumux/io/gridcreator.hh index 72c46f19da..c289d9bf39 100644 --- a/dumux/io/gridcreator.hh +++ b/dumux/io/gridcreator.hh @@ -666,6 +666,20 @@ public: grading[i] = getParamFromGroup>(modelParamGroup, "Grid.Grading" + std::to_string(i), grading[i]); } + // call the generic function + makeGrid(positions, cells, grading, modelParamGroup); + } + + /*! + * \brief Make the grid using input data not read from the input file. + */ + static void makeGrid(const std::array, dim>& positions, + const std::array, dim>& cells, + const std::array, dim>& grading, + const std::string& modelParamGroup = "") + { + + // Additional arameters (they have a default) const auto periodic = getParamFromGroup>(modelParamGroup, "Grid.Periodic", std::bitset()); const int overlap = YaspOverlapHelper::getOverlap(modelParamGroup); -- GitLab