blockVertex.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 OpenFOAM Foundation
9  Copyright (C) 2019 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::blockVertex
29 
30 Description
31  Define a block vertex.
32 
33 SourceFiles
34  blockVertex.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef blockVertex_H
39 #define blockVertex_H
40 
41 #include "searchableSurfaces.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class blockVertex Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class blockVertex
53 {
54 public:
55 
56  //- Runtime type information
57  TypeName("blockVertex");
58 
59 
60  // Declare run-time constructor selection tables
61 
63  (
64  autoPtr,
66  Istream,
67  (
68  const dictionary& dict,
69  const label index,
70  const searchableSurfaces& geometry,
71  Istream& is
72  ),
73  (dict, index, geometry, is)
74  );
75 
76 
77  // Constructors
78 
79  //- Default construct
80  blockVertex() noexcept = default;
81 
82  //- Clone function
83  virtual autoPtr<blockVertex> clone() const;
84 
85  //- New function which constructs and returns pointer to a blockVertex
87  (
88  const dictionary& dict,
89  const label index,
90  const searchableSurfaces& geometry,
91  Istream&
92  );
93 
94  //- Class used for the read-construction of
95  // PtrLists of blockVertex
96  class iNew
97  {
98  const dictionary& dict_;
99  const searchableSurfaces& geometry_;
100  mutable label index_;
101 
102  public:
103 
104  iNew(const dictionary& dict, const searchableSurfaces& geometry)
105  :
106  dict_(dict),
107  geometry_(geometry),
108  index_(0)
109  {}
110 
112  {
113  return blockVertex::New(dict_, index_++, geometry_, is);
114  }
115  };
116 
117 
118  //- Destructor
119  virtual ~blockVertex() = default;
120 
121 
122  // Member Functions
123 
124  virtual operator point() const = 0;
125 
126  //- Read vertex index with optional name lookup
127  static label read(Istream&, const dictionary&);
128 
129  //- Write vertex index with optional name backsubstitution
130  static void write(Ostream&, const label, const dictionary&);
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::blockVertex::iNew::iNew
iNew(const dictionary &dict, const searchableSurfaces &geometry)
Definition: blockVertex.H:103
Foam::blockVertex::TypeName
TypeName("blockVertex")
Runtime type information.
Foam::blockVertex::New
static autoPtr< blockVertex > New(const dictionary &dict, const label index, const searchableSurfaces &geometry, Istream &)
New function which constructs and returns pointer to a blockVertex.
Definition: blockVertex.C:52
Foam::blockVertex::blockVertex
blockVertex() noexcept=default
Default construct.
Foam::blockVertex::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, blockVertex, Istream,(const dictionary &dict, const label index, const searchableSurfaces &geometry, Istream &is),(dict, index, geometry, is))
searchableSurfaces.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::blockVertex
Define a block vertex.
Definition: blockVertex.H:51
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:123
Foam::blockVertex::iNew::operator()
autoPtr< blockVertex > operator()(Istream &is) const
Definition: blockVertex.H:110
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::blockVertex::read
static label read(Istream &, const dictionary &)
Read vertex index with optional name lookup.
Definition: blockVertex.C:103
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::searchableSurfaces
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
Definition: searchableSurfaces.H:92
Foam::blockVertex::iNew
Class used for the read-construction of.
Definition: blockVertex.H:95
Foam::blockVertex::~blockVertex
virtual ~blockVertex()=default
Destructor.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::blockVertex::write
static void write(Ostream &, const label, const dictionary &)
Write vertex index with optional name backsubstitution.
Definition: blockVertex.C:118
Foam::blockVertex::clone
virtual autoPtr< blockVertex > clone() const
Clone function.
Definition: blockVertex.C:44