searchableExtrudedCircle.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) 2016-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::searchableExtrudedCircle
28
29Description
30 Searching on edgeMesh with constant radius
31
32 \heading Dictionary parameters
33 \table
34 Property | Description | Required | Default
35 type | extrudedCircle | selector |
36 file | The name of the edge mesh | yes |
37 radius | Search radius around the edges | yes |
38 \endtable
39
40Note
41 - The edge mesh file is to be located in the constant/geometry directory.
42 - Can not be used with snappyHexMesh since only implements nearest
43 searching.
44
45Note
46 Longer type name : \c searchableExtrudedCircle
47
48SourceFiles
49 searchableExtrudedCircle.C
50
51\*---------------------------------------------------------------------------*/
52
53#ifndef searchableExtrudedCircle_H
54#define searchableExtrudedCircle_H
55
56#include "treeBoundBox.H"
57#include "searchableSurface.H"
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61namespace Foam
62{
63
64// Forward declarations
65class edgeMesh;
66class treeDataEdge;
67template<class Type> class indexedOctree;
68
69/*---------------------------------------------------------------------------*\
70 Class searchableExtrudedCircle Declaration
71\*---------------------------------------------------------------------------*/
72
73class searchableExtrudedCircle
74:
75 public searchableSurface
76{
77 // Private Member Data
78
79 //- Feature
80 autoPtr<edgeMesh> eMeshPtr_;
81
82 //- Search structure
83 autoPtr<indexedOctree<treeDataEdge>> edgeTree_;
84
85 //- Radius
86 const scalar radius_;
87
88 //- Names of regions
89 mutable wordList regions_;
90
91
92 // Private Member Functions
93
94 //- No copy construct
96
97 //- No copy assignment
98 void operator=(const searchableExtrudedCircle&) = delete;
99
100
101public:
102
103 //- Runtime type information
104 TypeName("searchableExtrudedCircle");
105
106
107 // Constructors
108
109 //- Construct from dictionary (used by searchableSurface)
111 (
112 const IOobject& io,
113 const dictionary& dict
114 );
115
116
117 //- Destructor
119
120
121 // Member Functions
122
123 //- Names of regions
124 virtual const wordList& regions() const;
125
126 //- Whether supports volume type below
127 virtual bool hasVolumeType() const
128 {
129 return true;
130 }
131
132 //- What is type of points outside bounds
133 virtual volumeType outsideVolumeType() const
134 {
135 return volumeType::OUTSIDE;
136 }
137
138 //- Range of local indices that can be returned.
139 virtual label size() const;
140
141 //- Get representative set of element coordinates
142 // Usually the element centres (should be of length size()).
143 virtual tmp<pointField> coordinates() const;
144
145 //- Get bounding spheres (centre and radius squared), one per element.
146 // Any point on element is guaranteed to be inside.
147 virtual void boundingSpheres
148 (
149 pointField& centres,
150 scalarField& radiusSqr
151 ) const;
153 //- Get the points that define the surface.
154 virtual tmp<pointField> points() const
155 {
156 return coordinates();
157 }
158
159 //- Does any part of the surface overlap the supplied bound box?
160 virtual bool overlaps(const boundBox& bb) const
161 {
163 return false;
164 }
165
166
167 // Multiple point queries.
168
169 virtual void findNearest
170 (
171 const pointField& sample,
172 const scalarField& nearestDistSqr,
174 ) const;
175
176 //- Unique to parametric geometry: given points find
177 // an interpolated (along the curve) point on the surface.
178 // The lambdas[0] is equivalent for start, lambdas.last()
179 // is equivalent for end.
180 virtual void findParametricNearest
181 (
182 const point& start,
183 const point& end,
184 const scalarField& lambdas,
185 const scalarField& nearestDistSqr,
187 ) const;
188
189 virtual void findLine
190 (
191 const pointField& start,
192 const pointField& end,
194 ) const
195 {
197 }
198
199 virtual void findLineAny
200 (
201 const pointField& start,
202 const pointField& end,
204 ) const
205 {
207 }
209 //- Get all intersections in order from start to end.
210 virtual void findLineAll
211 (
212 const pointField& start,
213 const pointField& end,
215 ) const
216 {
219
220 //- From a set of points and indices get the region
221 virtual void getRegion
222 (
223 const List<pointIndexHit>&,
224 labelList& region
225 ) const;
226
227 //- From a set of points and indices get the normal
228 virtual void getNormal
230 const List<pointIndexHit>&,
231 vectorField& normal
232 ) const;
233
234 //- Determine type (inside/outside/mixed) for point.
235 // Unknown if cannot be determined (e.g. non-manifold surface)
236 virtual void getVolumeType
237 (
238 const pointField&,
240 ) const
241 {
243 }
244
245 bool writeData(Ostream&) const
246 {
248 return false;
249 }
250};
251
252
253// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254
255} // End namespace Foam
256
257// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
258
259#endif
260
261// ************************************************************************* //
Minimal example by using system/controlDict.functions:
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:64
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Searching on edgeMesh with constant radius.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
bool writeData(Ostream &) const
Pure virtual writeData function.
virtual ~searchableExtrudedCircle()
Destructor.
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
virtual label size() const
Range of local indices that can be returned.
virtual void boundingSpheres(pointField &centres, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual tmp< pointField > points() const
Get the points that define the surface.
virtual volumeType outsideVolumeType() const
What is type of points outside bounds.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
virtual void getRegion(const List< pointIndexHit > &, labelList &region) const
From a set of points and indices get the region.
virtual const wordList & regions() const
Names of regions.
virtual void findParametricNearest(const point &start, const point &end, const scalarField &lambdas, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
Unique to parametric geometry: given points find.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
virtual bool hasVolumeType() const
Whether supports volume type below.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const
Get all intersections in order from start to end.
TypeName("searchableExtrudedCircle")
Runtime type information.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
A class for managing temporary objects.
Definition: tmp.H:65
An enumeration wrapper for classification of a location as being inside/outside of a volume.
Definition: volumeType.H:61
@ OUTSIDE
A location outside the volume.
Definition: volumeType.H:69
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:63
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73