cellListPMG.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  cellListPMG
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 cellListPMG_H
37 #define cellListPMG_H
38 
39 #include "cellList.H"
40 #include "Istream.H"
41 #include "Ostream.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 class cellListPMG
51  : public cellList
52 {
53  // Private data
54  //- number of used elements
55  label nElmts_;
56 
57  // Disallow bitwise assignment
58  void operator=(const cellListPMG&);
59 
60  cellListPMG(const cellListPMG&);
61 
62  // Disallow transfer from cellList
63  void transfer(cellList&);
64 
65 public:
66 
67  // Constructors
68  //- null construct
69  inline cellListPMG();
70 
71  // Destructor
72  inline ~cellListPMG();
73 
74  // Member functions
75  //- return the number of used elements
76  inline label size() const;
77 
78  //- set the number of used elements
79  inline void setSize(const label nElmts);
80 
81  //- set the size to zero
82  inline void clear();
83 
84  //- add a cell at the end of the list
85  inline void append(const cell&);
86 
87  //- return an element with bound checking
88  inline cell& newElmt(const label);
89 
90  // Member operators
91  inline void operator=(const cellList&);
92 
93  friend inline Ostream& operator<<(Ostream&, const cellListPMG&);
94 
95  friend inline Istream& operator>>(Istream&, cellListPMG&);
96 };
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace Foam
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #include "cellListPMGI.H"
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 #endif
109 
110 // ************************************************************************* //
Foam::cellListPMG::clear
void clear()
set the size to zero
Definition: cellListPMGI.H:83
Foam::cellListPMG::~cellListPMG
~cellListPMG()
Definition: cellListPMGI.H:50
Foam::cellListPMG::setSize
void setSize(const label nElmts)
set the number of used elements
Definition: cellListPMGI.H:61
Foam::cellListPMG::operator>>
friend Istream & operator>>(Istream &, cellListPMG &)
Definition: cellListPMGI.H:118
Foam::cellListPMG::operator=
void operator=(const cellListPMG &)
Foam::cellListPMG::cellListPMG
cellListPMG()
null construct
Definition: cellListPMGI.H:40
Foam::cellListPMG::newElmt
cell & newElmt(const label)
return an element with bound checking
Definition: cellListPMGI.H:95
Foam::cellListPMG::transfer
void transfer(cellList &)
Foam::cellListPMG
Definition: cellListPMG.H:49
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
cellList.H
Istream.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cellListPMG::nElmts_
label nElmts_
number of used elements
Definition: cellListPMG.H:54
Ostream.H
Foam::cellListPMG::append
void append(const cell &)
add a cell at the end of the list
Definition: cellListPMGI.H:88
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
cellListPMGI.H
Foam::cellListPMG::operator<<
friend Ostream & operator<<(Ostream &, const cellListPMG &)
Definition: cellListPMGI.H:110
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::cell
A cell is defined as a list of faces with extra functionality.
Definition: cell.H:56
Foam::cellListPMG::size
label size() const
return the number of used elements
Definition: cellListPMGI.H:56