5 #ifndef DUNE_GEOGRID_CORNERSTORAGE_HH 6 #define DUNE_GEOGRID_CORNERSTORAGE_HH 21 template<
int mydim,
class Gr
id,
bool fake >
25 template<
int mydim,
class Gr
id >
28 typedef typename std::remove_const< Grid >::type::Traits Traits;
30 typedef typename Traits::ctype ctype;
32 static const int dimension = Traits::dimension;
33 static const int mydimension = mydim;
34 static const int codimension = dimension - mydimension;
35 static const int dimensionworld = Traits::dimensionworld;
37 typedef FieldVector< ctype, dimensionworld > Coordinate;
39 typedef typename Traits::HostGrid HostGrid;
40 typedef typename Traits::CoordFunction CoordFunction;
44 typedef GeoGrid :: CoordFunctionCaller< HostEntity, typename CoordFunction::Interface >
49 const CoordFunction &coordFunction )
50 : coordFunctionCaller_( hostEntity, coordFunction )
53 template< std::
size_t size >
54 void calculate ( std::array< Coordinate, size > (&corners) )
const 56 const std::size_t numCorners = coordFunctionCaller_.size();
57 assert( size >= numCorners );
58 for( std::size_t i = 0; i < numCorners; ++i )
59 coordFunctionCaller_.evaluate( i, corners[ i ] );
67 template<
int mydim,
class Gr
id >
70 typedef typename std::remove_const< Grid > :: type :: Traits Traits;
72 typedef typename Traits::ctype ctype;
74 static const int dimension = Traits::dimension;
75 static const int mydimension = mydim;
76 static const int codimension = dimension - mydimension;
77 static const int dimensionworld = Traits::dimensionworld;
79 typedef FieldVector< ctype, dimensionworld > Coordinate;
81 typedef typename Traits::HostGrid HostGrid;
82 typedef typename Traits::CoordFunction CoordFunction;
91 const unsigned int subEntity,
92 const CoordFunction &coordFunction )
93 : coordFunctionCaller_( hostElement, coordFunction ),
94 subEntity_( subEntity )
97 template< std::
size_t size >
98 void calculate ( std::array< Coordinate, size > (&corners) )
const 101 auto refElement = referenceElement< ctype, dimension >( type );
102 const std::size_t numCorners = refElement.size( subEntity_, codimension, dimension );
103 assert( size >= numCorners );
104 for( std::size_t i = 0; i < numCorners; ++i )
106 const std::size_t j = refElement.subEntity( subEntity_, codimension, i, dimension );
107 coordFunctionCaller_.evaluate( j, corners[ i ] );
113 const unsigned int subEntity_;
121 template<
class Gr
id >
124 typedef typename std::remove_const< Grid >::type::Traits Traits;
126 typedef typename Traits::ctype ctype;
128 static const int dimension = Traits::dimension;
129 static const int codimension = 1;
130 static const int mydimension = dimension-codimension;
131 static const int dimensionworld = Traits::dimensionworld;
133 typedef FieldVector< ctype, dimensionworld > Coordinate;
135 typedef typename Traits::HostGrid HostGrid;
137 typedef typename Traits::template Codim< 0 >::GeometryImpl ElementGeometryImpl;
138 typedef typename Traits::template Codim< codimension >::LocalGeometry HostLocalGeometry;
142 const HostLocalGeometry &hostLocalGeometry )
143 : elementGeometry_( elementGeometry ),
144 hostLocalGeometry_( hostLocalGeometry )
147 template< std::
size_t size >
148 void calculate ( std::array< Coordinate, size > (&corners) )
const 150 const std::size_t numCorners = hostLocalGeometry_.corners();
151 assert( size >= numCorners );
152 for( std::size_t i = 0; i < numCorners; ++i )
153 corners[ i ] = elementGeometry_.global( hostLocalGeometry_.corner( i ) );
156 template<
unsigned int numCorners >
157 void calculate ( Coordinate (&corners)[ numCorners ] )
const 159 assert( numCorners == hostLocalGeometry_.corners() );
163 const ElementGeometryImpl &elementGeometry_;
164 HostLocalGeometry hostLocalGeometry_;
172 template<
int mydim,
int cdim,
class Gr
id >
175 typedef typename std::remove_const< Grid >::type::Traits Traits;
177 typedef typename Traits::ctype ctype;
178 typedef FieldVector< ctype, cdim > Coordinate;
180 typedef std::array< Coordinate, (1 << mydim) > Coords;
185 template<
bool fake >
188 coords.calculate( coords_ );
212 #endif // #ifndef DUNE_GEOGRID_CORNERSTORAGE_HH CornerStorage(const CoordVector< mydim, Grid, fake > &coords)
Definition: cornerstorage.hh:186
concept Entity
Model of a grid entity.
Definition: concepts/entity.hh:119
Definition: coordfunctioncaller.hh:21
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Definition: common/grid.hh:375
CoordVector(const HostEntity &hostEntity, const CoordFunction &coordFunction)
Definition: cornerstorage.hh:48
CornerStorage(const IntersectionCoordVector< Grid > &coords)
Definition: cornerstorage.hh:191
const_iterator end() const
Definition: cornerstorage.hh:202
Definition: cornerstorage.hh:173
const Coordinate & operator[](unsigned int i) const
Definition: cornerstorage.hh:196
void calculate(Coordinate(&corners)[numCorners]) const
Definition: cornerstorage.hh:157
CoordVector(const HostElement &hostElement, const unsigned int subEntity, const CoordFunction &coordFunction)
Definition: cornerstorage.hh:90
void calculate(std::array< Coordinate, size >(&corners)) const
Definition: cornerstorage.hh:98
Include standard header files.
Definition: agrid.hh:59
void calculate(std::array< Coordinate, size >(&corners)) const
Definition: cornerstorage.hh:54
void calculate(std::array< Coordinate, size >(&corners)) const
Definition: cornerstorage.hh:148
Coords::const_iterator const_iterator
Definition: cornerstorage.hh:183
Definition: cornerstorage.hh:122
Definition: cornerstorage.hh:22
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
const_iterator begin() const
Definition: cornerstorage.hh:201
IntersectionCoordVector(const ElementGeometryImpl &elementGeometry, const HostLocalGeometry &hostLocalGeometry)
Definition: cornerstorage.hh:141