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

Function conservativeValidLoop

src/dynamicMesh/meshCut/cellCuts/cellCuts.C:1858–1946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1856
1857
1858bool Foam::cellCuts::conservativeValidLoop
1859(
1860 const label celli,
1861 const labelList& loop
1862) const
1863{
1864
1865 if (loop.size() < 2)
1866 {
1867 return false;
1868 }
1869
1870 forAll(loop, cutI)
1871 {
1872 if (isEdge(loop[cutI]))
1873 {
1874 label edgeI = getEdge(loop[cutI]);
1875
1876 if (edgeIsCut_[edgeI])
1877 {
1878 // edge compatibility already checked.
1879 }
1880 else
1881 {
1882 // Quick rejection: vertices of edge itself cannot be cut.
1883 const edge& e = mesh().edges()[edgeI];
1884
1885 if (pointIsCut_[e.start()] || pointIsCut_[e.end()])
1886 {
1887 return false;
1888 }
1889
1890
1891 // Check faces using this edge
1892 const labelList& eFaces = mesh().edgeFaces()[edgeI];
1893
1894 forAll(eFaces, eFacei)
1895 {
1896 label nCuts = countFaceCuts(eFaces[eFacei], loop);
1897
1898 if (nCuts > 2)
1899 {
1900 return false;
1901 }
1902 }
1903 }
1904 }
1905 else
1906 {
1907 // Vertex cut
1908
1909 label vertI = getVertex(loop[cutI]);
1910
1911 if (!pointIsCut_[vertI])
1912 {
1913 // New cut through vertex.
1914
1915 // Check edges using vertex.

Callers 1

validLoopFunction · 0.85

Calls 6

meshFunction · 0.85
forAllFunction · 0.50
sizeMethod · 0.45
edgesMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected