Return true if angle between faces using it is larger than certain value.
| 111 | |
| 112 | // Return true if angle between faces using it is larger than certain value. |
| 113 | bool Foam::cellFeatures::isCellFeatureEdge |
| 114 | ( |
| 115 | const scalar minCos, |
| 116 | const label edgeI |
| 117 | ) const |
| 118 | { |
| 119 | // Get the two faces using this edge |
| 120 | |
| 121 | label face0; |
| 122 | label face1; |
| 123 | meshTools::getEdgeFaces(mesh_, celli_, edgeI, face0, face1); |
| 124 | |
| 125 | // Check the angle between them by comparing the face normals. |
| 126 | |
| 127 | vector n0 = mesh_.faceAreas()[face0]; |
| 128 | n0 /= mag(n0); |
| 129 | |
| 130 | vector n1 = mesh_.faceAreas()[face1]; |
| 131 | n1 /= mag(n1); |
| 132 | |
| 133 | scalar cosAngle = n0 & n1; |
| 134 | |
| 135 | |
| 136 | const edge& e = mesh_.edges()[edgeI]; |
| 137 | |
| 138 | const face& f0 = mesh_.faces()[face0]; |
| 139 | |
| 140 | label face0Start = findIndex(f0, e.start()); |
| 141 | label face0End = f0.fcIndex(face0Start); |
| 142 | |
| 143 | const face& f1 = mesh_.faces()[face1]; |
| 144 | |
| 145 | label face1Start = findIndex(f1, e.start()); |
| 146 | label face1End = f1.fcIndex(face1Start); |
| 147 | |
| 148 | if |
| 149 | ( |
| 150 | ( |
| 151 | (f0[face0End] == e.end()) |
| 152 | && (f1[face1End] != e.end()) |
| 153 | ) |
| 154 | || ( |
| 155 | (f0[face0End] != e.end()) |
| 156 | && (f1[face1End] == e.end()) |
| 157 | ) |
| 158 | ) |
| 159 | { |
| 160 | } |
| 161 | else |
| 162 | { |
| 163 | cosAngle = -cosAngle; |
| 164 | } |
| 165 | |
| 166 | if (cosAngle < minCos) |
| 167 | { |
| 168 | return true; |
| 169 | } |
| 170 | else |
no test coverage detected