| 840 | |
| 841 | |
| 842 | bool Foam::cellCuts::walkFace |
| 843 | ( |
| 844 | const label celli, |
| 845 | const label startCut, |
| 846 | const label facei, |
| 847 | const label cut, |
| 848 | |
| 849 | label& lastCut, |
| 850 | label& beforeLastCut, |
| 851 | label& nVisited, |
| 852 | labelList& visited |
| 853 | ) const |
| 854 | { |
| 855 | const labelList& fCuts = faceCuts()[facei]; |
| 856 | |
| 857 | if (fCuts.size() < 2) |
| 858 | { |
| 859 | return false; |
| 860 | } |
| 861 | |
| 862 | // Easy case : two cuts. |
| 863 | if (fCuts.size() == 2) |
| 864 | { |
| 865 | if (fCuts[0] == cut) |
| 866 | { |
| 867 | if (!addCut(celli, cut, nVisited, visited)) |
| 868 | { |
| 869 | return false; |
| 870 | } |
| 871 | |
| 872 | beforeLastCut = cut; |
| 873 | lastCut = fCuts[1]; |
| 874 | |
| 875 | return true; |
| 876 | } |
| 877 | else |
| 878 | { |
| 879 | if (!addCut(celli, cut, nVisited, visited)) |
| 880 | { |
| 881 | return false; |
| 882 | } |
| 883 | |
| 884 | beforeLastCut = cut; |
| 885 | lastCut = fCuts[0]; |
| 886 | |
| 887 | return true; |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | // Harder case: more than 2 cuts on face. |
| 892 | // Should be start or end of string of cuts. Store all but last cut. |
| 893 | if (fCuts[0] == cut) |
| 894 | { |
| 895 | // Walk forward |
| 896 | for (label i = 0; i < fCuts.size()-1; i++) |
| 897 | { |
| 898 | if (!addCut(celli, fCuts[i], nVisited, visited)) |
| 899 | { |
no test coverage detected