35 Foam::attachDetach::pointMatchMap()
const 37 if (!pointMatchMapPtr_)
42 return *pointMatchMapPtr_;
46 void Foam::attachDetach::calcPointMatchMap()
const 50 Pout<<
"void attachDetach::calcPointMatchMap() const " 51 <<
" for object " <<
name() <<
" : " 52 <<
"Calculating point matching" <<
endl;
55 if (pointMatchMapPtr_)
58 <<
"Point match map already calculated for object " <<
name()
63 const faceList& faces = mesh.faces();
65 const polyPatch& masterPatch = mesh.boundaryMesh()[masterPatchID_.
index()];
66 const polyPatch& slavePatch = mesh.boundaryMesh()[slavePatchID_.
index()];
75 const label slavePatchStart = slavePatch.start();
77 forAll(reverseSlavePatch, facei)
79 reverseSlavePatch[facei] =
80 faces[slavePatchStart + facei].reverseFace();
84 const labelList& masterMeshPoints = masterPatch.meshPoints();
85 const labelList& slaveMeshPoints = reverseSlavePatch.meshPoints();
87 const faceList& masterLocalFaces = masterPatch.localFaces();
88 const faceList& slaveLocalFaces = reverseSlavePatch.localFaces();
90 pointMatchMapPtr_ =
new Map<label>(2*slaveMeshPoints.size());
91 Map<label>& removedPointMap = *pointMatchMapPtr_;
93 forAll(masterLocalFaces, facei)
95 const face& curMasterPoints = masterLocalFaces[facei];
96 const face& curSlavePoints = slaveLocalFaces[facei];
98 forAll(curMasterPoints, pointi)
105 masterMeshPoints[curMasterPoints[pointi]]
106 != slaveMeshPoints[curSlavePoints[pointi]]
116 removedPointMap.insert
118 slaveMeshPoints[curSlavePoints[pointi]],
119 masterMeshPoints[curMasterPoints[pointi]]
127 Pout<<
"void attachDetach::calcPointMatchMap() const " 128 <<
" for object " <<
name() <<
" : " 129 <<
"Finished calculating point matching" <<
endl;
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< label > labelList
A List of labels.
errorManip< error > abort(error &err)
label index() const
Return index of first matching zone.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
const polyTopoChanger & topoChanger() const
Return reference to morph engine.
prefixOSstream Pout(cout, "Pout")
const word & name() const
Return name of this modifier.
const polyMesh & mesh() const
Return the mesh reference.
A HashTable to objects of type <T> with a label key.