Go to the documentation of this file.
29 template<
class graphType>
32 if( (i < 0) || (i >=data_.sizeOfRow(rowI_)) )
36 "void Foam::graphRow<graphType>::"
37 "checkIndex(const label i) const"
38 ) <<
"Row index " << rowI_
46 template<
class graphType>
54 template<
class graphType>
65 template<
class graphType>
73 template<
class graphType>
76 return data_.sizeOfRow(rowI_);
79 template<
class graphType>
82 data_.setRowSize(rowI_,
s);
85 template<
class graphType>
88 data_.setRowSize(rowI_, 0);
91 template<
class graphType>
94 data_.append(rowI_, el);
97 template<
class graphType>
100 data_.appendIfNotIn(rowI_, el);
103 template<
class graphType>
106 return data_.contains(rowI_,
e);
109 template<
class graphType>
115 return data_.containsAtPosition(rowI_,
e);
120 template<
class graphType>
123 return data_(rowI_, i);
126 template<
class graphType>
129 return data_(rowI_, i);
132 template<
class graphType>
138 data_.setRowSize(rowI_, l.size());
139 for(
label i=0;i<l.size();++i)
140 data_(rowI_, i) = l[i];
143 template<
class graphType>
144 template<
class listType>
147 data_.setRowSize(rowI_, l.size());
148 for(
label i=0;i<l.size();++i)
149 data_(rowI_, i) = l[i];
152 template<
class graphType>
159 os << r.size() <<
"(";
void checkIndex(const label i) const
check index
void appendIfNotIn(const label)
Append an element to the given row if it does not exist there.
const dimensionedVector & g
graphType & data_
reference to the graph
void append(const label)
Append an element to the given row.
const label rowI_
row number
void setSize(const label size)
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.
label size() const
Returns the number of rows.
void clear()
Clear the graph.
label operator[](const label) const
set and get operators
errorManip< error > abort(error &err)
const double e
Elementary charge.
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))
graphRow(graphType &, const label)
Construct from graph and row number.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
label containsAtPosition(const label e) const
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool contains(const label e) const
check if the element is in the given row (takes linear time)
void operator=(const graphRow< graphType > &)
Assignment operator.