dune-grid  2.2.1
boundaryseg.hh
Go to the documentation of this file.
1 #ifndef DUNE_DGF_BOUNDARYSEGBLOCK_HH
2 #define DUNE_DGF_BOUNDARYSEGBLOCK_HH
3 
4 #include <cassert>
5 #include <iostream>
6 #include <string>
7 #include <vector>
8 #include <map>
9 
12 
13 
14 namespace Dune
15 {
16 
17  namespace dgf
18  {
20  : public BasicBlock
21  {
22  int dimworld; // the dimension of the vertices (is given from user)
23  bool goodline; // active line describes a vertex
24  std :: vector< unsigned int > p; // active vertex
25  int bndid;
26  typedef DGFBoundaryParameter::type BoundaryParameter;
27  BoundaryParameter parameter;
28  bool simplexgrid;
29 
30  public:
32  typedef std::pair < int, BoundaryParameter > BndParam;
33 
34  // initialize vertex block and get first vertex
35  BoundarySegBlock ( std :: istream &in, int pnofvtx,
36  int pdimworld, bool psimplexgrid );
37 
38  // some information
39  int get( std :: map< EntityKey, BndParam > & facemap,
40  bool fixedsize,
41  int vtxoffset
42  );
43 
44  bool ok()
45  {
46  return goodline;
47  }
48 
49  int nofbound()
50  {
51  return noflines();
52  }
53 
54  private:
55  bool next();
56 
57  // get coordinates of active vertex
58  int operator[] (int i)
59  {
60  assert(ok());
61  assert(linenumber()>=0);
62  assert(0<=i && i<dimworld+1);
63  return p[i];
64  }
65 
66  int size()
67  {
68  return p.size();
69  }
70 
71  };
72 
73  } // end namespace dgf
74 
75 } // end namespace Dune
76 
77 #endif