faceListPMG.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  faceListPMG
26 
27 Description
28  This is a container with additional size to prevent re-allocation
29  every time it is resized
30 
31 SourceFiles
32 
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef faceListPMG_H
37 #define faceListPMG_H
38 
39 #include "regIOobject.H"
40 #include "faceList.H"
41 #include "Istream.H"
42 #include "Ostream.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 class faceListPMG
52 : public regIOobject,
53  public faceList
54 {
55  // Private data
56  //- number of used elements
57  label nElmts_;
58 
59  // Disallow bitwise assignment
60  void operator=(const faceListPMG&);
61 
62  faceListPMG(const faceListPMG&);
63 
64  // Disallow transfer from faceList
65  void transfer(faceList&);
66 
67 public:
68 
69  TypeName("faceList");
70 
71  // Constructors
72  //- construct from IOobject
73  inline faceListPMG(const IOobject&);
74 
75  //- construct from IOobject and size
76  inline faceListPMG(const IOobject&, const label);
77 
78  //- construct from IOobject and faceList
79  inline faceListPMG(const IOobject&, const faceList&);
80 
81  // Destructor
82  inline ~faceListPMG();
83 
84  // Member functions
85  //- return the number of used elements
86  inline label size() const;
87 
88  //- set the number of used elements
89  inline void setSize(const label nElmts);
90 
91  //- set the size to zero
92  inline void clear();
93 
94  //- add a face at the end of the list
95  inline void append(const face&);
96 
97  //- return an element with bound checking
98  inline face& newElmt(const label);
99 
100  //- read/write the list onto disk
101  inline bool writeData(Ostream&) const;
102 
103  // Member operators
104  inline void operator=(const faceList&);
105 
106  friend inline Ostream& operator<<(Ostream&, const faceListPMG&);
107 
108  friend inline Istream& operator>>(Istream&, faceListPMG&);
109 };
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #include "faceListPMGI.H"
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
regIOobject.H
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::faceListPMG::writeData
bool writeData(Ostream &) const
read/write the list onto disk
Definition: faceListPMGI.H:120
Foam::faceListPMG::operator>>
friend Istream & operator>>(Istream &, faceListPMG &)
Definition: faceListPMGI.H:140
faceList.H
Foam::faceListPMG::newElmt
face & newElmt(const label)
return an element with bound checking
Definition: faceListPMGI.H:112
faceListPMGI.H
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::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::faceListPMG::setSize
void setSize(const label nElmts)
set the number of used elements
Definition: faceListPMGI.H:78
Istream.H
Foam::faceListPMG::operator<<
friend Ostream & operator<<(Ostream &, const faceListPMG &)
Definition: faceListPMGI.H:132
Foam::faceListPMG::append
void append(const face &)
add a face at the end of the list
Definition: faceListPMGI.H:105
Foam::faceListPMG::TypeName
TypeName("faceList")
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::faceListPMG::clear
void clear()
set the size to zero
Definition: faceListPMGI.H:100
Ostream.H
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:60
Foam::faceListPMG::size
label size() const
return the number of used elements
Definition: faceListPMGI.H:73
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::faceListPMG::operator=
void operator=(const faceListPMG &)
Foam::faceListPMG::~faceListPMG
~faceListPMG()
Definition: faceListPMGI.H:67
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::faceListPMG::faceListPMG
faceListPMG(const faceListPMG &)
Foam::faceListPMG
Definition: faceListPMG.H:50
Foam::faceListPMG::nElmts_
label nElmts_
number of used elements
Definition: faceListPMG.H:56
Foam::faceListPMG::transfer
void transfer(faceList &)