3#ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH
4#define DUNE_DGFPARSER_DGFIDENTITYGRID_HH
9#include <dune/grid/io/file/dgfparser/dgfparser.hh>
10#include <dune/grid/utility/hostgridaccess.hh>
18 template<
class HostGr
id >
19 struct DGFGridFactory< IdentityGrid< HostGrid > >
21 typedef IdentityGrid< HostGrid > Grid;
25 typedef typename Grid::template Codim<0>::Entity Element;
26 typedef typename Grid::template Codim<dimension>::Entity Vertex;
28 explicit DGFGridFactory ( std::istream &input,
30 : dgfHostFactory_( input, comm ),
33 HostGrid *hostGrid = dgfHostFactory_.grid();
34 assert( hostGrid != 0 );
35 grid_ =
new Grid( *hostGrid );
38 explicit DGFGridFactory (
const std::string &filename,
40 : dgfHostFactory_( filename, comm ),
43 HostGrid *hostGrid = dgfHostFactory_.grid();
44 assert( hostGrid != 0 );
45 std::ifstream input( filename.c_str() );
46 grid_ =
new Grid( *hostGrid );
54 template<
class Intersection >
55 bool wasInserted (
const Intersection &intersection )
const
57 return dgfHostFactory_.wasInserted( HostGridAccess< Grid >::hostIntersection( intersection ) );
60 template<
class Intersection >
61 int boundaryId (
const Intersection &intersection )
const
63 return dgfHostFactory_.boundaryId( HostGridAccess< Grid >::hostIntersection( intersection ) );
67 int numParameters ()
const
69 return dgfHostFactory_.template numParameters< codim >();
72 template<
class Entity >
73 std::vector< double > ¶meter (
const Entity &entity )
75 return dgfHostFactory_.parameter( HostGridAccess< Grid >::hostEntity( entity ) );
79 DGFGridFactory< HostGrid > dgfHostFactory_;
88 template<
class HostGr
id >
89 struct DGFGridInfo< IdentityGrid< HostGrid > >
@ dimension
The dimension of the grid.
Definition: grid.hh:387
MPI_Comm MPICommunicator
The type of the mpi communicator.
Definition: mpihelper.hh:182
static MPICommunicator getCommunicator()
get the default communicator
Definition: mpihelper.hh:190
Dune namespace.
Definition: alignedallocator.hh:14
static double refineWeight()
static int refineStepsForHalf()
number of globalRefine steps needed to refuce h by 0.5
Traits for type conversions and type information.