OpenFOAM: API Guide
v2006
The open source CFD toolbox
boxToPoint.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-2015 OpenFOAM Foundation
9
Copyright (C) 2018-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
Class
28
Foam::boxToPoint
29
30
Description
31
A \c topoSetPointSource to select all points based
32
on whether they are inside given bounding box(es).
33
34
Operands:
35
\table
36
Operand | Type | Location
37
output | pointSet | $FOAM_CASE/constant/polyMesh/sets/<set>
38
\endtable
39
40
Usage
41
Minimal example by using \c system/topoSetDict.actions:
42
\verbatim
43
{
44
// Mandatory (inherited) entries
45
name <name>;
46
type pointSet;
47
action <action>;
48
49
// Mandatory entries
50
source boxToPoint;
51
52
// Conditional mandatory entries
53
// Select either of the below
54
55
// Option-1
56
boxes
57
(
58
(<minX> <minY> <minZ>) (<maxX> <maxY> <maxZ>) // box-1
59
(<minX> <minY> <minZ>) (<maxX> <maxY> <maxZ>) // box-2
60
...
61
);
62
63
// Option-2
64
box (<minX> <minY> <minZ>) (<maxX> <maxY> <maxZ>);
65
66
// Option-3
67
min (<minX> <minY> <minZ>);
68
max (<maxX> <maxY> <maxZ>);
69
}
70
\endverbatim
71
72
where the entries mean:
73
\table
74
Property | Description | Type | Req'd | Dflt
75
name | Name of pointSet | word | yes | -
76
type | Type name: pointSet | word | yes | -
77
action | Action applied on points - see below | word | yes | -
78
source | Source name: boxToPoint | word | yes | -
79
\endtable
80
81
Options for the \c action entry:
82
\verbatim
83
new | Create a new pointSet from selected points
84
add | Add selected points into this pointSet
85
subtract | Remove selected points from this pointSet
86
\endverbatim
87
88
Options for the conditional mandatory entries:
89
\verbatim
90
Entry | Description | Type | Req'd | Dflt
91
boxes | Multiple bounding boxes | vectorList | cond'l | -
92
box | A single bounding box | vector | cond'l | -
93
min | Minimum point for a single box | vector | cond'l | -
94
max | Maximum point for a single box | vector | cond'l | -
95
\verbatim
96
97
Note
98
The order of precedence among the conditional mandatory entries from the
99
highest to the lowest is \c boxes, \c box or a \c min-max pair
100
(compatibility with \c searchableBox).
101
102
See also
103
- Foam::topoSetSource
104
- Foam::topoSetPointSource
105
106
SourceFiles
107
boxToPoint.C
108
109
\*---------------------------------------------------------------------------*/
110
111
#ifndef boxToPoint_H
112
#define boxToPoint_H
113
114
#include "
topoSetPointSource.H
"
115
#include "
treeBoundBoxList.H
"
116
117
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119
namespace
Foam
120
{
121
122
/*---------------------------------------------------------------------------*\
123
Class boxToPoint Declaration
124
\*---------------------------------------------------------------------------*/
125
126
class
boxToPoint
127
:
128
public
topoSetPointSource
129
{
130
// Private Data
131
132
//- Add usage string
133
static
addToUsageTable usage_;
134
135
//- Bounding boxes
136
treeBoundBoxList
bbs_;
137
138
139
// Private Member Functions
140
141
void
combine
(topoSet& set,
const
bool
add
)
const
;
142
143
144
public
:
145
146
//- Runtime type information
147
TypeName
(
"boxToPoint"
);
148
149
150
// Constructors
151
152
//- Construct from components, copying bounding boxes
153
boxToPoint(
const
polyMesh&
mesh
,
const
treeBoundBoxList
& bbs);
154
155
//- Construct from components, moving bounding boxes
156
boxToPoint(
const
polyMesh&
mesh
,
treeBoundBoxList
&& bbs);
157
158
//- Construct from dictionary
159
boxToPoint(
const
polyMesh&
mesh
,
const
dictionary&
dict
);
160
161
//- Construct from stream - a single box.
162
boxToPoint(
const
polyMesh&
mesh
, Istream& is);
163
164
165
//- Destructor
166
virtual
~boxToPoint() =
default
;
167
168
169
// Member Functions
170
171
virtual
void
applyToSet
172
(
173
const
topoSetSource::setAction
action,
174
topoSet& set
175
)
const
;
176
};
177
178
179
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181
}
// End namespace Foam
182
183
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185
#endif
186
187
// ************************************************************************* //
TypeName
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition:
typeInfo.H:73
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition:
topoSetSource.H:99
Foam::ListListOps::combine
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
Definition:
ListListOps.C:69
dict
dictionary dict
Definition:
searchingEngine.H:14
Foam::add
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition:
FieldFieldFunctions.C:939
mesh
dynamicFvMesh & mesh
Definition:
createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:33
treeBoundBoxList.H
topoSetPointSource.H
Foam::treeBoundBoxList
List< treeBoundBox > treeBoundBoxList
List of bounding boxes.
Definition:
treeBoundBoxList.H:46
src
meshTools
sets
pointSources
boxToPoint
boxToPoint.H
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.