polyMeshAdder Class Reference

Adds two meshes without using any polyMesh morphing. More...

Inheritance diagram for polyMeshAdder:
[legend]

Static Public Member Functions

static autoPtr< polyMeshadd (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< mapAddedPolyMeshadd (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...
 

Detailed Description

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.

Source files

Definition at line 61 of file polyMeshAdder.H.

Member Function Documentation

◆ add() [1/3]

Foam::autoPtr< Foam::polyMesh > add ( const IOobject io,
const polyMesh mesh0,
const polyMesh mesh1,
const faceCoupleInfo coupleInfo,
autoPtr< mapAddedPolyMesh > &  mapPtr 
)
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.

Here is the call graph for this function:

◆ add() [2/3]

Foam::autoPtr< Foam::mapAddedPolyMesh > add ( polyMesh mesh0,
const polyMesh mesh1,
const faceCoupleInfo coupleInfo,
const bool  validBoundary = true 
)
static

◆ findSharedPoints()

Foam::Map< Foam::label > findSharedPoints ( const polyMesh mesh,
const scalar  mergeTol 
)
static

Find topologically and geometrically shared points.

  • should only be called for parallel correct mesh (since uses mesh.globalData)
  • returns Map from point to master point (all in mesh point labels) for any sets of points that need to be merged.

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().

Here is the call graph for this function:

◆ mergePoints()

void mergePoints ( const polyMesh mesh,
const Map< label > &  pointToMaster,
polyTopoChange meshMod 
)
static

Helper: Merge points.

  • Gets map from point to destination point
  • Removes all points that don't map to themselves
  • Modifies all faces that use the points to be removed.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ procPatchPairs()

Foam::label procPatchPairs ( const UPtrList< polyMesh > &  meshes,
List< DynamicList< label > > &  localPatch,
List< DynamicList< label > > &  remoteMesh,
List< DynamicList< label > > &  remotePatch 
)
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().

Here is the call graph for this function:

◆ patchFacePairs()

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

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().

Here is the call graph for this function:

◆ add() [3/3]

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 
)
static

The documentation for this class was generated from the following files: