PairCollisionRecord.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::PairCollisionRecord
28
29Description
30
31 Record of a collision between the particle holding the record and
32 the particle with the stored id.
33
34 The access status of the record is to be coded in the
35 origProcOfOther data member. The actual processor is offset by
36 +1. A negative value means that the record has not been accessed,
37 positive means that it has.
38
39SourceFiles
40 PairCollisionRecordI.H
41 PairCollisionRecord.C
42 PairCollisionRecordIO.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef PairCollisionRecord_H
47#define PairCollisionRecord_H
48
49#include "label.H"
50#include "vector.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56
57// Forward declaration of friend functions and operators
58template<class Type>
59class PairCollisionRecord;
60
61template<class Type>
62inline bool operator==
63(
64 const PairCollisionRecord<Type>&,
65 const PairCollisionRecord<Type>&
66);
67
68template<class Type>
69inline bool operator!=
70(
71 const PairCollisionRecord<Type>&,
72 const PairCollisionRecord<Type>&
73);
74
75template<class Type>
77
78template<class Type>
80
81
82/*---------------------------------------------------------------------------*\
83 Class PairCollisionRecord Declaration
84\*---------------------------------------------------------------------------*/
85
86template<class Type>
88{
89 // Private data
90
91 //- Originating processor id of other collision partner
92 label origProcOfOther_;
93
94 //- Local particle id on originating processor of other
95 // collision partner
96 label origIdOfOther_;
97
98 //- Collision data, stored as if the storing particle was the
99 // first particle (particle A) in the collision.
100 Type data_;
101
102
103public:
104
105 // Constructors
106
107 //- Construct null
109
110 //- Construct from components
112 (
113 bool accessed,
114 label origProcOfOther,
115 label origIdOfOther,
116 const Type& data = Type(Zero)
117 );
118
119 //- Construct from Istream
121
122 //- Construct as copy
124
125
126 //- Destructor
128
129
130 // Member Functions
131
132
133 // Access
134
135 //- Return the origProcOfOther data
136 inline label origProcOfOther() const;
137
138 //- Return the origIdOfOther data
139 inline label origIdOfOther() const;
140
141 //- Return access to the collision data
142 inline const Type& collisionData() const;
143
144 //- Return access to the collision data
145 inline Type& collisionData();
146
147
148 // Check
149
150 inline bool match
151 (
152 label queryOrigProcOfOther,
153 label queryOrigIdOfOther
154 ) const;
155
156 //- Return the accessed status of the record
157 inline bool accessed() const;
158
159
160 // Edit
161
162 //- Set the accessed property of the record to accessed
163 inline void setAccessed();
164
165 //- Set the accessed property of the record to unaccessed
166 inline void setUnaccessed();
167
168
169 // Member Operators
170
171 void operator=(const PairCollisionRecord&);
172
173
174 // Friend Operators
176 friend bool operator== <Type>
177 (
180 );
182 friend bool operator!= <Type>
183 (
186 );
187
188
189 // IOstream Operators
191 friend Istream& operator>> <Type>
192 (
193 Istream&,
195 );
197 friend Ostream& operator<< <Type>
198 (
199 Ostream&,
201 );
202};
203
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207} // End namespace Foam
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211#include "PairCollisionRecordI.H"
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215#ifdef NoRepository
216 #include "PairCollisionRecord.C"
217#endif
218
219// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220
221#endif
222
223// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Record of a collision between the particle holding the record and the particle with the stored id.
bool match(label queryOrigProcOfOther, label queryOrigIdOfOther) const
label origIdOfOther() const
Return the origIdOfOther data.
void setAccessed()
Set the accessed property of the record to accessed.
PairCollisionRecord()
Construct null.
const Type & collisionData() const
Return access to the collision data.
bool accessed() const
Return the accessed status of the record.
void setUnaccessed()
Set the accessed property of the record to unaccessed.
PairCollisionRecord(const PairCollisionRecord &)
Construct as copy.
label origProcOfOther() const
Return the origProcOfOther data.
void operator=(const PairCollisionRecord &)
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131