FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

globalIndex Class Reference

Calculates a unique integer (label so might not have enough room - 2G max) for processor + local index. E.g. More...

#include <OpenFOAM/globalIndex.H>


Detailed Description

Calculates a unique integer (label so might not have enough room - 2G max) for processor + local index. E.g.

globalIndex globalFaces(mesh.nFaces()); label globalFaceI = globalFaces.toGlobal(faceI);

Source files

Definition at line 62 of file globalIndex.H.

Collaboration diagram for globalIndex:

List of all members.

Public Member Functions

 globalIndex (const label localSize)
 Construct from local max size.
 globalIndex (Istream &is)
 Construct from Istream.
label  localSize () const
 my local size
label  toGlobal (const label i) const
 From local to global.
bool  isLocal (const label i) const
 Is on local processor.
label  toLocal (const label i) const
 From global to local on current processor.
label  size () const
 Global sum of localSizes.
label  localSize (const label procI) const
 Size of procI data.
label  toGlobal (const label procI, const label i) const
 From local to global on procI.
bool  isLocal (const label procI, const label i) const
 Is on processor procI.
label  toLocal (const label procI, const label i) const
 From global to local on procI.
label  whichProcID (const label i) const
 Which processor does global come from? Binary search.
label  offset (const label procI) const
 Start of procI data.

Friends

Istream &  operator>> (Istream &is, globalIndex &gi)
Ostream &  operator<< (Ostream &os, const globalIndex &gi)

Constructor & Destructor Documentation

globalIndex ( Istream &   is  )

Construct from Istream.

Definition at line 58 of file globalIndex.C.


Member Function Documentation

Foam::label localSize (  ) const [inline]

my local size

Definition at line 53 of file globalIndexI.H.

References Pstream::myProcNo().

Referenced by extendedCellToFaceStencil::calcDistributeMap(), and globalIndex::globalIndex().

Foam::label toGlobal ( const label   i  ) const [inline]

From local to global.

Definition at line 75 of file globalIndexI.H.

References Pstream::myProcNo().

Referenced by distributedTriSurfaceMesh::findNearest(), and sampledTriSurfaceMesh::update().

bool isLocal ( const label   i  ) const [inline]

Is on local processor.

Definition at line 90 of file globalIndexI.H.

References Pstream::myProcNo().

Referenced by sampledTriSurfaceMesh::update().

Foam::label toLocal ( const label   i  ) const [inline]

From global to local on current processor.

FatalError if not on local processor.

Definition at line 112 of file globalIndexI.H.

References Pstream::myProcNo().

Referenced by extendedCellToFaceStencil::calcDistributeMap(), and sampledTriSurfaceMesh::update().

Foam::label size (  ) const [inline]

Global sum of localSizes.

Definition at line 59 of file globalIndexI.H.

References Pstream::nProcs().

Referenced by distributedTriSurfaceMesh::globalSize().

Foam::label localSize ( const label   procI  ) const [inline]

Size of procI data.

Definition at line 42 of file globalIndexI.H.

Foam::label toGlobal ( const label   procI,
const label   i  
) const [inline]

From local to global on procI.

Definition at line 66 of file globalIndexI.H.

bool isLocal ( const label   procI,
const label   i  
) const [inline]

Is on processor procI.

Is on local processor.

Definition at line 82 of file globalIndexI.H.

Foam::label toLocal ( const label   procI,
const label   i  
) const [inline]

From global to local on procI.

Definition at line 96 of file globalIndexI.H.

References Foam::abort(), Foam::endl(), Foam::FatalError, and FatalErrorIn.

Foam::label whichProcID ( const label   i  ) const [inline]

Which processor does global come from? Binary search.

Definition at line 118 of file globalIndexI.H.

References Foam::abort(), Foam::FatalError, FatalErrorIn, Foam::findLower(), and Pstream::nProcs().

Referenced by extendedCellToFaceStencil::calcDistributeMap().

Foam::label offset ( const label   procI  ) const [inline]

Start of procI data.

Definition at line 36 of file globalIndexI.H.

Referenced by globalIndex::globalIndex().


Friends And Related Function Documentation

Istream& operator>> ( Istream &   is,
globalIndex &   gi  
) [friend]
Ostream& operator<< ( Ostream &   os,
const globalIndex &   gi  
) [friend]

The documentation for this class was generated from the following files: