Various tools to aid synchronizing lists across coupled patches. More...
#include <OpenFOAM/syncTools.H>
Various tools to aid synchronizing lists across coupled patches.
Can apply coordinate rotation/separation on cyclics but only for faces or if there is a single rotation/separation tensor.
Definition at line 68 of file syncTools.H.
Public Member Functions | |
template<> | |
void | separateList (const vectorField &separation, UList< vector > &field) |
template<> | |
void | separateList (const vectorField &separation, Map< vector > &field) |
template<> | |
void | separateList (const vectorField &separation, EdgeMap< vector > &field) |
Static Public Member Functions | |
template<class T , class CombineOp > | |
static void | syncPointList (const polyMesh &, UList< T > &, const CombineOp &cop, const T &nullValue, const bool applySeparation) |
Synchronize values on all mesh points.
| |
template<class T , class CombineOp > | |
static void | syncPointList (const polyMesh &, const labelList &meshPoints, UList< T > &, const CombineOp &bop, const T &nullValue, const bool applySeparation) |
Synchronize values on selected mesh points.
| |
template<class T , class CombineOp > | |
static void | syncEdgeList (const polyMesh &, UList< T > &, const CombineOp &cop, const T &nullValue, const bool applySeparation) |
Synchronize values on all mesh edges.
| |
template<class T , class CombineOp > | |
static void | syncBoundaryFaceList (const polyMesh &, UList< T > &, const CombineOp &cop, const bool applySeparation) |
Synchronize values on boundary faces only.
| |
template<class T , class CombineOp > | |
static void | syncFaceList (const polyMesh &, UList< T > &, const CombineOp &cop, const bool applySeparation) |
Synchronize values on all mesh faces.
| |
template<class T > | |
static void | swapBoundaryFaceList (const polyMesh &, UList< T > &, const bool applySeparation) |
Swap coupled face values.
| |
template<class T > | |
static void | swapFaceList (const polyMesh &, UList< T > &, const bool applySeparation) |
Swap coupled face values.
| |
template<class T , class CombineOp > | |
static void | syncPointMap (const polyMesh &, Map< T > &pointValues, const CombineOp &cop, const bool applySeparation) |
Synchronize values on selected points.
| |
template<class T , class CombineOp > | |
static void | syncEdgeMap (const polyMesh &, EdgeMap< T > &edgeValues, const CombineOp &cop, const bool applySeparation) |
Synchronize values on selected edges. Edges are represented.
| |
template<unsigned nBits, class CombineOp > | |
static void | syncFaceList (const polyMesh &mesh, PackedList< nBits > &faceValues, const CombineOp &cop) |
template<unsigned nBits> | |
static void | swapFaceList (const polyMesh &mesh, PackedList< nBits > &faceValues) |
template<unsigned nBits, class CombineOp > | |
static void | syncPointList (const polyMesh &mesh, PackedList< nBits > &pointValues, const CombineOp &cop, const unsigned int nullValue) |
template<unsigned nBits, class CombineOp > | |
static void | syncEdgeList (const polyMesh &mesh, PackedList< nBits > &edgeValues, const CombineOp &cop, const unsigned int nullValue) |
static PackedBoolList | getMasterPoints (const polyMesh &) |
Get per point whether is it master (of a coupled set of points)
| |
static PackedBoolList | getMasterEdges (const polyMesh &) |
Get per edge whether is it master (of a coupled set of edges)
| |
static PackedBoolList | getMasterFaces (const polyMesh &) |
Get per face whether is it master (of a coupled set of faces)
|
void syncPointList | ( | const polyMesh & | mesh, |
UList< T > & | pointValues, | ||
const CombineOp & | cop, | ||
const T & | nullValue, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on all mesh points.
Applies rotation and optionally separation for parallel cyclics
Note: hasTransformation is only used for warning messages so
reduction not strictly nessecary. reduce(hasTransformation, orOp<bool>());
Definition at line 850 of file syncToolsTemplates.C.
References Foam::abort(), PstreamBase::blocking, polyMesh::boundaryMesh(), cyclicPolyPatch::coupledPoints(), e, Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, coupledPolyPatch::forwardT(), polyMesh::globalData(), Pstream::listCombineGather(), Pstream::listCombineScatter(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), processorPolyPatch::neighbPoints(), processorPolyPatch::neighbProcNo(), globalMeshData::nGlobalPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), nPoints, primitiveMesh::nPoints(), coupledPolyPatch::parallel(), Pstream::parRun(), patches, coupledPolyPatch::reverseT(), coupledPolyPatch::separated(), coupledPolyPatch::separation(), globalMeshData::sharedPointAddr(), globalMeshData::sharedPointLabels(), List< T >::size(), UList< T >::size(), Foam::transformList(), and WarningIn.
Referenced by autoSnapDriver::calcNearestSurface(), autoSnapDriver::calcSnapDistance(), hexRef8::checkRefinementLevels(), hexRef8::consistentSlowRefinement(), motionSmoother::correctBoundaryConditions(), removePoints::countPointUsage(), motionSmoother::scaleMesh(), motionSmoother::setDisplacement(), removeFaces::setRefinement(), combineFaces::setRefinement(), addPatchCellLayer::setRefinement(), meshRefinement::splitMesh(), pointSet::sync(), and syncTools::syncPointList().
void syncPointList | ( | const polyMesh & | mesh, |
const labelList & | meshPoints, | ||
UList< T > & | pointValues, | ||
const CombineOp & | bop, | ||
const T & | nullValue, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on selected mesh points.
Applies rotation and optionally separation for parallel cyclics
Definition at line 1070 of file syncToolsTemplates.C.
References Foam::abort(), polyMesh::boundaryMesh(), Foam::FatalError, FatalErrorIn, forAll, primitiveMesh::nPoints(), List< T >::size(), UList< T >::size(), and syncTools::syncPointList().
void syncEdgeList | ( | const polyMesh & | mesh, |
UList< T > & | edgeValues, | ||
const CombineOp & | cop, | ||
const T & | nullValue, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on all mesh edges.
Applies rotation and optionally separation for parallel cyclics
Note: hasTransformation is only used for warning messages so
reduction not strictly nessecary. reduce(hasTransformation, orOp<bool>());
Definition at line 1121 of file syncToolsTemplates.C.
References Foam::abort(), PstreamBase::blocking, polyMesh::boundaryMesh(), cyclicPolyPatch::coupledEdges(), e, Foam::endl(), Foam::FatalError, FatalErrorIn, forAll, coupledPolyPatch::forwardT(), polyMesh::globalData(), Pstream::listCombineGather(), Pstream::listCombineScatter(), polyPatch::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), primitiveMesh::nEdges(), processorPolyPatch::neighbEdges(), processorPolyPatch::neighbProcNo(), globalMeshData::nGlobalEdges(), coupledPolyPatch::parallel(), Pstream::parRun(), patches, coupledPolyPatch::reverseT(), coupledPolyPatch::separated(), coupledPolyPatch::separation(), globalMeshData::sharedEdgeAddr(), globalMeshData::sharedEdgeLabels(), List< T >::size(), UList< T >::size(), Foam::transformList(), and WarningIn.
Referenced by removeFaces::setRefinement(), hexRef8::setRefinement(), and addPatchCellLayer::setRefinement().
void syncBoundaryFaceList | ( | const polyMesh & | mesh, |
UList< T > & | faceValues, | ||
const CombineOp & | cop, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on boundary faces only.
Optionally applies rotation tensor for non-parallel cyclics (but not separation!)
Definition at line 1345 of file syncToolsTemplates.C.
References Foam::abort(), PstreamBase::blocking, polyMesh::boundaryMesh(), Foam::FatalError, FatalErrorIn, forAll, coupledPolyPatch::forwardT(), processorPolyPatch::neighbProcNo(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), coupledPolyPatch::parallel(), Pstream::parRun(), patches, IPstream::read(), coupledPolyPatch::reverseT(), coupledPolyPatch::separated(), coupledPolyPatch::separation(), UList< T >::size(), polyPatch::start(), Foam::T(), Foam::transformList(), and OPstream::write().
Referenced by removePoints::getUnrefimentSet(), and hexRef8::setRefinement().
void syncFaceList | ( | const polyMesh & | mesh, |
UList< T > & | faceValues, | ||
const CombineOp & | cop, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on all mesh faces.
Optionally applies rotation tensor for non-parallel cyclics (but not separation!)
Definition at line 1512 of file syncToolsTemplates.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), and UList< T >::size().
Referenced by meshRefinement::balance(), dynamicRefineFvMesh::calculateProtectedCells(), meshRefinement::createBaffles(), dynamicRefineFvMesh::dynamicRefineFvMesh(), dynamicRefineFvMesh::extendMarkedCells(), removeCells::getExposedFaces(), hexRef8::setRefinement(), meshRefinement::splitMesh(), and meshRefinement::zonify().
void swapBoundaryFaceList | ( | const polyMesh & | mesh, |
UList< T > & | faceValues, | ||
const bool | applySeparation | ||
) | [static]
|
Swap coupled face values.
Applies rotation and optionally separation for parallel cyclics
Definition at line 1550 of file syncToolsTemplates.C.
Referenced by cellToFaceStencil::calcFaceStencil(), parMetisDecomp::calcMetisDistributedCSR(), dynamicRefineFvMesh::calculateProtectedCells(), meshRefinement::checkCoupledFaceZones(), meshRefinement::checkData(), polyMeshGeometry::checkFaceDotProduct(), polyMeshGeometry::checkFaceSkewness(), polyMeshGeometry::checkFaceTwist(), polyMeshGeometry::checkFaceWeights(), hexRef8::checkMesh(), faceZone::checkParallelSync(), hexRef8::checkRefinementLevels(), polyMeshGeometry::checkVolRatio(), hexRef8::consistentSlowRefinement(), hexRef8::consistentUnrefinement(), parMetisDecomp::decompose(), hexRef8::setRefinement(), and meshRefinement::zonify().
void swapFaceList | ( | const polyMesh & | mesh, |
UList< T > & | faceValues, | ||
const bool | applySeparation | ||
) | [static]
|
Swap coupled face values.
Applies rotation and optionally separation for parallel cyclics
Definition at line 1562 of file syncToolsTemplates.C.
Referenced by dynamicRefineFvMesh::dynamicRefineFvMesh(), and removeFaces::setRefinement().
void syncPointMap | ( | const polyMesh & | mesh, |
Map< T > & | pointValues, | ||
const CombineOp & | cop, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on selected points.
Applies rotation and optionally separation for parallel cyclics.
Note: hasTransformation is only used for warning messages so
reduction not strictly nessecary. reduce(hasTransformation, orOp<bool>());
Definition at line 111 of file syncToolsTemplates.C.
References PstreamBase::blocking, polyMesh::boundaryMesh(), Foam::ListListOps::combine(), cyclicPolyPatch::coupledPoints(), e, HashTable< T, label, Hash< label > >::end(), Foam::endl(), HashTable< T, label, Hash< label > >::find(), Pstream::firstSlave(), forAll, forAllConstIter, coupledPolyPatch::forwardT(), polyMesh::globalData(), Pstream::lastSlave(), Pstream::master(), Pstream::masterNo(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), processorPolyPatch::neighbPoints(), processorPolyPatch::neighbProcNo(), globalMeshData::nGlobalPoints(), nPoints, coupledPolyPatch::parallel(), Pstream::parRun(), patches, coupledPolyPatch::reverseT(), coupledPolyPatch::separated(), coupledPolyPatch::separation(), globalMeshData::sharedPointAddr(), globalMeshData::sharedPointLabels(), List< T >::size(), Foam::transformList(), and WarningIn.
void syncEdgeMap | ( | const polyMesh & | mesh, |
EdgeMap< T > & | edgeValues, | ||
const CombineOp & | cop, | ||
const bool | applySeparation | ||
) | [static]
|
Synchronize values on selected edges. Edges are represented.
by the two vertices that make it up so global edges never get constructed. Applies rotation and optionally separation for parallel cyclics.
Definition at line 457 of file syncToolsTemplates.C.
References PstreamBase::blocking, polyMesh::boundaryMesh(), Foam::ListListOps::combine(), cyclicPolyPatch::coupledEdges(), e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), HashTable< T, label, Hash< label > >::end(), HashTable< T, edge, Hash< edge > >::end(), f(), polyMesh::faces(), UList< T >::fcIndex(), HashTable< T, Key, Hash >::find(), HashTable< T, edge, Hash< edge > >::find(), Pstream::firstSlave(), forAll, forAllConstIter, coupledPolyPatch::forwardT(), polyMesh::globalData(), Pstream::lastSlave(), Pstream::master(), Pstream::masterNo(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), processorPolyPatch::neighbPoints(), processorPolyPatch::neighbProcNo(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), coupledPolyPatch::parallel(), Pstream::parRun(), patches, coupledPolyPatch::reverseT(), coupledPolyPatch::separated(), coupledPolyPatch::separation(), globalMeshData::sharedPointAddr(), globalMeshData::sharedPointLabels(), List< T >::size(), Foam::transformList(), and v1.
void syncFaceList | ( | const polyMesh & | mesh, |
PackedList< nBits > & | faceValues, | ||
const CombineOp & | cop | ||
) | [static]
|
Definition at line 1574 of file syncToolsTemplates.C.
References Foam::abort(), PstreamBase::blocking, polyMesh::boundaryMesh(), Foam::FatalError, FatalErrorIn, forAll, PackedList< nBits >::get(), processorPolyPatch::neighbProcNo(), primitiveMesh::nFaces(), Pstream::parRun(), patches, PackedList< nBits >::set(), PtrList< T >::size(), PackedList< nBits >::size(), and polyPatch::start().
void swapFaceList | ( | const polyMesh & | mesh, |
PackedList< nBits > & | faceValues | ||
) | [static]
|
Definition at line 1695 of file syncToolsTemplates.C.
void syncPointList | ( | const polyMesh & | mesh, |
PackedList< nBits > & | pointValues, | ||
const CombineOp & | cop, | ||
const unsigned int | nullValue | ||
) | [static]
|
Definition at line 1706 of file syncToolsTemplates.C.
References Foam::abort(), PstreamBase::blocking, polyMesh::boundaryMesh(), cyclicPolyPatch::coupledPoints(), e, Foam::FatalError, FatalErrorIn, forAll, PackedList< nBits >::get(), polyMesh::globalData(), Pstream::listCombineGather(), Pstream::listCombineScatter(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), processorPolyPatch::neighbPoints(), processorPolyPatch::neighbProcNo(), globalMeshData::nGlobalPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), nPoints, primitiveMesh::nPoints(), Pstream::parRun(), patches, PackedList< nBits >::set(), globalMeshData::sharedPointAddr(), globalMeshData::sharedPointLabels(), PtrList< T >::size(), and PackedList< nBits >::size().
void syncEdgeList | ( | const polyMesh & | mesh, |
PackedList< nBits > & | edgeValues, | ||
const CombineOp & | cop, | ||
const unsigned int | nullValue | ||
) | [static]
|
Definition at line 1874 of file syncToolsTemplates.C.
References Foam::abort(), PstreamBase::blocking, polyMesh::boundaryMesh(), cyclicPolyPatch::coupledEdges(), e, Foam::FatalError, FatalErrorIn, forAll, PackedList< nBits >::get(), polyMesh::globalData(), Pstream::listCombineGather(), Pstream::listCombineScatter(), polyPatch::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), primitiveMesh::nEdges(), processorPolyPatch::neighbEdges(), processorPolyPatch::neighbProcNo(), globalMeshData::nGlobalEdges(), Pstream::parRun(), patches, PackedList< nBits >::set(), globalMeshData::sharedEdgeAddr(), globalMeshData::sharedEdgeLabels(), PtrList< T >::size(), and PackedList< nBits >::size().
Foam::PackedBoolList getMasterPoints | ( | const polyMesh & | mesh ) | [static]
|
Get per point whether is it master (of a coupled set of points)
Definition at line 75 of file syncTools.C.
References Foam::abort(), polyMesh::boundaryMesh(), cyclicPolyPatch::coupledPoints(), Foam::FatalError, FatalErrorIn, forAll, polyMesh::globalData(), Pstream::listCombineGather(), Pstream::listCombineScatter(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Pstream::myProcNo(), IOobject::name(), globalMeshData::nGlobalPoints(), primitiveMesh::nPoints(), processorPolyPatch::owner(), Pstream::parRun(), globalMeshData::sharedPointAddr(), and globalMeshData::sharedPointLabels().
Foam::PackedBoolList getMasterEdges | ( | const polyMesh & | mesh ) | [static]
|
Get per edge whether is it master (of a coupled set of edges)
Definition at line 194 of file syncTools.C.
References Foam::abort(), polyMesh::boundaryMesh(), cyclicPolyPatch::coupledEdges(), Foam::FatalError, FatalErrorIn, forAll, polyMesh::globalData(), Pstream::listCombineGather(), Pstream::listCombineScatter(), polyPatch::meshEdges(), Pstream::myProcNo(), IOobject::name(), primitiveMesh::nEdges(), globalMeshData::nGlobalEdges(), processorPolyPatch::owner(), Pstream::parRun(), globalMeshData::sharedEdgeAddr(), and globalMeshData::sharedEdgeLabels().
Referenced by motionSmoother::updateMesh().
Foam::PackedBoolList getMasterFaces | ( | const polyMesh & | mesh ) | [static]
|
Get per face whether is it master (of a coupled set of faces)
Definition at line 313 of file syncTools.C.
References Foam::abort(), polyMesh::boundaryMesh(), Foam::FatalError, FatalErrorIn, forAll, primitiveMesh::nFaces(), processorPolyPatch::owner(), Pstream::parRun(), and polyPatch::start().
Referenced by meshRefinement::countHits(), and meshRefinement::zonify().
void separateList | ( | const vectorField & | separation, |
UList< vector > & | field | ||
) |
Definition at line 362 of file syncTools.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAll, UList< T >::size(), and List< T >::size().
void separateList | ( | const vectorField & | separation, |
Map< vector > & | field | ||
) |
Definition at line 397 of file syncTools.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAllIter, HashTable< T, label, Hash< label > >::size(), and List< T >::size().
void separateList | ( | const vectorField & | separation, |
EdgeMap< vector > & | field | ||
) |
Definition at line 431 of file syncTools.C.
References Foam::abort(), Foam::FatalError, FatalErrorIn, forAllIter, HashTable< T, edge, Hash< edge > >::size(), and List< T >::size().