blockFace.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::blockFace
29
30Description
31 Define a curved face.
32
33SourceFiles
34 blockFace.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef blockFace_H
39#define blockFace_H
40
41#include "searchableSurfaces.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48// Forward Declarations
49class blockDescriptor;
50class blockFace;
51
52Ostream& operator<<(Ostream&, const blockFace&);
53
54/*---------------------------------------------------------------------------*\
55 Class blockFace Declaration
56\*---------------------------------------------------------------------------*/
58class blockFace
59{
60protected:
61
62 // Protected data
63
64 //- Block face vertices
65 const face vertices_;
66
67
68public:
69
70 //- Runtime type information
71 TypeName("blockFace");
72
73
74 // Declare run-time constructor selection tables
77 (
78 autoPtr,
80 Istream,
81 (
82 const dictionary& dict,
83 const label index,
84 const searchableSurfaces& geometry,
85 Istream& is
86 ),
87 (dict, index, geometry, is)
88 );
89
90
91 // Constructors
92
93 //- Construct from face vertices
94 explicit blockFace(const face& vertices);
95
96 //- Construct from Istream
98 (
99 const dictionary& dict,
100 const label index,
101 Istream& is
102 );
103
104 //- Clone function
105 virtual autoPtr<blockFace> clone() const;
106
107 //- New function which constructs and returns pointer to a blockFace
109 (
110 const dictionary& dict,
111 const label index,
112 const searchableSurfaces& geometry,
113 Istream&
114 );
115
116 //- Class used for the read-construction of
117 // PtrLists of blockFace
118 class iNew
119 {
120 const dictionary& dict_;
121 const searchableSurfaces& geometry_;
122 mutable label index_;
123
124 public:
126 iNew(const dictionary& dict, const searchableSurfaces& geometry)
127 :
128 dict_(dict),
129 geometry_(geometry),
130 index_(0)
131 {}
134 {
135 return blockFace::New(dict_, index_++, geometry_, is);
136 }
137 };
138
139
140 //- Destructor
141 virtual ~blockFace() = default;
142
143
144 // Member Functions
145
146 //- Return block face vertices
147 inline const face& vertices() const;
148
149 //- Compare with given blockFace
150 inline bool compare(const blockFace&) const;
151
152 //- Compare with the given block and block face
153 inline bool compare(const face& vertices) const;
155 virtual void project
156 (
157 const blockDescriptor&,
158 const label blockFacei,
160 ) const = 0;
161
162 //- Write face with variable backsubstitution
163 void write(Ostream&, const dictionary&) const;
164
165
166 // Ostream Operator
168 friend Ostream& operator<<(Ostream&, const blockFace&);
169};
170
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
174} // End namespace Foam
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#include "blockFaceI.H"
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182#endif
183
184// ************************************************************************* //
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
Takes the description of the block and the list of curved edges and creates a list of points on edges...
Class used for the read-construction of.
Definition: blockFace.H:118
iNew(const dictionary &dict, const searchableSurfaces &geometry)
Definition: blockFace.H:125
autoPtr< blockFace > operator()(Istream &is) const
Definition: blockFace.H:132
Define a curved face.
Definition: blockFace.H:58
virtual void project(const blockDescriptor &, const label blockFacei, pointField &points) const =0
const face & vertices() const
Return block face vertices.
Definition: blockFaceI.H:30
virtual ~blockFace()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, blockFace, Istream,(const dictionary &dict, const label index, const searchableSurfaces &geometry, Istream &is),(dict, index, geometry, is))
friend Ostream & operator<<(Ostream &, const blockFace &)
const face vertices_
Block face vertices.
Definition: blockFace.H:64
static autoPtr< blockFace > New(const dictionary &dict, const label index, const searchableSurfaces &geometry, Istream &)
New function which constructs and returns pointer to a blockFace.
Definition: blockFace.C:76
TypeName("blockFace")
Runtime type information.
virtual autoPtr< blockFace > clone() const
Clone function.
Definition: blockFace.C:68
bool compare(const blockFace &) const
Compare with given blockFace.
Definition: blockFaceI.H:36
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
const pointField & points
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
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