Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
meshes
meshShapes
cellModel
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Description
25
26
\*---------------------------------------------------------------------------*/
27
28
#include <
OpenFOAM/error.H
>
29
#include "
cellModel.H
"
30
31
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33
namespace
Foam
34
{
35
36
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37
38
inline
const
word
&
cellModel::name
()
const
39
{
40
return
name_;
41
}
42
43
44
inline
label
cellModel::index
()
const
45
{
46
return
index_;
47
}
48
49
50
inline
label
cellModel::nPoints
()
const
51
{
52
return
nPoints_;
53
}
54
55
56
inline
label
cellModel::nEdges
()
const
57
{
58
return
edges_.
size
();
59
}
60
61
62
inline
label
cellModel::nFaces
()
const
63
{
64
return
faces_.
size
();
65
}
66
67
68
// Return the faces of a cellModel by untangling the geometry
69
// supplied in terms of the face labels
70
inline
edgeList
cellModel::edges
(
const
labelList
&
pointLabels
)
const
71
{
72
edgeList
e
(edges_.
size
());
73
74
// Translate model lebels into global labels
75
forAll
(edges_, edgeI)
76
{
77
e
[edgeI] =
78
edge
79
(
80
pointLabels[edges_[edgeI].start()],
81
pointLabels[edges_[edgeI].end()]
82
);
83
}
84
85
return
e
;
86
}
87
88
89
// Return a raw list of model faces
90
inline
const
faceList
&
cellModel::modelFaces
()
const
91
{
92
return
faces_;
93
}
94
95
// Return the faces of a cellModel by untangling the geometry
96
// supplied in terms of the face labels
97
inline
faceList
cellModel::faces
(
const
labelList
&
pointLabels
)
const
98
{
99
faceList
f
(faces_.
size
());
100
101
// Translate model lebels into global labels
102
forAll
(faces_, faceI)
103
{
104
const
labelList
& curModelLabels = faces_[faceI];
105
106
face
& curFace =
f
[faceI];
107
108
curFace.
setSize
(curModelLabels.
size
());
109
110
forAll
(curModelLabels,
labelI
)
111
{
112
curFace[
labelI
] = pointLabels[curModelLabels[
labelI
]];
113
}
114
}
115
116
return
f
;
117
}
118
119
120
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
121
122
// Equality operator: true => ptr to models are equal !
123
inline
bool
operator==
(
const
cellModel
& m1,
const
cellModel
& m2)
124
{
125
return
(&m1 == &m2);
126
}
127
128
// Inequality operator: true => ptr to models are not equal !
129
inline
bool
operator!=
(
const
cellModel
& m1,
const
cellModel
& m2)
130
{
131
return
(&m1 != &m2);
132
}
133
134
135
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137
}
// End namespace Foam
138
139
// ************************ vim: set sw=4 sts=4 et: ************************ //