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 -------------------------------------------------------------------------------
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::blockFace
29 
30 Description
31  Define a curved face.
32 
33 SourceFiles
34  blockFace.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef blockFace_H
39 #define blockFace_H
40 
41 #include "searchableSurfaces.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward Declarations
49 class blockDescriptor;
50 class blockFace;
51 
52 Ostream& operator<<(Ostream&, const blockFace&);
53 
54 /*---------------------------------------------------------------------------*\
55  Class blockFace Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class blockFace
59 {
60 protected:
61 
62  // Protected data
63 
64  //- Block face vertices
65  const face vertices_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("blockFace");
72 
73 
74  // Declare run-time constructor selection tables
75 
77  (
78  autoPtr,
79  blockFace,
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
97  blockFace
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
108  static autoPtr<blockFace> New
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:
125 
126  iNew(const dictionary& dict, const searchableSurfaces& geometry)
127  :
128  dict_(dict),
129  geometry_(geometry),
130  index_(0)
131  {}
132 
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;
154 
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
167 
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 // ************************************************************************* //
Foam::blockFace::operator<<
friend Ostream & operator<<(Ostream &, const blockFace &)
Foam::blockFace::vertices_
const face vertices_
Block face vertices.
Definition: blockFace.H:64
Foam::blockFace::compare
bool compare(const blockFace &) const
Compare with given blockFace.
Definition: blockFaceI.H:36
Foam::blockFace::iNew::operator()
autoPtr< blockFace > operator()(Istream &is) const
Definition: blockFace.H:132
Foam::blockFace::TypeName
TypeName("blockFace")
Runtime type information.
Foam::blockFace
Define a curved face.
Definition: blockFace.H:57
Foam::blockFace::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, blockFace, Istream,(const dictionary &dict, const label index, const searchableSurfaces &geometry, Istream &is),(dict, index, geometry, is))
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
searchableSurfaces.H
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::blockFace::iNew::iNew
iNew(const dictionary &dict, const searchableSurfaces &geometry)
Definition: blockFace.H:125
Foam::blockFace::New
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
Foam::blockFace::project
virtual void project(const blockDescriptor &, const label blockFacei, pointField &points) const =0
blockFaceI.H
Foam::blockFace::vertices
const face & vertices() const
Return block face vertices.
Definition: blockFaceI.H:30
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::blockFace::clone
virtual autoPtr< blockFace > clone() const
Clone function.
Definition: blockFace.C:68
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
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::blockFace::~blockFace
virtual ~blockFace()=default
Destructor.
Foam::blockFace::write
void write(Ostream &, const dictionary &) const
Write face with variable backsubstitution.
Definition: blockFace.C:106
Foam::blockDescriptor
Takes the description of the block and the list of curved edges and creates a list of points on edges...
Definition: blockDescriptor.H:78
Foam::blockFace::blockFace
blockFace(const face &vertices)
Construct from face vertices.
Definition: blockFace.C:44
Foam::blockFace::iNew
Class used for the read-construction of.
Definition: blockFace.H:117