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 element index. Pstream will be used to determine the
83  // processor index.
84  inline remote(const label);
85 
86  //- Construct from stream
87  inline remote(Istream& is);
88 
89 
90  // Public Classes
91 
92  //- Operator to take the first valid process
93  struct firstProcOp
94  {
95  inline remote operator()(const remote& a, const remote& b) const;
96  };
97 
98  //- Operator to take the first valid process
99  struct firstProcEqOp
100  {
101  inline void operator()(remote& a, const remote& b) const;
102  };
103 
104 
105  // Friend Operators
106 
107  //- Equality comparison
108  friend bool operator==(const remote& a, const remote& b);
109 
110  //- Inequality comparison
111  friend bool operator!=(const remote& a, const remote& b);
112 
113 
114  // IOstream Operators
115 
116  //- Write to stream
117  friend Ostream& operator<<(Ostream& os, const remote& p);
118 
119  //- Read from stream
120  friend Istream& operator>>(Istream& is, remote& p);
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #include "remoteI.H"
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
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:31
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:27
Namespace for OpenFOAM.
bool operator!=(const particle &, const particle &)
Definition: particle.C:424
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:99
void operator()(remote &a, const remote &b) const
Definition: remoteI.H:78
Operator to take the first valid process.
Definition: remote.H:93
remote operator()(const remote &a, const remote &b) const
Definition: remoteI.H:61