RemoteData.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::RemoteData
26 
27 Description
28  Struct for keeping processor, element (cell, face, point) and a piece of
29  data. Used for finding minimum values across multiple processes.
30 
31 SourceFiles
32  RemoteDataI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef RemoteData_H
37 #define RemoteData_H
38 
39 #include "remote.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 template<class Type>
48 class RemoteData;
49 template<class Type>
50 inline bool operator==(const RemoteData<Type>&, const RemoteData<Type>&);
51 template<class Type>
52 inline bool operator!=(const RemoteData<Type>&, const RemoteData<Type>&);
53 template<class Type>
55 template<class Type>
56 inline Ostream& operator<<(Ostream&, const RemoteData<Type>&);
57 
58 /*---------------------------------------------------------------------------*\
59  Class RemoteData Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class Type>
63 class RemoteData
64 :
65  public remote
66 {
67 public:
68 
69  //- Component type
70  typedef RemoteData<Type> cmptType;
71 
72 
73  // Public Data
74 
75  //- Data
76  Type data;
77 
78 
79  // Constructors
80 
81  //- Construct null
82  inline RemoteData();
83 
84  //- Construct from components
85  inline RemoteData(const label, const label, const Type&);
86 
87  //- Construct from stream
88  inline RemoteData(Istream& is);
89 
90 
91  // Public Classes
92 
93  //- Operator to take smallest valid value
94  struct smallestEqOp
95  {
96  inline void operator()
97  (
99  const RemoteData<Type>& b
100  ) const;
101  };
102 
103  //- Operator to take smallest first valid value
104  struct smallestFirstEqOp
105  {
106  inline void operator()
107  (
108  RemoteData<Type>& a,
109  const RemoteData<Type>& b
110  ) const;
111  };
112 
113 
114  // Friend Operators
115 
116  //- Equality comparison
117  friend bool operator== <Type>
118  (
119  const RemoteData<Type>& a,
120  const RemoteData<Type>& b
121  );
122 
123  //- Inequality comparison
124  friend bool operator!= <Type>
125  (
126  const RemoteData<Type>& a,
127  const RemoteData<Type>& b
128  );
129 
130 
131  // IOstream Operators
132 
133  //- Write to stream
134  friend Ostream& operator<< <Type>
135  (
136  Ostream& os,
137  const RemoteData<Type>& p
138  );
139 
140  //- Read from stream
141  friend Istream& operator>> <Type>
142  (
143  Istream& is,
145  );
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #include "RemoteDataI.H"
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
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) and a piece of data. Used for finding minim...
Definition: RemoteData.H:65
RemoteData()
Construct null.
Definition: RemoteDataI.H:31
RemoteData< Type > cmptType
Component type.
Definition: RemoteData.H:69
friend Ostream & operator(Ostream &os, const RemoteData< Type > &p)
Write to stream.
Type data
Data.
Definition: RemoteData.H:75
Struct for keeping processor, element (cell, face, point) index.
Definition: remote.H:57
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 smallest valid value.
Definition: RemoteData.H:94
Operator to take smallest first valid value.
Definition: RemoteData.H:104