phaseInterfaceKey.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) 2021-2022 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 "phaseModel.H"
27 #include "phaseInterface.H"
28 #include "phaseInterfaceKey.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
33 {}
34 
35 
37 {}
38 
39 
41 (
42  const phaseModel& phase1,
43  const phaseModel& phase2
44 )
45 :
46  Pair<word>
47  (
48  phaseInterface::getPhase1(phase1, phase2).name(),
49  phaseInterface::getPhase2(phase1, phase2).name()
50  )
51 {}
52 
53 
55 :
56  phaseInterfaceKey(interface.phase1(), interface.phase2())
57 {}
58 
59 
60 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
61 
63 {}
64 
65 
66 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
67 
68 Foam::label Foam::phaseInterfaceKey::hash::operator()
69 (
70  const phaseInterfaceKey& key
71 ) const
72 {
73  return word::hash()(key.first()) + word::hash()(key.second());
74 }
75 
76 
77 // * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
78 
79 bool Foam::operator==
80 (
81  const phaseInterfaceKey& a,
82  const phaseInterfaceKey& b
83 )
84 {
85  return Pair<word>::compare(a, b) == 1;
86 }
87 
88 
89 bool Foam::operator!=
90 (
91  const phaseInterfaceKey& a,
92  const phaseInterfaceKey& b
93 )
94 {
95  return !(a == b);
96 }
97 
98 
99 // * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * //
100 
101 Foam::Istream& Foam::operator>>(Istream& is, phaseInterfaceKey& key)
102 {
104 
105  return is;
106 }
107 
108 
109 // * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * * //
110 
111 Foam::Ostream& Foam::operator<<(Ostream& os, const phaseInterfaceKey& key)
112 {
114 
115  return os;
116 }
117 
118 
119 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
static int compare(const Pair< Type > &a, const Pair< Type > &b)
Compare Pairs.
Definition: Pair.H:153
phaseInterface(const phaseModel &phase1, const phaseModel &phase2)
Construct from phases.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
Definition: createFields.H:27
Holds information (coordinate and normal) regarding nearest wall point.
const phaseModel & phase1() const
Return phase 1.
Istream & operator>>(Istream &, directionInfo &)
phaseInterfaceKey()
Construct null.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const phaseModel & phase2() const
Return phase 2.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Pair()
Null constructor.
Definition: Pair.H:72
Ostream & operator<<(Ostream &, const ensightPart &)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353