11#ifndef DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH
12#define DUNE_LOCALFUNCTIONS_TEST_GEOMETRIES_HH
21#include <dune/geometry/multilineargeometry.hh>
23template<
class ctype, std::
size_t dim>
27class TestGeometries<ctype, 0> :
28 public std::vector<Dune::MultiLinearGeometry<ctype, 0, 0> >
30 static constexpr std::size_t dim = 0;
37 std::vector<Dune::FieldVector<ctype, dim> > coords;
45 for(std::size_t i = 0; i < this->size(); ++i)
46 if((*
this)[i].type() ==
gt)
return (*
this)[i];
48 "dimension " << dim <<
" for GeometryType " <<
gt);
53class TestGeometries<ctype, 1> :
54 public std::vector<Dune::MultiLinearGeometry<ctype, 1, 1> >
56 static constexpr std::size_t dim = 1;
63 std::vector<Dune::FieldVector<ctype, dim> > coords;
73 for(std::size_t i = 0; i < this->size(); ++i)
74 if((*
this)[i].type() ==
gt)
return (*
this)[i];
76 "dimension " << dim <<
" for GeometryType " <<
gt);
81class TestGeometries<ctype, 2> :
82 public std::vector<Dune::MultiLinearGeometry<ctype, 2, 2> >
84 static constexpr std::size_t dim = 2;
91 std::vector<Dune::FieldVector<ctype, dim> > coords;
95 coords[0][0] = -.5; coords[0][1] = -.5;
96 coords[1][0] = .5; coords[1][1] = -.5;
97 coords[2][0] = 0 ; coords[2][1] = .5;
102 coords[0][0] = -.5; coords[0][1] = 0;
103 coords[1][0] = 0 ; coords[1][1] = -.5;
104 coords[2][0] = .5; coords[2][1] = 0;
105 coords[3][0] = 0 ; coords[3][1] = .5;
110 for(std::size_t i = 0; i < this->size(); ++i)
111 if((*
this)[i].type() ==
gt)
return (*
this)[i];
113 "dimension " << dim <<
" for GeometryType " <<
gt);
118class TestGeometries<ctype, 3> :
119 public std::vector<Dune::MultiLinearGeometry<ctype, 3, 3> >
121 static constexpr std::size_t dim = 3;
128 std::vector<Dune::FieldVector<ctype, dim> > coords;
132 coords[0][0] = -.5; coords[0][1] = -.5; coords[0][2] = -.5;
133 coords[1][0] = .5; coords[1][1] = -.5; coords[1][2] = -.5;
134 coords[2][0] = 0 ; coords[2][1] = .5; coords[2][2] = -.5;
135 coords[3][0] = 0 ; coords[3][1] = 0 ; coords[3][2] = .5;
140 coords[0][0] = -.5; coords[0][1] = 0; coords[0][2] = -.5;
141 coords[1][0] = 0 ; coords[1][1] = -.5; coords[1][2] = -.5;
142 coords[2][0] = .5; coords[2][1] = 0; coords[2][2] = -.5;
143 coords[3][0] = 0 ; coords[3][1] = .5; coords[3][2] = -.5;
144 coords[4][0] = .1; coords[4][1] = .1; coords[4][2] = .1;
149 coords[0][0] = -.6; coords[0][1] = -.5; coords[0][2] = -.4;
150 coords[1][0] = .5; coords[1][1] = -.6; coords[1][2] = -.5;
151 coords[2][0] = .1; coords[2][1] = .5; coords[2][2] = -.6;
152 coords[3][0] = -.5; coords[3][1] = -.4; coords[3][2] = .5;
153 coords[4][0] = .4; coords[4][1] = -.5; coords[4][2] = .6;
154 coords[5][0] = 0 ; coords[5][1] = .4; coords[5][2] = .5;
159 coords[0][0] = -.7; coords[0][1] = -.6; coords[0][2] = -.5;
160 coords[1][0] = .4; coords[1][1] = -.3; coords[1][2] = -.7;
161 coords[2][0] = -.6; coords[2][1] = .5; coords[2][2] = -.4;
162 coords[3][0] = .3; coords[3][1] = .7; coords[3][2] = -.6;
163 coords[4][0] = -.5; coords[4][1] = -.4; coords[4][2] = .3;
164 coords[5][0] = .7; coords[5][1] = -.6; coords[5][2] = .5;
165 coords[6][0] = -.4; coords[6][1] = .3; coords[6][2] = .7;
166 coords[7][0] = .6; coords[7][1] = .5; coords[7][2] = .4;
171 for(std::size_t i = 0; i < this->size(); ++i)
172 if((*
this)[i].type() ==
gt)
return (*
this)[i];
174 "dimension " << dim <<
" for GeometryType " <<
gt);
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
generic geometry implementation based on corner coordinates
Definition: multilineargeometry.hh:181
Default exception for dummy implementations.
Definition: exceptions.hh:263
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:218
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:158
constexpr GeometryType line
GeometryType representing a line.
Definition: type.hh:498
constexpr GeometryType prism
GeometryType representing a 3D prism.
Definition: type.hh:528
constexpr GeometryType triangle
GeometryType representing a triangle.
Definition: type.hh:504
constexpr GeometryType quadrilateral
GeometryType representing a quadrilateral (a square).
Definition: type.hh:510
constexpr GeometryType hexahedron
GeometryType representing a hexahedron.
Definition: type.hh:534
constexpr GeometryType pyramid
GeometryType representing a 3D pyramid.
Definition: type.hh:522
constexpr GeometryType tetrahedron
GeometryType representing a tetrahedron.
Definition: type.hh:516
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:492
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:416
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
Return the entry at position pos of the given sequence.
Definition: integersequence.hh:22
A unique label for each type of element that can occur in a grid.