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-2018 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  // Private Member Functions
75 
76  //- Disallow default bitwise copy construct
78 
79  //- Disallow default bitwise assignment
80  void operator=(const searchableExtrudedCircle&);
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("searchableExtrudedCircle");
87 
88 
89  // Constructors
90 
91  //- Construct from dictionary (used by searchableSurface)
93  (
94  const IOobject& io,
95  const dictionary& dict
96  );
97 
98 
99  //- Destructor
100  virtual ~searchableExtrudedCircle();
101 
102 
103  // Member Functions
104 
105  virtual const wordList& regions() const;
106 
107  //- Whether supports volume type below
108  virtual bool hasVolumeType() const
109  {
110  return true;
111  }
112 
113  //- Range of local indices that can be returned.
114  virtual label size() const;
115 
116  //- Get representative set of element coordinates
117  // Usually the element centres (should be of length size()).
118  virtual tmp<pointField> coordinates() const;
119 
120  //- Get bounding spheres (centre and radius squared), one per element.
121  // Any point on element is guaranteed to be inside.
122  virtual void boundingSpheres
123  (
124  pointField& centres,
125  scalarField& radiusSqr
126  ) const;
127 
128  //- Get the points that define the surface.
129  virtual tmp<pointField> points() const
130  {
131  return coordinates();
132  }
133 
134  //- Does any part of the surface overlap the supplied bound box?
135  virtual bool overlaps(const boundBox& bb) const
136  {
138  return false;
139  }
140 
141 
142  // Multiple point queries.
143 
144  virtual void findNearest
145  (
146  const pointField& sample,
147  const scalarField& nearestDistSqr,
149  ) const;
150 
151  //- Unique to parametric geometry: given points find
152  // an interpolated (along the curve) point on the surface.
153  // The lambdas[0] is equivalent for start, lambdas.last()
154  // is equivalent for end.
155  virtual void findParametricNearest
156  (
157  const point& start,
158  const point& end,
159  const scalarField& lambdas,
160  const scalarField& nearestDistSqr,
162  ) const;
163 
164  virtual void findLine
165  (
166  const pointField& start,
167  const pointField& end,
169  ) const
170  {
172  }
173 
174  virtual void findLineAny
175  (
176  const pointField& start,
177  const pointField& end,
179  ) const
180  {
182  }
183 
184  //- Get all intersections in order from start to end.
185  virtual void findLineAll
186  (
187  const pointField& start,
188  const pointField& end,
190  ) const
191  {
193  }
194 
195  //- From a set of points and indices get the region
196  virtual void getRegion
197  (
198  const List<pointIndexHit>&,
199  labelList& region
200  ) const;
201 
202  //- From a set of points and indices get the normal
203  virtual void getNormal
204  (
205  const List<pointIndexHit>&,
206  vectorField& normal
207  ) const;
208 
209  //- Determine type (inside/outside/mixed) for point. unknown if
210  // cannot be determined (e.g. non-manifold surface)
211  virtual void getVolumeType
212  (
213  const pointField&,
215  ) const
216  {
218  }
220  bool writeData(Ostream&) const
221  {
223  return false;
224  }
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:137
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.
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
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.