Loading...
Searching...
No Matches
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 * * * * * * * * * * * * * //
31inline const Foam::word& Foam::cellModel::name() const noexcept
32{
33 return name_;
34}
35
37inline Foam::label Foam::cellModel::index() const noexcept
38{
39 return index_;
40}
41
43inline Foam::label Foam::cellModel::nPoints() const noexcept
44{
45 return nPoints_;
46}
47
49inline Foam::label Foam::cellModel::nEdges() const noexcept
50{
51 return edges_.size();
52}
53
55inline Foam::label Foam::cellModel::nFaces() const noexcept
56{
57 return faces_.size();
58}
59
62{
63 return edges_;
64}
65
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,
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// ************************************************************************* //
Maps a geometry to a set of cell primitives.
Definition cellModel.H:73
const word & name() const noexcept
Return model name.
Definition cellModelI.H:24
edgeList edges(const labelUList &pointLabels) const
Return list of cell edges.
Definition cellModelI.H:67
label nEdges() const noexcept
Return number of edges.
Definition cellModelI.H:42
const faceList & modelFaces() const noexcept
Return a raw list of model faces.
Definition cellModelI.H:60
label index() const noexcept
Return index of model in the model list.
Definition cellModelI.H:30
label nPoints() const noexcept
Return number of points.
Definition cellModelI.H:36
Foam::edge edge(const label modelEdgei, const labelUList &pointLabels) const
Return the cell edge for specified model edge.
Definition cellModelI.H:84
label nFaces() const noexcept
Return number of faces.
Definition cellModelI.H:48
Foam::face face(const label modelFacei, const labelUList &pointLabels) const
Return the cell face for specified model face.
Definition cellModelI.H:112
faceList faces(const labelUList &pointLabels) const
Return list of cell faces.
Definition cellModelI.H:95
const edgeList & modelEdges() const noexcept
Return a raw list of model edges.
Definition cellModelI.H:54
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
Definition edge.H:62
A face is a list of labels corresponding to mesh vertices.
Definition face.H:71
A class for handling words, derived from Foam::string.
Definition word.H:66
List< edge > edgeList
List of edge.
Definition edgeList.H:32
List< face > faceList
List of faces.
Definition faceListFwd.H:41
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75
labelList pointLabels(nPoints, -1)
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299