searchableExtrudedCircle.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
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::searchableExtrudedCircle
26 
27 Description
28  Searching on edgemesh with constant radius
29 
30 SourceFiles
31  searchableExtrudedCircle.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef searchableExtrudedCircle_H
36 #define searchableExtrudedCircle_H
37 
38 #include "treeBoundBox.H"
39 #include "searchableSurface.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class edgeMesh;
48 class treeDataEdge;
49 template <class Type> class indexedOctree;
50 
51 /*---------------------------------------------------------------------------*\
52  Class searchableExtrudedCircle Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
57  public searchableSurface
58 {
59  // Private Member Data
60 
61  //- Feature
62  autoPtr<edgeMesh> eMeshPtr_;
63 
64  //- Search structure
66 
67  //- Radius
68  const scalar radius_;
69 
70  //- Names of regions
71  mutable wordList regions_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("searchableExtrudedCircle");
78 
79 
80  // Constructors
81 
82  //- Construct from dictionary (used by searchableSurface)
84  (
85  const IOobject& io,
86  const dictionary& dict
87  );
88 
89  //- Disallow default bitwise copy construction
91 
92 
93  //- Destructor
94  virtual ~searchableExtrudedCircle();
95 
96 
97  // Member Functions
98 
99  virtual const wordList& regions() const;
100 
101  //- Whether supports volume type below
102  virtual bool hasVolumeType() const
103  {
104  return true;
105  }
106 
107  //- Range of local indices that can be returned.
108  virtual label size() const;
109 
110  //- Get representative set of element coordinates
111  // Usually the element centres (should be of length size()).
112  virtual tmp<pointField> coordinates() const;
113 
114  //- Get bounding spheres (centre and radius squared), one per element.
115  // Any point on element is guaranteed to be inside.
116  virtual void boundingSpheres
117  (
118  pointField& centres,
119  scalarField& radiusSqr
120  ) const;
121 
122  //- Get the points that define the surface.
123  virtual tmp<pointField> points() const
124  {
125  return coordinates();
126  }
127 
128  //- Does any part of the surface overlap the supplied bound box?
129  virtual bool overlaps(const boundBox& bb) const
130  {
132  return false;
133  }
134 
135 
136  // Multiple point queries.
137 
138  virtual void findNearest
139  (
140  const pointField& sample,
141  const scalarField& nearestDistSqr,
143  ) const;
144 
145  //- Unique to parametric geometry: given points find
146  // an interpolated (along the curve) point on the surface.
147  // The lambdas[0] is equivalent for start, lambdas.last()
148  // is equivalent for end.
149  virtual void findParametricNearest
150  (
151  const point& start,
152  const point& end,
153  const scalarField& lambdas,
154  const scalarField& nearestDistSqr,
156  ) const;
157 
158  virtual void findLine
159  (
160  const pointField& start,
161  const pointField& end,
163  ) const
164  {
166  }
167 
168  virtual void findLineAny
169  (
170  const pointField& start,
171  const pointField& end,
173  ) const
174  {
176  }
177 
178  //- Get all intersections in order from start to end.
179  virtual void findLineAll
180  (
181  const pointField& start,
182  const pointField& end,
184  ) const
185  {
187  }
188 
189  //- From a set of points and indices get the region
190  virtual void getRegion
191  (
192  const List<pointIndexHit>&,
193  labelList& region
194  ) const;
195 
196  //- From a set of points and indices get the normal
197  virtual void getNormal
198  (
199  const List<pointIndexHit>&,
200  vectorField& normal
201  ) const;
202 
203  //- Determine type (inside/outside/mixed) for point. unknown if
204  // cannot be determined (e.g. non-manifold surface)
205  virtual void getVolumeType
206  (
207  const pointField&,
209  ) const
210  {
212  }
214  bool writeData(Ostream&) const
215  {
217  return false;
218  }
219 
220 
221  // Member Operators
222 
223  //- Disallow default bitwise assignment
224  void operator=(const searchableExtrudedCircle&) = delete;
225 };
226 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 } // End namespace Foam
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
virtual ~searchableExtrudedCircle()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual label size() const
Range of local indices that can be returned.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual void getRegion(const List< pointIndexHit > &, labelList &region) const
From a set of points and indices get the region.
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:58
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
void operator=(const searchableExtrudedCircle &)=delete
Disallow default bitwise assignment.
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 getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
bool writeData(Ostream &) const
Pure virtual writaData function.
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
virtual void boundingSpheres(pointField &centres, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
TypeName("searchableExtrudedCircle")
Runtime type information.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual const wordList & regions() const
Names of regions.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
Searching on edgemesh with constant radius.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
searchableExtrudedCircle(const IOobject &io, const dictionary &dict)
Construct from dictionary (used by searchableSurface)
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< pointField > points() const
Get the points that define the surface.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
virtual bool hasVolumeType() const
Whether supports volume type below.
Namespace for OpenFOAM.