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 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  // Public Data
70 
71  //- Data
72  Type data;
73 
74 
75  // Constructors
76 
77  //- Construct null
78  inline RemoteData();
79 
80  //- Construct from components
81  inline RemoteData(const label, const label, const Type&);
82 
83  //- Construct from stream
84  inline RemoteData(Istream& is);
85 
86 
87  // Public Classes
88 
89  //- Operator to take smallest valid value
90  struct smallestEqOp
91  {
92  inline void operator()
93  (
95  const RemoteData<Type>& y
96  ) const;
97  };
98 
99  //- Operator to take smallest first valid value
100  struct smallestFirstEqOp
101  {
102  inline void operator()
103  (
105  const RemoteData<Type>& y
106  ) const;
107  };
108 
109 
110  // Friend Operators
111 
112  //- Equality comparison
113  friend bool operator== <Type>
114  (
115  const RemoteData<Type>& a,
116  const RemoteData<Type>& b
117  );
118 
119  //- Inequality comparison
120  friend bool operator!= <Type>
121  (
122  const RemoteData<Type>& a,
123  const RemoteData<Type>& b
124  );
125 
126 
127  // IOstream Operators
128 
129  //- Write to stream
130  friend Ostream& operator<< <Type>
131  (
132  Ostream& os,
133  const RemoteData<Type>& p
134  );
135 
136  //- Read from stream
137  friend Istream& operator>> <Type>
138  (
139  Istream& is,
141  );
142 };
143 
144 
145 template<class Type>
146 struct pTraits<RemoteData<Type>>
147 {
148  typedef RemoteData<Type> cmptType;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #include "RemoteDataI.H"
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
scalar y
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
friend Ostream & operator(Ostream &os, const RemoteData< Type > &p)
Write to stream.
Type data
Data.
Definition: RemoteData.H:71
Traits class for primitives.
Definition: pTraits.H:53
Struct for keeping processor, element (cell, face, point) index.
Definition: remote.H:57
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
Operator to take smallest valid value.
Definition: RemoteData.H:90
Operator to take smallest first valid value.
Definition: RemoteData.H:100