repatchPatch.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-2021 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::repatchPatch
26 
27 Description
28  Like polyPatch but without reference to mesh. patchIdentifier::index
29  is not used. Used in repatchMesh to hold data on patches.
30 
31 SourceFiles
32  repatchPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef repatchPatch_H
37 #define repatchPatch_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 repatchPatch;
50 
51 Ostream& operator<<(Ostream&, const repatchPatch&);
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class repatchPatch Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class repatchPatch
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  repatchPatch(const repatchPatch&, const label index);
91 
92  //- Clone
94 
95 
96  //- Destructor
97  ~repatchPatch();
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 repatchPatch&);
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
repatchPatch(const word &name, const label index, const label size, const label start, const word &physicalType=word::null)
Construct from components.
Definition: repatchPatch.C:33
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.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Identifies patch by name, patch index and physical type.
label size() const
Definition: repatchPatch.H:101
autoPtr< repatchPatch > clone() const
Clone.
Definition: repatchPatch.C:68
A class for handling words, derived from string.
Definition: word.H:59
static const word null
An empty word.
Definition: word.H:77
~repatchPatch()
Destructor.
Definition: repatchPatch.C:76
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const word & physicalType() const
Return the optional physical type of the patch.
virtual void write(Ostream &) const
Write dictionary.
Definition: repatchPatch.C:82
label index() const
Return the index of this patch in the boundaryMesh.
Ostream & operator<<(Ostream &, const ensightPart &)
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 repatchPatch &)
label start() const
Definition: repatchPatch.H:111
Namespace for OpenFOAM.
Like polyPatch but without reference to mesh. patchIdentifier::index is not used. Used in repatchMesh...
Definition: repatchPatch.H:57