globalIndex.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2018-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::globalIndex
29 
30 Description
31  Calculates a unique integer (label so might not have enough room - 2G max)
32  for processor + local index. E.g.
33 
34  globalIndex globalFaces(mesh.nFaces());
35  label globalFacei = globalFaces.toGlobal(facei);
36 
37 SourceFiles
38  globalIndexI.H
39  globalIndex.C
40  globalIndexTemplates.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef globalIndex_H
45 #define globalIndex_H
46 
47 #include "Pstream.H"
48 #include "CompactListList.H"
49 #include "DynamicList.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 // Forward Declarations
57 
58 class globalIndex;
59 class labelRange;
60 
61 Istream& operator>>(Istream& is, globalIndex& gi);
62 Ostream& operator<<(Ostream& os, const globalIndex& gi);
63 
64 
65 /*---------------------------------------------------------------------------*\
66  Class globalIndex Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class globalIndex
70 {
71  // Private Data
72 
73  //- Start of proci. Size is nProcs()+1. (so like CompactListList)
74  labelList offsets_;
75 
76 
77  // Private Member Functions
78 
79  //- Sort and bin. validBins contains bins with non-zero size.
80  static void bin
81  (
82  const labelUList& offsets,
83  const labelUList& globalIds,
84  labelList& order,
85  CompactListList<label>& sortedElems,
86  DynamicList<label>& validBins
87  );
88 
89 public:
90 
91  // Public Data Types
92 
93  //- Disambiguation tag (list construction dispatch)
94  enum accessType : char { OFFSETS, SIZES };
95 
96 
97  // Constructors
98 
99  //- Default construct
100  globalIndex() = default;
101 
102  //- Copy construct from a list of offsets.
103  //- No communication required
104  inline explicit globalIndex(const labelUList& listOffsets);
105 
106  //- Move construct from a list of offsets.
107  //- No communication required
108  inline explicit globalIndex(labelList&& listOffsets);
109 
110  //- Copy construct from a list of offsets or sizes.
111  //- No communication required
112  inline globalIndex
113  (
114  const labelUList& offsetsOrSizes,
115  enum accessType accType
116  );
117 
118  //- Construct from local size.
119  // Communication with default communicator and message tag.
120  inline explicit globalIndex(const label localSize);
121 
122  //- Construct from local size.
123  // Communication with given communicator and message tag,
124  // unless parallel == false
125  inline globalIndex
126  (
127  const label localSize,
128  const int tag,
129  const label comm,
130  const bool parallel
131  );
132 
133  //- Construct from Istream.
134  //- No communication required
135  explicit globalIndex(Istream& is);
136 
137 
138  // Member Functions
139 
140  //- Check for default constructed or global sum == 0
141  inline bool empty() const;
142 
143  //- Global sum of localSizes
144  inline label size() const;
145 
146  //- The local sizes
147  labelList sizes() const;
148 
149  //- The local starts
150  inline const labelUList localStarts() const;
151 
152  //- Global max of localSizes
153  inline label maxSize() const;
154 
155  //- Const-access to the offsets
156  inline const labelList& offsets() const noexcept;
157 
158 
159  // Dimensions
160 
161  //- The number of processors covered by the offsets
162  inline label nProcs() const noexcept;
163 
164  //- Range of process indices for all addressed offsets (processes)
165  inline labelRange allProcs() const noexcept;
166 
167  //- Range of process indices for addressed sub-offsets (processes)
168  inline labelRange subProcs() const noexcept;
169 
170 
171  // Edit
172 
173  //- Write-access to the offsets, for changing after construction
174  inline labelList& offsets() noexcept;
175 
176  //- Reset from local size.
177  // Does communication with default communicator and message tag.
178  inline void reset(const label localSize);
179 
180  //- Reset from local size.
181  // Does communication with given communicator and message tag,
182  // unless parallel == false
183  void reset
184  (
185  const label localSize,
186  const int tag,
187  const label comm,
188  const bool parallel
189  );
190 
191  //- Reset from list of local sizes,
192  //- with optional check for label overflow.
193  //- No communication required
194  void reset
195  (
196  const labelUList& sizes,
197  const bool checkOverflow = false
198  );
199 
200  //- Alter local size for given processor
201  void setLocalSize(const label proci, const label len);
202 
203 
204  // Queries
205 
206  // Queries relating to my processor (using world communicator)
207 
208  //- My local start
209  inline label localStart() const;
210 
211  //- My local size
212  inline label localSize() const;
213 
214  //- The max of localSizes, excluding current processor
215  inline label maxNonLocalSize() const;
216 
217  //- Return start/size range of local processor data
218  inline labelRange range() const;
219 
220  //- Return start/size ranges for all data
221  List<labelRange> ranges() const;
222 
223  //- Is on local processor
224  inline bool isLocal(const label i) const;
225 
226  //- From local to global index
227  inline label toGlobal(const label i) const;
228 
229  //- From local to global index
230  inline labelList toGlobal(const labelUList& labels) const;
231 
232  //- From local to global index (inplace)
233  inline void inplaceToGlobal(labelList& labels) const;
234 
235  //- From global to local on current processor.
236  // FatalError if not on local processor.
237  inline label toLocal(const label i) const;
238 
239 
240  // Global (off-processor) queries
241 
242  //- Start of proci data
243  inline label offset(const label proci) const;
244 
245  //- Start of proci data
246  inline label localStart(const label proci) const;
247 
248  //- Size of proci data
249  inline label localSize(const label proci) const;
250 
251  //- The max of localSizes, excluding the specified processor
252  label maxNonLocalSize(const label proci) const;
253 
254  //- Return start/size range of proci data
255  inline labelRange range(const label proci) const;
256 
257  //- Is on processor proci
258  inline bool isLocal(const label proci, const label i) const;
259 
260  //- From local to global on proci
261  inline label toGlobal(const label proci, const label i) const;
262 
263  //- From local to global on proci
264  inline labelList toGlobal
265  (
266  const label proci,
267  const labelUList& labels
268  ) const;
269 
270  //- From local to global index on proci (inplace)
271  inline void inplaceToGlobal
272  (
273  const label proci,
274  labelList& labels
275  ) const;
276 
277 
278  //- From global to local on proci
279  inline label toLocal(const label proci, const label i) const;
280 
281  //- Which processor does global come from? Binary search.
282  inline label whichProcID(const label i) const;
283 
284 
285  // Iteration
286 
287  //- Forward input iterator with const access
288  class const_iterator
289  {
290  //- The parent class for which this is an iterator
291  const globalIndex* parent_;
292 
293  //- The index into the parent
294  label proci_;
295 
296 
297  public:
298 
299  // Constructors
300 
301  //- Construct from globalIndex list at given index
302  explicit const_iterator
303  (
304  const globalIndex* globalIdx,
305  const label proci = 0
306  ) noexcept;
307 
308 
309  // Member Operators
310 
311  //- The associated local proc
312  inline label proci() const noexcept;
313 
314  //- The local start
315  inline label start() const;
316 
317  //- The local size
318  inline label size() const;
319 
320  //- The local range
321  inline labelRange range() const;
322 
323  //- The local range
324  inline labelRange operator*() const;
325 
326  inline const_iterator& operator++();
327  inline const_iterator operator++(int);
328 
329  inline const_iterator& operator--();
330  inline const_iterator operator--(int);
331 
332  inline bool operator==(const const_iterator& iter) const noexcept;
333  inline bool operator!=(const const_iterator& iter) const noexcept;
334  };
335 
336 
337  //- A const_iterator set to the beginning
338  inline const_iterator cbegin() const noexcept;
339 
340  //- A const_iterator set to beyond the end
341  inline const const_iterator cend() const noexcept;
342 
343  //- A const_iterator set to the beginning
344  inline const_iterator begin() const noexcept;
345 
346  //- A const_iterator set to beyond the end
347  inline const const_iterator end() const noexcept;
348 
349 
350  // Helper Functions
351 
352  //- Calculate offsets from a list of local sizes,
353  //- with optional check for label overflow
354  static labelList calcOffsets
355  (
356  const labelUList& localSizes,
357  const bool checkOverflow = false
358  );
359 
360  //- Calculate offsets from list of lists,
361  //- with optional check for label overflow
362  template<class SubListType>
364  (
365  const List<SubListType>& lists,
366  const bool checkOverflow = false
367  );
368 
369  //- Calculate ranges (offset/size) from a list of local sizes,
370  //- with optional check for label overflow
371  static List<labelRange> calcRanges
372  (
373  const labelUList& localSizes,
374  const bool checkOverflow = false
375  );
376 
377 
378  // Other
379 
380  // Gather
381 
382  //- Collect data in processor order on master (== procIDs[0]).
383  // Offsets needed on master only.
384  template<class ProcIDsContainer, class Type>
385  static void gather
386  (
387  const labelUList& offsets,
388  const label comm,
389  const ProcIDsContainer& procIDs,
390  const UList<Type>& fld,
391  List<Type>& allFld,
392  const int tag = UPstream::msgType(),
393  const Pstream::commsTypes = Pstream::commsTypes::nonBlocking
394  );
395 
396  //- Collect indirect data in processor order on master
397  // Offsets needed on master only.
398  template<class Type, class Addr>
399  static void gather
400  (
401  const labelUList& offsets,
402  const label comm,
403  const UList<int>& procIDs,
404  const IndirectListBase<Type, Addr>& fld,
405  List<Type>& allFld,
406  const int tag = UPstream::msgType(),
407  const Pstream::commsTypes = Pstream::commsTypes::scheduled
408  );
409 
410  //- Collect data in processor order on master (== procIDs[0]).
411  // Offsets needed on master only.
412  template<class ProcIDsContainer, class Type>
413  void gather
414  (
415  const label comm,
416  const ProcIDsContainer& procIDs,
417  const UList<Type>& fld,
418  List<Type>& allFld,
419  const int tag = UPstream::msgType(),
420  const Pstream::commsTypes commsType =
421  Pstream::commsTypes::nonBlocking
422  ) const
423  {
424  gather(offsets_, comm, procIDs, fld, allFld, tag, commsType);
425  }
426 
427  //- Collect data in processor order on master.
428  // Does communication with default communicator and message tag.
429  template<class Type>
430  void gather
431  (
432  const UList<Type>& fld,
433  List<Type>& allFld,
434  const int tag = UPstream::msgType(),
436  const label comm = UPstream::worldComm
437  ) const;
438 
439  //- Collect data indirectly in processor order on master.
440  // Does communication with default communicator and message tag.
441  template<class Type, class Addr>
442  void gather
443  (
445  List<Type>& allFld,
446  const int tag = UPstream::msgType(),
448  const label comm = UPstream::worldComm
449  ) const;
450 
451  //- Inplace collect in processor order on master (== procIDs[0]).
452  //- Needs offsets only on master.
453  template<class ProcIDsContainer, class Type>
454  static void gather
455  (
456  const labelUList& offsets,
457  const label comm,
458  const ProcIDsContainer& procIDs,
459  List<Type>& fld,
460  const int tag = UPstream::msgType(),
462  );
463 
464  //- Inplace collect in processor order on master (== procIDs[0]).
465  //- Needs offsets only on master.
466  template<class ProcIDsContainer, class Type>
467  void gather
468  (
469  const label comm,
470  const ProcIDsContainer& procIDs,
471  List<Type>& fld,
472  const int tag = UPstream::msgType(),
473  const Pstream::commsTypes commsType =
475  ) const
476  {
477  gather(offsets_, comm, procIDs, fld, tag, commsType);
478  }
479 
480  //- Inplace collect data in processor order on master
481  // Does communication with default communicator and message tag.
482  // After the gather, the field is zero-sized on the slaves.
483  template<class Type>
484  void gather
485  (
486  List<Type>& fld,
487  const int tag = UPstream::msgType(),
489  const label comm = UPstream::worldComm
490  ) const;
491 
492  //- Collect \em contiguous data using a MPI_Gatherv call
493  // \attention The nProcs for globalIndex and communicator
494  // must match!!
495  template<class Type, class OutputContainer = List<Type>>
496  void mpiGather
497  (
498  const UList<Type>& sendData,
499  OutputContainer& allValues,
500  const label comm = UPstream::worldComm
501  ) const;
502 
503  //- Collect \em contiguous data using a MPI_Gatherv call
504  // \attention The nProcs for globalIndex and communicator
505  // must match!!
506  template<class Type, class OutputContainer = List<Type>>
507  OutputContainer mpiGather
508  (
509  const UList<Type>& sendData,
510  const label comm = UPstream::worldComm
511  ) const;
512 
513 
514  //- Collect data in processor order on master.
515  // Does communication with default communicator and message tag.
516  template<class Type>
517  static void gatherOp
518  (
519  const UList<Type>& fld,
520  List<Type>& allFld,
521  const int tag = UPstream::msgType(),
523  );
524 
525  //- Inplace collect data in processor order on master
526  // Does communication with default communicator and message tag.
527  // After the gather, the field is zero-sized on the slaves.
528  template<class Type>
529  static void gatherOp
530  (
531  List<Type>& fld,
532  const int tag = UPstream::msgType(),
534  );
535 
536 
537  // Scatter
538 
539  //- Distribute data in processor order. Requires fld to be sized!
540  template<class ProcIDsContainer, class Type>
541  static void scatter
542  (
543  const labelUList& offsets,
544  const label comm,
545  const ProcIDsContainer& procIDs,
546  const UList<Type>& allFld,
547  UList<Type>& fld,
548  const int tag = UPstream::msgType(),
550  );
551 
552  //- Distribute data in processor order. Requires fld to be sized!
553  template<class ProcIDsContainer, class Type>
554  void scatter
555  (
556  const label comm,
557  const ProcIDsContainer& procIDs,
558  const UList<Type>& allFld,
559  UList<Type>& fld,
560  const int tag = UPstream::msgType(),
561  const Pstream::commsTypes commsType =
563  ) const
564  {
565  scatter(offsets_, comm, procIDs, allFld, fld, tag, commsType);
566  }
567 
568  //- Distribute data in processor order. Requires fld to be sized!
569  // Does communication with default communicator and message tag.
570  template<class Type>
571  void scatter
572  (
573  const UList<Type>& allFld,
574  UList<Type>& fld,
575  const int tag = UPstream::msgType(),
577  const label comm = UPstream::worldComm
578  ) const;
579 
580 
581  // Scatter
582 
583  //- Get (potentially remote) data.
584  //- Elements required given as global indices
585  template<class Type, class CombineOp>
586  void get
587  (
588  List<Type>& allFld,
589  const labelUList& globalIds,
590  const CombineOp& cop,
591  const label comm = UPstream::worldComm,
592  const int tag = UPstream::msgType()
593  ) const;
594 
595 
596  // IOstream Operators
597 
598  friend Istream& operator>>(Istream& is, globalIndex& gi);
599  friend Ostream& operator<<(Ostream& os, const globalIndex& gi);
600 };
601 
602 
603 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
604 
605 } // End namespace Foam
606 
607 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
608 
609 #include "globalIndexI.H"
610 
611 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
612 
613 #ifdef NoRepository
614  #include "globalIndexTemplates.C"
615 #endif
616 
617 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
618 
619 #endif
620 
621 // ************************************************************************* //
globalIndexTemplates.C
Foam::globalIndex::gather
static void gather(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
Definition: globalIndexTemplates.C:75
Foam::globalIndex::OFFSETS
Definition: globalIndex.H:93
Foam::globalIndex::allProcs
labelRange allProcs() const noexcept
Range of process indices for all addressed offsets (processes)
Definition: globalIndexI.H:113
Foam::globalIndex::localStart
label localStart() const
My local start.
Definition: globalIndexI.H:175
Foam::DynamicList< label >
Foam::globalIndex::range
labelRange range() const
Return start/size range of local processor data.
Definition: globalIndexI.H:212
Foam::CompactListList
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
Definition: CompactListList.H:63
Foam::globalIndex::sizes
labelList sizes() const
The local sizes.
Definition: globalIndex.C:265
Foam::globalIndex::calcListOffsets
static labelList calcListOffsets(const List< SubListType > &lists, const bool checkOverflow=false)
Foam::globalIndex::localSize
label localSize() const
My local size.
Definition: globalIndexI.H:187
Foam::globalIndex::isLocal
bool isLocal(const label i) const
Is on local processor.
Definition: globalIndexI.H:224
Foam::operator>>
Istream & operator>>(Istream &, directionInfo &)
Definition: directionInfo.C:230
Foam::globalIndex::inplaceToGlobal
void inplaceToGlobal(labelList &labels) const
From local to global index (inplace)
Definition: globalIndexI.H:283
Foam::globalIndex::get
void get(List< Type > &allFld, const labelUList &globalIds, const CombineOp &cop, const label comm=UPstream::worldComm, const int tag=UPstream::msgType()) const
Definition: globalIndexTemplates.C:672
Foam::globalIndex::empty
bool empty() const
Check for default constructed or global sum == 0.
Definition: globalIndexI.H:100
Foam::globalIndex::operator>>
friend Istream & operator>>(Istream &is, globalIndex &gi)
Foam::globalIndex::maxSize
label maxSize() const
Global max of localSizes.
Definition: globalIndexI.H:193
Foam::globalIndex::SIZES
Definition: globalIndex.H:93
globalIndexI.H
Foam::globalIndex::const_iterator
Forward input iterator with const access.
Definition: globalIndex.H:287
Foam::operator!=
bool operator!=(const eddy &a, const eddy &b)
Definition: eddy.H:239
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::UPstream
Inter-processor communications stream.
Definition: UPstream.H:61
Foam::operator==
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::globalIndex::accessType
accessType
Disambiguation tag (list construction dispatch)
Definition: globalIndex.H:93
Foam::globalIndex::end
const const_iterator end() const noexcept
A const_iterator set to beyond the end.
Definition: globalIndexI.H:458
Foam::labelRange
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:55
Foam::globalIndex::calcRanges
static List< labelRange > calcRanges(const labelUList &localSizes, const bool checkOverflow=false)
Definition: globalIndex.C:74
Foam::globalIndex::operator<<
friend Ostream & operator<<(Ostream &os, const globalIndex &gi)
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::globalIndex::gatherOp
static void gatherOp(const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
Collect data in processor order on master.
Definition: globalIndexTemplates.C:472
os
OBJstream os(runTime.globalPath()/outputName)
Foam::globalIndex::localStarts
const labelUList localStarts() const
The local starts.
Definition: globalIndexI.H:141
Pstream.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Foam::globalIndex::reset
void reset(const label localSize)
Reset from local size.
Definition: globalIndexI.H:157
Foam::globalIndex::subProcs
labelRange subProcs() const noexcept
Range of process indices for addressed sub-offsets (processes)
Definition: globalIndexI.H:121
Foam::globalIndex::cend
const const_iterator cend() const noexcept
A const_iterator set to beyond the end.
Definition: globalIndexI.H:444
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::globalIndex::toLocal
label toLocal(const label i) const
From global to local on current processor.
Definition: globalIndexI.H:305
Foam::globalIndex::ranges
List< labelRange > ranges() const
Return start/size ranges for all data.
Definition: globalIndex.C:288
Foam::UPstream::commsTypes::nonBlocking
Foam::UPstream::msgType
static int & msgType() noexcept
Message tag of standard messages.
Definition: UPstream.H:540
Foam::globalIndex::setLocalSize
void setLocalSize(const label proci, const label len)
Alter local size for given processor.
Definition: globalIndex.C:247
Foam::UPstream::commsTypes::scheduled
Foam::globalIndex::size
label size() const
Global sum of localSizes.
Definition: globalIndexI.H:151
Foam::globalIndex::mpiGather
void mpiGather(const UList< Type > &sendData, OutputContainer &allValues, const label comm=UPstream::worldComm) const
Collect contiguous data using a MPI_Gatherv call.
Definition: globalIndexTemplates.C:393
Foam::globalIndex::nProcs
label nProcs() const noexcept
The number of processors covered by the offsets.
Definition: globalIndexI.H:106
Foam::Pstream
Inter-processor communications stream.
Definition: Pstream.H:56
Foam::UPstream::worldComm
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:293
Foam::List< label >
Foam::globalIndex::offsets
const labelList & offsets() const noexcept
Const-access to the offsets.
Definition: globalIndexI.H:129
Foam::globalIndex::maxNonLocalSize
label maxNonLocalSize() const
The max of localSizes, excluding current processor.
Definition: globalIndexI.H:200
Foam::globalIndex::whichProcID
label whichProcID(const label i) const
Which processor does global come from? Binary search.
Definition: globalIndexI.H:311
Foam::operator*
tmp< faMatrix< Type > > operator*(const areaScalarField &, const faMatrix< Type > &)
Foam::UList< label >
Foam::globalIndex::cbegin
const_iterator cbegin() const noexcept
A const_iterator set to the beginning.
Definition: globalIndexI.H:437
Foam::globalIndex::globalIndex
globalIndex()=default
Default construct.
Foam::globalIndex::scatter
static void scatter(const labelUList &offsets, const label comm, const ProcIDsContainer &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes=Pstream::commsTypes::nonBlocking)
Distribute data in processor order. Requires fld to be sized!
Definition: globalIndexTemplates.C:497
Foam::globalIndex::offset
label offset(const label proci) const
Start of proci data.
Definition: globalIndexI.H:163
Foam::globalIndex::begin
const_iterator begin() const noexcept
A const_iterator set to the beginning.
Definition: globalIndexI.H:451
DynamicList.H
Foam::IndirectListBase
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
Definition: IndirectListBase.H:56
CompactListList.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::globalIndex::calcOffsets
static labelList calcOffsets(const labelUList &localSizes, const bool checkOverflow=false)
Definition: globalIndex.C:36
Foam::globalIndex::toGlobal
label toGlobal(const label i) const
From local to global index.
Definition: globalIndexI.H:240