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... | |
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 59 of file polyMeshAdder.H.
|
static |
Add two polyMeshes. Returns new polyMesh and map construct.
Definition at line 1462 of file polyMeshAdder.C.
References polyMesh::addPatches(), Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), faceCoupleInfo::cutFaces(), Foam::identity(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nPoints(), autoPtr< T >::reset(), UPtrList< T >::size(), and Foam::xferMove().
Referenced by fvMeshAdder::add().
|
static |
Inplace add mesh to polyMesh. Returns map construct.
Definition at line 1685 of file polyMeshAdder.C.
References Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), autoPtr< T >::clear(), polyMeshAdder::findSharedPoints(), forAll, Foam::identity(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nPoints(), PtrList< T >::setSize(), UPtrList< T >::size(), and Foam::xferMove().
|
static |
Find topologically and geometrically shared points.
Old: geometric merging. Causes problems for two close shared points.
labelList sharedToMerged; label nUnique = Foam::mergePoints ( pointField ( 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 2000 of file polyMeshAdder.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::findIndex(), forAll, forAllConstIter(), polyMesh::globalData(), HashTable< T, Key, Hash >::insert(), Foam::invertOneToMany(), Foam::labelMax, Foam::mergePoints(), polyMeshAdder::mergePoints(), Foam::min(), polyMesh::points(), List< T >::setSize(), globalMeshData::sharedPointAddr(), globalMeshData::sharedPointLabels(), and List< T >::size().
Referenced by polyMeshAdder::add(), and fvMeshDistribute::printCoupleInfo().
|
static |
Helper: Merge points.
Definition at line 2212 of file polyMeshAdder.C.
References polyMesh::boundaryMesh(), HashTableCore::end(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), polyMesh::faceZones(), HashTable< T, Key, Hash >::find(), faceZone::flipMap(), forAll, polyMesh::points(), polyTopoChange::removePoint(), polyTopoChange::setAction(), faceZone::whichFace(), polyBoundaryMesh::whichPatch(), and ZoneMesh< ZoneType, MeshType >::whichZone().
Referenced by polyMeshAdder::findSharedPoints(), and fvMeshDistribute::printCoupleInfo().