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))
253 return pairRecords_.emplace_back(
true, origProcOfOther, origIdOfOther);
257 template<
class PairType,
class WallType>
260 label origProcOfOther,
268 if (pCR.
match(origProcOfOther, origIdOfOther))
278 template<
class PairType,
class WallType>
293 if (wCR.
match(pRel, radius))
305 return wallRecords_.emplace_back(
true, pRel);
309 template<
class PairType,
class WallType>
320 if (wCR.
match(pRel, radius))
330 template<
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;
350 DynamicList<WallCollisionRecord<WallType>> updatedRecords;
354 if (wallRecords_[i].accessed())
356 wallRecords_[i].setUnaccessed();
358 updatedRecords.append(wallRecords_[i]);
362 wallRecords_ = updatedRecords;
369 template<
class PairType,
class WallType>
370 inline bool Foam::operator==
372 const CollisionRecordList<PairType, WallType>& a,
373 const CollisionRecordList<PairType, WallType>&
b 378 a.pairRecords_ ==
b.pairRecords_
379 && a.wallRecords_ ==
b.wallRecords_
384 template<
class PairType,
class WallType>
385 inline bool Foam::operator!=
387 const CollisionRecordList<PairType, WallType>& a,
388 const CollisionRecordList<PairType, WallType>&
b 397 template<
class PairType,
class WallType>
401 CollisionRecordList<PairType, WallType>& cRL
404 is >> cRL.pairRecords_ >> cRL.wallRecords_;
411 template<
class PairType,
class WallType>
415 const CollisionRecordList<PairType, WallType>& cRL
418 os << cRL.pairRecords_ << cRL.wallRecords_;
Field< WallType > wallData() const
Return field of wall data from each record, used for field IO.
void size(const label n)
Older name for setAddressableSize.
labelField wallAccessed() const
Return field of wall accessed from each record, used for field IO.
bool match(label queryOrigProcOfOther, label queryOrigIdOfOther) const
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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)...
constexpr char nl
The newline '\n' character (0x0a)
Field< PairType > pairData() const
Return field of pair data from each record, used for field IO.
labelField pairAccessed() const
Return field of pair accessed from each record, used for.
void update()
Update the collision records, deleting any records not.
#define forAll(list, i)
Loop across all elements in list.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
bool checkWallRecord(const vector &pRel, scalar radius)
Enquire if the specified record exists without modifying.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
labelField pairOrigProcOfOther() const
Return field of pair origProcOfOther from each record,.
labelField pairOrigIdOfOther() const
Return field of pair origIdOfOther from each record, used.
errorManip< error > abort(error &err)
void setAccessed()
Set the accessed property of the record to accessed.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
PairCollisionRecord< PairType > & matchPairRecord(label origProcOfOther, label origIdOfOther)
Enquires if the proc and id pair of the other particle are.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
CollisionRecordList()=default
Default construct.
OBJstream os(runTime.globalPath()/outputName)
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)
WallCollisionRecord< WallType > & matchWallRecord(const vector &pRel, scalar radius)
Enquires if the position of wall impact relative to the.
Record of a collision between the particle holding the record and the particle with the stored id...
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.
void setAccessed()
Set the accessed property of the record to accessed.