3 #ifndef DUNE_GRID_YASPGRID_STRUCTUREDYASPGRIDFACTORY_HH
4 #define DUNE_GRID_YASPGRID_STRUCTUREDYASPGRIDFACTORY_HH
25 template<
class ctype,
int dim>
29 static const int dimworld = GridType::dimensionworld;
42 static std::unique_ptr<GridType>
44 const FieldVector<ctype,dimworld>& upperRight,
45 const std::array<unsigned int,dim>& elements)
48 for(
int d = 0; d < dimworld; ++d)
49 if(abs(lowerLeft[d]) > abs(upperRight[d])*1e-10)
50 DUNE_THROW(
GridError, className<StructuredGridFactory>()
51 <<
"::createCubeGrid(): You have to use Yaspgrid<dim"
52 ", EquidistantOffsetCoordinates<ctype,dim> > as your"
53 "grid type for non-trivial origin." );
56 std::array<int, dim> elem;
57 std::copy(elements.begin(), elements.end(), elem.begin());
59 return std::make_unique<GridType>(upperRight, elem,
60 std::bitset<dim>(), 1);
68 static std::unique_ptr<GridType>
70 const FieldVector<ctype,dimworld>& upperRight,
71 const std::array<unsigned int,dim>& elements)
73 DUNE_THROW(
GridError, className<StructuredGridFactory>()
74 <<
"::createSimplexGrid(): Simplices are not supported "
87 template<
class ctype,
int dim>
90 static const int dimworld = GridType::dimensionworld;
99 static std::unique_ptr<GridType>
101 const FieldVector<ctype,dimworld>& upperRight,
102 const std::array<unsigned int,dim>& elements)
105 std::array<int, dim> elem;
106 std::copy(elements.begin(), elements.end(), elem.begin());
108 return std::make_unique<GridType>(lowerLeft, upperRight, elem,
109 std::bitset<dim>(), 1);
117 static std::unique_ptr<GridType>
119 const FieldVector<ctype,dimworld>& upperRight,
120 const std::array<unsigned int,dim>& elements)
122 DUNE_THROW(
GridError, className<StructuredGridFactory>()
123 <<
"::createSimplexGrid(): Simplices are not supported "