DUNE PDELab (git)

boundaryseg.hh
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_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
14#include <dune/grid/io/file/dgfparser/parser.hh>
15#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
16
17
18namespace Dune
19{
20
21 namespace dgf
22 {
23 class BoundarySegBlock
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:
35 typedef DGFEntityKey< unsigned int> EntityKey;
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
53 int nofbound()
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
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
Return the entry at position pos of the given sequence.
Definition: integersequence.hh:22
std::string type
type of additional boundary parameters
Definition: parser.hh:25
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)