61 for (
label j = 0; j <= nj; j++)
63 for (
label i = 0; i <= ni; i++)
68 vector edgex1 = p000 + (p100 - p000)*
w[0][i];
69 vector edgex2 = p010 + (p110 - p010)*
w[1][i];
70 vector edgex3 = p011 + (p111 - p011)*
w[2][i];
71 vector edgex4 = p001 + (p101 - p001)*
w[3][i];
73 vector edgey1 = p000 + (p010 - p000)*
w[4][j];
74 vector edgey2 = p100 + (p110 - p100)*
w[5][j];
75 vector edgey3 = p101 + (p111 - p101)*
w[6][j];
76 vector edgey4 = p001 + (p011 - p001)*
w[7][j];
78 vector edgez1 = p000 + (p001 - p000)*
w[8][
k];
79 vector edgez2 = p100 + (p101 - p100)*
w[9][
k];
80 vector edgez3 = p110 + (p111 - p110)*
w[10][
k];
81 vector edgez4 = p010 + (p011 - p010)*
w[11][
k];
89 (1.0 -
w[0][i])*(1.0 -
w[4][j])*(1.0 -
w[8][
k])
90 +
w[0][i]*(1.0 -
w[5][j])*(1.0 -
w[9][
k])
95 (1.0 -
w[1][i])*
w[4][j]*(1.0 -
w[11][
k])
96 +
w[1][i]*
w[5][j]*(1.0 -
w[10][
k])
101 (1.0 -
w[2][i])*
w[7][j]*
w[11][
k]
102 +
w[2][i]*
w[6][j]*
w[10][
k]
107 (1.0 -
w[3][i])*(1.0 -
w[7][j])*
w[8][
k]
108 +
w[3][i]*(1.0 -
w[6][j])*
w[9][
k]
111 scalar magImpx = impx1 + impx2 + impx3 + impx4;
121 (1.0 -
w[4][j])*(1.0 -
w[0][i])*(1.0 -
w[8][
k])
122 +
w[4][j]*(1.0 -
w[1][i])*(1.0 -
w[11][
k])
127 (1.0 -
w[5][j])*
w[0][i]*(1.0 -
w[9][
k])
128 +
w[5][j]*
w[1][i]*(1.0 -
w[10][
k])
133 (1.0 -
w[6][j])*
w[3][i]*
w[9][
k]
134 +
w[6][j]*
w[2][i]*
w[10][
k]
139 (1.0 -
w[7][j])*(1.0 -
w[3][i])*
w[8][
k]
140 +
w[7][j]*(1.0 -
w[2][i])*
w[11][
k]
143 scalar magImpy = impy1 + impy2 + impy3 + impy4;
153 (1.0 -
w[8][
k])*(1.0 -
w[0][i])*(1.0 -
w[4][j])
154 +
w[8][
k]*(1.0 -
w[3][i])*(1.0 -
w[7][j])
159 (1.0 -
w[9][
k])*
w[0][i]*(1.0 -
w[5][j])
160 +
w[9][
k]*
w[3][i]*(1.0 -
w[6][j])
165 (1.0 -
w[10][
k])*
w[1][i]*
w[5][j]
166 +
w[10][
k]*
w[2][i]*
w[6][j]
171 (1.0 -
w[11][
k])*(1.0 -
w[1][i])*
w[4][j]
172 +
w[11][
k]*(1.0 -
w[2][i])*
w[7][j]
175 scalar magImpz = impz1 + impz2 + impz3 + impz4;
183 vector corx1 = impx1*(
p[0][i] - edgex1);
184 vector corx2 = impx2*(
p[1][i] - edgex2);
185 vector corx3 = impx3*(
p[2][i] - edgex3);
186 vector corx4 = impx4*(
p[3][i] - edgex4);
188 vector cory1 = impy1*(
p[4][j] - edgey1);
189 vector cory2 = impy2*(
p[5][j] - edgey2);
190 vector cory3 = impy3*(
p[6][j] - edgey3);
191 vector cory4 = impy4*(
p[7][j] - edgey4);
193 vector corz1 = impz1*(
p[8][
k] - edgez1);
194 vector corz2 = impz2*(
p[9][
k] - edgez2);
195 vector corz3 = impz3*(
p[10][
k] - edgez3);
196 vector corz4 = impz4*(
p[11][
k] - edgez4);
223 edgex1 + edgex2 + edgex3 + edgex4
224 + edgey1 + edgey2 + edgey3 + edgey4
225 + edgez1 + edgez2 + edgez3 + edgez4
230 corx1 + corx2 + corx3 + corx4
231 + cory1 + cory2 + cory3 + cory4
232 + corz1 + corz2 + corz3 + corz4
242 const label ni = meshDensity().x();
243 const label nj = meshDensity().y();
244 const label nk = meshDensity().z();
250 cells_.setSize(nCells());
256 for (
label j = 0; j < nj; j++)
258 for (
label i = 0; i < ni; i++)
260 cells_[cellNo].setSize(8);
262 cells_[cellNo][0] = vtxLabel(i, j,
k);
263 cells_[cellNo][1] = vtxLabel(i+1, j,
k);
264 cells_[cellNo][2] = vtxLabel(i+1, j+1,
k);
265 cells_[cellNo][3] = vtxLabel(i, j+1,
k);
266 cells_[cellNo][4] = vtxLabel(i, j,
k+1);
267 cells_[cellNo][5] = vtxLabel(i+1, j,
k+1);
268 cells_[cellNo][6] = vtxLabel(i+1, j+1,
k+1);
269 cells_[cellNo][7] = vtxLabel(i, j+1,
k+1);
279 const label ni = meshDensity().x();
280 const label nj = meshDensity().y();
281 const label nk = meshDensity().z();
286 boundaryPatches_.clear();
287 boundaryPatches_.setSize(6);
293 label wallCellLabel = 0;
296 boundaryPatches_[wallLabel].setSize(nj*nk);
299 for (
label j = 0; j < nj; j++)
301 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
304 boundaryPatches_[wallLabel][wallCellLabel][0] =
306 boundaryPatches_[wallLabel][wallCellLabel][1] =
307 vtxLabel(0, j,
k + 1);
308 boundaryPatches_[wallLabel][wallCellLabel][2] =
309 vtxLabel(0, j + 1,
k + 1);
310 boundaryPatches_[wallLabel][wallCellLabel][3] =
311 vtxLabel(0, j + 1,
k);
322 boundaryPatches_[wallLabel].setSize(nj*nk);
326 for (
label j = 0; j < nj; j++)
328 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
331 boundaryPatches_[wallLabel][wallCellLabel][0] =
333 boundaryPatches_[wallLabel][wallCellLabel][1] =
334 vtxLabel(ni, j+1,
k);
335 boundaryPatches_[wallLabel][wallCellLabel][2] =
336 vtxLabel(ni, j+1,
k+1);
337 boundaryPatches_[wallLabel][wallCellLabel][3] =
338 vtxLabel(ni, j,
k+1);
351 boundaryPatches_[wallLabel].setSize(ni*nk);
352 for (
label i = 0; i < ni; i++)
356 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
359 boundaryPatches_[wallLabel][wallCellLabel][0] =
361 boundaryPatches_[wallLabel][wallCellLabel][1] =
362 vtxLabel(i + 1, 0,
k);
363 boundaryPatches_[wallLabel][wallCellLabel][2] =
364 vtxLabel(i + 1, 0,
k + 1);
365 boundaryPatches_[wallLabel][wallCellLabel][3] =
366 vtxLabel(i, 0,
k + 1);
377 boundaryPatches_[wallLabel].setSize(ni*nk);
379 for (
label i = 0; i < ni; i++)
383 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
386 boundaryPatches_[wallLabel][wallCellLabel][0] =
388 boundaryPatches_[wallLabel][wallCellLabel][1] =
389 vtxLabel(i, nj,
k + 1);
390 boundaryPatches_[wallLabel][wallCellLabel][2] =
391 vtxLabel(i + 1, nj,
k + 1);
392 boundaryPatches_[wallLabel][wallCellLabel][3] =
393 vtxLabel(i + 1, nj,
k);
406 boundaryPatches_[wallLabel].setSize(ni*nj);
408 for (
label i = 0; i < ni; i++)
410 for (
label j = 0; j < nj; j++)
412 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
415 boundaryPatches_[wallLabel][wallCellLabel][0] =
417 boundaryPatches_[wallLabel][wallCellLabel][1] =
418 vtxLabel(i, j + 1, 0);
419 boundaryPatches_[wallLabel][wallCellLabel][2] =
420 vtxLabel(i + 1, j + 1, 0);
421 boundaryPatches_[wallLabel][wallCellLabel][3] =
422 vtxLabel(i + 1, j, 0);
433 boundaryPatches_[wallLabel].setSize(ni*nj);
435 for (
label i = 0; i < ni; i++)
437 for (
label j = 0; j < nj; j++)
439 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
442 boundaryPatches_[wallLabel][wallCellLabel][0] =
444 boundaryPatches_[wallLabel][wallCellLabel][1] =
445 vtxLabel(i + 1, j, nk);
446 boundaryPatches_[wallLabel][wallCellLabel][2] =
447 vtxLabel(i + 1, j + 1, nk);
448 boundaryPatches_[wallLabel][wallCellLabel][3] =
449 vtxLabel(i, j + 1, nk);
462 boundaryPatches_.clear();