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-2020 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 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 inline void Foam::ensightFaces::add(const elemType etype, label id, bool flip)
31 {
32  // Linear addressing location
33  const label index = offsets_[etype] + sizes_[etype]++;
34 
35  addressing()[index] = id;
36 
37  if (flipMap_.size())
38  {
39  flipMap_[index] = flip;
40  }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
45 
46 inline const char* Foam::ensightFaces::key(const elemType etype)
47 {
48  return elemNames[etype];
49 }
50 
51 
53 {
54  return sizes_;
55 }
56 
57 
58 inline Foam::label Foam::ensightFaces::total(const elemType etype) const
59 {
60  return sizes_[etype];
61 }
62 
63 
64 inline Foam::label Foam::ensightFaces::size(const elemType etype) const
65 {
66  return (offsets_[etype+1] - offsets_[etype]);
67 }
68 
69 
71 {
72  return labelRange(offsets_[etype], offsets_[etype+1] - offsets_[etype]);
73 }
74 
75 
77 {
78  return addressing();
79 }
80 
81 
82 inline const Foam::labelUList
84 {
85  return addressing()[range(etype)];
86 }
87 
88 
90 {
91  return flipMap_;
92 }
93 
94 
96 {
97  return (!flipMap_.empty() && flipMap_.size() == size());
98 }
99 
100 
101 inline void Foam::ensightFaces::incrFaceIds(const label off)
102 {
103  incrAddressing(off);
104 }
105 
106 
107 inline void Foam::ensightFaces::decrFaceIds(const label off)
108 {
109  decrAddressing(off);
110 }
111 
112 
113 // ************************************************************************* //
Foam::ensightFaces::flipMap
const boolList & flipMap() const
Processor-local flip-map of all elements.
Definition: ensightFacesI.H:89
Foam::ensightPart::addressing
const labelList & addressing() const
Element addressing.
Definition: ensightPart.H:76
Foam::ensightFaces::decrFaceIds
void decrFaceIds(const label off)
Decrease face ids by specified offset value.
Definition: ensightFacesI.H:107
Foam::ensightPart::index
label index() const
The index in a list (0-based)
Definition: ensightPart.H:124
Foam::ensightPart::size
label size() const
Processor-local size of all elements.
Definition: ensightPart.H:154
Foam::ensightFaces::key
static const char * key(const elemType etype)
The ensight element name for the specified 'Face' type.
Definition: ensightFacesI.H:46
Foam::ensightFaces::usesFlipMap
bool usesFlipMap() const
True for non-zero flip-map that spans the addresses.
Definition: ensightFacesI.H:95
Foam::ensightFaces::range
labelRange range(const elemType etype) const
Processor-local offset/size of element type.
Definition: ensightFacesI.H:70
Foam::ensightFaces::total
label total() const
The global size of all element types.
Definition: ensightFaces.C:130
Foam::labelRange
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:55
Foam::ensightFaces::faceIds
const labelList & faceIds() const
Processor-local face ids of all elements.
Definition: ensightFacesI.H:76
Foam::ensightFaces::totals
const FixedList< label, nTypes > & totals() const
The global sizes for each element type.
Definition: ensightFacesI.H:52
Foam::ensightFaces::incrFaceIds
void incrFaceIds(const label off)
Increase face ids by specified offset value.
Definition: ensightFacesI.H:101
Foam::ensightFaces::elemType
elemType
Supported ensight 'Face' element types.
Definition: ensightFaces.H:78
range
scalar range
Definition: LISASMDCalcMethod1.H:12
Foam::List< label >
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
Foam::UList< label >