Commit fc1cd1d3 authored by Praetorius, Simon's avatar Praetorius, Simon

interface changed in gridfactory

parent 8ca9a701
Pipeline #1485 failed with stage
in 30 minutes and 31 seconds
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include <vector> #include <vector>
#include <dune/common/hybridutilities.hh> #include <dune/common/hybridutilities.hh>
#include <dune/common/to_unique_ptr.hh>
#include <dune/common/version.hh>
#include <dune/common/std/type_traits.hh> #include <dune/common/std/type_traits.hh>
#include <dune/grid/common/gridfactory.hh> #include <dune/grid/common/gridfactory.hh>
...@@ -147,6 +149,7 @@ namespace Dune ...@@ -147,6 +149,7 @@ namespace Dune
* Create n copies of the grid and store it in unique_pointers * Create n copies of the grid and store it in unique_pointers
* inside the multimesh grid. * inside the multimesh grid.
**/ **/
#if DUNE_VERSION_LTE(DUNE_GRID,2,7)
virtual Grid* createGrid () override virtual Grid* createGrid () override
{ {
Grid* multimesh = new Grid{}; Grid* multimesh = new Grid{};
...@@ -154,6 +157,15 @@ namespace Dune ...@@ -154,6 +157,15 @@ namespace Dune
multimesh->grids_.emplace_back(gridFactory->createGrid()); multimesh->grids_.emplace_back(gridFactory->createGrid());
return multimesh; return multimesh;
} }
#else
virtual ToUniquePtr<Grid> createGrid () override
{
std::unique_ptr<Grid> multimesh{std::make_unique<Grid>()};
for (auto& gridFactory : gridFactories_)
multimesh->grids_.emplace_back(gridFactory->createGrid());
return std::move(multimesh);
}
#endif
private: private:
std::vector<std::unique_ptr<GridFactory<HostGrid>>> gridFactories_; std::vector<std::unique_ptr<GridFactory<HostGrid>>> gridFactories_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment