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 -------------------------------------------------------------------------------
11 License
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 
31 inline const Foam::word& Foam::cellModel::name() const noexcept
32 {
33  return name_;
34 }
35 
36 
37 inline Foam::label Foam::cellModel::index() const noexcept
38 {
39  return index_;
40 }
41 
42 
43 inline Foam::label Foam::cellModel::nPoints() const noexcept
44 {
45  return nPoints_;
46 }
47 
48 
49 inline Foam::label Foam::cellModel::nEdges() const noexcept
50 {
51  return edges_.size();
52 }
53 
54 
55 inline Foam::label Foam::cellModel::nFaces() const noexcept
56 {
57  return faces_.size();
58 }
59 
60 
61 inline const Foam::edgeList& Foam::cellModel::modelEdges() const noexcept
62 {
63  return edges_;
64 }
65 
66 
67 inline const Foam::faceList& Foam::cellModel::modelFaces() const noexcept
68 {
69  return faces_;
70 }
71 
72 
74 (
75  const labelUList& pointLabels
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,
93  const labelUList& pointLabels
94 ) const
95 {
96  // From model labels to global labels
97  return Foam::edge(pointLabels, edges_[modelEdgei]);
98 }
99 
100 
102 (
103  const labelUList& pointLabels
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,
121  const labelUList& pointLabels
122 ) const
123 {
124  // From model labels to global labels
125  return Foam::face(pointLabels, faces_[modelFacei]);
126 }
127 
128 
129 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
130 
131 inline bool Foam::operator==
132 (
133  const cellModel& lhs,
134  const cellModel& rhs
135 ) noexcept
136 {
137  return (&lhs == &rhs);
138 }
139 
140 
141 inline bool Foam::operator!=
142 (
143  const cellModel& lhs,
144  const cellModel& rhs
145 ) noexcept
146 {
147  return (&lhs != &rhs);
148 }
149 
150 
151 // ************************************************************************* //
Foam::cellModel::index
label index() const noexcept
Return index of model in the model list.
Definition: cellModelI.H:37
Foam::cellModel::faces
faceList faces(const labelUList &pointLabels) const
Return list of cell faces.
Definition: cellModelI.H:102
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::cellModel::face
Foam::face face(const label modelFacei, const labelUList &pointLabels) const
Return the cell face for specified model face.
Definition: cellModelI.H:119
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:63
Foam::cellModel::edges
edgeList edges(const labelUList &pointLabels) const
Return list of cell edges.
Definition: cellModelI.H:74
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::cellModel::modelEdges
const edgeList & modelEdges() const noexcept
Return a raw list of model edges.
Definition: cellModelI.H:61
Foam::cellModel::nEdges
label nEdges() const noexcept
Return number of edges.
Definition: cellModelI.H:49
Foam::cellModel::edge
Foam::edge edge(const label modelEdgei, const labelUList &pointLabels) const
Return the cell edge for specified model edge.
Definition: cellModelI.H:91
Foam::cellModel::name
const word & name() const noexcept
Return model name.
Definition: cellModelI.H:31
Foam::cellModel::nFaces
label nFaces() const noexcept
Return number of faces.
Definition: cellModelI.H:55
Foam::List< edge >
Foam::UList< label >
Foam::cellModel::nPoints
label nPoints() const noexcept
Return number of points.
Definition: cellModelI.H:43
Foam::cellModel::modelFaces
const faceList & modelFaces() const noexcept
Return a raw list of model faces.
Definition: cellModelI.H:67
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
Foam::cellModel
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:72
pointLabels
labelList pointLabels(nPoints, -1)