| 493 | |
| 494 | |
| 495 | void 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]; |