3 #ifndef DUNE_DGFGEOGRID_HH
4 #define DUNE_DGFGEOGRID_HH
6 #include <dune/common/typetraits.hh>
32 template<
class Gr
idImp,
class IntersectionImp >
40 template<
int dimD,
int dimR >
54 : expression_( expression )
59 std::vector< double > vx( dimD );
60 std::vector< double > vy;
61 for(
int i = 0; i < dimD; ++i )
64 assert( vy.size() == size_t( dimR ) );
65 for(
int i = 0; i < dimR; ++i )
78 template<
class HostGrid,
class CoordFunction,
79 bool discrete = GeoGrid::isDiscreteCoordFunctionInterface< typename CoordFunction::Interface >::value >
80 struct DGFCoordFunctionFactory;
83 template<
class HostGr
id,
class CoordFunction >
84 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, false >
86 static CoordFunction *create ( std::istream &input,
const HostGrid &hostGrid )
88 return new CoordFunction;
93 template<
class HostGr
id,
class CoordFunction >
94 struct DGFCoordFunctionFactory< HostGrid, CoordFunction, true >
96 static CoordFunction *create ( std::istream &input,
const HostGrid &hostGrid )
98 return new CoordFunction( hostGrid );
103 template<
class HostGr
id,
int dimD,
int dimR >
108 static CoordFunction *create ( std::istream &input,
const HostGrid &hostGrid )
112 if( expression == 0 )
113 DUNE_THROW(
DGFException,
"no coordfunction specified in DGF file." );
123 template<
class HostGr
id,
class CoordFunction,
class Allocator >
130 typedef typename Grid::template Codim<0>::Entity
Element;
131 typedef typename Grid::template Codim<dimension>::Entity
Vertex;
137 : dgfHostFactory_( input, comm ),
140 HostGrid *hostGrid = dgfHostFactory_.grid();
141 assert( hostGrid != 0 );
142 CoordFunction *coordFunction = CoordFunctionFactory::create( input, *hostGrid );
143 grid_ =
new Grid( hostGrid, coordFunction );
148 : dgfHostFactory_( filename, comm ),
151 HostGrid *hostGrid = dgfHostFactory_.grid();
152 assert( hostGrid != 0 );
153 std::ifstream input( filename.c_str() );
154 CoordFunction *coordFunction = CoordFunctionFactory::create( input, *hostGrid );
155 grid_ =
new Grid( hostGrid, coordFunction );
163 template<
class Intersection >
169 template<
class Intersection >
175 template<
int codim >
178 return dgfHostFactory_.template numParameters< codim >();
184 return dgfHostFactory_.haveBoundaryParameters();
187 template<
class GG,
class II >
194 template<
class Entity >
210 template<
class HostGr
id,
class CoordFunction,
class Allocator >
226 #endif // #ifndef DUNE_DGFGEOGRID_HH