40 bool Foam::layerAdditionRemoval::setLayerPairing()
const
60 mesh.faceZones()[faceZoneID_.
index()].masterCells();
65 mesh.faceZones()[faceZoneID_.
index()].flipMap();
72 mesh.faceZones()[faceZoneID_.
index()]().localFaces();
75 mesh.faceZones()[faceZoneID_.
index()]().meshPoints();
79 if (pointsPairingPtr_ || facesPairingPtr_)
82 <<
"Problem with layer pairing data"
86 pointsPairingPtr_ =
new labelList(meshPoints.size(), -1);
89 facesPairingPtr_ =
new labelList(mf.size(), -1);
94 Pout<<
"meshPoints: " << meshPoints <<
nl
96 <<
mesh.faceZones()[faceZoneID_.
index()]().localPoints()
101 label nPointErrors = 0;
102 label nFaceErrors = 0;
107 face curLocalFace = mlf[facei];
116 oppositeFace lidFace =
117 cells[mc[facei]].opposingFace(mf[facei], faces);
119 if (!lidFace.found())
128 Pout<<
"curMasterFace: " << faces[mf[facei]] <<
nl
129 <<
"cell shape: " <<
mesh.cellShapes()[mc[facei]] <<
nl
130 <<
"curLocalFace: " << curLocalFace <<
nl
131 <<
"lidFace: " << lidFace
132 <<
" master index: " << lidFace.masterIndex()
133 <<
" oppositeIndex: " << lidFace.oppositeIndex() <<
endl;
137 ftc[facei] = lidFace.oppositeIndex();
140 forAll(curLocalFace, pointi)
142 const label clp = curLocalFace[pointi];
147 ptc[clp] = lidFace[pointi];
152 if (ptc[clp] != lidFace[pointi])
158 Pout<<
"Topological error in cell layer pairing. "
159 <<
"This mesh is either topologically incorrect "
160 <<
"or the master face layer is not defined "
161 <<
"consistently. Please check the "
162 <<
"face zone flip map." <<
nl
163 <<
"First index: " << ptc[clp]
164 <<
" new index: " << lidFace[pointi] <<
endl;
171 reduce(nPointErrors, sumOp<label>());
172 reduce(nFaceErrors, sumOp<label>());
174 if (nPointErrors > 0 || nFaceErrors > 0)
188 const Foam::labelList& Foam::layerAdditionRemoval::pointsPairing()
const
190 if (!pointsPairingPtr_)
193 <<
"Problem with layer pairing data for object " <<
name()
197 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;