nearestToPoint.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 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::nearestToPoint
29 
30 Description
31  A topoSetPointSource to select points nearest to points.
32 
33  \heading Dictionary parameters
34  \table
35  Property | Description | Required | Default
36  points | List of selection points | yes |
37  \endtable
38 
39 SourceFiles
40  nearestToPoint.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef nearestToPoint_H
45 #define nearestToPoint_H
46 
47 #include "topoSetPointSource.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class nearestToPoint Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class nearestToPoint
59 :
60  public topoSetPointSource
61 {
62 
63  // Private data
64 
65  //- Add usage string
66  static addToUsageTable usage_;
67 
68  //- Points to select nearest to
69  pointField points_;
70 
71 
72  // Private Member Functions
73 
74  void combine(topoSet& set, const bool add) const;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("nearestToPoint");
81 
82  // Constructors
83 
84  //- Construct from components, copying points
86 
87  //- Construct from components, moving points
89 
90  //- Construct from dictionary
91  nearestToPoint(const polyMesh& mesh, const dictionary& dict);
92 
93  //- Construct from Istream
94  nearestToPoint(const polyMesh& mesh, Istream& is);
95 
96 
97  //- Destructor
98  virtual ~nearestToPoint() = default;
99 
100 
101  // Member Functions
102 
103  virtual void applyToSet
104  (
105  const topoSetSource::setAction action,
106  topoSet& set
107  ) const;
108 
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
Foam::nearestToPoint::applyToSet
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Definition: nearestToPoint.C:168
Foam::combine
Definition: FaceCellWave.C:56
Foam::nearestToPoint
A topoSetPointSource to select points nearest to points.
Definition: nearestToPoint.H:67
Foam::topoSetSource::setAction
setAction
Enumeration defining the valid actions.
Definition: topoSetSource.H:99
Foam::topoSetSource::mesh
const polyMesh & mesh() const
Reference to the mesh.
Definition: topoSetSource.H:333
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::nearestToPoint::TypeName
TypeName("nearestToPoint")
Runtime type information.
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::nearestToPoint::nearestToPoint
nearestToPoint(const polyMesh &mesh, const pointField &points)
Construct from components, copying points.
Definition: nearestToPoint.C:123
Foam::topoSet
General set of labels of mesh quantity (points, cells, faces).
Definition: topoSet.H:66
Foam::topoSetPointSource
Base class of a topoSet source for selecting points.
Definition: topoSetPointSource.H:50
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
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
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::nearestToPoint::~nearestToPoint
virtual ~nearestToPoint()=default
Destructor.
topoSetPointSource.H
points
const pointField & points
Definition: gmvOutputHeader.H:1