Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ordering of the underlying primitive patch. More...
Public Member Functions | |
ClassName ("faMeshBoundaryHalo") | |
faMeshBoundaryHalo (const label comm=UPstream::worldComm) | |
Default construct. More... | |
faMeshBoundaryHalo (const faMesh &mesh) | |
Construct from mesh. More... | |
void | clear () |
Clear out all parameters. More... | |
void | reset (const faMesh &mesh) |
Redefine map and connectivity for a mesh. More... | |
label | haloSize () const |
The local data size (output) More... | |
const labelList & | inputMeshFaces () const noexcept |
List of local input mesh faces required. More... | |
template<class Type > | |
void | distributeSparse (List< Type > &fld, const labelUList &sparseInputLocations, const labelUList &compactOutputMapping) const |
Distribute sparse data. More... | |
template<class Type > | |
void | distributeSparse (List< Type > &fld, const labelUList &sparseInputLocations) const |
Distribute sparse data. More... | |
template<class Type > | |
void | distributeSparse (List< Type > &fld) const |
Distribute sparse data. More... | |
Public Member Functions inherited from mapDistributeBase | |
ClassName ("mapDistributeBase") | |
mapDistributeBase () noexcept | |
Default construct (uses worldComm) More... | |
mapDistributeBase (const label comm) noexcept | |
Default construct with specified communicator. More... | |
mapDistributeBase (const mapDistributeBase &map) | |
Copy construct. More... | |
mapDistributeBase (mapDistributeBase &&map) | |
Move construct. More... | |
mapDistributeBase (const dictionary &dict, const label comm=UPstream::worldComm) | |
Read construct from dictionary. More... | |
mapDistributeBase (const label constructSize, labelListList &&subMap, labelListList &&constructMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
Move construct from components. More... | |
mapDistributeBase (const labelUList &sendProcs, const labelUList &recvProcs, const label comm=UPstream::worldComm) | |
Construct from reverse addressing: per data item the send processor and the receive processor. More... | |
mapDistributeBase (const globalIndex &, labelList &elements, List< Map< label >> &compactMap, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) | |
Construct from list of (possibly) remote elements in globalIndex numbering (or -1). More... | |
mapDistributeBase (const globalIndex &, labelListList &cellCells, List< Map< label >> &compactMap, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) | |
Special variant that works with the info sorted into bins according to local indices. More... | |
mapDistributeBase (const layoutTypes constructLayout, labelListList &&subMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
Construct from my elements to send, targetting the specified constructMap layout. More... | |
mapDistributeBase (labelListList &&subMap, const bool subHasFlip=false, const bool constructHasFlip=false, const label comm=UPstream::worldComm) | |
Construct from my elements to send. More... | |
mapDistributeBase (const UPtrList< const mapDistributeBase > &maps, const labelList &localRanks, const label newComm, const labelListList &newToOldRanks, labelList &startOfLocal, List< Map< label >> &compactMaps) | |
Construct from multiple maps and processor collation. More... | |
mapDistributeBase (Istream &is) | |
Construct from Istream. More... | |
label | constructSize () const noexcept |
Constructed data size. More... | |
label & | constructSize () noexcept |
Constructed data size. More... | |
const labelListList & | subMap () const noexcept |
From subsetted data back to original data. More... | |
labelListList & | subMap () noexcept |
From subsetted data back to original data. More... | |
const labelListList & | constructMap () const noexcept |
From subsetted data to new reconstructed data. More... | |
labelListList & | constructMap () noexcept |
From subsetted data to new reconstructed data. More... | |
bool | subHasFlip () const noexcept |
Does subMap include a sign. More... | |
bool & | subHasFlip () noexcept |
Does subMap include a sign. More... | |
bool | constructHasFlip () const noexcept |
Does constructMap include a sign. More... | |
bool & | constructHasFlip () noexcept |
Does constructMap include a sign. More... | |
label | comm () const noexcept |
The communicator used. More... | |
label | nMaps () const noexcept |
The number of sub-lists within the maps. More... | |
labelList | subMapSizes () const |
The sizes of the subMap lists. More... | |
labelList | constructMapSizes () const |
The sizes of the constructMap lists. More... | |
label | subMapTotalSize () const noexcept |
The sum of the subMap list sizes. More... | |
label | constructMapTotalSize () const noexcept |
The sum of the constructMap list sizes. More... | |
const List< labelPair > & | schedule () const |
Return a schedule. Demand driven. See above. More... | |
const List< labelPair > & | whichSchedule (const UPstream::commsTypes commsType) const |
Return real or dummy schedule depending on the communication type. More... | |
void | clear () |
Reset to zero size, only retaining communicator. More... | |
void | transfer (mapDistributeBase &rhs) |
Transfer the contents of the argument and annul the argument. More... | |
void | compactLocalData (const bitSet &allowedLocalElems, const int tag=UPstream::msgType(), const bool doRenumber=false) |
Compact send/receive maps based on selection of originating local (send) elements. More... | |
void | compactRemoteData (const bitSet &allowedRemoteElems, const int tag=UPstream::msgType(), const bool doRenumber=false) |
Compact send/receive maps based on selection of remote (receive) elements. More... | |
void | compactLocalData (const bitSet &allowedLocalElems, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
Compact send/receive maps based on selection of originating local (send) elements. Returns compaction mappings for subMap and constructMap. More... | |
void | compactRemoteData (const bitSet &allowedRemoteElems, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
Compact send/receive maps based on selection of remote (receive) elements. Returns compaction mappings for subMap and constructMap. More... | |
void | compactData (const labelUList &localElements, const labelUList &remoteElements, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
Compact send/receive maps based on selection of originating local (send) and remote (receive) elements. More... | |
void | compactLocalData (const labelUList &localElements, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
Compact send/receive maps based on selection of originating local (send) elements. More... | |
void | compactRemoteData (const labelUList &remoteElements, labelList &oldToNewSub, labelList &oldToNewConstruct, const label localSize=-1, const int tag=UPstream::msgType()) |
Compact send/receive maps based on selection of remote (receive) elements. More... | |
template<class T > | |
void | distribute (List< T > &values, const int tag=UPstream::msgType()) const |
Distribute List data using default commsType and the default flip/negate operator. More... | |
template<class T > | |
void | distribute (DynamicList< T > &values, const int tag=UPstream::msgType()) const |
Distribute DynamicList data using default commsType and the default flip/negate operator. More... | |
template<class T > | |
void | distribute (const UPstream::commsTypes commsType, List< T > &values, const int tag=UPstream::msgType()) const |
Distribute List data using specified commsType and the default flip/negate operator. More... | |
template<class T > | |
void | distribute (const UPstream::commsTypes commsType, DynamicList< T > &values, const int tag=UPstream::msgType()) const |
Distribute DynamicList data using specified commsType and the default flip/negate operator. More... | |
template<class T , class NegateOp > | |
void | distribute (List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
Distribute data using default commsType and the specified negate operator (for flips). More... | |
template<class T , class NegateOp > | |
void | distribute (const UPstream::commsTypes commsType, List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
Distribute data using specified commsType and the specified negate operator (for flips). More... | |
template<class T , class NegateOp > | |
void | distribute (const UPstream::commsTypes commsType, const T &nullValue, List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
Distribute data using specified commsType and the specified negate operator (for flips). More... | |
template<class T > | |
void | reverseDistribute (const label constructSize, List< T > &values, const int tag=UPstream::msgType()) const |
Reverse distribute data using default commsType and the default flip/negate operator. More... | |
template<class T > | |
void | reverseDistribute (const label constructSize, const T &nullValue, List< T > &values, const int tag=UPstream::msgType()) const |
Reverse distribute data using default commsType and the default flip/negate operator. More... | |
template<class T > | |
void | reverseDistribute (const UPstream::commsTypes commsType, const label constructSize, List< T > &values, const int tag=UPstream::msgType()) const |
Reverse distribute data using specified commsType and the default flip/negate operator. More... | |
template<class T , class NegateOp > | |
void | reverseDistribute (const UPstream::commsTypes commsType, const label constructSize, List< T > &values, const NegateOp &negOp, const int tag=UPstream::msgType()) const |
Reverse distribute data using specified commsType and the specified flip/negate operator. More... | |
template<class T > | |
void | reverseDistribute (const UPstream::commsTypes commsType, const label constructSize, const T &nullValue, List< T > &values, const int tag=UPstream::msgType()) const |
Reverse distribute data using specified commsType and the default flip/negate operator. More... | |
template<class T > | |
void | send (PstreamBuffers &pBufs, const List< T > &field) const |
Do all sends using PstreamBuffers. More... | |
template<class T > | |
void | receive (PstreamBuffers &pBufs, List< T > &field) const |
Do all receives using PstreamBuffers. More... | |
template<class T > | |
void | send (const UList< T > &field, labelRange &sendRequests, PtrList< List< T >> &sendFields, labelRange &recvRequests, PtrList< List< T >> &recvFields, const int tag=UPstream::msgType()) const |
Start all sends and receives (always non-blocking) More... | |
template<class T > | |
void | receive (const labelRange &requests, const UPtrList< List< T >> &recvFields, List< T > &field, const int tag=UPstream::msgType()) const |
Wait for (receive) requests to finish and consume. More... | |
void | printLayout (Ostream &os) const |
Debug: print layout. Can only be used on maps with sorted. More... | |
void | operator= (const mapDistributeBase &rhs) |
Copy assignment. More... | |
void | operator= (mapDistributeBase &&rhs) |
Move assignment. More... | |
InfoProxy< mapDistributeBase > | info () const noexcept |
Return info proxy, used to print summary information to a stream. More... | |
void | readDict (const dictionary &dict) |
Read entries from dictionary format. More... | |
void | writeEntries (Ostream &os) const |
Write entries in dictionary format. More... | |
void | updateMesh (const mapPolyMesh &) |
No correction for topo change. More... | |
void | compact (const boolList &remoteElemUsed, const int tag=UPstream::msgType()) |
OpenFOAM-v2112 and earlier naming for compactRemoteData() using boolList. More... | |
void | compact (const boolList &remoteElemUsed, const label localSize, labelList &oldToNewSub, labelList &oldToNewConstruct, const int tag=UPstream::msgType()) |
OpenFOAM-v2112 and earlier naming for compactRemoteData(). using boolList. More... | |
template<class T , class NegateOp > | |
Foam::List< T > | accessAndFlip (const UList< T > &values, const labelUList &map, const bool hasFlip, const NegateOp &negOp) |
Additional Inherited Members | |
Public Types inherited from mapDistributeBase | |
enum | layoutTypes : char { linear, localFirst } |
The map layout (eg, of the constructMap) More... | |
Static Public Member Functions inherited from mapDistributeBase | |
static bool | hasFlipAddressing (const labelUList &map) |
Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as positive non-zero indices. More... | |
static bool | hasFlipAddressing (const labelListList &maps) |
Test for flip addressing, where flips are encoded as negative indices and non-flips are encoded as positive non-zero indices. More... | |
static label | countUnmapped (const labelUList &elements, const labelListList &maps, const bool hasFlip) |
Count the number of unmapped elements. More... | |
static List< labelPair > | schedule (const labelListList &subMap, const labelListList &constructMap, const int tag, const label comm=UPstream::worldComm) |
Calculate a communication schedule. See above. More... | |
static label | renumber (const globalIndex &, const label comm, const List< Map< label >> &compactMap, const label globalElement) |
Helper for construct from globalIndex. Renumbers element. More... | |
static label | renumberMap (labelListList &mapElements, const labelUList &oldToNew, const bool hasFlip) |
Helper for renumbering the (compacted) map elements using the supplied old-to-new mapping. More... | |
static label | renumberMap (labelList &map, const label localSize, const label offset, const Map< label > &cMap, const bool hasFlip) |
Helper for renumbering the map elements. Assumes local elements are first, followed by any remote. Local elements get offset, remote elements are mapped. More... | |
static label | renumberMap (labelListList &mapElements, const label localSize, const label offset, const Map< label > &cMap, const bool hasFlip) |
Helper for a list of maps. Calls above renumberMap for all elements. More... | |
template<class T , class CombineOp , class NegateOp > | |
static void | distribute (const UPstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const T &nullValue, const CombineOp &cop, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) |
Distribute combine data with specified combine operation and negate operator (for flips). More... | |
template<class T , class NegateOp > | |
static void | distribute (const UPstream::commsTypes commsType, const List< labelPair > &schedule, const label constructSize, const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, List< T > &field, const NegateOp &negOp, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm) |
Distribute assign data with specified negate operator (for flips). Uses assignment for combine operation. More... | |
template<class T , class negateOp > | |
static void | send (const labelListList &subMap, const bool subHasFlip, const labelListList &constructMap, const bool constructHasFlip, const UList< T > &field, labelRange &sendRequests, PtrList< List< T >> &sendFields, labelRange &recvRequests, PtrList< List< T >> &recvFields, const negateOp &negOp, const int tag, const label comm) |
Start all sends and receives (always non-blocking) More... | |
template<class T , class CombineOp , class negateOp > | |
static void | receive (const label constructSize, const labelListList &constructMap, const bool constructHasFlip, const labelRange &requests, const UPtrList< List< T >> &recvFields, List< T > &field, const CombineOp &cop, const negateOp &negOp, const int tag, const label comm) |
Wait for (receive) requests to finish and consume. More... | |
Protected Member Functions inherited from mapDistributeBase | |
void | calcCompactAddressing (const globalIndex &globalNumbering, const labelUList &elements, List< Map< label >> &compactMap) const |
Construct per processor compact addressing of the global elements. More... | |
void | calcCompactAddressing (const globalIndex &globalNumbering, const labelListList &elements, List< Map< label >> &compactMap) const |
void | exchangeAddressing (const int tag, const globalIndex &globalNumbering, labelList &elements, List< Map< label >> &compactMap, labelList &compactStart) |
void | exchangeAddressing (const int tag, const globalIndex &globalNumbering, labelListList &elements, List< Map< label >> &compactMap, labelList &compactStart) |
Static Protected Member Functions inherited from mapDistributeBase | |
static void | checkReceivedSize (const label proci, const label expectedSize, const label receivedSize) |
Fatal if expected != received size. More... | |
static label | getMappedSize (const labelListList &maps, const bool hasFlip) |
Scan the maps for the max addressed index. More... | |
static void | exchangeMasks (const UList< bitSet > &sendMasks, UList< bitSet > &recvMasks, const int tag, const label comm) |
Synchronize send/recv mask buffers as a 'copy' operation. More... | |
static void | unionCombineMasks (UList< bitSet > &sendMasks, UList< bitSet > &recvMasks, const int tag, const label comm) |
Bi-direction sync of send/recv buffers using bitwise '&=' combine operation. More... | |
template<class T , class CombineOp , class NegateOp > | |
static void | flipAndCombine (List< T > &lhs, const UList< T > &rhs, const labelUList &map, const bool hasFlip, const CombineOp &cop, const NegateOp &negOp) |
Combine field values (after any flip negation operation) into the specified mapped target locations. More... | |
template<class T , class NegateOp > | |
static void | accessAndFlip (List< T > &output, const UList< T > &values, const labelUList &map, const bool hasFlip, const NegateOp &negOp) |
Lookup field values at specified map indices and save after any flip negation operations. More... | |
template<class T , class NegateOp > | |
static List< T > | accessAndFlip (const UList< T > &values, const labelUList &map, const bool hasFlip, const NegateOp &negOp) |
Lookup field values at specified indices and return after any flip negation operations. More... | |
Class for obtaining halo face data for the boundary edges. The ordering follows that natural edge ordering of the underlying primitive patch.
Definition at line 55 of file faMeshBoundaryHalo.H.
|
explicit |
Default construct.
Definition at line 36 of file faMeshBoundaryHalo.C.
|
explicit |
Construct from mesh.
Definition at line 44 of file faMeshBoundaryHalo.C.
References faMeshBoundaryHalo::reset().
ClassName | ( | "faMeshBoundaryHalo" | ) |
void clear | ( | ) |
Clear out all parameters.
Definition at line 56 of file faMeshBoundaryHalo.C.
void reset | ( | const faMesh & | mesh | ) |
Redefine map and connectivity for a mesh.
Definition at line 78 of file faMeshBoundaryHalo.C.
References forAll, HashSet< Key, Hash >::insert(), UPstream::msgType(), UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), List< T >::resize(), and HashTable< T, Key, Hash >::sortedToc().
Referenced by faMeshBoundaryHalo::faMeshBoundaryHalo().
Foam::label haloSize | ( | ) | const |
The local data size (output)
Definition at line 65 of file faMeshBoundaryHalo.C.
References UPstream::parRun().
|
inlinenoexcept |
List of local input mesh faces required.
Definition at line 116 of file faMeshBoundaryHalo.H.
void distributeSparse | ( | List< Type > & | fld, |
const labelUList & | sparseInputLocations, | ||
const labelUList & | compactOutputMapping | ||
) | const |
Distribute sparse data.
On output it is adjusted.
Definition at line 29 of file faMeshBoundaryHaloTemplates.C.
References UList< T >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, fld, forAll, UList< T >::size(), and Foam::Zero.
Referenced by faMeshBoundaryHalo::distributeSparse().
void distributeSparse | ( | List< Type > & | fld, |
const labelUList & | sparseInputLocations | ||
) | const |
Distribute sparse data.
On output it is adjusted.
Definition at line 84 of file faMeshBoundaryHaloTemplates.C.
References fld.
void distributeSparse | ( | List< Type > & | fld | ) | const |
Distribute sparse data.
The input field one enty per sparse id (inputMeshFaces). On output it will have for the input sparse The input field contains location.
Definition at line 94 of file faMeshBoundaryHaloTemplates.C.
References faMeshBoundaryHalo::distributeSparse().