57 faceSet::clearStorage();
140 for (label facei = 0; facei < maxLen; ++facei)
149 addressing_.setSize(
n);
153 for (label facei = 0; facei < maxLen; ++facei)
157 addressing_[
n] = facei;
170 DynamicList<label> newAddressing(addressing_.size());
171 DynamicList<bool> newFlipMap(flipMap_.size());
173 Map<label> faceToIndex(addressing_.size());
176 faceToIndex.insert(addressing_[i], i);
179 const faceZoneSet& zoneSet = refCast<const faceZoneSet>(
set);
181 forAll(zoneSet.addressing(), i)
183 const label facei = zoneSet.addressing()[i];
185 const auto iter = faceToIndex.cfind(facei);
189 const label index = *iter;
191 if (zoneSet.flipMap()[i] != flipMap_[index])
195 newAddressing.append(facei);
196 newFlipMap.append(flipMap_[index]);
203 <<
"subset : there are " << nConflict
204 <<
" faces with different orientation in faceZonesSets "
208 addressing_.transfer(newAddressing);
209 flipMap_.transfer(newFlipMap);
224 faceToIndex.insert(addressing_[i], i);
227 const faceZoneSet& zoneSet = refCast<const faceZoneSet>(
set);
229 forAll(zoneSet.addressing(), i)
231 label facei = zoneSet.addressing()[i];
233 const auto iter = faceToIndex.cfind(facei);
237 const label index = *iter;
239 if (zoneSet.flipMap()[i] != flipMap_[index])
246 newAddressing.append(facei);
247 newFlipMap.append(zoneSet.flipMap()[i]);
254 <<
"addSet : there are " << nConflict
255 <<
" faces with different orientation in faceZonesSets "
259 addressing_.transfer(newAddressing);
260 flipMap_.transfer(newFlipMap);
277 faceToIndex.insert(zoneSet.
addressing()[i], i);
282 const label facei = addressing_[i];
284 const auto iter = faceToIndex.cfind(facei);
288 const label index = *iter;
290 if (zoneSet.
flipMap()[index] != flipMap_[i])
298 newAddressing.append(facei);
299 newFlipMap.append(zoneSet.
flipMap()[i]);
306 <<
"subtractSet : there are " << nConflict
307 <<
" faces with different orientation in faceZonesSets "
311 addressing_.transfer(newAddressing);
312 flipMap_.transfer(newFlipMap);
332 <<
" faces that are in the faceZone but not"
333 <<
" in the faceSet or vice versa."
334 <<
" The faceZoneSet should only be manipulated"
335 <<
" using " << setsToFaceZone::typeName
336 <<
" or " << setToFaceZone::typeName <<
endl;
348 const label UNFLIPPED = 1;
349 const label FLIPPED = -1;
360 myZoneFace[bFacei] = FLIPPED;
364 myZoneFace[bFacei] = UNFLIPPED;
379 DynamicList<label> newAddressing(addressing_.size());
380 DynamicList<bool> newFlipMap(flipMap_.size());
384 const label facei = addressing_[i];
387 newAddressing.append(facei);
388 newFlipMap.append(flipMap_[i]);
399 if (neiStat == UNFLIPPED)
402 newAddressing.append(facei);
403 newFlipMap.append(
true);
405 else if (neiStat == FLIPPED)
407 newAddressing.append(facei);
408 newFlipMap.append(
false);
413 if (myStat == neiStat)
416 newAddressing.append(facei);
417 if (isMasterFace[facei])
419 newFlipMap.append(myStat == FLIPPED);
423 newFlipMap.append(neiStat == UNFLIPPED);
428 newAddressing.append(facei);
429 newFlipMap.append(myStat == FLIPPED);
434 addressing_.transfer(newAddressing);
435 flipMap_.transfer(newFlipMap);
453 word oldTypeName = typeName;
454 const_cast<word&
>(
type()) = faceSet::typeName;
456 const_cast<word&
>(
type()) = oldTypeName;
464 zoneID = faceZones.size();
466 faceZones.setSize(
zoneID+1);
482 faceZones[
zoneID].resetAddressing(addressing_, flipMap_);
486 return ok && faceZones.write(valid);
493 labelList newAddressing(addressing_.size());
494 boolList newFlipMap(flipMap_.size(),
false);
499 label facei = addressing_[i];
500 label newFacei = morphMap.reverseFaceMap()[facei];
503 newAddressing[
n] = newFacei;
504 newFlipMap[
n] = flipMap_[i];
508 newAddressing.setSize(
n);
509 newFlipMap.setSize(
n);
511 addressing_.transfer(newAddressing);
512 flipMap_.transfer(newFlipMap);