1#ifndef DUNE_FEM_ALLGEOMTYPES_HH
2#define DUNE_FEM_ALLGEOMTYPES_HH
10#include <dune/geometry/referenceelements.hh>
11#include <dune/geometry/type.hh>
12#include <dune/grid/common/capabilities.hh>
28 template<
class Gr
idImp,
int codim >
38 static const int dim = GridType::dimension - codim;
41 typedef typename GridType::ctype
ctype;
48 typedef std::decay_t< decltype( ReferenceElementsType::general( std::declval< const GeometryType & >() ) ) >
ReferenceElementType;
79 ->
decltype( ReferenceElementsType::general( type ) )
81 assert( ! type.isNone() );
82 return ReferenceElementsType::general( type );
89 void buildMaps (
const std::vector< GeometryType > &geomTypes )
97 template<
class IndexSetImp,
class Gr
idImp >
106 static const unsigned int ncodim = GridType :: dimension + 1;
118 static const int codim = GridType :: dimension -
dim ;
119 typedef Dune::ReferenceElements< typename GridType :: ctype, dim > ReferenceElementContainer ;
120 typedef typename ReferenceElementContainer :: Iterator Iterator ;
121 for( Iterator it = ReferenceElementContainer::begin(),
122 end = ReferenceElementContainer::end(); it != end; ++it )
135 std::vector< std::set< GeometryType > >
geomTypes( ncodim );
140 auto types = indexSet.types( 0 );
141 for(
const auto type : types )
146 for(
unsigned int cd=0; cd < ncodim; ++cd )
149 for(
const auto& type :
geomTypes[ cd ] )
158 for(
int codim=0; codim<GridType::dimension+1; ++codim )
160 typename IndexSetType::Types types = indexSet.types( codim );
161 const int size = types.size();
163 std::copy_n( types.begin(), size,
geomTypes_[ codim ].begin() );
171 const std :: vector< GeometryType > &
geomTypes (
unsigned int codim )
const
173 assert( codim < ncodim );
180 return !Dune::Capabilities :: hasSingleGeometryType < GridType > :: v;
Definition: bindguard.hh:11
Definition: forloop.hh:17
ReferenceVolume and local bary center keeper class.
Definition: allgeomtypes.hh:30
GridType::ctype ctype
coordinate type
Definition: allgeomtypes.hh:41
GeometryInformation()
constructor creating empty geometry information
Definition: allgeomtypes.hh:55
const DomainType localCenter(const GeometryType &type) const
return local bary center for geometry of type type
Definition: allgeomtypes.hh:66
void buildMaps(const std::vector< GeometryType > &geomTypes)
build maps
Definition: allgeomtypes.hh:89
ctype referenceVolume(const GeometryType &type) const
return volume of reference element for geometry of type type
Definition: allgeomtypes.hh:72
static auto referenceElement(const GeometryType &type) -> decltype(ReferenceElementsType::general(type))
return reference element for type
Definition: allgeomtypes.hh:78
static const int dim
dimension
Definition: allgeomtypes.hh:38
GeometryInformation(const std::vector< GeometryType > &geomTypes)
creating geometry information due to given geometry types list
Definition: allgeomtypes.hh:60
Dune::ReferenceElements< ctype, dim > ReferenceElementsType
Definition: allgeomtypes.hh:44
std::decay_t< decltype(ReferenceElementsType::general(std::declval< const GeometryType & >())) > ReferenceElementType
type of reference element
Definition: allgeomtypes.hh:48
GridImp GridType
grid type
Definition: allgeomtypes.hh:35
FieldVector< ctype, dim > DomainType
type of domain vector
Definition: allgeomtypes.hh:51
DomainType isNoneLocalCenter_
Definition: allgeomtypes.hh:86
default implementation uses method geomTypes of given index set. Used in DiscreteFunctionSpaces.
Definition: allgeomtypes.hh:99
static bool multipleGeomTypes()
UGGrid might have different geom types.
Definition: allgeomtypes.hh:178
GridImp GridType
Definition: allgeomtypes.hh:102
const std ::vector< GeometryType > & geomTypes(unsigned int codim) const
returns vector with geometry tpyes this index set has indices for
Definition: allgeomtypes.hh:171
std::vector< std::vector< GeometryType > > geomTypes_
Definition: allgeomtypes.hh:109
IndexSetImp IndexSetType
Definition: allgeomtypes.hh:101
AllGeomTypes(const IndexSetType &indexSet)
constructor storing index set reference
Definition: allgeomtypes.hh:130
Definition: allgeomtypes.hh:115
static void apply(std::vector< std::set< GeometryType > > &geomTypes)
Definition: allgeomtypes.hh:116