| 43 | #define w11 w[11][k] |
| 44 | |
| 45 | void Foam::block::createPoints() |
| 46 | { |
| 47 | // Set local variables for mesh specification |
| 48 | const label ni = density().x(); |
| 49 | const label nj = density().y(); |
| 50 | const label nk = density().z(); |
| 51 | |
| 52 | const point& p000 = blockPoint(0); |
| 53 | const point& p100 = blockPoint(1); |
| 54 | const point& p110 = blockPoint(2); |
| 55 | const point& p010 = blockPoint(3); |
| 56 | |
| 57 | const point& p001 = blockPoint(4); |
| 58 | const point& p101 = blockPoint(5); |
| 59 | const point& p111 = blockPoint(6); |
| 60 | const point& p011 = blockPoint(7); |
| 61 | |
| 62 | // List of edge point and weighting factors |
| 63 | pointField p[12]; |
| 64 | scalarList w[12]; |
| 65 | label nCurvedEdges = edgesPointsWeights(p, w); |
| 66 | |
| 67 | points_.setSize(nPoints()); |
| 68 | |
| 69 | points_[pointLabel(0, 0, 0)] = p000; |
| 70 | points_[pointLabel(ni, 0, 0)] = p100; |
| 71 | points_[pointLabel(ni, nj, 0)] = p110; |
| 72 | points_[pointLabel(0, nj, 0)] = p010; |
| 73 | points_[pointLabel(0, 0, nk)] = p001; |
| 74 | points_[pointLabel(ni, 0, nk)] = p101; |
| 75 | points_[pointLabel(ni, nj, nk)] = p111; |
| 76 | points_[pointLabel(0, nj, nk)] = p011; |
| 77 | |
| 78 | for (label k=0; k<=nk; k++) |
| 79 | { |
| 80 | for (label j=0; j<=nj; j++) |
| 81 | { |
| 82 | for (label i=0; i<=ni; i++) |
| 83 | { |
| 84 | // Skip block vertices |
| 85 | if (vertex(i, j, k)) continue; |
| 86 | |
| 87 | const label vijk = pointLabel(i, j, k); |
| 88 | |
| 89 | // Calculate the weighting factors for all edges |
| 90 | |
| 91 | // x-direction |
| 92 | scalar wx1 = (1 - w0)*(1 - w4)*(1 - w8) + w0*(1 - w5)*(1 - w9); |
| 93 | scalar wx2 = (1 - w1)*w4*(1 - w11) + w1*w5*(1 - w10); |
| 94 | scalar wx3 = (1 - w2)*w7*w11 + w2*w6*w10; |
| 95 | scalar wx4 = (1 - w3)*(1 - w7)*w8 + w3*(1 - w6)*w9; |
| 96 | |
| 97 | const scalar sumWx = wx1 + wx2 + wx3 + wx4; |
| 98 | wx1 /= sumWx; |
| 99 | wx2 /= sumWx; |
| 100 | wx3 /= sumWx; |
| 101 | wx4 /= sumWx; |
| 102 | |