boundaryPatch.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 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::boundaryPatch
29 
30 Description
31  Like polyPatch but without reference to mesh.
32  Used in boundaryMesh to hold data on patches.
33  The patchIdentifier::index is set, but not used.
34 
35 SourceFiles
36  boundaryPatch.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef Foam_boundaryPatch_H
41 #define Foam_boundaryPatch_H
42 
43 #include "patchIdentifier.H"
44 #include "autoPtr.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class boundaryPatch Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class boundaryPatch
56 :
57  public patchIdentifier
58 {
59  // Private Data
60 
61  label size_;
62 
63  label start_;
64 
65 public:
66 
67  // Generated Methods: copy construct, copy assignment
68 
69 
70  // Constructors
71 
72  //- Construct from components
74  (
75  const word& name,
76  const label index,
77  const label size,
78  const label start,
80  );
81 
82  //- Construct from dictionary
84  (
85  const word& name,
86  const dictionary& dict,
87  const label index
88  );
89 
90  //- Copy construct, resetting the index
91  boundaryPatch(const boundaryPatch& p, const label index);
92 
93 
94  //- Clone
96  {
97  return autoPtr<boundaryPatch>::New(*this);
98  }
99 
100 
101  // Member Functions
102 
103  label size() const
104  {
105  return size_;
106  }
107 
108  label& size()
109  {
110  return size_;
111  }
112 
113  label start() const
114  {
115  return start_;
116  }
117 
118  label& start()
119  {
120  return start_;
121  }
122 
123 
124  //- Write dictionary entries (without surrounding braces)
125  virtual void write(Ostream& os) const;
126 };
127 
128 
129 // Global Operators
130 
131 //- Write boundaryPatch as dictionary entries (without surrounding braces)
132 Ostream& operator<<(Ostream&, const boundaryPatch& p);
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
label size() const
dictionary dict
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches...
Definition: boundaryPatch.H:50
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
Identifies a patch by name and index, with optional physical type and group information.
autoPtr< boundaryPatch > clone() const
Clone.
Definition: boundaryPatch.H:98
label start() const
A class for handling words, derived from Foam::string.
Definition: word.H:63
static const word null
An empty word.
Definition: word.H:84
const word & name() const noexcept
The patch name.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:55
const word & physicalType() const noexcept
The (optional) physical type of the patch.
OBJstream os(runTime.globalPath()/outputName)
boundaryPatch(const word &name, const label index, const label size, const label start, const word &physicalType=word::null)
Construct from components.
Definition: boundaryPatch.C:29
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:76
virtual void write(Ostream &os) const
Write dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:66
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
label index() const noexcept
The index of this patch in the boundaryMesh.
volScalarField & p
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition: autoPtr.H:178
Namespace for OpenFOAM.