1 #ifndef DUNE_FEM_ALLGEOMTYPES_HH 2 #define DUNE_FEM_ALLGEOMTYPES_HH 9 #include <dune/geometry/referenceelements.hh> 10 #include <dune/geometry/type.hh> 11 #include <dune/grid/common/capabilities.hh> 27 template<
class Gr
idImp,
int codim >
37 static const int dim = GridType::dimension - codim;
40 typedef typename GridType::ctype
ctype;
61 const DomainType &
localCenter (
const GeometryType &type )
const 75 return Dune::ReferenceElements< ctype, dim >::general( type );
80 void buildMaps (
const std::vector< GeometryType > &geomTypes )
88 template<
class IndexSetImp,
class Gr
idImp >
97 static const unsigned int ncodim = GridType :: dimension + 1;
107 static void apply( std::vector< std::vector< GeometryType > >& geomTypes )
109 static const int codim = GridType :: dimension -
dim ;
110 typedef Dune::ReferenceElements< typename GridType :: ctype, dim > ReferenceElementContainer ;
111 typedef typename ReferenceElementContainer :: Iterator Iterator ;
112 for( Iterator it = ReferenceElementContainer::begin(),
113 end = ReferenceElementContainer::end(); it != end; ++it )
115 geomTypes[ codim ].push_back( it->type() );
122 : geomTypes_( ncodim )
124 if( multipleGeomTypes() )
127 ForLoop< InsertGeometryTypes, 0, GridType::dimension > :: apply( geomTypes_ );
132 for(
int codim=0; codim<GridType::dimension+1; ++codim )
134 typename IndexSetType::Types types = indexSet.types( codim );
135 const int size = types.size();
136 geomTypes_[ codim ].resize( size );
137 std::copy_n( types.begin(), size, geomTypes_[ codim ].begin() );
145 const std :: vector< GeometryType > &
geomTypes (
unsigned int codim )
const 147 assert( codim < ncodim );
148 return geomTypes_[ codim ];
154 return !Dune::Capabilities :: hasSingleGeometryType < GridType > :: v;
162 #endif // #ifndef DUNE_FEM_ALLGEOMTYPES_HH static const int dim
dimension
Definition: allgeomtypes.hh:37
static void apply(std::vector< std::vector< GeometryType > > &geomTypes)
Definition: allgeomtypes.hh:107
GridImp GridType
grid type
Definition: allgeomtypes.hh:34
Definition: allgeomtypes.hh:105
GridType::ctype ctype
coordinate type
Definition: allgeomtypes.hh:40
AllGeomTypes(const IndexSetType &indexSet)
constructor storing index set reference
Definition: allgeomtypes.hh:121
Dune::ReferenceElement< ctype, dim > ReferenceElementType
type of reference element
Definition: allgeomtypes.hh:43
IndexSetImp IndexSetType
Definition: allgeomtypes.hh:92
ReferenceVolume and local bary center keeper class.
Definition: allgeomtypes.hh:28
void buildMaps(const std::vector< GeometryType > &geomTypes)
build maps
Definition: allgeomtypes.hh:80
GeometryInformation()
constructor creating empty geometry information
Definition: allgeomtypes.hh:50
double referenceVolume(const GeometryType &type) const
return volume of reference element for geometry of type type
Definition: allgeomtypes.hh:67
Definition: coordinate.hh:4
static bool multipleGeomTypes()
UGGrid might have different geom types.
Definition: allgeomtypes.hh:152
GeometryInformation(const std::vector< GeometryType > &geomTypes)
creating geometry information due to given geometry types list
Definition: allgeomtypes.hh:55
default implementation uses method geomTypes of given index set. Used in DiscreteFunctionSpaces.
Definition: allgeomtypes.hh:89
std::vector< std::vector< GeometryType > > geomTypes_
Definition: allgeomtypes.hh:100
const DomainType & localCenter(const GeometryType &type) const
return local bary center for geometry of type type
Definition: allgeomtypes.hh:61
GridImp GridType
Definition: allgeomtypes.hh:93
static const ReferenceElementType & referenceElement(const GeometryType &type)
return reference element for type
Definition: allgeomtypes.hh:73
const std::vector< GeometryType > & geomTypes(unsigned int codim) const
returns vector with geometry tpyes this index set has indices for
Definition: allgeomtypes.hh:145
FieldVector< ctype, dim > DomainType
type of domain vector
Definition: allgeomtypes.hh:46