| 761 | |
| 762 | |
| 763 | bool Foam::cellCuts::crossEdge |
| 764 | ( |
| 765 | const label celli, |
| 766 | const label startCut, |
| 767 | const label facei, |
| 768 | const label otherCut, |
| 769 | |
| 770 | label& nVisited, |
| 771 | labelList& visited |
| 772 | ) const |
| 773 | { |
| 774 | // Cross edge to other face |
| 775 | label edgeI = getEdge(otherCut); |
| 776 | |
| 777 | label otherFacei = meshTools::otherFace(mesh(), celli, facei, edgeI); |
| 778 | |
| 779 | // Store old state |
| 780 | label oldNVisited = nVisited; |
| 781 | |
| 782 | // Recurse to otherCut |
| 783 | bool foundLoop = |
| 784 | walkCell |
| 785 | ( |
| 786 | celli, |
| 787 | startCut, |
| 788 | otherFacei, |
| 789 | otherCut, |
| 790 | nVisited, |
| 791 | visited |
| 792 | ); |
| 793 | |
| 794 | if (foundLoop) |
| 795 | { |
| 796 | return true; |
| 797 | } |
| 798 | else |
| 799 | { |
| 800 | // No success. Restore state (i.e. backtrack) |
| 801 | nVisited = oldNVisited; |
| 802 | |
| 803 | return false; |
| 804 | } |
| 805 | } |
| 806 | |
| 807 | |
| 808 | bool Foam::cellCuts::addCut |