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

Function setCutEdgeToPoints

src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C:495–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493
494
495void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
496{
497 labelListList masterToCutEdges
498 (
499 invertOneToMany
500 (
501 masterPatch().nEdges(),
502 cutToMasterEdges
503 )
504 );
505
506 const edgeList& cutEdges = cutFaces().edges();
507
508 // Size extra big so searching is faster
509 cutEdgeToPoints_.resize
510 (
511 masterPatch().nEdges()
512 + slavePatch().nEdges()
513 + cutEdges.size()
514 );
515
516 forAll(masterToCutEdges, masterEdgeI)
517 {
518 const edge& masterE = masterPatch().edges()[masterEdgeI];
519
520 //Pout<< "Master:" << masterPatch().localPoints()[masterE[0]] << ' '
521 // << masterPatch().localPoints()[masterE[1]] << endl;
522
523 const labelList& stringedEdges = masterToCutEdges[masterEdgeI];
524
525 if (stringedEdges.empty())
526 {
527 FatalErrorInFunction
528 << "Did not match all of master edges to cutFace edges"
529 << nl
530 << "First unmatched edge:" << masterEdgeI << " endPoints:"
531 << masterPatch().localPoints()[masterE[0]]
532 << masterPatch().localPoints()[masterE[1]]
533 << endl
534 << "This usually means that the slave patch is not a"
535 << " subdivision of the master patch"
536 << abort(FatalError);
537 }
538 else if (stringedEdges.size() > 1)
539 {
540 // String up the edges between e[0] and e[1]. Store the points
541 // inbetween e[0] and e[1] (all in cutFaces() labels)
542
543 DynamicList<label> splitPoints(stringedEdges.size()-1);
544
545 // Unsplit edge endpoints
546 const edge unsplitEdge
547 (
548 masterToCutPoints_[masterE[0]],
549 masterToCutPoints_[masterE[1]]
550 );
551
552 label startVertI = unsplitEdge[0];

Callers 1

subDivisionMatchFunction · 0.85

Calls 11

localPointsMethod · 0.80
shrinkMethod · 0.80
forAllFunction · 0.50
abortFunction · 0.50
edgesMethod · 0.45
resizeMethod · 0.45
nEdgesMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
appendMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected