DUNE-FEM (unstable)

corner.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
6#ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH
7#define DUNE_GRID_IO_FILE_VTK_CORNER_HH
8
10
11namespace Dune
12{
15
16 namespace VTK {
17
19
24 template<typename Cell>
25 class Corner {
26 // store a pointer to the element
27 const Cell* cell_;
28 // store index of the corner within element (Dune numbering)
29 unsigned index;
30
31 public:
33
38 Corner(const Cell& cell, unsigned duneIndex)
39 : cell_(&cell), index(duneIndex)
40 { }
41
43 Corner() { }
44
46 const Cell& cell() const { return *cell_; }
48
52 void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }
53
55 unsigned duneIndex() const { return index; }
57 void duneIndex(unsigned i) { index = i; }
58
60
63 unsigned vtkIndex() const { return renumber(cell_->type(), index); }
65
68 void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }
69 };
70
71 } // namespace VTK
72
74
75} // namespace Dune
76
77#endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH
simple class representing a corner of a cell
Definition: corner.hh:25
unsigned vtkIndex() const
get the index of the corner within the cell in VTK-numbering
Definition: corner.hh:63
void vtkIndex(unsigned i)
set the index of the corner within the cell in VTK-numbering
Definition: corner.hh:68
Corner(const Cell &cell, unsigned duneIndex)
construct a Corner
Definition: corner.hh:38
void cell(const Cell &cell__)
set a new cell
Definition: corner.hh:52
void duneIndex(unsigned i)
set the index of the corner within the cell in Dune-numbering
Definition: corner.hh:57
unsigned duneIndex() const
get the index of the corner within the cell in Dune-numbering
Definition: corner.hh:55
const Cell & cell() const
get reference to the cell
Definition: corner.hh:46
Corner()
construct an invalid Corner
Definition: corner.hh:43
Common stuff for the VTKWriter.
int renumber(const Dune::GeometryType &t, int i)
renumber VTK <-> Dune
Definition: common.hh:186
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)