All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
phaseInterfaceKey.H
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-2023 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::phaseInterfaceKey
26 
27 Description
28  Word-pair based class used for keying interface models in hash tables.
29 
30 SourceFiles
31  phaseInterfaceKey.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef phaseInterfaceKey_H
36 #define phaseInterfaceKey_H
37 
38 #include "Pair.H"
39 #include "word.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 
48 class phaseModel;
49 class phaseInterface;
50 class phaseInterfaceKey;
51 
52 bool operator==(const phaseInterfaceKey&, const phaseInterfaceKey&);
53 bool operator!=(const phaseInterfaceKey&, const phaseInterfaceKey&);
54 
55 Istream& operator>>(Istream&, phaseInterfaceKey&);
56 Ostream& operator<<(Ostream&, const phaseInterfaceKey&);
57 
58 /*---------------------------------------------------------------------------*\
59  Class phaseInterfaceKey Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
64  public Pair<word>
65 {
66 public:
67 
68  // Public Classes
69 
70  //- Hashing class
71  class hash
72  :
73  public Hash<phaseInterfaceKey>
74  {
75  public:
76 
77  // Constructors
78 
79  // Construct null
80  hash();
81 
82 
83  // Member Operators
84 
85  // Generate a hash from a phase interface key
86  label operator()(const phaseInterfaceKey& key) const;
87  };
88 
89 
90 public:
91 
92  // Constructors
93 
94  //- Construct null
96 
97  //- Construct from phases
98  phaseInterfaceKey(const phaseModel& phase1, const phaseModel& phase2);
99 
100  //- Construct from phase interface
101  phaseInterfaceKey(const phaseInterface& interface);
102 
103 
104  // Destructor
105  virtual ~phaseInterfaceKey();
106 
107 
108  // Friend Operators
109 
110  //- Test if keys are equal
111  friend bool operator==
112  (
113  const phaseInterfaceKey& a,
114  const phaseInterfaceKey& b
115  );
116 
117  //- Test if keys are unequal
118  friend bool operator!=
119  (
120  const phaseInterfaceKey& a,
121  const phaseInterfaceKey& b
122  );
123 
124  //- Read from stream
125  friend Istream& operator>>(Istream& is, phaseInterfaceKey& key);
126 
127  //- Write to stream
128  friend Ostream& operator<<(Ostream& os, const phaseInterfaceKey& key);
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
Hashing function class.
Definition: FixedList.H:97
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:65
label operator()(const phaseInterfaceKey &key) const
Word-pair based class used for keying interface models in hash tables.
friend Istream & operator>>(Istream &is, phaseInterfaceKey &key)
Read from stream.
friend Ostream & operator<<(Ostream &os, const phaseInterfaceKey &key)
Write to stream.
phaseInterfaceKey()
Construct null.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
volScalarField & b
Definition: createFields.H:25
Namespace for OpenFOAM.
bool operator!=(const particle &, const particle &)
Definition: particle.C:1210
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)