16 template<
class Gr
idImp,
class IntersectionImp >
24 template<
int dim,
int dimworld,
class ctype >
34 typedef FieldVector< double, dimension > Point;
40 MPICommunicatorType comm = MPIHelper::getCommunicator() )
42 generate( input, comm );
46 MPICommunicatorType comm = MPIHelper::getCommunicator() )
48 std::ifstream input( filename.c_str() );
49 generate( input, comm );
57 template<
class Intersection >
63 template<
class Intersection >
66 if( boundaryDomainBlock_->isactive() )
68 std::vector< Point > corners;
69 getCorners( intersection.
geometry(), corners );
70 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
89 return boundaryDomainBlock_->isactive();
92 template<
class GG,
class II >
98 std::vector< Point > corners;
99 getCorners( intersection.
geometry(), corners );
100 const dgf::DomainData *data = boundaryDomainBlock_->contains( corners );
111 template<
class Entity >
118 void generate( std::istream &gridin, MPICommunicatorType comm );
120 template<
class Geometry >
121 static void getCorners (
const Geometry &geometry, std::vector< Point > &corners )
123 corners.resize( geometry.
corners() );
124 for(
int i = 0; i < geometry.
corners(); ++i )
128 corners[ i ][ j ] = corner[ j ];
134 std::vector< double > emptyParam;
139 template<
int dim,
int dimworld,
class ctype >
141 ::generate ( std::istream &gridin, MPICommunicatorType comm )
146 DUNE_THROW(
DGFException,
"SGrid can only be created from an interval block." );
149 DUNE_THROW(
DGFException,
"SGrid can only handle 1 interval block." );
151 if( intervalBlock.
dimw() != dim )
154 "Cannot read an interval of dimension " << intervalBlock.
dimw()
155 <<
"into a SGrid< " << dim <<
", " << dimworld <<
" >." );
160 FieldVector< double, dimension > lower, upper;
161 FieldVector< int, dimension > anz;
164 lower[ i ] = interval.p[ 0 ][ i ];
165 upper[ i ] = interval.p[ 1 ][ i ];
166 anz[ i ] = interval.n[ i ];
169 grid_ =
new Grid( anz, lower, upper );
176 template<
int dim,
int dimworld,
class ctype >
186 return 1.0 / double( 1 << dim );
191 #endif // #ifndef DUNE_DGFS_HH int corners() const
Return the number of corners of the reference element.
Definition: common/geometry.hh:142
int dimw() const
Definition: interval.hh:65
Definition: boundarydom.hh:20
Intersection of a mesh entities of codimension 0 ("elements") with a "neighboring" element or with th...
Definition: albertagrid/dgfparser.hh:26
bool isactive()
Definition: basic.hh:75
const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
Definition: dgfs.hh:94
DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
Definition: dgfs.hh:45
Wrapper class for geometries.
Definition: common/geometry.hh:65
[ provides Dune::Grid ]
Definition: sgrid.hh:54
Definition: interval.hh:23
static const int dimension
Definition: dgfgridfactory.hh:38
static const type & defaultValue()
default constructor
Definition: parser.hh:26
int numIntervals() const
Definition: interval.hh:60
static double refineWeight()
Definition: dgfs.hh:184
Wrapper class for entities.
Definition: common/entity.hh:61
const BoundaryParameter & parameter() const
Definition: boundarydom.hh:52
std::vector< double > & parameter(const Entity &entity)
Definition: dgfs.hh:112
std::string type
type of additional boundary parameters
Definition: parser.hh:23
FieldVector< ctype, cdim > GlobalCoordinate
type of the global coordinates
Definition: common/geometry.hh:104
SGrid< dim, dimworld, ctype > Grid
Definition: dgfs.hh:27
static int refineStepsForHalf()
Definition: dgfs.hh:179
int id() const
Definition: boundarydom.hh:40
int boundaryId(const Intersection &intersection) const
Definition: dgfs.hh:64
GlobalCoordinate corner(int i) const
Obtain a corner of the geometry.
Definition: common/geometry.hh:156
void get(std::vector< std::vector< double > > &vtx, int &nofvtx, std::vector< std::vector< unsigned int > > &simplex, int &nofsimpl)
Definition: interval.hh:38
bool haveBoundaryParameters() const
Definition: dgfgridfactory.hh:156
Grid * grid() const
Definition: dgfs.hh:52
Include standard header files.
Definition: agrid.hh:59
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in...
Definition: common/intersection.hh:393
DGFGridFactory(std::istream &input, MPICommunicatorType comm=MPIHelper::getCommunicator())
Definition: dgfs.hh:39
bool haveBoundaryParameters() const
Definition: dgfs.hh:87
Definition: boundarydom.hh:191
int numParameters() const
Definition: dgfs.hh:81
Some simple static information for a given GridType.
Definition: io/file/dgfparser/dgfparser.hh:54
MPIHelper::MPICommunicator MPICommunicatorType
Definition: dgfs.hh:31
Geometry geometry() const
geometrical information about the intersection in global coordinates.
Definition: common/intersection.hh:373
The dimension of the grid.
Definition: common/grid.hh:402
G Grid
Definition: dgfgridfactory.hh:37
Definition: interval.hh:20
exception class for IO errors in the DGF parser
Definition: dgfexception.hh:12
bool wasInserted(const Intersection &intersection) const
Definition: dgfs.hh:58