MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / sync

Function sync

src/meshTools/sets/topoSets/faceZoneSet.C:327–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325
326
327void faceZoneSet::sync(const polyMesh& mesh)
328{
329 // Make sure that the faceZone is consistent with the faceSet
330 {
331 const labelHashSet zoneSet(addressing_);
332
333 // Get elements that are in zone but not faceSet
334 labelHashSet badSet(zoneSet);
335 badSet -= *this;
336
337 // Add elements that are in faceSet but not in zone
338 labelHashSet fSet(*this);
339 fSet -= zoneSet;
340
341 badSet += fSet;
342
343 label nBad = returnReduce(badSet.size(), sumOp<label>());
344
345 if (nBad)
346 {
347 WarningInFunction << "Detected " << nBad
348 << " faces that are in the faceZone but not"
349 << " in the faceSet or vice versa."
350 << " The faceZoneSet should only be manipulated"
351 << " using " << setsToFaceZone::typeName
352 << " or " << setToFaceZone::typeName << endl;
353 }
354 }
355
356
357 // Make sure that on coupled faces orientation is opposite. Pushes
358 // master orientation to slave in case of conflict.
359
360
361 // 0 : not in faceZone
362 // 1 : in faceZone and unflipped
363 //-1 : in faceZone and flipped
364 const label UNFLIPPED = 1;
365 const label FLIPPED = -1;
366 labelList myZoneFace(mesh.nFaces()-mesh.nInternalFaces(), 0);
367
368 forAll(addressing_, i)
369 {
370 label bFacei = addressing_[i]-mesh.nInternalFaces();
371
372 if (bFacei >= 0)
373 {
374 if (flipMap_[i])
375 {
376 myZoneFace[bFacei] = FLIPPED;
377 }
378 else
379 {
380 myZoneFace[bFacei] = UNFLIPPED;
381 }
382 }
383 }
384

Callers

nothing calls this directly

Calls 8

returnReduceFunction · 0.85
updateSetFunction · 0.70
forAllFunction · 0.50
sizeMethod · 0.45
nInternalFacesMethod · 0.45
appendMethod · 0.45
nFacesMethod · 0.45
transferMethod · 0.45

Tested by

no test coverage detected