Adds two meshes without using any polyMesh morphing. More...
Static Public Member Functions | |
static autoPtr< polyMesh > | add (const IOobject &io, const polyMesh &mesh0, const polyMesh &mesh1, const faceCoupleInfo &coupleInfo, autoPtr< mapAddedPolyMesh > &mapPtr) |
Add two polyMeshes. Returns new polyMesh and map construct. More... | |
static autoPtr< mapAddedPolyMesh > | add (polyMesh &mesh0, const polyMesh &mesh1, const faceCoupleInfo &coupleInfo, const bool validBoundary=true) |
Inplace add mesh to polyMesh. Returns map construct. More... | |
static Map< label > | findSharedPoints (const polyMesh &, const scalar mergeTol) |
Find topologically and geometrically shared points. More... | |
static void | mergePoints (const polyMesh &, const Map< label > &pointToMaster, polyTopoChange &meshMod) |
Helper: Merge points. More... | |
static label | procPatchPairs (const UPtrList< polyMesh > &meshes, List< DynamicList< label > > &localPatch, List< DynamicList< label > > &remoteMesh, List< DynamicList< label > > &remotePatch) |
static void | patchFacePairs (const UPtrList< polyMesh > &meshes, const List< DynamicList< label > > &localPatch, const List< DynamicList< label > > &remoteMesh, const List< DynamicList< label > > &remotePatch, labelListList &localBoundaryFace, labelListList &remoteFaceMesh, labelListList &remoteBoundaryFace) |
static void | add (const UPtrList< polyMesh > &meshes, const UList< labelList > &patchMap, const labelListList &localBoundaryFace, const labelListList &remoteFaceMesh, const labelListList &remoteBoundaryFace, const labelListList &remoteFaceStart, const UList< labelList > &pointZoneMap, const UList< labelList > &faceZoneMap, const UList< labelList > &cellZoneMap, polyTopoChange &meshMod, labelListList &cellProcAddressing, labelListList &faceProcAddressing, labelListList &pointProcAddressing) |
Add multiple meshes. More... | |
Adds two meshes without using any polyMesh morphing.
Gets faces to couple as faceCoupleInfo which is list of faces on both meshes. Returns map from last mesh addition.
Definition at line 61 of file polyMeshAdder.H.
|
static |
Add two polyMeshes. Returns new polyMesh and map construct.
Definition at line 1451 of file polyMeshAdder.C.
References polyMesh::addPatches(), polyMesh::boundaryMesh(), faceCoupleInfo::cutFaces(), Foam::identity(), io(), mesh, meshPtr, primitiveMesh::nCells(), Time::New(), primitiveMesh::nFaces(), nFaces(), primitiveMesh::nInternalFaces(), primitiveMesh::nPoints(), autoPtr< T >::reset(), UPtrList< T >::size(), UList< T >::size(), and Foam::Zero.
|
static |
Inplace add mesh to polyMesh. Returns map construct.
Definition at line 1671 of file polyMeshAdder.C.
References polyMesh::boundaryMesh(), polyMesh::cellZones(), ZoneMesh< ZoneType, MeshType >::clear(), polyMesh::faceZones(), forAll, Foam::identity(), primitiveMesh::nCells(), primitiveMesh::nFaces(), nFaces(), primitiveMesh::nPoints(), polyMesh::pointZones(), polyMesh::resetMotion(), polyMesh::resetPrimitives(), PtrList< T >::set(), List< T >::setSize(), PtrList< T >::setSize(), UPtrList< T >::size(), UList< T >::size(), and Foam::Zero.
Find topologically and geometrically shared points.
Old: geometric merging. Causes problems for two close shared points.
labelList sharedToMerged; label nUnique = Foam::mergePoints ( UIndirectList<point>(mesh.points(), sharedPointLabels), mergeDist, false, sharedToMerged );
Find out which sets of points get merged and create a map from mesh point to unique point.
Map<label> pointToMaster(10*sharedToMerged.size());
if (nUnique < sharedPointLabels.size()) { labelListList mergeSets ( invertOneToMany ( sharedToMerged.size(), sharedToMerged ) );
label nMergeSets = 0;
forAll(mergeSets, setI) { const labelList& mergeSet = mergeSets[setI];
if (mergeSet.size() > 1) { Take as master the shared point with the lowest mesh point label. (rather arbitrarily - could use max or any other one of the points)
nMergeSets++;
label masterI = labelMax;
forAll(mergeSet, i) { label sharedI = mergeSet[i];
masterI = min(masterI, sharedPointLabels[sharedI]); }
forAll(mergeSet, i) { label sharedI = mergeSet[i];
pointToMaster.insert(sharedPointLabels[sharedI], masterI); } } }
if (debug) { Pout<< "polyMeshAdder : merging:" << pointToMaster.size() << " into " << nMergeSets << " sets." << endl; } }
Definition at line 1986 of file polyMeshAdder.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), forAll, forAllConstIters, UList< T >::found(), polyMesh::globalData(), HashTable< T, Key, Hash >::insert(), Foam::invertOneToMany(), Foam::labelMax, Foam::mergePoints(), mesh, Foam::min(), polyMesh::points(), List< T >::setSize(), globalMeshData::sharedPointAddr(), globalMeshData::sharedPointLabels(), and UList< T >::size().
|
static |
Helper: Merge points.
Definition at line 2193 of file polyMeshAdder.C.
References polyMesh::boundaryMesh(), HashTable< T, Key, Hash >::cfind(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), polyMesh::faceZones(), faceZone::flipMap(), forAll, mesh, patchID, polyMesh::points(), polyTopoChange::removePoint(), polyTopoChange::setAction(), faceZone::whichFace(), polyBoundaryMesh::whichPatch(), ZoneMesh< ZoneType, MeshType >::whichZone(), and zoneID.
Referenced by meshRefinement::mergePoints().
|
static |
Helper: find pairs of processor patches. Return number of non-processor patches
Definition at line 2323 of file polyMeshAdder.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, meshes(), patchIdentifier::name(), polyBoundaryMesh::names(), processorPolyPatch::neighbProcNo(), polyBoundaryMesh::nNonProcessor(), processorPolyPatch::owner(), and UPtrList< T >::size().
|
static |
Helper: expand list of coupled patches into pairs of coupled faces
Definition at line 2444 of file polyMeshAdder.C.
References polyMesh::boundaryMesh(), forAll, mesh, meshes(), nFaces(), primitiveMesh::nInternalFaces(), List< T >::setSize(), UPtrList< T >::size(), and polyPatch::start().
|
static |
Add multiple meshes.
Definition at line 2668 of file polyMeshAdder.C.
References polyTopoChange::addCell(), polyTopoChange::addFace(), polyTopoChange::addPoint(), polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), polyMesh::cellZones(), List< T >::clear(), Foam::endl(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), polyMesh::faceZones(), forAll, Foam::identity(), mesh, meshes(), IOobject::name(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), nPoints, primitiveMesh::nPoints(), pointLabels(), points, polyMesh::points(), polyMesh::pointZones(), face::reverseFace(), PtrList< T >::set(), List< T >::setSize(), UPtrList< T >::size(), UList< T >::size(), polyPatch::start(), Foam::Swap(), and WarningInFunction.