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
triSurface
triSurface
geometricSurfacePatch
geometricSurfacePatch.C
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
\*---------------------------------------------------------------------------*/
25
26
#include "
geometricSurfacePatch.H
"
27
#include <
OpenFOAM/dictionary.H
>
28
29
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30
31
namespace
Foam
32
{
33
34
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36
defineTypeNameAndDebug
(geometricSurfacePatch, 0);
37
38
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39
40
// Construct null
41
geometricSurfacePatch::geometricSurfacePatch
()
42
:
43
geometricType_(
"empty"
),
44
name_(
"patch"
),
45
index_(0)
46
{}
47
48
49
// Construct from components
50
geometricSurfacePatch::geometricSurfacePatch
51
(
52
const
word
& geometricType,
53
const
word
&
name
,
54
const
label index
55
)
56
:
57
geometricType_(geometricType),
58
name_(name),
59
index_(index)
60
61
{
62
if
(geometricType_.empty())
63
{
64
geometricType_ =
"empty"
;
65
}
66
}
67
68
69
// Construct from Istream
70
geometricSurfacePatch::geometricSurfacePatch
(
Istream
& is,
const
label index)
71
:
72
geometricType_(is),
73
name_(is),
74
index_(index)
75
{
76
if
(geometricType_.empty())
77
{
78
geometricType_ =
"empty"
;
79
}
80
}
81
82
83
// Construct from dictionary
84
geometricSurfacePatch::geometricSurfacePatch
85
(
86
const
word
& name,
87
const
dictionary
& dict,
88
const
label index
89
)
90
:
91
geometricType_(dict.
lookup
(
"geometricType"
)),
92
name_(name),
93
index_(index)
94
{
95
if
(geometricType_.empty())
96
{
97
geometricType_ =
"empty"
;
98
}
99
}
100
101
102
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103
104
// Write
105
void
geometricSurfacePatch::write
(
Ostream
& os)
const
106
{
107
os <<
nl
<< name_
108
<<
nl
<< geometricType_;
109
}
110
111
112
void
geometricSurfacePatch::writeDict
(
Ostream
& os)
const
113
{
114
os <<
" geometricType "
<< geometricType_ <<
';'
<<
nl
;
115
}
116
117
118
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
119
120
bool
Foam::geometricSurfacePatch::operator!=
(
const
geometricSurfacePatch
&
p
)
121
const
122
{
123
return
!(*
this
==
p
);
124
}
125
126
127
bool
Foam::geometricSurfacePatch::operator==
(
const
geometricSurfacePatch
&
p
)
128
const
129
{
130
return
131
(
132
(geometricType() == p.
geometricType
())
133
&& (
name
() == p.
name
())
134
);
135
}
136
137
138
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
139
140
Istream
&
operator>>
(
Istream
& is,
geometricSurfacePatch
& gp)
141
{
142
is >> gp.name_ >> gp.geometricType_;
143
144
return
is;
145
}
146
147
148
Ostream
&
operator<<
(
Ostream
& os,
const
geometricSurfacePatch
& gp)
149
{
150
gp.
write
(os);
151
os.
check
152
(
153
"Ostream& operator<<(Ostream& f, const geometricSurfacePatch& gp)"
154
);
155
return
os;
156
}
157
158
159
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160
161
}
// End namespace Foam
162
163
// ************************ vim: set sw=4 sts=4 et: ************************ //