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 boundaryPatch_H
41 #define 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 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::boundaryPatch::clone
autoPtr< boundaryPatch > clone() const
Clone.
Definition: boundaryPatch.H:94
Foam::boundaryPatch
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
Definition: boundaryPatch.H:54
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::boundaryPatch::size
label size() const
Definition: boundaryPatch.H:102
Foam::patchIdentifier
Identifies a patch by name and index, with optional physical type and group information.
Definition: patchIdentifier.H:55
Foam::boundaryPatch::start
label start() const
Definition: boundaryPatch.H:112
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
os
OBJstream os(runTime.globalPath()/outputName)
Foam::boundaryPatch::boundaryPatch
boundaryPatch(const word &name, const label index, const label size, const label start, const word &physicalType=word::null)
Construct from components.
Definition: boundaryPatch.C:36
Foam::boundaryPatch::start
label & start()
Definition: boundaryPatch.H:117
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchIdentifier::index
label index() const noexcept
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:147
Foam::boundaryPatch::write
virtual void write(Ostream &os) const
Write dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:73
patchIdentifier.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::boundaryPatch::size
label & size()
Definition: boundaryPatch.H:107
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::patchIdentifier::name
const word & name() const noexcept
The patch name.
Definition: patchIdentifier.H:135
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::patchIdentifier::physicalType
const word & physicalType() const noexcept
The (optional) physical type of the patch.
Definition: patchIdentifier.H:159
autoPtr.H