remote.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) 2022-2024 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::remote
26 
27 Description
28  Struct for keeping processor, element (cell, face, point) index.
29 
30 SourceFiles
31  remoteI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef remote_H
36 #define remote_H
37 
38 #include "Istream.H"
39 #include "Ostream.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 class remote;
48 inline bool operator==(const remote&, const remote&);
49 inline bool operator!=(const remote&, const remote&);
50 inline Istream& operator>>(Istream&, remote&);
51 inline Ostream& operator<<(Ostream&, const remote&);
52 
53 /*---------------------------------------------------------------------------*\
54  Class remote Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class remote
58 {
59 public:
60 
61  //- Component type
62  typedef remote cmptType;
63 
64 
65  // Public Data
66 
67  //- Processor index
68  label proci;
69 
70  //- Element index
72 
73 
74  // Constructors
75 
76  //- Construct null
77  inline remote();
78 
79  //- Construct from components
80  inline remote(const label, const label);
81 
82  //- Construct from stream
83  inline remote(Istream& is);
84 
85 
86  // Public Classes
87 
88  //- Operator to take the first valid process
89  struct firstProcOp
90  {
91  inline remote operator()(const remote& a, const remote& b) const;
92  };
93 
94  //- Operator to take the first valid process
95  struct firstProcEqOp
96  {
97  inline void operator()(remote& a, const remote& b) const;
98  };
99 
100 
101  // Friend Operators
102 
103  //- Equality comparison
104  friend bool operator==(const remote& a, const remote& b);
105 
106  //- Inequality comparison
107  friend bool operator!=(const remote& a, const remote& b);
108 
109 
110  // IOstream Operators
111 
112  //- Write to stream
113  friend Ostream& operator<<(Ostream& os, const remote& p);
114 
115  //- Read from stream
116  friend Istream& operator>>(Istream& is, remote& p);
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #include "remoteI.H"
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
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
Struct for keeping processor, element (cell, face, point) index.
Definition: remote.H:57
friend bool operator==(const remote &a, const remote &b)
Equality comparison.
remote()
Construct null.
Definition: remoteI.H:30
friend Ostream & operator<<(Ostream &os, const remote &p)
Write to stream.
label elementi
Element index.
Definition: remote.H:70
remote cmptType
Component type.
Definition: remote.H:61
label proci
Processor index.
Definition: remote.H:67
friend bool operator!=(const remote &a, const remote &b)
Inequality comparison.
friend Istream & operator>>(Istream &is, remote &p)
Read from stream.
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)
volScalarField & p
Operator to take the first valid process.
Definition: remote.H:95
void operator()(remote &a, const remote &b) const
Definition: remoteI.H:70
Operator to take the first valid process.
Definition: remote.H:89
remote operator()(const remote &a, const remote &b) const
Definition: remoteI.H:53