PairCollisionRecord.C
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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "PairCollisionRecord.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class Type>
35 :
36  origProcOfOther_(0),
37  origIdOfOther_(-1),
38  data_(Zero)
39 {}
40 
41 
42 template<class Type>
44 (
45  bool accessed,
46  label origProcOfOther,
47  label origIdOfOther,
48  const Type& data
49 )
50 :
51  origProcOfOther_(origProcOfOther + 1),
52  origIdOfOther_(origIdOfOther),
53  data_(data)
54 {
55  // Default assignment to origProcOfOther_ assumes accessed is true
56 
57  if (!accessed)
58  {
59  setUnaccessed();
60  }
61 }
62 
63 
64 template<class Type>
66 (
67  const PairCollisionRecord<Type>& pCR
68 )
69 :
70  origProcOfOther_(pCR.origProcOfOther_),
71  origIdOfOther_(pCR.origIdOfOther_),
72  data_(pCR.data_)
73 {}
74 
75 
76 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
77 
78 template<class Type>
80 {}
81 
82 
83 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
84 
85 template<class Type>
87 (
88  const PairCollisionRecord<Type>& rhs
89 )
90 {
91  if (this == &rhs)
92  {
93  return; // Self-assignment is a no-op
94  }
95 
96  origProcOfOther_ = rhs.origProcOfOther_;
97  origIdOfOther_ = rhs.origIdOfOther_;
98  data_ = rhs.data_;
99 }
100 
101 
102 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
103 
104 #include "PairCollisionRecordIO.C"
105 
106 
107 // ************************************************************************* //
Foam::PairCollisionRecord::~PairCollisionRecord
~PairCollisionRecord()
Destructor.
Definition: PairCollisionRecord.C:79
PairCollisionRecord.H
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::PairCollisionRecord::PairCollisionRecord
PairCollisionRecord()
Construct null.
Definition: PairCollisionRecord.C:34
Foam::PairCollisionRecord
Record of a collision between the particle holding the record and the particle with the stored id.
Definition: PairCollisionRecord.H:58
PairCollisionRecordIO.C
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:55