dune-grid  2.11
general.hh
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 // vi: set et ts=4 sw=2 sts=2:
5 #ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
6 #define DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
7 
8 #include <iostream>
9 #include <vector>
10 
12 
13 
14 namespace Dune
15 {
16 
17  namespace dgf
18  {
19 
20  // GeneralBlock
21  // ---------
22 
24  : public BasicBlock
25  {
26  unsigned int nofvtx;
27  int dimgrid;
28  bool goodline; // active line describes a vertex
29  std :: vector< unsigned int > map; // active vertex
30  int nofparams;
31  int vtxoffset;
32 
33  public:
34  GeneralBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
35 
36  int get ( std :: vector< std :: vector< unsigned int> > &simplex,
37  std :: vector< std :: vector< double > > &params,
38  int &nofp );
39 
40  // some information
41  bool ok ()
42  {
43  return goodline;
44  }
45 
46  int nofsimplex ()
47  {
48  return noflines();
49  }
50 
51  private:
52  // get the dimension of the grid
53  int getDimGrid ();
54  // get next simplex
55  bool next ( std :: vector< unsigned int > &simplex,
56  std :: vector< double > &param );
57  };
58 
59  } // end namespace dgf
60 
61 } // end namespace Dune
62 
63 #endif // #ifndef DUNE_GRID_IO_FILE_DGFPARSER_BLOCKS_GENERAL_HH
int & noflines()
Definition: basic.hh:87
Definition: general.hh:23
Include standard header files.
Definition: agrid.hh:59
bool ok()
Definition: general.hh:41
Definition: basic.hh:30
GeneralBlock(std ::istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid)
Definition: general.cc:18
int nofsimplex()
Definition: general.hh:46