Functions
Foam::ListListOps Namespace Reference

Various utility functions to work on Lists of Lists (usually resulting from 'gather'ing and combining information from individual processors) More...

Functions

template<class T , class Addr , class AccessOp >
labelList subSizes (const IndirectListBase< T, Addr > &lists, AccessOp aop)
 
template<class IntListType >
void inplaceRenumber (const labelUList &oldToNew, IntListType &lists)
 
template<class T , class AccessOp >
labelList subSizes (const UList< T > &lists, AccessOp aop=accessOp< T >())
 
template<class T , class AccessOp >
label sumSizes (const UList< T > &lists, AccessOp aop=accessOp< T >())
 
template<class AccessType , class T , class AccessOp >
AccessType combine (const UList< T > &lists, AccessOp aop=accessOp< T >())
 
template<class AccessType , class T , class AccessOp , class OffsetOp >
AccessType combineOffset (const UList< T > &lists, const labelUList &offsets, AccessOp aop, OffsetOp oop=offsetOp< T >())
 

Detailed Description

Various utility functions to work on Lists of Lists (usually resulting from 'gather'ing and combining information from individual processors)

The access of data is through an AccessOp so that data can be 'gather'ed in one go, minimizing communication, and then picked apart and recombined.

Example:

// Assuming myContainer defined which holds all the data I want to
// transfer (say a pointField and a faceList). myContainer also defines
// access operators to
// access the individual elements, say myContainerPoints::operator(),
// and myContainerFaces::operator()
List<myContainer> gatheredData(Pstream::nProcs());
gatheredData[Pstream::myProcNo()] = myContainer(points, faces);
// Gather data onto master
Pstream::gatherList(gatheredData);
// Combine
pointField combinedPoints
(
ListListOps::combine<pointField>
(
gatheredData,
myContainerPoints()
)
);
// Combine and renumber (so combinedFaces indexes combinedPoints)
// Extract sizes of individual lists
labelList sizes
(
ListListOps::subSizes(gatheredData, myContainerPoints())
);
// Renumber using user-defined operator offsetOp<face>()
faceList combinedFaces
(
ListListOps::combineOffset<faceList>
(
gatheredData, sizes, myContainerFaces(), offsetOp<face>()
)
);
Source files

Function Documentation

◆ subSizes() [1/2]

labelList Foam::ListListOps::subSizes ( const IndirectListBase< T, Addr > &  lists,
AccessOp  aop 
)

Definition at line 65 of file ensightOutput.H.

References Foam::output(), IndirectListBase< T, Addr >::size(), and Foam::T().

Here is the call graph for this function:

◆ inplaceRenumber()

void Foam::ListListOps::inplaceRenumber ( const labelUList oldToNew,
IntListType &  lists 
)

◆ subSizes() [2/2]

labelList Foam::ListListOps::subSizes ( const UList< T > &  lists,
AccessOp  aop = accessOpT >() 
)

◆ sumSizes()

label Foam::ListListOps::sumSizes ( const UList< T > &  lists,
AccessOp  aop = accessOpT >() 
)

◆ combine()

AccessType combine ( const UList< T > &  lists,
AccessOp  aop = accessOp<T>() 
)

Definition at line 62 of file ListListOps.C.

References Foam::output(), and T.

Referenced by badQualityToCell::applyToSet(), badQualityToFace::applyToSet(), regionsToCell::applyToSet(), boundaryToCell::applyToSet(), boundaryToFace::applyToSet(), nbrToCell::applyToSet(), nearestToPoint::applyToSet(), nearestToCell::applyToSet(), patchToCell::applyToSet(), haloToCell::applyToSet(), patchToFace::applyToSet(), shapeToCell::applyToSet(), sphereToPoint::applyToSet(), sphereToFace::applyToSet(), sphereToCell::applyToSet(), regionToFace::applyToSet(), searchableSurfaceToCell::applyToSet(), boxToPoint::applyToSet(), searchableSurfaceToPoint::applyToSet(), boxToCell::applyToSet(), boxToFace::applyToSet(), searchableSurfaceToFace::applyToSet(), cylinderToPoint::applyToSet(), targetVolumeToCell::applyToSet(), cylinderAnnulusToFace::applyToSet(), cylinderToFace::applyToSet(), cylinderToCell::applyToSet(), rotatedBoxToCell::applyToSet(), cylinderAnnulusToCell::applyToSet(), cellToPoint::applyToSet(), zoneToCell::applyToSet(), faceToPoint::applyToSet(), zoneToPoint::applyToSet(), zoneToFace::applyToSet(), pointToCell::applyToSet(), pointToFace::applyToSet(), faceToCell::applyToSet(), planeToFaceZone::applyToSet(), regionToCell::applyToSet(), surfaceToPoint::applyToSet(), faceZoneToCell::applyToSet(), surfaceToCell::applyToSet(), InflationInjection< CloudType >::parcelsToInject(), syncTools::syncEdgeMap(), and syncTools::syncPointMap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ combineOffset()

AccessType combineOffset ( const UList< T > &  lists,
const labelUList offsets,
AccessOp  aop,
OffsetOp  oop = offsetOp<T>() 
)

Definition at line 92 of file ListListOps.C.

References UList::begin(), Foam::output(), and T.

Here is the call graph for this function:
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:63
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
Foam::ListListOps::subSizes
labelList subSizes(const IndirectListBase< T, Addr > &lists, AccessOp aop)
Definition: ensightOutput.H:65
Foam::Pstream::gatherList
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Definition: gatherScatterList.C:46
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=worldComm)
Definition: UPstream.H:459
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:41
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::UPstream::nProcs
static label nProcs(const label communicator=worldComm)
Definition: UPstream.H:441