34 template<
class PairType,
class WallType>
44 template<
class PairType,
class WallType>
59 label nPair = pairAccessed.size();
63 pairOrigProcOfOther.size() != nPair
64 || pairOrigIdOfOther.size() != nPair
65 || pairData.size() != nPair
69 <<
"Pair field size mismatch." <<
nl
71 << pairOrigProcOfOther <<
nl
72 << pairOrigIdOfOther <<
nl
81 PairCollisionRecord<PairType>
84 pairOrigProcOfOther[i],
91 label nWall = wallAccessed.size();
93 if (wallPRel.size() != nWall || wallData.size() != nWall)
96 <<
"Wall field size mismatch." <<
nl
107 WallCollisionRecord<WallType>
120 template<
class PairType,
class WallType>
128 f[i] = pairRecords_[i].accessed();
135 template<
class PairType,
class WallType>
143 f[i] = pairRecords_[i].origProcOfOther();
150 template<
class PairType,
class WallType>
158 f[i] = pairRecords_[i].origIdOfOther();
165 template<
class PairType,
class WallType>
173 f[i] = pairRecords_[i].collisionData();
180 template<
class PairType,
class WallType>
188 f[i] = wallRecords_[i].accessed();
195 template<
class PairType,
class WallType>
203 f[i] = wallRecords_[i].pRel();
210 template<
class PairType,
class WallType>
218 f[i] = wallRecords_[i].collisionData();
225 template<
class PairType,
class WallType>
229 label origProcOfOther,
241 if (pCR.
match(origProcOfOther, origIdOfOther))
255 PairCollisionRecord<PairType>(
true, origProcOfOther, origIdOfOther)
258 return pairRecords_.last();
262 template<
class PairType,
class WallType>
265 label origProcOfOther,
273 if (pCR.
match(origProcOfOther, origIdOfOther))
283 template<
class PairType,
class WallType>
298 if (wCR.
match(pRel, radius))
310 wallRecords_.append(WallCollisionRecord<WallType>(
true, pRel));
312 return wallRecords_.last();
316 template<
class PairType,
class WallType>
327 if (wCR.
match(pRel, radius))
337 template<
class PairType,
class WallType>
341 DynamicList<PairCollisionRecord<PairType>> updatedRecords;
345 if (pairRecords_[i].accessed())
347 pairRecords_[i].setUnaccessed();
349 updatedRecords.append(pairRecords_[i]);
353 pairRecords_ = updatedRecords;
357 DynamicList<WallCollisionRecord<WallType>> updatedRecords;
361 if (wallRecords_[i].accessed())
363 wallRecords_[i].setUnaccessed();
365 updatedRecords.append(wallRecords_[i]);
369 wallRecords_ = updatedRecords;
376 template<
class PairType,
class WallType>
377 inline bool Foam::operator==
379 const CollisionRecordList<PairType, WallType>& a,
380 const CollisionRecordList<PairType, WallType>&
b
385 a.pairRecords_ ==
b.pairRecords_
386 && a.wallRecords_ ==
b.wallRecords_
391 template<
class PairType,
class WallType>
392 inline bool Foam::operator!=
394 const CollisionRecordList<PairType, WallType>& a,
395 const CollisionRecordList<PairType, WallType>&
b
404 template<
class PairType,
class WallType>
408 CollisionRecordList<PairType, WallType>& cRL
411 is >> cRL.pairRecords_ >> cRL.wallRecords_;
418 template<
class PairType,
class WallType>
422 const CollisionRecordList<PairType, WallType>& cRL
425 os << cRL.pairRecords_ << cRL.wallRecords_;