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-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::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  // Public Data
62 
63  //- Processor index
64  label proci;
65 
66  //- Element index
68 
69 
70  // Constructors
71 
72  //- Construct null
73  inline remote();
74 
75  //- Construct from components
76  inline remote(const label, const label);
77 
78  //- Construct from stream
79  inline remote(Istream& is);
80 
81 
82  // Friend Operators
83 
84  //- Equality comparison
85  friend bool operator==(const remote& a, const remote& b);
86 
87  //- Inequality comparison
88  friend bool operator!=(const remote& a, const remote& b);
89 
90 
91  // IOstream Operators
92 
93  //- Write to stream
94  friend Ostream& operator<<(Ostream& os, const remote& p);
95 
96  //- Read from stream
97  friend Istream& operator>>(Istream& is, remote& p);
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 template<>
104 class pTraits<remote>
105 {
106 public:
107  typedef remote cmptType;
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #include "remoteI.H"
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
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
Traits class for primitives.
Definition: pTraits.H:53
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:66
label proci
Processor index.
Definition: remote.H:63
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:1257
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 &, directionInfo &)
Ostream & operator<<(Ostream &, const ensightPart &)
volScalarField & p