boundaryPatchBase.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  boundaryPatchBase
26 
27 Description
28  Writes information for a given boundary patch
29 
30 SourceFiles
31  boundaryPatchBase.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef boundaryPatchBase_H
36 #define boundaryPatchBase_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "word.H"
41 #include "label.H"
42 #include "objectRegistry.H"
43 #include "typeInfo.H"
44 #include "dictionary.H"
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
52 {
53 protected:
54 
55  // Protected data
56  word name_;
57 
58  word type_;
59 
60  label nFaces_;
61 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("boundaryPatchBase");
68 
69  // Constructors
70 
72  (
73  const word&,
74  const word&,
75  const label,
76  const label
77  );
78 
79  boundaryPatchBase(const word& name, const dictionary&);
80 
81  // Destructor
82 
83  virtual ~boundaryPatchBase()
84  {}
85 
86  // Declare run-time constructor selection table
87 
89  (
90  autoPtr,
92  dictionary,
93  (
94  const word& name,
95  const dictionary& dict
96  ),
97  (name, dict)
98  );
99 
100  // Selectors
101 
103  (
104  const word& name,
105  const dictionary& dict
106  );
107 
109  (
110  Istream&
111  );
112 
113  // Construct and return a clone
114 
116  {
117  return New
118  (
119  name_,
120  this->dict()
121  );
122  }
123 
124  //- Write
125  virtual void write(Ostream&) const = 0;
126 
127  //- Write dictionary
128  virtual void writeDict(Ostream&) const = 0;
129 
130  // Member functions
131 
132  inline const word& patchName() const
133  {
134  return name_;
135  }
136 
137  inline word& patchName()
138  {
139  return name_;
140  }
141 
142  inline const word& patchType() const
143  {
144  return type_;
145  }
146 
147  inline word& patchType()
148  {
149  return type_;
150  }
151 
152  inline label patchStart() const
153  {
154  return startFace_;
155  }
156 
157  inline label& patchStart()
158  {
159  return startFace_;
160  }
161 
162  inline label patchSize() const
163  {
164  return nFaces_;
165  }
166 
167  inline label& patchSize()
168  {
169  return nFaces_;
170  }
171 
172  //- Return as dictionary of entries
173  virtual dictionary dict() const = 0;
174 
175  // Member operators
176  friend Ostream& operator<<(Ostream&, const boundaryPatchBase&);
177  virtual Istream& operator>>(Istream&) = 0;
178  //virtual void operator=(const boundaryPatchBase&) = 0;
179  //virtual bool operator!=(const boundaryPatchBase&) const = 0;
180 };
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::boundaryPatchBase::writeDict
virtual void writeDict(Ostream &) const =0
Write dictionary.
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::boundaryPatchBase::patchSize
label patchSize() const
Definition: boundaryPatchBase.H:161
typeInfo.H
Foam::boundaryPatchBase::name_
word name_
Definition: boundaryPatchBase.H:55
Foam::boundaryPatchBase::clone
autoPtr< boundaryPatchBase > clone() const
Definition: boundaryPatchBase.H:114
Foam::boundaryPatchBase::operator>>
virtual Istream & operator>>(Istream &)=0
Foam::boundaryPatchBase::patchName
const word & patchName() const
Definition: boundaryPatchBase.H:131
objectRegistry.H
Foam::boundaryPatchBase::dict
virtual dictionary dict() const =0
Return as dictionary of entries.
Foam::boundaryPatchBase::patchSize
label & patchSize()
Definition: boundaryPatchBase.H:166
Foam::boundaryPatchBase::patchType
const word & patchType() const
Definition: boundaryPatchBase.H:141
Foam::boundaryPatchBase::patchType
word & patchType()
Definition: boundaryPatchBase.H:146
Foam::boundaryPatchBase::TypeName
TypeName("boundaryPatchBase")
Runtime type information.
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::boundaryPatchBase::nFaces_
label nFaces_
Definition: boundaryPatchBase.H:59
Foam::boundaryPatchBase::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, boundaryPatchBase, dictionary,(const word &name, const dictionary &dict),(name, dict))
Foam::boundaryPatchBase::patchName
word & patchName()
Definition: boundaryPatchBase.H:136
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::boundaryPatchBase::boundaryPatchBase
boundaryPatchBase(const word &, const word &, const label, const label)
Definition: boundaryPatchBase.C:97
Foam::boundaryPatchBase::patchStart
label & patchStart()
Definition: boundaryPatchBase.H:156
Foam::boundaryPatchBase::type_
word type_
Definition: boundaryPatchBase.H:57
Foam::boundaryPatchBase::New
static autoPtr< boundaryPatchBase > New(const word &name, const dictionary &dict)
Definition: boundaryPatchBase.C:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::boundaryPatchBase::operator<<
friend Ostream & operator<<(Ostream &, const boundaryPatchBase &)
Definition: boundaryPatchBase.C:125
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::boundaryPatchBase
Definition: boundaryPatchBase.H:50
label.H
Foam::boundaryPatchBase::patchStart
label patchStart() const
Definition: boundaryPatchBase.H:151
dictionary.H
Foam::boundaryPatchBase::write
virtual void write(Ostream &) const =0
Write.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
word.H
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::boundaryPatchBase::~boundaryPatchBase
virtual ~boundaryPatchBase()
Definition: boundaryPatchBase.H:82
Foam::boundaryPatchBase::startFace_
label startFace_
Definition: boundaryPatchBase.H:61