| 1268 | } |
| 1269 | |
| 1270 | void vtkHigherOrderWedge::SetUniformOrderFromNumPoints(vtkIdType numPts) |
| 1271 | { |
| 1272 | const double n = static_cast<double>(numPts); |
| 1273 | static const double third(1. / 3.); |
| 1274 | static const double ninth(1. / 9.); |
| 1275 | static const double twentyseventh(1. / 27.); |
| 1276 | const double term = |
| 1277 | std::cbrt(third * sqrt(third) * sqrt((27.0 * n - 2.0) * n) + n - twentyseventh); |
| 1278 | int deg = static_cast<int>(round(term + ninth / term - 4 * third)); |
| 1279 | |
| 1280 | #ifdef VTK_21_POINT_WEDGE |
| 1281 | if (numPts == 21) |
| 1282 | { |
| 1283 | deg = 2; |
| 1284 | } |
| 1285 | #endif |
| 1286 | |
| 1287 | this->SetOrder(deg, deg, deg, numPts); |
| 1288 | } |
| 1289 | |
| 1290 | void vtkHigherOrderWedge::SetOrder(int s, int t, int u, vtkIdType numPts) |
| 1291 | { |