WallCollisionRecord.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::WallCollisionRecord
28
29Description
30 Record of a collision between the particle holding the record and
31 a wall face at the position relative to the centre of the particle.
32
33SourceFiles
34 WallCollisionRecordI.H
35 WallCollisionRecord.C
36 WallCollisionRecordIO.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef WallCollisionRecord_H
41#define WallCollisionRecord_H
42
43#include "vector.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward declaration of friend functions and operators
51template<class Type>
52class WallCollisionRecord;
53
54template<class Type>
55inline bool operator==
56(
57 const WallCollisionRecord<Type>&,
58 const WallCollisionRecord<Type>&
59);
60
61template<class Type>
62inline bool operator!=
63(
64 const WallCollisionRecord<Type>&,
65 const WallCollisionRecord<Type>&
66);
67
68template<class Type>
70
71template<class Type>
73
74
75/*---------------------------------------------------------------------------*\
76 Class WallCollisionRecord Declaration
77\*---------------------------------------------------------------------------*/
78
79template<class Type>
81{
82 // Private data
83
84 // //- Recording whether or not this record has been accessed
85 bool accessed_;
86
87 //- The position of wall impact relative to the particle centre
88 vector pRel_;
89
90 //- Collision data, stored as if the storing particle was the
91 // first particle (particle A) in the collision.
92 Type data_;
93
94
95public:
96
97 // Static data members
98
99 //- Tolerance for detecting seriously erroneous wall matches
100 static const scalar errorCosAngle;
101
102
103 // Constructors
104
105 //- Construct null
107
108 //- Construct from components
110 (
111 bool accessed,
112 const vector& pRel,
113 const Type& data = Type(Zero)
114 );
115
116 //- Construct from Istream
118
119 //- Construct as copy
121
122
123 //- Destructor
125
126
127 // Member Functions
128
129
130 // Access
131
132 //- Return the pRel data
133 inline const vector& pRel() const;
134
135 //- Return access to the collision data
136 inline const Type& collisionData() const;
137
138 //- Return access to the collision data
139 inline Type& collisionData();
140
141
142 // Check
143
144 inline bool match(const vector& pRel, scalar radius);
145
146 //- Return the accessed status of the record
147 inline bool accessed() const;
148
149
150 // Edit
151
152 //- Set the accessed property of the record to accessed
153 inline void setAccessed();
154
155 //- Set the accessed property of the record to unaccessed
156 inline void setUnaccessed();
157
158
159 // Member Operators
160
161 void operator=(const WallCollisionRecord&);
162
163
164 // Friend Operators
166 friend bool operator== <Type>
167 (
170 );
172 friend bool operator!= <Type>
173 (
176 );
177
178
179 // IOstream Operators
181 friend Istream& operator>> <Type>
182 (
183 Istream&,
185 );
187 friend Ostream& operator<< <Type>
188 (
189 Ostream&,
191 );
192};
193
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197} // End namespace Foam
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201#include "WallCollisionRecordI.H"
202
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205#ifdef NoRepository
206 #include "WallCollisionRecord.C"
207#endif
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211#endif
212
213// ************************************************************************* //
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 a wall face at the position relativ...
const vector & pRel() const
Return the pRel data.
bool match(const vector &pRel, scalar radius)
void setAccessed()
Set the accessed property of the record to accessed.
const Type & collisionData() const
Return access to the collision data.
WallCollisionRecord(const WallCollisionRecord &)
Construct as copy.
void operator=(const WallCollisionRecord &)
bool accessed() const
Return the accessed status of the record.
void setUnaccessed()
Set the accessed property of the record to unaccessed.
static const scalar errorCosAngle
Tolerance for detecting seriously erroneous wall matches.
WallCollisionRecord()
Construct null.
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