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 Private Member Functions | |
static label | patchIndex (const polyPatch &, DynamicList< word > &allPatchNames, DynamicList< word > &allPatchTypes) |
Index of patch in allPatches. Add if nonexisting. More... | |
static label | zoneIndex (const word &, DynamicList< word > &) |
Index of zone in all zones. More... | |
static void | mergePatchNames (const polyBoundaryMesh &patches0, const polyBoundaryMesh &patches1, DynamicList< word > &allPatchNames, DynamicList< word > &allPatchTypes, labelList &from1ToAllPatches, labelList &fromAllTo1Patches) |
static labelList | getPatchStarts (const polyBoundaryMesh &) |
Get starts of patches. More... | |
static labelList | getPatchSizes (const polyBoundaryMesh &) |
Get sizes of patches. More... | |
static List< polyPatch * > | combinePatches (const polyMesh &mesh0, const polyMesh &mesh1, const polyBoundaryMesh &allBoundaryMesh, const label nAllPatches, const labelList &fromAllTo1Patches, const label nInternalFaces, const labelList &nFaces, labelList &from0ToAllPatches, labelList &from1ToAllPatches) |
static labelList | getFaceOrder (const cellList &cells, const label nInternalFaces, const labelList &owner, const labelList &neighbour) |
Determine order for internalFaces to be upper-triangular. More... | |
static void | insertVertices (const edgeLookup &cutEdgeToPoints, const Map< label > &meshToMaster, const labelList &masterToCutPoints, const face &masterFace, DynamicList< label > &workFace, face &f) |
Extends face f with split points. cutEdgeToPoints gives for every. More... | |
static void | mergePrimitives (const polyMesh &mesh0, const polyMesh &mesh1, const faceCoupleInfo &coupleInfo, const label nAllPatches, const labelList &fromAllTo1Patches, const labelList &from1ToAllPatches, pointField &allPoints, labelList &from0ToAllPoints, labelList &from1ToAllPoints, faceList &allFaces, labelList &allOwner, labelList &allNeighbour, label &nInternalFaces, labelList &nFacesPerPatch, label &nCells, labelList &from0ToAllFaces, labelList &from1ToAllFaces, labelList &from1ToAllCells) |
Merges primitives of two meshes. More... | |
static void | mergePointZones (const label nAllPoints, const pointZoneMesh &pz0, const pointZoneMesh &pz1, const labelList &from0ToAllPoints, const labelList &from1ToAllPoints, DynamicList< word > &zoneNames, labelList &from1ToAll, List< DynamicList< label > > &pzPoints) |
Merge point zones. More... | |
static void | mergeFaceZones (const labelList &allOwner, const polyMesh &mesh0, const polyMesh &mesh1, const labelList &from0ToAllFaces, const labelList &from1ToAllFaces, const labelList &from1ToAllCells, DynamicList< word > &zoneNames, labelList &from1ToAll, List< DynamicList< label > > &fzFaces, List< DynamicList< bool > > &fzFlips) |
Merge face zones. More... | |
static void | mergeCellZones (const label nAllCells, const cellZoneMesh &cz0, const cellZoneMesh &cz1, const labelList &from1ToAllCells, DynamicList< word > &zoneNames, labelList &from1ToAll, List< DynamicList< label > > &czCells) |
Merge cell zones. More... | |
static void | mergeZones (const label nAllPoints, const labelList &allOwner, const label nAllCells, const polyMesh &mesh0, const polyMesh &mesh1, const labelList &from0ToAllPoints, const labelList &from0ToAllFaces, const labelList &from1ToAllPoints, const labelList &from1ToAllFaces, const labelList &from1ToAllCells, DynamicList< word > &pointZoneNames, List< DynamicList< label > > &pzPoints, DynamicList< word > &faceZoneNames, List< DynamicList< label > > &fzFaces, List< DynamicList< bool > > &fzFlips, DynamicList< word > &cellZoneNames, List< DynamicList< label > > &czCells) |
Merge point/face/cell zone information. More... | |
static void | addZones (const DynamicList< word > &pointZoneNames, const List< DynamicList< label > > &pzPoints, const DynamicList< word > &faceZoneNames, const List< DynamicList< label > > &fzFaces, const List< DynamicList< bool > > &fzFlips, const DynamicList< word > &cellZoneNames, const List< DynamicList< label > > &czCells, polyMesh &mesh) |
Create new zones and add to new mesh. 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.
|
staticprivate |
Index of patch in allPatches. Add if nonexisting.
Definition at line 43 of file polyMeshAdder.C.
References DynamicList::append(), Foam::endl(), Foam::findIndex(), p, and Foam::Pout.
|
staticprivate |
Index of zone in all zones.
Definition at line 94 of file polyMeshAdder.C.
References DynamicList::append(), and Foam::findIndex().
|
staticprivate |
Definition at line 116 of file polyMeshAdder.C.
References DynamicList::append(), forAll, polyBoundaryMesh::names(), List::setSize(), DynamicList::shrink(), PtrList::size(), and polyBoundaryMesh::types().
|
staticprivate |
Get starts of patches.
Definition at line 165 of file polyMeshAdder.C.
|
staticprivate |
Get sizes of patches.
Definition at line 179 of file polyMeshAdder.C.
|
staticprivate |
Definition at line 193 of file polyMeshAdder.C.
References DynamicList::append(), polyMesh::boundaryMesh(), forAll, List::setSize(), DynamicList::shrink(), and PtrList::size().
|
staticprivate |
Determine order for internalFaces to be upper-triangular.
Does not change order of external faces.
Definition at line 311 of file polyMeshAdder.C.
References Foam::abort(), cells, Foam::FatalError, FatalErrorInFunction, forAll, SortableList::indices(), List::size(), and SortableList::sort().
|
staticprivate |
Extends face f with split points. cutEdgeToPoints gives for every.
edge the points introduced inbetween the endpoints.
Definition at line 398 of file polyMeshAdder.C.
References DynamicList::append(), DynamicList::clear(), Foam::constant::electromagnetic::e, HashTable::find(), forAll, forAllReverse, face::nextLabel(), List::size(), and List::transfer().
|
staticprivate |
Merges primitives of two meshes.
Definition at line 483 of file polyMeshAdder.C.
References Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), primitiveMesh::cells(), faceCoupleInfo::cutEdgeToPoints(), faceCoupleInfo::cutFaces(), faceCoupleInfo::cutPoints(), faceCoupleInfo::cutToMasterFaces(), faceCoupleInfo::cutToSlaveFaces(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), forAll, HashTable::found(), getFaceOrder(), Foam::inplaceRenumber(), Foam::inplaceReorder(), HashSet< Key, Hash >::insert(), Foam::invertOneToMany(), faceCoupleInfo::masterPatch(), faceCoupleInfo::masterToCutPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), primitiveMesh::nPoints(), polyMesh::points(), renumber(), List::setSize(), List::size(), PtrList::size(), faceCoupleInfo::slavePatch(), faceCoupleInfo::slaveToCutPoints(), polyPatch::start(), and polyBoundaryMesh::whichPatch().
|
staticprivate |
Merge point zones.
Definition at line 866 of file polyMeshAdder.C.
References List::append(), DynamicList::append(), Foam::findIndex(), forAll, Foam::name(), ZoneMesh::names(), nPoints, pZones(), DynamicList::setCapacity(), List::setSize(), DynamicList::shrink(), and Foam::stableSort().
|
staticprivate |
Merge face zones.
Definition at line 1001 of file polyMeshAdder.C.
References List::append(), DynamicList::append(), polyMesh::faceOwner(), polyMesh::faceZones(), Foam::findIndex(), forAll, Foam::name(), ZoneMesh::names(), DynamicList::setCapacity(), List::setSize(), DynamicList::shrink(), List::size(), and Foam::sortedOrder().
|
staticprivate |
Merge cell zones.
Definition at line 1193 of file polyMeshAdder.C.
References List::append(), DynamicList::append(), Foam::findIndex(), forAll, Foam::name(), ZoneMesh::names(), DynamicList::setCapacity(), List::setSize(), DynamicList::shrink(), and Foam::stableSort().
|
staticprivate |
Merge point/face/cell zone information.
Definition at line 1323 of file polyMeshAdder.C.
References polyMesh::cellZones(), and polyMesh::pointZones().
|
staticprivate |
Create new zones and add to new mesh.
Definition at line 1394 of file polyMeshAdder.C.
References forAll, mesh, and pZones().
|
static |
Add two polyMeshes. Returns new polyMesh and map construct.
Definition at line 1462 of file polyMeshAdder.C.
References Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), faceCoupleInfo::cutFaces(), Foam::identity(), mesh, primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), primitiveMesh::nPoints(), autoPtr::reset(), PtrList::size(), and Foam::xferMove().
|
static |
Inplace add mesh to polyMesh. Returns map construct.
Definition at line 1685 of file polyMeshAdder.C.
References Foam::DelaunayMeshTools::allPoints(), polyMesh::boundaryMesh(), polyMesh::cellZones(), ZoneMesh::clear(), polyMesh::faceZones(), forAll, Foam::identity(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nPoints(), polyMesh::pointZones(), polyMesh::resetMotion(), polyMesh::resetPrimitives(), PtrList::set(), List::setSize(), PtrList::setSize(), List::size(), PtrList::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(), Foam::invertOneToMany(), Foam::labelMax, Foam::mergePoints(), mesh, Foam::min(), List::setSize(), and List::size().
Referenced by fvMeshDistribute::mergeSharedPoints(), and mergeSharedPoints().
|
static |
Helper: Merge points.
Definition at line 2212 of file polyMeshAdder.C.
References f(), faceZone::flipMap(), forAll, mesh, polyTopoChange::removePoint(), polyTopoChange::setAction(), and faceZone::whichFace().
Referenced by meshRefinement::mergePoints(), fvMeshDistribute::mergeSharedPoints(), and mergeSharedPoints().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.