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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::blockVertex
29
30Description
31 Define a block vertex.
32
33SourceFiles
34 blockVertex.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef blockVertex_H
39#define blockVertex_H
40
41#include "searchableSurfaces.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class blockVertex Declaration
50\*---------------------------------------------------------------------------*/
52class blockVertex
53{
54public:
55
56 //- Runtime type information
57 TypeName("blockVertex");
58
59
60 // Declare run-time constructor selection tables
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
86 static autoPtr<blockVertex> New
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:
104 iNew(const dictionary& dict, const searchableSurfaces& geometry)
105 :
106 dict_(dict),
107 geometry_(geometry),
108 index_(0)
109 {}
111 autoPtr<blockVertex> operator()(Istream& is) const
112 {
113 return blockVertex::New(dict_, index_++, geometry_, is);
114 }
115 };
116
117
118 //- Destructor
119 virtual ~blockVertex() = default;
120
121
122 // Member Functions
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// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Class used for the read-construction of.
Definition: blockVertex.H:96
iNew(const dictionary &dict, const searchableSurfaces &geometry)
Definition: blockVertex.H:103
autoPtr< blockVertex > operator()(Istream &is) const
Definition: blockVertex.H:110
Define a block vertex.
Definition: blockVertex.H:52
static label read(Istream &, const dictionary &)
Read vertex index with optional name lookup.
Definition: blockVertex.C:103
virtual ~blockVertex()=default
Destructor.
blockVertex() noexcept=default
Default construct.
TypeName("blockVertex")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, blockVertex, Istream,(const dictionary &dict, const label index, const searchableSurfaces &geometry, Istream &is),(dict, index, geometry, is))
virtual autoPtr< blockVertex > clone() const
Clone function.
Definition: blockVertex.C:44
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
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
Namespace for OpenFOAM.
vector point
Point is a vector.
Definition: point.H:43
const direction noexcept
Definition: Scalar.H:223
runTime write()
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73