boundaryPatch.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) 2011-2019 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::boundaryPatch
26 
27 Description
28  Like polyPatch but without reference to mesh. patchIdentifier::index
29  is not used. Used in boundaryMesh to hold data on patches.
30 
31 SourceFiles
32  boundaryPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef boundaryPatch_H
37 #define boundaryPatch_H
38 
39 #include "patchIdentifier.H"
40 #include "autoPtr.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of friend functions and operators
48 
49 class boundaryPatch;
50 
51 Ostream& operator<<(Ostream&, const boundaryPatch&);
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class boundaryPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class boundaryPatch
59 :
60  public patchIdentifier
61 {
62  // Private Data
63 
64  label size_;
65  label start_;
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct from components
73  (
74  const word& name,
75  const label index,
76  const label size,
77  const label start,
79  );
80 
81  //- Construct from dictionary
83  (
84  const word& name,
85  const dictionary& dict,
86  const label index
87  );
88 
89  //- Copy constructor, resetting the index
90  boundaryPatch(const boundaryPatch&, const label index);
91 
92  //- Clone
94 
95 
96  //- Destructor
98 
99 
100  // Member Functions
102  label size() const
103  {
104  return size_;
105  }
107  label& size()
108  {
109  return size_;
110  }
112  label start() const
113  {
114  return start_;
115  }
117  label& start()
118  {
119  return start_;
120  }
121 
122 
123  //- Write dictionary
124  virtual void write(Ostream&) const;
125 
126 
127  // Ostream Operator
128 
129  friend Ostream& operator<<(Ostream&, const boundaryPatch&);
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
label size() const
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const word & name() const
Return name.
Like polyPatch but without reference to mesh. patchIdentifier::index is not used. Used in boundaryMes...
Definition: boundaryPatch.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Identifies patch by name, patch index and physical type.
~boundaryPatch()
Destructor.
Definition: boundaryPatch.C:76
label start() const
virtual void write(Ostream &) const
Write dictionary.
Definition: boundaryPatch.C:82
A class for handling words, derived from string.
Definition: word.H:59
static const word null
An empty word.
Definition: word.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const word & physicalType() const
Return the optional physical type of the patch.
boundaryPatch(const word &name, const label index, const label size, const label start, const word &physicalType=word::null)
Construct from components.
Definition: boundaryPatch.C:33
label index() const
Return the index of this patch in the boundaryMesh.
Ostream & operator<<(Ostream &, const ensightPart &)
autoPtr< boundaryPatch > clone() const
Clone.
Definition: boundaryPatch.C:68
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
friend Ostream & operator<<(Ostream &, const boundaryPatch &)
Namespace for OpenFOAM.