cellModelI.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30
31inline const Foam::word& Foam::cellModel::name() const noexcept
32{
33 return name_;
34}
35
36
37inline Foam::label Foam::cellModel::index() const noexcept
38{
39 return index_;
40}
41
42
43inline Foam::label Foam::cellModel::nPoints() const noexcept
44{
45 return nPoints_;
46}
47
48
49inline Foam::label Foam::cellModel::nEdges() const noexcept
50{
51 return edges_.size();
52}
53
54
55inline Foam::label Foam::cellModel::nFaces() const noexcept
56{
57 return faces_.size();
58}
59
60
62{
63 return edges_;
64}
65
66
68{
69 return faces_;
70}
71
72
74(
76) const
77{
78 edgeList theEdges(edges_.size());
79
80 forAll(edges_, edgei)
81 {
82 // From model labels to global labels
83 theEdges[edgei] = Foam::edge(pointLabels, edges_[edgei]);
84 }
85
86 return theEdges;
87}
88
89
91(
92 const label modelEdgei,
94) const
95{
96 // From model labels to global labels
97 return Foam::edge(pointLabels, edges_[modelEdgei]);
98}
99
100
102(
104) const
105{
106 faceList theFaces(faces_.size());
107
108 forAll(faces_, facei)
109 {
110 // From model labels to global labels
111 theFaces[facei] = Foam::face(pointLabels, faces_[facei]);
112 }
113
114 return theFaces;
115}
116
117
119(
120 const label modelFacei,
122) const
123{
124 // From model labels to global labels
125 return Foam::face(pointLabels, faces_[modelFacei]);
126}
127
128
129// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
130
131inline bool Foam::operator==
132(
133 const cellModel& lhs,
134 const cellModel& rhs
135) noexcept
136{
137 return (&lhs == &rhs);
138}
139
140
141inline bool Foam::operator!=
142(
143 const cellModel& lhs,
144 const cellModel& rhs
145) noexcept
146{
147 return (&lhs != &rhs);
148}
149
150
151// ************************************************************************* //
static const faceList faces
Faces to point addressing, as per a 'hex' cell.
Definition: boundBox.H:89
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:73
const word & name() const noexcept
Return model name.
Definition: cellModelI.H:31
label nEdges() const noexcept
Return number of edges.
Definition: cellModelI.H:49
const faceList & modelFaces() const noexcept
Return a raw list of model faces.
Definition: cellModelI.H:67
label index() const noexcept
Return index of model in the model list.
Definition: cellModelI.H:37
label nPoints() const noexcept
Return number of points.
Definition: cellModelI.H:43
label nFaces() const noexcept
Return number of faces.
Definition: cellModelI.H:55
const edgeList & modelEdges() const noexcept
Return a raw list of model edges.
Definition: cellModelI.H:61
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:66
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
static const edgeList edges
Edge to point addressing.
Definition: treeBoundBox.H:154
A class for handling words, derived from Foam::string.
Definition: word.H:68
const direction noexcept
Definition: Scalar.H:223
labelList pointLabels(nPoints, -1)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333