1 #ifndef DUNE_DGFGEOGRID_HH
2 #define DUNE_DGFGEOGRID_HH
4 #include <dune/common/typetraits.hh>
28 template <
class Gr
idImp,
template <
class >
class IntersectionImp >
34 template<
int dimD,
int dimR >
48 : expression_( expression )
53 std::vector< double > vx( dimD );
54 std::vector< double > vy;
55 for(
int i = 0; i < dimD; ++i )
58 assert( vy.size() == size_t( dimR ) );
59 for(
int i = 0; i < dimR; ++i )
72 template<
class HostGrid,
class CoordFunction,
73 bool discrete = GeoGrid::isDiscreteCoordFunctionInterface< typename CoordFunction::Interface >::value >
77 template<
class HostGr
id,
class CoordFunction >
80 static CoordFunction *create ( std::istream &input,
const HostGrid &hostGrid )
82 return new CoordFunction;
87 template<
class HostGr
id,
class CoordFunction >
90 static CoordFunction *create ( std::istream &input,
const HostGrid &hostGrid )
92 return new CoordFunction( hostGrid );
97 template<
class HostGr
id,
int dimD,
int dimR >
102 static CoordFunction *create ( std::istream &input,
const HostGrid &hostGrid )
106 if( expression == 0 )
107 DUNE_THROW(
DGFException,
"no coordfunction specified in DGF file." );
117 template<
class HostGr
id,
class CoordFunction,
class Allocator >
124 typedef typename Grid::template Codim<0>::Entity
Element;
125 typedef typename Grid::template Codim<dimension>::Entity
Vertex;
131 : dgfHostFactory_( input, comm ),
134 HostGrid *hostGrid = dgfHostFactory_.grid();
135 assert( hostGrid != 0 );
136 CoordFunction *coordFunction = CoordFunctionFactory::create( input, *hostGrid );
137 grid_ =
new Grid( hostGrid, coordFunction );
142 : dgfHostFactory_( filename, comm ),
145 HostGrid *hostGrid = dgfHostFactory_.grid();
146 assert( hostGrid != 0 );
147 std::ifstream input( filename.c_str() );
148 CoordFunction *coordFunction = CoordFunctionFactory::create( input, *hostGrid );
149 grid_ =
new Grid( hostGrid, coordFunction );
157 template<
class Intersection >
163 template<
class Intersection >
169 template<
int codim >
172 return dgfHostFactory_.template numParameters< codim >();
178 return dgfHostFactory_.haveBoundaryParameters();
181 template<
class GG,
template<
class >
class II >
188 template<
class Entity >
204 template<
class HostGr
id,
class CoordFunction,
class Allocator >
220 #endif // #ifndef DUNE_DGFGEOGRID_HH