dune-grid 2.9.0
boundaryseg.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 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_DGF_BOUNDARYSEGBLOCK_HH
6#define DUNE_DGF_BOUNDARYSEGBLOCK_HH
7
8#include <cassert>
9#include <iostream>
10#include <string>
11#include <vector>
12#include <map>
13
16
17
18namespace Dune
19{
20
21 namespace dgf
22 {
24 : public BasicBlock
25 {
26 int dimworld; // the dimension of the vertices (is given from user)
27 bool goodline; // active line describes a vertex
28 std :: vector< unsigned int > p; // active vertex
29 int bndid;
30 typedef DGFBoundaryParameter::type BoundaryParameter;
31 BoundaryParameter parameter;
32 bool simplexgrid;
33
34 public:
36 typedef std::pair < int, BoundaryParameter > BndParam;
37
38 // initialize vertex block and get first vertex
39 BoundarySegBlock ( std :: istream &in, int pnofvtx,
40 int pdimworld, bool psimplexgrid );
41
42 // some information
43 int get( std :: map< EntityKey, BndParam > & facemap,
44 bool fixedsize,
45 int vtxoffset
46 );
47
48 bool ok()
49 {
50 return goodline;
51 }
52
54 {
55 return noflines();
56 }
57
58 private:
59 bool next();
60
61 // get coordinates of active vertex
62 int operator[] (int i)
63 {
64 assert(ok());
65 assert(linenumber()>=0);
66 assert(0<=i && i<dimworld+1);
67 return p[i];
68 }
69
70 int size()
71 {
72 return p.size();
73 }
74
75 };
76
77 } // end namespace dgf
78
79} // end namespace Dune
80
81#endif
Include standard header files.
Definition: agrid.hh:60
Definition: basic.hh:31
int & noflines()
Definition: basic.hh:87
int linenumber()
Definition: basic.hh:92
Definition: boundaryseg.hh:25
bool ok()
Definition: boundaryseg.hh:48
int get(std ::map< EntityKey, BndParam > &facemap, bool fixedsize, int vtxoffset)
Definition: boundaryseg.cc:35
std::pair< int, BoundaryParameter > BndParam
Definition: boundaryseg.hh:36
BoundarySegBlock(std ::istream &in, int pnofvtx, int pdimworld, bool psimplexgrid)
Definition: boundaryseg.cc:18
DGFEntityKey< unsigned int > EntityKey
Definition: boundaryseg.hh:35
int nofbound()
Definition: boundaryseg.hh:53
std::string type
type of additional boundary parameters
Definition: parser.hh:25