dune-grid  2.2.1
simplex.hh
Go to the documentation of this file.
1 #ifndef DUNE_DGF_SIMPLEXBLOCK_HH
2 #define DUNE_DGF_SIMPLEXBLOCK_HH
3 
4 #include <iostream>
5 #include <vector>
6 
8 
9 namespace Dune
10 {
11 
12  namespace dgf
13  {
14  // SimplexBlock
15  // ------------
16 
18  : public BasicBlock
19  {
20  unsigned int nofvtx;
21  int vtxoffset;
22  int dimgrid;
23  bool goodline; // active line describes a vertex
24  int nofparams; // nof parameters
25 
26  public:
27  SimplexBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
28 
29  int get ( std :: vector< std :: vector< unsigned int > > &simplex,
30  std :: vector< std :: vector< double > > &params,
31  int &nofp );
32 
33  // cubes -> simplex
34  static int
35  cube2simplex ( std :: vector< std :: vector< double > > &vtx,
36  std :: vector< std :: vector< unsigned int > > &elements,
37  std :: vector< std :: vector< double > > &params );
38 
39  // some information
40  bool ok ()
41  {
42  return goodline;
43  }
44 
45  int nofsimplex ()
46  {
47  return noflines();
48  }
49 
50  private:
51  // get the dimension of the grid
52  int getDimGrid ();
53  // get next simplex
54  bool next ( std :: vector< unsigned int > &simplex,
55  std :: vector< double > &param );
56  };
57 
58  } // end namespace dgf
59 
60 } // end namespace Dune
61 
62 #endif
63