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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::WallCollisionRecord
26 
27 Description
28  Record of a collision between the particle holding the record and
29  a wall face at the position relative to the centre of the particle.
30 
31 SourceFiles
32  WallCollisionRecordI.H
33  WallCollisionRecord.C
34  WallCollisionRecordIO.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef WallCollisionRecord_H
39 #define WallCollisionRecord_H
40 
41 #include "vector.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 template<class Type>
51 
52 template<class Type>
53 inline bool operator==
54 (
57 );
58 
59 template<class Type>
60 inline bool operator!=
61 (
64 );
65 
66 template<class Type>
68 
69 template<class Type>
70 Ostream& operator<<(Ostream&, const WallCollisionRecord<Type>&);
71 
72 
73 /*---------------------------------------------------------------------------*\
74  Class WallCollisionRecord Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 template<class Type>
79 {
80  // Private data
81 
82  // //- Recording whether or not this record has been accessed
83  bool accessed_;
84 
85  //- The position of wall impact relative to the particle centre
86  vector pRel_;
87 
88  //- Collision data, stored as if the storing particle was the
89  // first particle (particle A) in the collision.
90  Type data_;
91 
92 
93 public:
94 
95  // Static data members
96 
97  //- Tolerance for detecting seriously erroneous wall matches
98  static const scalar errorCosAngle;
99 
100 
101  // Constructors
102 
103  //- Construct null
105 
106  //- Construct from components
108  (
109  bool accessed,
110  const vector& pRel,
111  const Type& data = pTraits<Type>::zero
112  );
113 
114  //- Construct from Istream
116 
117  //- Construct as copy
119 
120 
121  //- Destructor
123 
124 
125  // Member Functions
126 
127 
128  // Access
129 
130  //- Return the pRel data
131  inline const vector& pRel() const;
132 
133  //- Return access to the collision data
134  inline const Type& collisionData() const;
135 
136  //- Return access to the collision data
137  inline Type& collisionData();
138 
139 
140  // Check
141 
142  inline bool match(const vector& pRel, scalar radius);
143 
144  //- Return the accessed status of the record
145  inline bool accessed() const;
146 
147 
148  // Edit
149 
150  //- Set the accessed property of the record to accessed
151  inline void setAccessed();
152 
153  //- Set the accessed property of the record to unaccessed
154  inline void setUnaccessed();
155 
156 
157  // Member Operators
158 
159  void operator=(const WallCollisionRecord&);
160 
161 
162  // Friend Operators
163 
164  friend bool operator== <Type>
165  (
167  const WallCollisionRecord<Type>&
168  );
169 
170  friend bool operator!= <Type>
171  (
172  const WallCollisionRecord<Type>&,
173  const WallCollisionRecord<Type>&
174  );
175 
176 
177  // IOstream Operators
178 
179  friend Istream& operator>> <Type>
180  (
181  Istream&,
182  WallCollisionRecord<Type>&
183  );
184 
185  friend Ostream& operator<< <Type>
186  (
187  Ostream&,
188  const WallCollisionRecord<Type>&
189  );
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #include "WallCollisionRecordI.H"
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #ifdef NoRepository
204  #include "WallCollisionRecord.C"
205 #endif
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
void setUnaccessed()
Set the accessed property of the record to unaccessed.
const vector & pRel() const
Return the pRel data.
bool accessed() const
Return the accessed status of the record.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
WallCollisionRecord()
Construct null.
const Type & collisionData() const
Return access to the collision data.
Traits class for primitives.
Definition: pTraits.H:50
Istream & operator>>(Istream &, directionInfo &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void operator=(const WallCollisionRecord &)
Database for solution data, solver performance and other reduced data.
Definition: data.H:52
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)
static const scalar errorCosAngle
Tolerance for detecting seriously erroneous wall matches.
Namespace for OpenFOAM.
void setAccessed()
Set the accessed property of the record to accessed.