Commit 45c2ea15 authored by Christoph Grüninger's avatar Christoph Grüninger

[C++11] Use array and shared_ptr from std:: instead of Dune::.

Use of fall back implementations is discouraged, cf. FS#1435.
parent 3c1b4bfd
......@@ -3,6 +3,9 @@
#ifndef UNITCUBE_HH
#define UNITCUBE_HH
#include <array>
#include <memory>
#include <dune/common/exceptions.hh>
#include <dune/common/fvector.hh>
#include <dune/grid/utility/structuredgridfactory.hh>
......@@ -21,7 +24,7 @@ public:
{
Dune::FieldVector<typename GridType::ctype,dim> lowerLeft(0);
Dune::FieldVector<typename GridType::ctype,dim> upperRight(1);
Dune::array<unsigned int,dim> elements;
std::array<unsigned int,dim> elements;
std::fill(elements.begin(), elements.end(), 1);
switch (variant) {
......@@ -44,7 +47,7 @@ public:
private:
// the constructed grid object
Dune::shared_ptr<T> grid_;
std::shared_ptr<T> grid_;
}; /*@\label{uc:uc1}@*/
......
......@@ -3,6 +3,9 @@
#ifndef UNITCUBE_ALUGRID_HH
#define UNITCUBE_ALUGRID_HH
#include <array>
#include <memory>
#include "unitcube.hh"
#if HAVE_ALUGRID
......@@ -23,14 +26,14 @@ public:
typedef Dune::ALUGrid<dim,dim,Dune::simplex,Dune::nonconforming> GridType;
private:
Dune::shared_ptr<GridType> grid_;
std::shared_ptr<GridType> grid_;
public:
UnitCube ()
{
Dune::FieldVector<typename GridType::ctype,dim> lowerLeft(0);
Dune::FieldVector<typename GridType::ctype,dim> upperRight(1);
Dune::array<unsigned int,dim> elements;
std::array<unsigned int,dim> elements;
std::fill(elements.begin(), elements.end(), 1);
grid_ = Dune::StructuredGridFactory<GridType>::createSimplexGrid(lowerLeft, upperRight, elements);
......@@ -50,14 +53,14 @@ public:
typedef Dune::ALUGrid<3,3,Dune::cube,Dune::nonconforming> GridType;
private:
Dune::shared_ptr<GridType> grid_;
std::shared_ptr<GridType> grid_;
public:
UnitCube ()
{
Dune::FieldVector<GridType::ctype,3> lowerLeft(0);
Dune::FieldVector<GridType::ctype,3> upperRight(1);
Dune::array<unsigned int,3> elements = { {1,1,1} };
std::array<unsigned int,3> elements = { {1,1,1} };
grid_ = Dune::StructuredGridFactory<GridType>::createCubeGrid(lowerLeft, upperRight, elements);
}
......
......@@ -3,10 +3,13 @@
#ifndef UNITCUBE_YASPGRID_HH
#define UNITCUBE_YASPGRID_HH
#include "unitcube.hh"
#include <array>
#include <memory>
#include <dune/grid/yaspgrid.hh>
#include "unitcube.hh"
// YaspGrid specialization
template<int dim, int size>
class UnitCube<Dune::YaspGrid<dim>,size>
......@@ -17,7 +20,7 @@ public:
UnitCube ()
{
Dune::FieldVector<double,dim> length(1.0);
Dune::array<int,dim> elements;
std::array<int,dim> elements;
std::fill(elements.begin(), elements.end(), size);
std::bitset<dim> periodicity(0);
......
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