Go to the documentation of this file.
31 template<
class PairType,
class WallType>
39 template<
class PairType,
class WallType>
48 "Foam::CollisionRecordList<PairType, WallType>::"
49 "CollisionRecordList(Foam::Istream&)"
54 template<
class PairType,
class WallType>
69 label nPair = pairAccessed.size();
73 pairOrigProcOfOther.size() != nPair
74 || pairOrigIdOfOther.size() != nPair
75 || pairData.size() != nPair
79 <<
"Pair field size mismatch." <<
nl
81 << pairOrigProcOfOther <<
nl
82 << pairOrigIdOfOther <<
nl
94 pairOrigProcOfOther[i],
101 label nWall = wallAccessed.size();
103 if (wallPRel.size() != nWall || wallData.size() != nWall)
106 <<
"Wall field size mismatch." <<
nl
107 << wallAccessed <<
nl
130 template<
class PairType,
class WallType>
137 template<
class PairType,
class WallType>
145 f[i] = pairRecords_[i].accessed();
152 template<
class PairType,
class WallType>
160 f[i] = pairRecords_[i].origProcOfOther();
167 template<
class PairType,
class WallType>
175 f[i] = pairRecords_[i].origIdOfOther();
182 template<
class PairType,
class WallType>
190 f[i] = pairRecords_[i].collisionData();
197 template<
class PairType,
class WallType>
205 f[i] = wallRecords_[i].accessed();
212 template<
class PairType,
class WallType>
220 f[i] = wallRecords_[i].pRel();
227 template<
class PairType,
class WallType>
235 f[i] = wallRecords_[i].collisionData();
242 template<
class PairType,
class WallType>
246 label origProcOfOther,
258 if (pCR.
match(origProcOfOther, origIdOfOther))
275 return pairRecords_.last();
279 template<
class PairType,
class WallType>
282 label origProcOfOther,
290 if (pCR.
match(origProcOfOther, origIdOfOther))
300 template<
class PairType,
class WallType>
315 if (wCR.
match(pRel, radius))
329 return wallRecords_.last();
333 template<
class PairType,
class WallType>
344 if (wCR.
match(pRel, radius))
354 template<
class PairType,
class WallType>
362 if (pairRecords_[i].accessed())
364 pairRecords_[i].setUnaccessed();
366 updatedRecords.
append(pairRecords_[i]);
370 pairRecords_ = updatedRecords;
378 if (wallRecords_[i].accessed())
380 wallRecords_[i].setUnaccessed();
382 updatedRecords.
append(wallRecords_[i]);
386 wallRecords_ = updatedRecords;
393 template<
class PairType,
class WallType>
403 <<
"Attempted assignment to self"
407 pairRecords_ = rhs.pairRecords_;
408 wallRecords_ = rhs.wallRecords_;
414 template<
class PairType,
class WallType>
415 inline bool Foam::operator==
429 template<
class PairType,
class WallType>
430 inline bool Foam::operator!=
442 template<
class PairType,
class WallType>
446 CollisionRecordList<PairType, WallType>& cRL
449 is >> cRL.pairRecords_ >> cRL.wallRecords_;
454 "Foam::Istream& Foam::operator>>"
455 "(Foam::Istream&, Foam::CollisionRecordList<PairType, WallType>&)"
462 template<
class PairType,
class WallType>
466 const CollisionRecordList<PairType, WallType>& cRL
469 os << cRL.pairRecords_ << cRL.wallRecords_;
474 "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
475 "const Foam::CollisionRecordList<PairType, WallType>&)"
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
#define forAll(list, i)
Loop across all elements in list.
vectorField wallPRel() const
Return field of wall pRel from each record, used for field IO.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
labelField wallAccessed() const
Return field of wall accessed from each record, used for field IO.
DynamicList< WallCollisionRecord< WallType > > wallRecords_
List of active wall collisions.
labelField pairOrigIdOfOther() const
Return field of pair origIdOfOther from each record, used.
DynamicList< PairCollisionRecord< PairType > > pairRecords_
List of active pair collisions.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
bool checkWallRecord(const vector &pRel, scalar radius)
Enquire if the specified record exists without modifying.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
bool checkPairRecord(label origProcOfOther, label origIdOfOther)
Enquire if the specified record exists without modifying.
bool match(label queryOrigProcOfOther, label queryOrigIdOfOther) const
~CollisionRecordList()
Destructor.
Field< PairType > pairData() const
Return field of pair data from each record, used for field IO.
Record of a collision between the particle holding the record and a wall face at the position relativ...
Record of a collision between the particle holding the record and the particle with the stored id.
void setAccessed()
Set the accessed property of the record to accessed.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
labelField pairOrigProcOfOther() const
Return field of pair origProcOfOther from each record,.
bool match(const vector &pRel, scalar radius)
errorManip< error > abort(error &err)
Field< WallType > wallData() const
Return field of wall data from each record, used for field IO.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void update()
Update the collision records, deleting any records not.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
PairCollisionRecord< PairType > & matchPairRecord(label origProcOfOther, label origIdOfOther)
Enquires if the proc and id pair of the other particle are.
CollisionRecordList()
Construct null.
labelField pairAccessed() const
Return field of pair accessed from each record, used for.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void setAccessed()
Set the accessed property of the record to accessed.
WallCollisionRecord< WallType > & matchWallRecord(const vector &pRel, scalar radius)
Enquires if the position of wall impact relative to the.