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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::WallCollisionRecord
28 
29 Description
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 
33 SourceFiles
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 
47 namespace Foam
48 {
49 
50 // Forward declaration of friend functions and operators
51 template<class Type>
53 
54 template<class Type>
55 inline bool operator==
56 (
59 );
60 
61 template<class Type>
62 inline bool operator!=
63 (
66 );
67 
68 template<class Type>
70 
71 template<class Type>
73 
74 
75 /*---------------------------------------------------------------------------*\
76  Class WallCollisionRecord Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 template<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 
95 public:
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
165 
166  friend bool operator== <Type>
167  (
170  );
171 
172  friend bool operator!= <Type>
173  (
176  );
177 
178 
179  // IOstream Operators
180 
181  friend Istream& operator>> <Type>
182  (
183  Istream&,
185  );
186 
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 // ************************************************************************* //
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
WallCollisionRecord.C
Foam::WallCollisionRecord::~WallCollisionRecord
~WallCollisionRecord()
Destructor.
Definition: WallCollisionRecord.C:77
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::WallCollisionRecord::pRel
const vector & pRel() const
Return the pRel data.
Definition: WallCollisionRecordI.H:75
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::WallCollisionRecord
Record of a collision between the particle holding the record and a wall face at the position relativ...
Definition: WallCollisionRecord.H:51
Foam::WallCollisionRecord::accessed
bool accessed() const
Return the accessed status of the record.
Definition: WallCollisionRecordI.H:97
Foam::WallCollisionRecord::setAccessed
void setAccessed()
Set the accessed property of the record to accessed.
Definition: WallCollisionRecordI.H:104
Foam::WallCollisionRecord::match
bool match(const vector &pRel, scalar radius)
Definition: WallCollisionRecordI.H:32
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::WallCollisionRecord::collisionData
const Type & collisionData() const
Return access to the collision data.
Definition: WallCollisionRecordI.H:83
Foam::WallCollisionRecord::WallCollisionRecord
WallCollisionRecord()
Construct null.
Definition: WallCollisionRecord.C:40
Foam::Vector< scalar >
vector.H
Foam::WallCollisionRecord::errorCosAngle
static const scalar errorCosAngle
Tolerance for detecting seriously erroneous wall matches.
Definition: WallCollisionRecord.H:99
Foam::WallCollisionRecord::operator=
void operator=(const WallCollisionRecord &)
Definition: WallCollisionRecord.C:85
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
WallCollisionRecordI.H
Foam::WallCollisionRecord::setUnaccessed
void setUnaccessed()
Set the accessed property of the record to unaccessed.
Definition: WallCollisionRecordI.H:111
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55