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