Dune Core Modules (2.10.0)

simplex.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_SIMPLEXBLOCK_HH
6#define DUNE_DGF_SIMPLEXBLOCK_HH
7
8#include <iostream>
9#include <vector>
10
11#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
12
13namespace Dune
14{
15
16 namespace dgf
17 {
18 // SimplexBlock
19 // ------------
20
21 class SimplexBlock
22 : public BasicBlock
23 {
24 unsigned int nofvtx;
25 int vtxoffset;
26 int dimgrid;
27 bool goodline; // active line describes a vertex
28 int nofparams; // nof parameters
29
30 public:
31 SimplexBlock ( std :: istream &in, int pnofvtx, int pvtxoffset, int &pdimgrid );
32
33 int get ( std :: vector< std :: vector< unsigned int > > &simplex,
34 std :: vector< std :: vector< double > > &params,
35 int &nofp );
36
37 // cubes -> simplex
38 static int
39 cube2simplex ( std :: vector< std :: vector< double > > &vtx,
40 std :: vector< std :: vector< unsigned int > > &elements,
41 std :: vector< std :: vector< double > > &params );
42
43 // some information
44 bool ok ()
45 {
46 return goodline;
47 }
48
49 int nofsimplex ()
50 {
51 return noflines();
52 }
53
54 private:
55 // get the dimension of the grid
56 int getDimGrid ();
57 // get next simplex
58 bool next ( std :: vector< unsigned int > &simplex,
59 std :: vector< double > &param );
60 };
61
62 } // end namespace dgf
63
64} // end namespace Dune
65
66#endif
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:453
Dune namespace.
Definition: alignedallocator.hh:13
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
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 28, 23:30, 2024)