13 template<
class Gr
idImp,
template<
class >
class IntersectionImp >
17 template<
int dim,
int dimworld,
class ctype >
27 typedef FieldVector< double, dimension > Point;
35 generate( input, comm );
41 std::ifstream input( filename.c_str() );
42 generate( input, comm );
50 template<
class Intersection >
56 template<
class Intersection >
59 if( boundaryDomainBlock_->isactive() )
61 std::vector< Point > corners;
62 getCorners( intersection.
geometry(), corners );
63 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
82 return boundaryDomainBlock_->isactive();
85 template <
class GG,
template <
class >
class II >
91 std::vector< Point > corners;
92 getCorners( intersection.
geometry(), corners );
93 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
104 template<
class Entity >
113 template<
class Geometry >
114 static void getCorners (
const Geometry &geometry, std::vector< Point > &corners )
116 corners.resize( geometry.
corners() );
117 for(
int i = 0; i < geometry.
corners(); ++i )
121 corners[ i ][ j ] = corner[ j ];
126 dgf::BoundaryDomBlock *boundaryDomainBlock_;
127 std::vector< double > emptyParam;
132 template<
int dim,
int dimworld,
class ctype >
133 inline void DGFGridFactory< SGrid< dim, dimworld, ctype > >
134 ::generate ( std::istream &gridin, MPICommunicatorType comm )
136 dgf::IntervalBlock intervalBlock( gridin );
138 if( !intervalBlock.isactive() )
139 DUNE_THROW( DGFException,
"SGrid can only be created from an interval block." );
141 if( intervalBlock.numIntervals() != 1 )
142 DUNE_THROW( DGFException,
"SGrid can only handle 1 interval block." );
144 if( intervalBlock.dimw() != dim )
146 DUNE_THROW( DGFException,
147 "Cannot read an interval of dimension " << intervalBlock.dimw()
148 <<
"into a SGrid< " << dim <<
", " << dimworld <<
" >." );
151 const dgf::IntervalBlock::Interval &interval = intervalBlock.get( 0 );
153 FieldVector< double, dimension > lower, upper;
154 FieldVector< int, dimension > anz;
155 for(
int i = 0; i < dimension; ++i )
157 lower[ i ] = interval.p[ 0 ][ i ];
158 upper[ i ] = interval.p[ 1 ][ i ];
159 anz[ i ] = interval.n[ i ];
162 grid_ =
new Grid( anz, lower, upper );
164 boundaryDomainBlock_ =
new dgf::BoundaryDomBlock( gridin, dimension );
169 template<
int dim,
int dimworld,
class ctype >
179 return 1.0 / double( 1 << dim );
184 #endif // #ifndef DUNE_DGFS_HH