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