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
dynamicMesh
polyTopoChange
polyTopoChange
addObject
polyAddPoint.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
Class
25
Foam::polyAddPoint
26
27
Description
28
Class containing data for point addition.
29
30
\*---------------------------------------------------------------------------*/
31
32
#ifndef polyAddPoint_H
33
#define polyAddPoint_H
34
35
#include <
OpenFOAM/label.H
>
36
#include <
OpenFOAM/point.H
>
37
#include <
dynamicMesh/topoAction.H
>
38
39
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40
41
namespace
Foam
42
{
43
44
/*---------------------------------------------------------------------------*\
45
Class polyAddPoint Declaration
46
\*---------------------------------------------------------------------------*/
47
48
class
polyAddPoint
49
:
50
public
topoAction
51
{
52
// Private data
53
54
//- Point to add
55
point
p_;
56
57
//- Master point
58
label masterPointID_;
59
60
//- Point zone ID
61
label zoneID_;
62
63
//- Does the point support a cell
64
bool
inCell_;
65
66
67
public
:
68
69
// Static data members
70
71
//- Runtime type information
72
TypeName
(
"addPoint"
);
73
74
75
// Constructors
76
77
//- Construct null. Used only for list construction
78
polyAddPoint
()
79
:
80
p_(
vector
::
zero
),
81
masterPointID_(-1),
82
zoneID_(-1),
83
inCell_(false)
84
{}
85
86
//- Construct from components
87
polyAddPoint
88
(
89
const
point
&
p
,
90
const
label
masterPointID
,
91
const
label
zoneID
,
92
const
bool
inCell
93
)
94
:
95
p_(p),
96
masterPointID_(masterPointID),
97
zoneID_(zoneID),
98
inCell_(inCell)
99
{
100
if
(zoneID_ < 0 && !inCell)
101
{
102
FatalErrorIn
103
(
104
"polyAddPoint\n"
105
"(\n"
106
" const point& p,\n"
107
" const label masterPointID,\n"
108
" const label zoneID,\n"
109
" const bool inCell\n"
110
")"
111
) <<
"Point is not in a cell and not in a zone. "
112
<<
"This is not allowed.\n"
113
<<
"point: "
<< p
114
<<
" master: "
<< masterPointID_
115
<<
" zone: "
<< zoneID_
116
<<
abort
(
FatalError
);
117
}
118
119
}
120
121
//- Construct and return a clone
122
virtual
autoPtr<topoAction>
clone
()
const
123
{
124
return
autoPtr<topoAction>
(
new
polyAddPoint
(*
this
));
125
}
126
127
128
// Default Destructor
129
130
131
// Member Functions
132
133
//- Point location
134
const
point
&
newPoint
()
const
135
{
136
return
p_;
137
}
138
139
//- Master point label
140
label
masterPointID
()
const
141
{
142
return
masterPointID_;
143
}
144
145
//- Is the point appended with no master
146
bool
appended
()
const
147
{
148
return
masterPointID_ < 0;
149
}
150
151
//- Does the point belong to a zone?
152
bool
isInZone
()
const
153
{
154
return
zoneID_ >= 0;
155
}
156
157
//- Point zone ID
158
label
zoneID
()
const
159
{
160
return
zoneID_;
161
}
162
163
//- Does the point support a cell
164
bool
inCell
()
const
165
{
166
return
inCell_;
167
}
168
};
169
170
171
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173
}
// End namespace Foam
174
175
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177
#endif
178
179
// ************************ vim: set sw=4 sts=4 et: ************************ //