5#ifndef DUNE_DGFPARSER_DGFIDENTITYGRID_HH
6#define DUNE_DGFPARSER_DGFIDENTITYGRID_HH
11#include <dune/grid/io/file/dgfparser/dgfparser.hh>
12#include <dune/grid/utility/hostgridaccess.hh>
20 template<
class HostGr
id >
21 struct DGFGridFactory< IdentityGrid< HostGrid > >
23 typedef IdentityGrid< HostGrid > Grid;
27 typedef typename Grid::template Codim<0>::Entity Element;
28 typedef typename Grid::template Codim<dimension>::Entity Vertex;
30 explicit DGFGridFactory ( std::istream &input,
32 : dgfHostFactory_( input, comm ),
35 HostGrid *hostGrid = dgfHostFactory_.grid();
36 assert( hostGrid != 0 );
37 grid_ =
new Grid( *hostGrid );
40 explicit DGFGridFactory (
const std::string &filename,
42 : dgfHostFactory_( filename, comm ),
45 HostGrid *hostGrid = dgfHostFactory_.grid();
46 assert( hostGrid != 0 );
47 std::ifstream input( filename.c_str() );
48 grid_ =
new Grid( *hostGrid );
56 template<
class Intersection >
57 bool wasInserted (
const Intersection &intersection )
const
59 return dgfHostFactory_.wasInserted( HostGridAccess< Grid >::hostIntersection( intersection ) );
62 template<
class Intersection >
63 int boundaryId (
const Intersection &intersection )
const
65 return dgfHostFactory_.boundaryId( HostGridAccess< Grid >::hostIntersection( intersection ) );
69 int numParameters ()
const
71 return dgfHostFactory_.template numParameters< codim >();
74 template<
class Entity >
75 std::vector< double > ¶meter (
const Entity &entity )
77 return dgfHostFactory_.parameter( HostGridAccess< Grid >::hostEntity( entity ) );
81 DGFGridFactory< HostGrid > dgfHostFactory_;
90 template<
class HostGr
id >
91 struct DGFGridInfo< IdentityGrid< HostGrid > >
static constexpr int dimension
The dimension of the grid.
Definition: grid.hh:387
MPI_Comm MPICommunicator
The type of the mpi communicator.
Definition: mpihelper.hh:192
static MPICommunicator getCommunicator()
get the default communicator
Definition: mpihelper.hh:200
Dune namespace.
Definition: alignedallocator.hh:13
static double refineWeight()
static int refineStepsForHalf()
number of globalRefine steps needed to refuce h by 0.5
Traits for type conversions and type information.