ensightCellsI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "error.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 inline const char* Foam::ensightCells::key(const enum elemType what)
33 {
34  return elemNames[what];
35 }
36 
37 
39 {
40  return index_;
41 }
42 
43 
45 {
46  return index_;
47 }
48 
49 
51 {
52  return address_.size();
53 }
54 
55 
57 {
58  return sizes_;
59 }
60 
61 
62 inline Foam::label Foam::ensightCells::total(const enum elemType what) const
63 {
64  return sizes_[what];
65 }
66 
67 
68 inline Foam::label Foam::ensightCells::size(const enum elemType what) const
69 {
70  return slices_[what].size();
71 }
72 
73 
74 inline Foam::label Foam::ensightCells::offset(const enum elemType what) const
75 {
76  return slices_[what].start();
77 }
78 
79 
81 (
82  const enum elemType what
83 ) const
84 {
85  return address_[slices_[what]];
86 }
87 
88 
90 {
91  return address_;
92 }
93 
94 
96 {
97  return address_[i];
98 }
99 
100 
101 // ************************************************************************* //
Foam::ensightCells::elemNames
static const char * elemNames[5]
The ensight element type names.
Definition: ensightCells.H:73
Foam::ensightCells::cellIds
const labelUList & cellIds() const
Return the cell ids of all elements.
Definition: ensightCellsI.H:89
Foam::ensightCells::index
label index() const
The index in a list.
Definition: ensightCellsI.H:38
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
error.H
Foam::ensightCells::key
static const char * key(const enum elemType)
Return the ensight element name for the specified type.
Definition: ensightCellsI.H:32
Foam::ensightCells::total
label total() const
The global number of all element types.
Definition: ensightCells.C:117
Foam::ensightCells::operator[]
label operator[](const label i) const
Return id from linear list of addressing.
Definition: ensightCellsI.H:95
Foam::ensightCells::elemType
elemType
Addressable ensight element types.
Definition: ensightCells.H:60
Foam::ensightCells::offset
label offset(const enum elemType what) const
Processor local starting offset of element type.
Definition: ensightCellsI.H:74
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
Foam::UList< label >
Foam::ensightCells::size
label size() const
The processor local size of all elements.
Definition: ensightCellsI.H:50
Foam::ensightCells::totals
const FixedList< label, 5 > & totals() const
The global numbers per element type.
Definition: ensightCellsI.H:56