5 #ifndef DUNE_ALBERTA_DGFPARSER_HH 6 #define DUNE_ALBERTA_DGFPARSER_HH 27 template<
class Gr
idImp,
class IntersectionImp >
35 template<
int dim,
int dimworld >
55 template<
class Intersection >
58 return factory_.wasInserted( intersection );
61 template<
class Intersection >
64 return intersection.
impl().boundaryId();
70 return dgf_.haveBndParameters;
73 template <
class GG,
class II >
81 auto refElem = referenceElement< double, dimension >( entity.type() );
82 int corners = refElem.size( face, 1,
dimension );
83 std :: vector< unsigned int > bound( corners );
84 for(
int i=0; i < corners; ++i )
86 const int k = refElem.subEntity( face, 1, i,
dimension );
87 bound[ i ] = factory_.insertionIndex( entity.template subEntity< dimension >( k ) );
90 DuneGridFormatParser::facemap_t::key_type key( bound,
false );
91 const DuneGridFormatParser::facemap_t::const_iterator pos = dgf_.facemap.find( key );
92 if( pos != dgf_.facemap.end() )
93 return dgf_.facemap.find( key )->second.second;
102 return dgf_.nofelparams;
104 return dgf_.nofvtxparams;
111 if( numParameters< 0 >() <= 0 )
113 DUNE_THROW( InvalidStateException,
114 "Calling DGFGridFactory::parameter is only allowed if there are parameters." );
116 return dgf_.elParams[ factory_.insertionIndex( element ) ];
121 if( numParameters< dimension >() <= 0 )
123 DUNE_THROW( InvalidStateException,
124 "Calling DGFGridFactory::parameter is only allowed if there are parameters." );
126 return dgf_.vtxParams[ factory_.insertionIndex(
vertex ) ];
130 bool generate( std::istream &input );
142 template<
int dim,
int dimworld >
161 template<
int dim,
int dimworld >
162 inline DGFGridFactory< AlbertaGrid< dim, dimworld > >
169 DUNE_THROW(
DGFException,
"Error resetting input stream." );
174 template<
int dim,
int dimworld >
179 std::ifstream input( filename.c_str() );
181 DUNE_THROW(
DGFException,
"Macrofile " << filename <<
" not found." );
182 if( !generate( input ) )
189 #endif // #if HAVE_ALBERTA 191 #endif // #ifndef DUNE_ALBERTA_DGFPARSER_HH int boundaryId(const Intersection &intersection) const
Definition: albertagrid/dgfparser.hh:62
concept Entity
Model of a grid entity.
Definition: concepts/entity.hh:119
GridImp::template Codim< 0 >::Entity Entity
Type of entity that this Intersection belongs to.
Definition: common/intersection.hh:192
The DuneGridFormatParser class: reads a DGF file and stores build information in vector structures us...
Definition: parser.hh:46
specialization of the generic GridFactory for AlbertaGrid
AlbertaGrid< dim, dimworld > Grid
Definition: albertagrid/dgfparser.hh:38
static int refineStepsForHalf()
Definition: albertagrid/dgfparser.hh:145
Grid abstract base classThis class is the base class for all grid implementations. Although no virtual functions are used we call it abstract since its methods do not contain an implementation but forward to the methods of the derived class via the Barton-Nackman trick.
Definition: common/grid.hh:375
Entity inside() const
return Entity on the inside of this intersection. That is the Entity where we started this...
Definition: common/intersection.hh:250
const DGFBoundaryParameter::type & boundaryParameter(const Intersection< GG, II > &intersection) const
Definition: albertagrid/dgfparser.hh:75
concept Intersection
Model of an intersection.
Definition: concepts/intersection.hh:23
Some simple static information for a given GridType.
Definition: io/file/dgfparser/dgfparser.hh:55
Grid * grid() const
Definition: albertagrid/dgfparser.hh:50
Grid::template Codim< 0 >::Entity Element
Definition: albertagrid/dgfparser.hh:41
int numParameters() const
Definition: albertagrid/dgfparser.hh:99
Definition: common.hh:133
bool haveBoundaryParameters() const
Definition: albertagrid/dgfparser.hh:68
static double refineWeight()
Definition: albertagrid/dgfparser.hh:150
Grid::template Codim< dimension >::Entity Vertex
Definition: albertagrid/dgfparser.hh:42
std::string type
type of additional boundary parameters
Definition: parser.hh:25
DGFGridFactory(const std::string &filename, MPICommunicatorType comm=MPIHelper::getCommunicator())
Definition: dgfgridfactory.hh:50
Include standard header files.
Definition: agrid.hh:59
bool wasInserted(const Intersection &intersection) const
Definition: albertagrid/dgfparser.hh:56
std::vector< double > & parameter(const Vertex &vertex)
Definition: albertagrid/dgfparser.hh:119
static constexpr int dimension
The dimension of the grid.
Definition: common/grid.hh:387
Intersection of a mesh entity of codimension 0 ("element") with a "neighboring" element or with the d...
Definition: albertagrid/dgfparser.hh:28
static const type & defaultValue()
default constructor
Definition: parser.hh:28
MPIHelper::MPICommunicator MPICommunicatorType
Definition: albertagrid/dgfparser.hh:40
std::vector< double > & parameter(const Element &element)
Definition: albertagrid/dgfparser.hh:109
int indexInInside() const
Local index of codim 1 entity in the inside() entity where intersection is contained in...
Definition: common/intersection.hh:351
Implementation & impl()
access to the underlying implementation
Definition: common/intersection.hh:178
[ provides Dune::Grid ]
Definition: agrid.hh:106
Dune::GridFactory< Grid > GridFactory
Definition: albertagrid/dgfparser.hh:43
static const int dimension
Definition: dgfgridfactory.hh:40
exception class for IO errors in the DGF parser
Definition: dgfexception.hh:14