9#ifndef DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH
10#define DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH
19#include <dune/geometry/multilineargeometry.hh>
21template<
class ctype, std::
size_t dim>
25class TestGeometries<ctype, 0> :
26 public std::vector<Dune::MultiLinearGeometry<ctype, 0, 0> >
28 static const std::size_t dim = 0;
35 std::vector<Dune::FieldVector<ctype, dim> > coords;
39 this->push_back(Geometry(
gt, coords));
43 for(std::size_t i = 0; i < this->size(); ++i)
44 if((*
this)[i].type() ==
gt)
return (*
this)[i];
46 "dimension " << dim <<
" for GeometryType " <<
gt);
51class TestGeometries<ctype, 1> :
52 public std::vector<Dune::MultiLinearGeometry<ctype, 1, 1> >
54 static const std::size_t dim = 1;
61 std::vector<Dune::FieldVector<ctype, dim> > coords;
67 this->push_back(Geometry(
gt, coords));
71 for(std::size_t i = 0; i < this->size(); ++i)
72 if((*
this)[i].type() ==
gt)
return (*
this)[i];
74 "dimension " << dim <<
" for GeometryType " <<
gt);
79class TestGeometries<ctype, 2> :
80 public std::vector<Dune::MultiLinearGeometry<ctype, 2, 2> >
82 static const std::size_t dim = 2;
89 std::vector<Dune::FieldVector<ctype, dim> > coords;
93 coords[0][0] = -.5; coords[0][1] = -.5;
94 coords[1][0] = .5; coords[1][1] = -.5;
95 coords[2][0] = 0 ; coords[2][1] = .5;
96 this->push_back(Geometry(
gt, coords));
100 coords[0][0] = -.5; coords[0][1] = 0;
101 coords[1][0] = 0 ; coords[1][1] = -.5;
102 coords[2][0] = .5; coords[2][1] = 0;
103 coords[3][0] = 0 ; coords[3][1] = .5;
104 this->push_back(Geometry(
gt, coords));
108 for(std::size_t i = 0; i < this->size(); ++i)
109 if((*
this)[i].type() ==
gt)
return (*
this)[i];
111 "dimension " << dim <<
" for GeometryType " <<
gt);
116class TestGeometries<ctype, 3> :
117 public std::vector<Dune::MultiLinearGeometry<ctype, 3, 3> >
119 static const std::size_t dim = 3;
126 std::vector<Dune::FieldVector<ctype, dim> > coords;
130 coords[0][0] = -.5; coords[0][1] = -.5; coords[0][2] = -.5;
131 coords[1][0] = .5; coords[1][1] = -.5; coords[1][2] = -.5;
132 coords[2][0] = 0 ; coords[2][1] = .5; coords[2][2] = -.5;
133 coords[3][0] = 0 ; coords[3][1] = 0 ; coords[3][2] = .5;
134 this->push_back(Geometry(
gt, coords));
138 coords[0][0] = -.5; coords[0][1] = 0; coords[0][2] = -.5;
139 coords[1][0] = 0 ; coords[1][1] = -.5; coords[1][2] = -.5;
140 coords[2][0] = .5; coords[2][1] = 0; coords[2][2] = -.5;
141 coords[3][0] = 0 ; coords[3][1] = .5; coords[3][2] = -.5;
142 coords[4][0] = .1; coords[4][1] = .1; coords[4][2] = .1;
143 this->push_back(Geometry(
gt, coords));
147 coords[0][0] = -.6; coords[0][1] = -.5; coords[0][2] = -.4;
148 coords[1][0] = .5; coords[1][1] = -.6; coords[1][2] = -.5;
149 coords[2][0] = .1; coords[2][1] = .5; coords[2][2] = -.6;
150 coords[3][0] = -.5; coords[3][1] = -.4; coords[3][2] = .5;
151 coords[4][0] = .4; coords[4][1] = -.5; coords[4][2] = .6;
152 coords[5][0] = 0 ; coords[5][1] = .4; coords[5][2] = .5;
153 this->push_back(Geometry(
gt, coords));
157 coords[0][0] = -.7; coords[0][1] = -.6; coords[0][2] = -.5;
158 coords[1][0] = .4; coords[1][1] = -.3; coords[1][2] = -.7;
159 coords[2][0] = -.6; coords[2][1] = .5; coords[2][2] = -.4;
160 coords[3][0] = .3; coords[3][1] = .7; coords[3][2] = -.6;
161 coords[4][0] = -.5; coords[4][1] = -.4; coords[4][2] = .3;
162 coords[5][0] = .7; coords[5][1] = -.6; coords[5][2] = .5;
163 coords[6][0] = -.4; coords[6][1] = .3; coords[6][2] = .7;
164 coords[7][0] = .6; coords[7][1] = .5; coords[7][2] = .4;
165 this->push_back(Geometry(
gt, coords));
169 for(std::size_t i = 0; i < this->size(); ++i)
170 if((*
this)[i].type() ==
gt)
return (*
this)[i];
172 "dimension " << dim <<
" for GeometryType " <<
gt);
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:277
generic geometry implementation based on corner coordinates
Definition: multilineargeometry.hh:179
Default exception for dummy implementations.
Definition: exceptions.hh:261
A few common exception classes.
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:147
constexpr GeometryType line
GeometryType representing a line.
Definition: type.hh:733
constexpr GeometryType prism
GeometryType representing a 3D prism.
Definition: type.hh:763
constexpr GeometryType triangle
GeometryType representing a triangle.
Definition: type.hh:739
constexpr GeometryType quadrilateral
GeometryType representing a quadrilateral (a square).
Definition: type.hh:745
constexpr GeometryType hexahedron
GeometryType representing a hexahedron.
Definition: type.hh:769
constexpr GeometryType pyramid
GeometryType representing a 3D pyramid.
Definition: type.hh:757
constexpr GeometryType tetrahedron
GeometryType representing a tetrahedron.
Definition: type.hh:751
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:727
A unique label for each type of element that can occur in a grid.