31 void Foam::block::createPoints()
const 59 for (
label k = 0; k <= nk; k++)
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);
221 vertices_[vertexNo] =
223 edgex1 + edgex2 + edgex3 + edgex4
224 + edgey1 + edgey2 + edgey3 + edgey4
225 + edgez1 + edgez2 + edgez3 + edgez4
228 vertices_[vertexNo] +=
230 corx1 + corx2 + corx3 + corx4
231 + cory1 + cory2 + cory3 + cory4
232 + corz1 + corz2 + corz3 + corz4
240 void Foam::block::createCells()
const 254 for (
label k = 0; k < nk; k++)
256 for (
label j = 0; j < nj; j++)
258 for (
label i = 0; i < ni; i++)
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);
277 void Foam::block::createBoundary()
const 286 boundaryPatches_.
clear();
293 label wallCellLabel = 0;
296 boundaryPatches_[wallLabel].
setSize(nj*nk);
297 for (
label k = 0; k < nk; k++)
299 for (
label j = 0; j < nj; j++)
301 boundaryPatches_[wallLabel][wallCellLabel].
setSize(4);
304 boundaryPatches_[wallLabel][wallCellLabel][0] =
306 boundaryPatches_[wallLabel][wallCellLabel][1] =
308 boundaryPatches_[wallLabel][wallCellLabel][2] =
310 boundaryPatches_[wallLabel][wallCellLabel][3] =
322 boundaryPatches_[wallLabel].
setSize(nj*nk);
324 for (
label k = 0; k < nk; k++)
326 for (
label j = 0; j < nj; j++)
328 boundaryPatches_[wallLabel][wallCellLabel].
setSize(4);
331 boundaryPatches_[wallLabel][wallCellLabel][0] =
333 boundaryPatches_[wallLabel][wallCellLabel][1] =
335 boundaryPatches_[wallLabel][wallCellLabel][2] =
337 boundaryPatches_[wallLabel][wallCellLabel][3] =
351 boundaryPatches_[wallLabel].
setSize(ni*nk);
352 for (
label i = 0; i < ni; i++)
354 for (
label k = 0; k < nk; k++)
356 boundaryPatches_[wallLabel][wallCellLabel].
setSize(4);
359 boundaryPatches_[wallLabel][wallCellLabel][0] =
361 boundaryPatches_[wallLabel][wallCellLabel][1] =
363 boundaryPatches_[wallLabel][wallCellLabel][2] =
365 boundaryPatches_[wallLabel][wallCellLabel][3] =
377 boundaryPatches_[wallLabel].
setSize(ni*nk);
379 for (
label i = 0; i < ni; i++)
381 for (
label k = 0; k < nk; k++)
383 boundaryPatches_[wallLabel][wallCellLabel].
setSize(4);
386 boundaryPatches_[wallLabel][wallCellLabel][0] =
388 boundaryPatches_[wallLabel][wallCellLabel][1] =
390 boundaryPatches_[wallLabel][wallCellLabel][2] =
392 boundaryPatches_[wallLabel][wallCellLabel][3] =
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] =
419 boundaryPatches_[wallLabel][wallCellLabel][2] =
421 boundaryPatches_[wallLabel][wallCellLabel][3] =
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] =
446 boundaryPatches_[wallLabel][wallCellLabel][2] =
448 boundaryPatches_[wallLabel][wallCellLabel][3] =
462 boundaryPatches_.
clear();
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const scalarListList & blockEdgeWeights() const
Return the weightings along each edge.
Vector< scalar > vector
A scalar version of the templated Vector.
label k
Boltzmann constant.
const Vector< label > & meshDensity() const
Return the mesh density (number of cells) in the i,j,k directions.
const point & blockPoint(const label i) const
Return block point at local label i.
void clearGeom()
Clear geometry (internal points, cells, boundaryPatches)
label nPoints() const
Return the number of points.
void clear()
Clear the list, i.e. set size to zero.
List< scalarList > scalarListList
label nCells() const
Return the number of cells.
label vtxLabel(label i, label j, label k) const
Vertex label offset for a particular i,j,k position.
void setSize(const label)
Reset size of List.
vector point
Point is a vector.
const List< List< point > > & blockEdgePoints() const
Return the block points along each edge.