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-2016 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  //- Construct as copy
91 
92  //- Construct as copy, resetting the index
93  boundaryPatch(const boundaryPatch&, const label index);
94 
95  //- Clone
97 
98 
99  //- Destructor
100  ~boundaryPatch();
101 
102 
103  // Member Functions
105  label size() const
106  {
107  return size_;
108  }
110  label& size()
111  {
112  return size_;
113  }
115  label start() const
116  {
117  return start_;
118  }
120  label& start()
121  {
122  return start_;
123  }
124 
125 
126  //- Write dictionary
127  virtual void write(Ostream&) const;
128 
129 
130  // Ostream Operator
131 
132  friend Ostream& operator<<(Ostream&, const boundaryPatch&);
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
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
Like polyPatch but without reference to mesh. patchIdentifier::index is not used. Used in boundaryMes...
Definition: boundaryPatch.H:57
autoPtr< boundaryPatch > clone() const
Clone.
Definition: boundaryPatch.C:76
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Identifies patch by name, patch index and physical type.
label start() const
const word & physicalType() const
Return the optional physical type of the patch.
~boundaryPatch()
Destructor.
Definition: boundaryPatch.C:84
A class for handling words, derived from string.
Definition: word.H:59
static const word null
An empty word.
Definition: word.H:77
const word & name() const
Return name.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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
Ostream & operator<<(Ostream &, const ensightPart &)
virtual void write(Ostream &) const
Write dictionary.
Definition: boundaryPatch.C:90
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
label size() const
friend Ostream & operator<<(Ostream &, const boundaryPatch &)
label index() const
Return the index of this patch in the boundaryMesh.
Namespace for OpenFOAM.