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) |
Helper: find pairs of processor patches. Return number of non-processor patches. More... | |
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) |
Helper: expand list of coupled patches into pairs of coupled faces. More... | |
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 57 of file polyMeshAdder.H.
|
static |
Add two polyMeshes. Returns new polyMesh and map construct.
Definition at line 1402 of file polyMeshAdder.C.
References polyMesh::addPatches(), Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), faceCoupleInfo::cutFaces(), Foam::identity(), io(), mesh, meshPtr, primitiveMesh::nCells(), autoPtr< T >::New(), primitiveMesh::nFaces(), primitiveMesh::nPoints(), polyBoundaryMesh::patchSizes(), polyBoundaryMesh::patchStarts(), autoPtr< T >::reset(), UPtrList< T >::size(), and Foam::Zero.
Referenced by fvMeshAdder::add().
|
static |
Inplace add mesh to polyMesh. Returns map construct.
Definition at line 1622 of file polyMeshAdder.C.
References Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), autoPtr< T >::clear(), forAll, Foam::identity(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nPoints(), polyBoundaryMesh::patchSizes(), polyBoundaryMesh::patchStarts(), PtrList< T >::setSize(), UPtrList< 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 1937 of file polyMeshAdder.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, UList< T >::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 2147 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(), and ZoneMesh< ZoneType, MeshType >::whichZone().
Referenced by meshRefinement::mergePoints().
|
static |
Helper: find pairs of processor patches. Return number of non-processor patches.
Definition at line 2277 of file polyMeshAdder.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, meshes(), Foam::PtrListOps::names(), polyBoundaryMesh::names(), polyBoundaryMesh::nNonProcessor(), pbm, pp(), and UPtrList< T >::size().
|
static |
Helper: expand list of coupled patches into pairs of coupled faces.
Definition at line 2398 of file polyMeshAdder.C.
References polyMesh::boundaryMesh(), forAll, mesh, meshes(), primitiveMesh::nInternalFaces(), pbm, pp(), List< T >::setSize(), and UPtrList< T >::size().
|
static |
Add multiple meshes.
Definition at line 2622 of file polyMeshAdder.C.
References polyTopoChange::addCell(), polyTopoChange::addFace(), polyTopoChange::addPoint(), DynamicList< T, SizeMin >::append(), polyMesh::boundaryMesh(), polyMesh::cellZones(), List< T >::clear(), DynamicList< T, SizeMin >::clear(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), polyMesh::faceZones(), face::flip(), forAll, Foam::identity(), Foam::inplaceRenumber(), mesh, meshes(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), nPoints, primitiveMesh::nPoints(), pbm, points, polyMesh::points(), polyMesh::pointZones(), pp(), PtrList< T >::set(), List< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), and ZoneMesh< ZoneType, MeshType >::whichZones().