41 bool Foam::layerAdditionRemoval::setLayerPairing()
const
61 mesh.faceZones()[faceZoneID_.
index()].masterCells();
66 mesh.faceZones()[faceZoneID_.
index()].flipMap();
73 mesh.faceZones()[faceZoneID_.
index()]().localFaces();
76 mesh.faceZones()[faceZoneID_.
index()]().meshPoints();
80 if (pointsPairingPtr_ || facesPairingPtr_)
83 <<
"Problem with layer pairing data"
87 pointsPairingPtr_.reset(
new labelList(meshPoints.size(), -1));
88 facesPairingPtr_.reset(
new labelList(mf.size(), -1));
90 auto& ptc = *pointsPairingPtr_;
91 auto& ftc = *facesPairingPtr_;
95 Pout<<
"meshPoints: " << meshPoints <<
nl
97 <<
mesh.faceZones()[faceZoneID_.
index()]().localPoints()
102 label nPointErrors = 0;
103 label nFaceErrors = 0;
108 face curLocalFace = mlf[facei];
117 oppositeFace lidFace =
118 cells[mc[facei]].opposingFace(mf[facei], faces);
120 if (!lidFace.found())
129 Pout<<
"curMasterFace: " << faces[mf[facei]] <<
nl
130 <<
"cell shape: " <<
mesh.cellShapes()[mc[facei]] <<
nl
131 <<
"curLocalFace: " << curLocalFace <<
nl
132 <<
"lidFace: " << lidFace
133 <<
" master index: " << lidFace.masterIndex()
134 <<
" oppositeIndex: " << lidFace.oppositeIndex() <<
endl;
138 ftc[facei] = lidFace.oppositeIndex();
141 forAll(curLocalFace, pointi)
143 const label clp = curLocalFace[pointi];
148 ptc[clp] = lidFace[pointi];
153 if (ptc[clp] != lidFace[pointi])
159 Pout<<
"Topological error in cell layer pairing. "
160 <<
"This mesh is either topologically incorrect "
161 <<
"or the master face layer is not defined "
162 <<
"consistently. Please check the "
163 <<
"face zone flip map." <<
nl
164 <<
"First index: " << ptc[clp]
165 <<
" new index: " << lidFace[pointi] <<
endl;
172 reduce(nPointErrors, sumOp<label>());
173 reduce(nFaceErrors, sumOp<label>());
175 if (nPointErrors > 0 || nFaceErrors > 0)
187 const Foam::labelList& Foam::layerAdditionRemoval::pointsPairing()
const
189 if (!pointsPairingPtr_)
192 <<
"Problem with layer pairing data for object " <<
name()
196 return *pointsPairingPtr_;
200 const Foam::labelList& Foam::layerAdditionRemoval::facesPairing()
const
202 if (!facesPairingPtr_)
205 <<
"Problem with layer pairing data for object " <<
name()
209 return *facesPairingPtr_;
222 Pout<<
"void layerAdditionRemoval::modifyMotionPoints("
223 <<
"pointField& motionPoints) const for object "
229 Pout<<
"No motion point adjustment" <<
endl;