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::shared_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::shared_ptr<GridType>
61 std::bitset<dim>(), 0));
69 static std::shared_ptr<GridType>
71 const FieldVector<ctype,dimworld>& upperRight,
72 const std::array<unsigned int,dim>& elements)
74 DUNE_THROW(
GridError, className<StructuredGridFactory>()
75 <<
"::createSimplexGrid(): Simplices are not supported "
88 template<
class ctype,
int dim>
91 static const int dimworld = GridType::dimensionworld;
100 static std::shared_ptr<GridType>
102 const FieldVector<ctype,dimworld>& upperRight,
103 const std::array<unsigned int,dim>& elements)
106 std::array<int, dim> elem;
107 std::copy(elements.begin(), elements.end(), elem.begin());
109 return std::shared_ptr<GridType>
110 (
new GridType(lowerLeft, upperRight, elem,
111 std::bitset<dim>(), 0));
119 static std::shared_ptr<GridType>
121 const FieldVector<ctype,dimworld>& upperRight,
122 const std::array<unsigned int,dim>& elements)
124 DUNE_THROW(
GridError, className<StructuredGridFactory>()
125 <<
"::createSimplexGrid(): Simplices are not supported "