FreeFOAM The Cross-Platform CFD Toolkit
searchablePlane.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::searchablePlane
26 
27 Description
28  Searching on (infinite) plane. See plane.H
29 
30 SourceFiles
31  searchablePlane.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef searchablePlane_H
36 #define searchablePlane_H
37 
38 #include "searchableSurface.H"
39 #include <OpenFOAM/plane.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 
48 /*---------------------------------------------------------------------------*\
49  Class searchablePlane Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public searchableSurface,
55  public plane
56 {
57 private:
58 
59  // Private Member Data
60 
61  mutable wordList regions_;
62 
63 
64  // Private Member Functions
65 
66  pointIndexHit findLine
67  (
68  const point& start,
69  const point& end
70  ) const;
71 
72 
73  //- Disallow default bitwise copy construct
75 
76  //- Disallow default bitwise assignment
77  void operator=(const searchablePlane&);
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("searchablePlane");
84 
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const IOobject& io,
92  const point& basePoint,
93  const vector& normal
94  );
95 
96  //- Construct from dictionary (used by searchableSurface)
98  (
99  const IOobject& io,
100  const dictionary& dict
101  );
102 
103  // Destructor
104 
105  virtual ~searchablePlane();
106 
107 
108  // Member Functions
109 
110  virtual const wordList& regions() const;
111 
112  //- Whether supports volume type below
113  virtual bool hasVolumeType() const
114  {
115  return false;
116  }
117 
118  //- Range of local indices that can be returned.
119  virtual label size() const
120  {
121  return 1;
122  }
123 
124  //- Get representative set of element coordinates
125  // Usually the element centres (should be of length size()).
126  virtual pointField coordinates() const
127  {
128  //notImplemented("searchablePlane::coordinates()")
129  return pointField(1, refPoint());
130  }
131 
132 
133  // Multiple point queries.
134 
135  virtual void findNearest
136  (
137  const pointField& sample,
138  const scalarField& nearestDistSqr,
140  ) const;
141 
142  virtual void findLine
143  (
144  const pointField& start,
145  const pointField& end,
147  ) const;
148 
149  virtual void findLineAny
150  (
151  const pointField& start,
152  const pointField& end,
154  ) const;
155 
156  //- Get all intersections in order from start to end.
157  virtual void findLineAll
158  (
159  const pointField& start,
160  const pointField& end,
162  ) const;
163 
164  //- From a set of points and indices get the region
165  virtual void getRegion
166  (
167  const List<pointIndexHit>&,
168  labelList& region
169  ) const;
170 
171  //- From a set of points and indices get the normal
172  virtual void getNormal
173  (
174  const List<pointIndexHit>&,
175  vectorField& normal
176  ) const;
177 
178  //- Determine type (inside/outside/mixed) for point. unknown if
179  // cannot be determined (e.g. non-manifold surface)
180  virtual void getVolumeType
181  (
182  const pointField&,
184  ) const;
185 
186 
187  // regIOobject implementation
188 
189  bool writeData(Ostream&) const
190  {
191  notImplemented("searchablePlane::writeData(Ostream&) const");
192  return false;
193  }
194 
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************ vim: set sw=4 sts=4 et: ************************ //