3#ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CONVERSION_HH
4#define DUNE_GEOMETRY_GENERICGEOMETRY_CONVERSION_HH
6#include <dune/common/visibility.hh>
15 namespace GenericGeometry
29 template<
class Topology, GeometryType::BasicType linetype >
32 template< GeometryType::BasicType linetype >
37 "Parameter linetype may only be a simplex or a cube.");
40 static const unsigned int dimension = 0;
44 template<
class BaseTopology, GeometryType::BasicType linetype >
51 "Parameter linetype may only be a simplex or a cube.");
55 "Only prisms over simplices or cubes can be converted.");
58 static const unsigned int dimension = DuneBaseGeometryType::dimension + 1;
62 : ((dimension == 2) || (DuneBaseGeometryType::basicType ==
GeometryType::cube))
67 template<
class BaseTopology, GeometryType::BasicType linetype >
74 "Parameter linetype may only be a simplex or a cube.");
78 "Only pyramids over simplices or cubes can be converted.");
81 static const unsigned int dimension = DuneBaseGeometryType::dimension + 1;
85 : ((dimension == 2) || (DuneBaseGeometryType::basicType ==
GeometryType::simplex))
106 template<
unsigned int dim, GeometryType::BasicType linetype >
134 return instance().types_[ topologyId / 2 ];
142 template< GeometryType :: BasicType type,
unsigned int dim >
145 template<
unsigned int dim >
149 <
typename Convert< GeometryType :: simplex, dim-1 > :: type >
159 template<
unsigned int dim >
162 typedef Prism<
typename Convert< GeometryType :: cube, dim-1 > :: type >
172 template<
unsigned int dim >
176 <
typename Convert< GeometryType :: simplex, dim-1 > :: type >
180 template<
unsigned int dim >
184 <
typename Convert< GeometryType :: cube, dim-1 > :: type >
A unique label for each type of element that can occur in a grid.
Definition affinegeometry.hh:19
statically convert a generic topology type into a GeometryType
Definition conversion.hh:30
dynamically convert a generic topology type into a GeometryType
Definition conversion.hh:108
static const unsigned int numTopologies
number of possible topologies
Definition conversion.hh:113
static const GeometryType & type(unsigned int topologyId)
obtain a Geometry type from a topology id
Definition conversion.hh:131
static const unsigned int dimension
dimension of the topologies to be converted
Definition conversion.hh:110
Definition conversion.hh:143
Pyramid< typename Convert< GeometryType ::simplex, dim-1 >::type > type
Definition conversion.hh:150
Point type
Definition conversion.hh:156
Prism< typename Convert< GeometryType ::cube, dim-1 >::type > type
Definition conversion.hh:163
Point type
Definition conversion.hh:169
Prism< typename Convert< GeometryType ::simplex, dim-1 >::type > type
Definition conversion.hh:177
Pyramid< typename Convert< GeometryType ::cube, dim-1 >::type > type
Definition conversion.hh:185
Definition topologytypes.hh:26
Definition topologytypes.hh:41
Definition topologytypes.hh:57
Definition topologytypes.hh:73
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:25
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition type.hh:29
@ cube
Cube element in any nonnegative dimension.
Definition type.hh:31
@ simplex
Simplicial element in any nonnegative dimension.
Definition type.hh:30