34template<
class PairType,
class WallType>
44template<
class PairType,
class WallType>
69 <<
"Pair field size mismatch." << nl
71 << pairOrigProcOfOther << nl
72 << pairOrigIdOfOther << nl
96 <<
"Wall field size mismatch." << nl
100 << abort(FatalError);
107 WallCollisionRecord<WallType>
120template<
class PairType,
class WallType>
128 f[i] = pairRecords_[i].accessed();
135template<
class PairType,
class WallType>
143 f[i] = pairRecords_[i].origProcOfOther();
150template<
class PairType,
class WallType>
158 f[i] = pairRecords_[i].origIdOfOther();
165template<
class PairType,
class WallType>
173 f[i] = pairRecords_[i].collisionData();
180template<
class PairType,
class WallType>
188 f[i] = wallRecords_[i].accessed();
195template<
class PairType,
class WallType>
203 f[i] = wallRecords_[i].pRel();
210template<
class PairType,
class WallType>
218 f[i] = wallRecords_[i].collisionData();
225template<
class PairType,
class WallType>
229 label origProcOfOther,
241 if (pCR.
match(origProcOfOther, origIdOfOther))
253 return pairRecords_.emplace_back(
true, origProcOfOther, origIdOfOther);
257template<
class PairType,
class WallType>
260 label origProcOfOther,
268 if (pCR.
match(origProcOfOther, origIdOfOther))
278template<
class PairType,
class WallType>
293 if (wCR.
match(pRel, radius))
305 return wallRecords_.emplace_back(
true, pRel);
309template<
class PairType,
class WallType>
320 if (wCR.
match(pRel, radius))
330template<
class PairType,
class WallType>
334 DynamicList<PairCollisionRecord<PairType>> updatedRecords;
338 if (pairRecords_[i].accessed())
340 pairRecords_[i].setUnaccessed();
342 updatedRecords.append(pairRecords_[i]);
346 pairRecords_ = updatedRecords;
354 if (wallRecords_[i].accessed())
356 wallRecords_[i].setUnaccessed();
358 updatedRecords.append(wallRecords_[i]);
362 wallRecords_ = updatedRecords;
369template<
class PairType,
class WallType>
370inline bool Foam::operator==
378 a.pairRecords_ ==
b.pairRecords_
379 && a.wallRecords_ ==
b.wallRecords_
384template<
class PairType,
class WallType>
385inline bool Foam::operator!=
387 const CollisionRecordList<PairType, WallType>& a,
388 const CollisionRecordList<PairType, WallType>&
b
397template<
class PairType,
class WallType>
398Foam::Istream& Foam::operator>>
404 is >> cRL.pairRecords_ >> cRL.wallRecords_;
411template<
class PairType,
class WallType>
412Foam::Ostream& Foam::operator<<
418 os << cRL.pairRecords_ << cRL.wallRecords_;
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
PairCollisionRecord< PairType > & matchPairRecord(label origProcOfOther, label origIdOfOther)
Enquires if the proc and id pair of the other particle are.
labelField pairAccessed() const
Return field of pair accessed from each record, used for.
labelField pairOrigIdOfOther() const
Return field of pair origIdOfOther from each record, used.
vectorField wallPRel() const
Return field of wall pRel from each record, used for field IO.
bool checkPairRecord(label origProcOfOther, label origIdOfOther)
Enquire if the specified record exists without modifying.
Field< WallType > wallData() const
Return field of wall data from each record, used for field IO.
Field< PairType > pairData() const
Return field of pair data from each record, used for field IO.
WallCollisionRecord< WallType > & matchWallRecord(const vector &pRel, scalar radius)
Enquires if the position of wall impact relative to the.
labelField wallAccessed() const
Return field of wall accessed from each record, used for field IO.
bool checkWallRecord(const vector &pRel, scalar radius)
Enquire if the specified record exists without modifying.
void update()
Update the collision records, deleting any records not.
labelField pairOrigProcOfOther() const
Return field of pair origProcOfOther from each record,.
CollisionRecordList()=default
Default construct.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Record of a collision between the particle holding the record and the particle with the stored id.
bool match(label queryOrigProcOfOther, label queryOrigIdOfOther) const
void setAccessed()
Set the accessed property of the record to accessed.
void size(const label n)
Older name for setAddressableSize.
Record of a collision between the particle holding the record and a wall face at the position relativ...
bool match(const vector &pRel, scalar radius)
void setAccessed()
Set the accessed property of the record to accessed.
OBJstream os(runTime.globalPath()/outputName)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< label > labelField
Specialisation of Field<T> for label.
#define forAll(list, i)
Loop across all elements in list.