WallCollisionRecord.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "WallCollisionRecord.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 template<class Type>
31 const Foam::scalar Foam::WallCollisionRecord<Type>::errorCosAngle(1.0 + 1e-6);
32 
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
36 template<class Type>
38 :
39  accessed_(false),
40  pRel_(),
41  data_(Zero)
42 {}
43 
44 
45 template<class Type>
47 (
48  bool accessed,
49  const vector& pRel,
50  const Type& data
51 )
52 :
53  accessed_(accessed),
54  pRel_(pRel),
55  data_(data)
56 {}
57 
58 
59 template<class Type>
61 (
62  const WallCollisionRecord<Type>& wCR
63 )
64 :
65  accessed_(wCR.accessed_),
66  pRel_(wCR.pRel_),
67  data_(wCR.data_)
68 {}
69 
70 
71 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
72 
73 template<class Type>
75 {}
76 
77 
78 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
79 
80 template<class Type>
81 void Foam::WallCollisionRecord<Type>::operator=
82 (
83  const WallCollisionRecord<Type>& rhs
84 )
85 {
86  // Check for assignment to self
87  if (this == &rhs)
88  {
90  << "Attempted assignment to self"
91  << abort(FatalError);
92  }
93 
94  accessed_ = rhs.accessed_;
95  pRel_ = rhs.pRel_;
96  data_ = rhs.data_;
97 }
98 
99 
100 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
101 
102 #include "WallCollisionRecordIO.C"
103 
104 
105 // ************************************************************************* //
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
WallCollisionRecord()
Construct null.
volScalarField & e
Elementary charge.
Definition: createFields.H:11
static const zero Zero
Definition: zero.H:97
errorManip< error > abort(error &err)
Definition: errorManip.H:131
Record of a collision between the particle holding the record and a wall face at the position relativ...
static const scalar errorCosAngle
Tolerance for detecting seriously erroneous wall matches.