VRWGraphList.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  VRWGraphList
26 
27 Description
28  This class is an implementation of a list of graphs
29  with variable column width. The implementation is memory efficient.
30 
31 SourceFiles
32  VRWGraphListI.H
33  VRWGraphList.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef VRWGraphList_H
38 #define VRWGraphList_H
39 
40 #include "VRWGraph.H"
41 #include "subGraph.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class VRWGraphList Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class VRWGraphList
53 {
54 
55  // Private data
56  //- graph containing the data
58 
59  //- number of rows
61 
62  // Private member functions
63  //- check index
64  inline void checkIndex
65  (
66  const label i,
67  const label j,
68  const label k
69  ) const;
70 
71 public:
72 
73  // Constructors
74 
75  //- Construct null
76  inline VRWGraphList();
77 
78  //- Copy contructor
79  inline VRWGraphList(const VRWGraphList&);
80 
81  // Destructor
82 
83  inline ~VRWGraphList();
84 
85  // Member Functions
86 
87  // Access
88 
89  //- Returns the number of graphs
90  inline label size() const;
91 
92  //- Returns the number of rows in the graph at that position
93  inline label sizeOfGraph(const label posI) const;
94 
95  //- Return the number of element in the row at the given position
96  inline label sizeOfRow(const label posI, const label rowI) const;
97 
98  //- Clear the graph
99  inline void clear();
100 
101  // Member Operators
102 
103  //- Append a graph at the end of the graphList
104  template<class GraphType>
105  inline void appendGraph(const GraphType& l);
106 
107  //- get and set operators
108  inline label operator()
109  (
110  const label i,
111  const label j,
112  const label k
113  ) const;
114 
115  inline label& operator()(const label i, const label j, const label k);
116 
117  inline const subGraph<const VRWGraph> operator[](const label i) const;
118 
119  //- Assignment operator
120  inline void operator=(const VRWGraphList&);
121 
122 
123  // IOstream operators
124 
125  // Write VRWGraphList to Ostream.
126  friend Ostream& operator<<(Ostream&, const VRWGraphList&);
127 
128  //- Read from Istream, discarding contents of existing VRWGraphList.
129 /* friend Istream& operator>> <T, width>
130  (
131  Istream&,
132  VRWGraphList<T, width>&
133  );
134 */
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #include "VRWGraphListI.H"
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Foam::VRWGraphList::operator[]
const subGraph< const VRWGraph > operator[](const label i) const
Definition: VRWGraphListI.H:165
VRWGraphListI.H
Foam::VRWGraphList::sizeOfRow
label sizeOfRow(const label posI, const label rowI) const
Return the number of element in the row at the given position.
Definition: VRWGraphListI.H:107
Foam::VRWGraphList::size
label size() const
Returns the number of graphs.
Definition: VRWGraphListI.H:96
VRWGraph.H
Foam::VRWGraphList::operator=
void operator=(const VRWGraphList &)
Assignment operator.
Definition: VRWGraphListI.H:172
Foam::VRWGraphList::data_
VRWGraph data_
graph containing the data
Definition: VRWGraphList.H:56
Foam::VRWGraphList
Definition: VRWGraphList.H:51
Foam::VRWGraphList::appendGraph
void appendGraph(const GraphType &l)
Append a graph at the end of the graphList.
Definition: VRWGraphListI.H:123
Foam::VRWGraphList::VRWGraphList
VRWGraphList()
Construct null.
Definition: VRWGraphListI.H:72
Foam::LongList
Definition: LongList.H:55
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::VRWGraphList::operator()
label operator()(const label i, const label j, const label k) const
get and set operators
Definition: VRWGraphListI.H:138
Foam::subGraph
Definition: subGraph.H:47
subGraph.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::VRWGraphList::operator<<
friend Ostream & operator<<(Ostream &, const VRWGraphList &)
Foam::VRWGraphList::sizeOfGraph
label sizeOfGraph(const label posI) const
Returns the number of rows in the graph at that position.
Definition: VRWGraphListI.H:101
Foam::VRWGraphList::clear
void clear()
Clear the graph.
Definition: VRWGraphListI.H:115
Foam::VRWGraphList::~VRWGraphList
~VRWGraphList()
Definition: VRWGraphListI.H:89
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::VRWGraphList::checkIndex
void checkIndex(const label i, const label j, const label k) const
check index
Definition: VRWGraphListI.H:32
Foam::VRWGraph
Definition: VRWGraph.H:101
Foam::VRWGraphList::rows_
LongList< rowElement > rows_
number of rows
Definition: VRWGraphList.H:59