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 | Copyright (C) 2011 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 /*---------------------------------------------------------------------------*\
48  Class boundaryPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class boundaryPatch
52 :
53  public patchIdentifier
54 {
55  // Private data
56 
58  label start_;
59 
60 public:
61 
62  // Constructors
63 
64  //- Construct from components
66  (
67  const word& name,
68  const label index,
69  const label size,
70  const label start,
72  );
73 
74  //- Construct from dictionary
76  (
77  const word& name,
78  const dictionary& dict,
79  const label index
80  );
81 
82  //- Construct as copy
84 
85  //- Construct as copy, resetting the index
86  boundaryPatch(const boundaryPatch&, const label index);
87 
88  //- Clone
90 
91 
92  //- Destructor
94 
95 
96  // Member Functions
97 
98  label size() const
99  {
100  return size_;
101  }
102 
103  label& size()
104  {
105  return size_;
106  }
107 
108  label start() const
109  {
110  return start_;
111  }
112 
113  label& start()
114  {
115  return start_;
116  }
117 
118 
119  //- Write dictionary
120  virtual void write(Ostream&) const;
121 
122 
123  // Ostream Operator
124 
125  friend Ostream& operator<<(Ostream&, const boundaryPatch&);
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::boundaryPatch::start_
label start_
Definition: boundaryPatch.H:57
Foam::boundaryPatch::operator<<
friend Ostream & operator<<(Ostream &, const boundaryPatch &)
Foam::boundaryPatch::dict
dictionary dict() const
Return as dictionary of entries.
Definition: boundaryPatch.C:63
Foam::boundaryPatch
Like polyPatch but without reference to mesh. patchIdentifier::index is not used. Used in boundaryMes...
Definition: boundaryPatch.H:50
Foam::boundaryPatch::size_
label size_
Definition: boundaryPatch.H:56
Foam::boundaryPatch::size
label size() const
Definition: boundaryPatch.H:97
Foam::patchIdentifier
Identifies patch by name, patch index and physical type.
Definition: patchIdentifier.H:57
Foam::label
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
Foam::boundaryPatch::clone
autoPtr< boundaryPatch > clone() const
Clone.
Definition: boundaryPatch.C:76
Foam::boundaryPatch::start
label start() const
Definition: boundaryPatch.H:107
Foam::patchIdentifier::physicalType
const word & physicalType() const
Return the optional physical type of the patch.
Definition: patchIdentifier.H:121
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
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:33
Foam::boundaryPatch::start
label & start()
Definition: boundaryPatch.H:112
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
patchIdentifier.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::boundaryPatch::~boundaryPatch
~boundaryPatch()
Destructor.
Definition: boundaryPatch.C:84
Foam::boundaryPatch::write
virtual void write(Ostream &) const
Write dictionary.
Definition: boundaryPatch.C:90
Foam::boundaryPatch::size
label & size()
Definition: boundaryPatch.H:102
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::patchIdentifier::name
const word & name() const
Return name.
Definition: patchIdentifier.H:109
Foam::patchIdentifier::index
label index() const
Return the index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:133
autoPtr.H