ensightFacesI.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-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29
30inline Foam::label
31Foam::ensightFaces::add(const elemType etype, label id, bool flip)
32{
33 // Linear addressing location
34 const label index = offsets_[etype] + sizes_[etype]++;
35
36 addressing()[index] = id;
37
38 if (flipMap_.size())
39 {
40 flipMap_[index] = flip;
41 }
42
43 return index;
44}
45
46
47// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
48
49inline const char* Foam::ensightFaces::key(const elemType etype)
50{
51 return elemNames[etype];
52}
53
54
56{
57 return sizes_;
58}
59
60
61inline Foam::label Foam::ensightFaces::total(const elemType etype) const
62{
63 return sizes_[etype];
64}
65
66
67inline Foam::label Foam::ensightFaces::size(const elemType etype) const
68{
69 return (offsets_[etype+1] - offsets_[etype]);
70}
71
72
74{
75 return labelRange(offsets_[etype], offsets_[etype+1] - offsets_[etype]);
76}
77
78
80{
81 return addressing();
82}
83
84
85inline const Foam::labelUList
87{
88 return addressing().slice(range(etype));
89}
90
91
93{
94 return flipMap_;
95}
96
97
99{
100 return (!flipMap_.empty() && flipMap_.size() == size());
101}
102
103
104inline const Foam::labelList&
106{
107 return faceOrder_;
108}
109
110
111inline const Foam::labelUList
113{
114 return faceOrder_.slice(range(etype));
115}
116
117
118inline void Foam::ensightFaces::incrFaceIds(const label off)
119{
120 incrAddressing(off);
121}
122
123
124inline void Foam::ensightFaces::decrFaceIds(const label off)
125{
126 decrAddressing(off);
127}
128
129
130// ************************************************************************* //
scalar range
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: FixedList.H:81
const Key & key() const
The key associated with the iterator.
SubList< T > slice(const label pos, label len=-1)
Return SubList slice (non-const access) - no range checking.
Definition: SubList.H:165
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
bool usesFlipMap() const
True for non-zero flip-map that spans the addresses.
Definition: ensightFacesI.H:98
void decrFaceIds(const label off)
Decrease face ids by specified offset value.
const labelList & faceIds() const noexcept
Processor-local face ids of all elements.
Definition: ensightFacesI.H:79
const labelList & faceOrder() const noexcept
void incrFaceIds(const label off)
Increase face ids by specified offset value.
elemType
Supported ensight 'Face' element types.
Definition: ensightFaces.H:83
label size() const noexcept
Processor-local size of all elements.
Definition: ensightPart.H:154
label total() const
The global size of all element types.
Definition: ensightFaces.C:136
const boolList & flipMap() const
Processor-local flip-map of all elements.
Definition: ensightFacesI.H:92
const FixedList< label, nTypes > & totals() const
The global sizes for each element type.
Definition: ensightFacesI.H:55
label index() const noexcept
The index in a list (0-based)
Definition: ensightPart.H:124
const labelList & addressing() const noexcept
Element addressing.
Definition: ensightPart.H:76
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
Definition: add.H:161
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:58
const direction noexcept
Definition: Scalar.H:223