Go to the documentation of this file.
26 template<
class T, Foam::label w
idth>
29 if( (i < 0) || (i >= nRows_) )
33 "void Foam::FRWGraph<T,width>::"
34 "checkIndex(const label i, const label j) const"
35 ) <<
"Row index " << i
36 <<
" is not in range " << 0
40 if( (j < 0) || (j >= width) )
43 "void Foam::FRWGraph<T,width>::"
44 "checkIndex(const label i, const label j) const"
45 ) <<
"Column index " << j
46 <<
" is not in range " << 0
53 template<
class T, Foam::label w
idth>
61 template<
class T, Foam::label w
idth>
73 template<
class T, Foam::label w
idth>
84 template<
class T, Foam::label w
idth>
94 template<
class T, Foam::label w
idth>
101 template<
class T, Foam::label w
idth>
107 template<
class T, Foam::label w
idth>
113 template<
class T, Foam::label w
idth>
116 data_.setSize(i * width);
120 template<
class T, Foam::label w
idth>
127 template<
class T, Foam::label w
idth>
134 data_.append(l[elI]);
138 template<
class T, Foam::label w
idth>
145 const label start = rowI * width;
147 data_[start+elI] = l[elI];
150 template<
class T, Foam::label w
idth>
157 const label start = rowI * width;
159 for(
label i=0;i<width;++i)
160 if( data_[start+i] ==
e )
166 template<
class T, Foam::label w
idth>
173 const label start = rowI * width;
175 for(
label i=0;i<width;++i)
176 if( data_[start+i] ==
e )
183 template<
class T, Foam::label w
idth>
194 return data_[i * width + j];
197 template<
class T, Foam::label w
idth>
207 return data_[i * width + j];
210 template<
class T, Foam::label w
idth>
void clear()
Clear the graph.
#define forAll(list, i)
Loop across all elements in list.
void setRow(const label rowI, const FixedList< T, width > &l)
Set row with the list.
label size() const
Returns the number of rows.
void setSize(const label)
Reset the number of rows.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool contains(const label rowI, const T &e) const
check if the element is in the given row (takes linear time)
errorManip< error > abort(error &err)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
friend Ostream & operator(Ostream &, const FRWGraph< T, width > &)
label nRows_
number of rows
label containsAtPosition(const label rowI, const T &e) const
LongList< T > data_
list containing the data
A 1D vector of objects of type <T> with a fixed size <Size>.
label sizeOfRow(const label rowI) const
Returns the size of a given row (obsolete)
const dimensionedScalar e
Elementary charge.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
void checkIndex(const label i, const label j) const
check index
FRWGraph()
Construct null.
void appendFixedList(const FixedList< T, width > &l)
Append a row at the end of the graph.