Commit af5766f0 authored by Martin Nolte's avatar Martin Nolte

Merge branch 'cherry-pick-73c827b3' into 'releases/2.6'

Merge branch 'feature/tensorgridfactory-return-unique_ptr' into 'master'

See merge request !250
parents 58acd3f3 98236bb3
Pipeline #6198 failed with stage
in 50 minutes and 36 seconds
......@@ -43,7 +43,7 @@ namespace Dune
typedef typename Grid::ctype ctype;
static const int dim = Grid::dimension;
std::shared_ptr<Grid> createGrid(Comm comm = Comm())
std::unique_ptr<Grid> createGrid(Comm comm = Comm())
{
TensorGridFactoryCreator<Grid> creator(*this);
return creator.createGrid(comm);
......@@ -309,7 +309,7 @@ namespace Dune
TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
std::shared_ptr<Grid> createGrid(Comm comm)
std::unique_ptr<Grid> createGrid(Comm comm)
{
// The grid factory
GridFactory<Grid> fac;
......@@ -375,7 +375,7 @@ namespace Dune
}
}
return std::shared_ptr<Grid>(fac.createGrid());
return std::unique_ptr<Grid>(fac.createGrid());
}
private:
......@@ -391,9 +391,9 @@ namespace Dune
TensorGridFactoryCreator(const TensorGridFactory<Grid>& factory) : _factory(factory) {}
std::shared_ptr<Grid> createGrid(Comm comm)
std::unique_ptr<Grid> createGrid(Comm comm)
{
return std::make_shared<Grid>(_factory.coords(), std::bitset<dim>(0ULL), 1, comm);
return std::make_unique<Grid>(_factory.coords(), std::bitset<dim>(0ULL), 1, comm);
}
private:
const TensorGridFactory<Grid>& _factory;
......
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