1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 inline void Foam::VRWGraphList::checkIndex
38 if( (i < 0) || (i >= rows_.size()) )
42 "void Foam::VRWGraphList<T,width>::"
43 "checkIndex(const label i, const label j, const label k) const"
44 ) << "Position index " << Foam::label(i)
45 << " is not in range " << Foam::label(0)
46 << " and " << rows_.size() << abort(FatalError);
49 if( (j < 0) || (j >= rows_[i].size()) )
52 "void Foam::VRWGraphList<T,width>::"
53 "checkIndex(label const i, const label j, const label k) const"
54 ) << "Row index " << Foam::label(j)
55 << " is not in range " << Foam::label(0)
56 << " and " << rows_[i].size() << abort(FatalError);
58 if( (k < 0) || (k >= data_.sizeOfRow(rows_[i].start()+j)) )
61 "void Foam::VRWGraphList<T,width>::"
62 "checkIndex(label const i, const label j, const label k) const"
63 ) << "Data index " << Foam::label(k)
64 << " is not in range " << Foam::label(0)
65 << " and " << data_.sizeOfRow(rows_[i].start()+j)
69 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
72 inline Foam::VRWGraphList::VRWGraphList()
79 inline Foam::VRWGraphList::VRWGraphList
81 const VRWGraphList& ol
89 inline Foam::VRWGraphList::~VRWGraphList()
94 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
96 inline Foam::label Foam::VRWGraphList::size() const
101 inline Foam::label Foam::VRWGraphList::sizeOfGraph(const label posI) const
103 return rows_[posI].size();
106 inline Foam::label Foam::VRWGraphList::sizeOfRow
112 return data_.sizeOfRow(rows_[posI].start()+rowI);
115 inline void Foam::VRWGraphList::clear()
121 template<class GraphType>
122 inline void Foam::VRWGraphList::appendGraph
127 rowElement re(data_.size(), l.size());
129 for(label i=0;i<l.size();++i)
130 data_.appendList(l[i]);
135 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
137 inline Foam::label Foam::VRWGraphList::operator()
148 return data_(rows_[i].start() + j, k);
152 inline Foam::label& Foam::VRWGraphList::operator()
154 const label i, const label j, const label k
161 return data_(rows_[i].start() + j, k);
164 inline const Foam::subGraph<const VRWGraph> Foam::VRWGraphList::operator[]
169 return Foam::subGraph<const VRWGraph>(data_, i, rows_[i].size());
172 inline void Foam::VRWGraphList::operator=(const VRWGraphList& l)
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // ************************************************************************* //