45 void Foam::block::createPoints()
80 for (
label j=0; j<=nj; j++)
82 for (
label i=0; i<=ni; i++)
92 scalar wx1 = (1 -
w0)*(1 -
w4)*(1 -
w8) +
w0*(1 -
w5)*(1 -
w9);
97 const scalar sumWx = wx1 + wx2 + wx3 + wx4;
105 scalar wy1 = (1 -
w4)*(1 -
w0)*(1 -
w8) +
w4*(1 -
w1)*(1 -
w11);
110 const scalar sumWy = wy1 + wy2 + wy3 + wy4;
118 scalar wz1 = (1 -
w8)*(1 -
w0)*(1 -
w4) +
w8*(1 -
w3)*(1 -
w7);
123 const scalar sumWz = wz1 + wz2 + wz3 + wz4;
131 const vector edgex1 = p000 + (p100 - p000)*
w0;
132 const vector edgex2 = p010 + (p110 - p010)*
w1;
133 const vector edgex3 = p011 + (p111 - p011)*
w2;
134 const vector edgex4 = p001 + (p101 - p001)*
w3;
136 const vector edgey1 = p000 + (p010 - p000)*
w4;
137 const vector edgey2 = p100 + (p110 - p100)*
w5;
138 const vector edgey3 = p101 + (p111 - p101)*
w6;
139 const vector edgey4 = p001 + (p011 - p001)*
w7;
141 const vector edgez1 = p000 + (p001 - p000)*
w8;
142 const vector edgez2 = p100 + (p101 - p100)*
w9;
143 const vector edgez3 = p110 + (p111 - p110)*
w10;
144 const vector edgez4 = p010 + (p011 - p010)*
w11;
149 wx1*edgex1 + wx2*edgex2 + wx3*edgex3 + wx4*edgex4
150 + wy1*edgey1 + wy2*edgey2 + wy3*edgey3 + wy4*edgey4
151 + wz1*edgez1 + wz2*edgez2 + wz3*edgez3 + wz4*edgez4
159 const vector corx1 = wx1*(
p[0][i] - edgex1);
160 const vector corx2 = wx2*(
p[1][i] - edgex2);
161 const vector corx3 = wx3*(
p[2][i] - edgex3);
162 const vector corx4 = wx4*(
p[3][i] - edgex4);
164 const vector cory1 = wy1*(
p[4][j] - edgey1);
165 const vector cory2 = wy2*(
p[5][j] - edgey2);
166 const vector cory3 = wy3*(
p[6][j] - edgey3);
167 const vector cory4 = wy4*(
p[7][j] - edgey4);
169 const vector corz1 = wz1*(
p[8][
k] - edgez1);
170 const vector corz2 = wz2*(
p[9][
k] - edgez2);
171 const vector corz3 = wz3*(
p[10][
k] - edgez3);
172 const vector corz4 = wz4*(
p[11][
k] - edgez4);
176 corx1 + corx2 + corx3 + corx4
177 + cory1 + cory2 + cory3 + cory4
178 + corz1 + corz2 + corz3 + corz4
192 for (
label ii=0; ii<=ni; ii++)
195 label i = (ii + 1)%(ni + 1);
197 for (
label j=0; j<=nj; j++)
208 (1 -
w0)*(1 -
w4)*(1 -
w8)
222 const scalar sumWf = wf0 + wf1;
244 for (
label jj=0; jj<=nj; jj++)
247 label j = (jj + 1)%(nj + 1);
249 for (
label i=0; i<=ni; i++)
260 (1 -
w4)*(1 -
w1)*(1 -
w8)
274 const scalar sumWf = wf2 + wf3;
296 for (
label kk=0; kk<=nk; kk++)
299 label k = (kk + 1)%(nk + 1);
301 for (
label i=0; i<=ni; i++)
303 for (
label j=0; j<=nj; j++)
312 (1 -
w8)*(1 -
w0)*(1 -
w4)
326 const scalar sumWf = wf4 + wf5;
351 const label ni = density().x();
352 const label nj = density().y();
353 const label nk = density().z();
361 for (
label j=0; j<nj; j++)
363 for (
label i=0; i<ni; i++)
365 cells[celli][0] = pointLabel(i, j,
k);
366 cells[celli][1] = pointLabel(i+1, j,
k);
367 cells[celli][2] = pointLabel(i+1, j+1,
k);
368 cells[celli][3] = pointLabel(i, j+1,
k);
369 cells[celli][4] = pointLabel(i, j,
k+1);
370 cells[celli][5] = pointLabel(i+1, j,
k+1);
371 cells[celli][6] = pointLabel(i+1, j+1,
k+1);
372 cells[celli][7] = pointLabel(i, j+1,
k+1);
383 void Foam::block::createBoundary()
385 const label ni = density().x();
386 const label nj = density().y();
387 const label nk = density().z();
395 boundaryPatches_[
patchi].setSize(nj*nk);
398 for (
label j=0; j<nj; j++)
400 boundaryPatches_[
patchi][facei][0] = pointLabel(0, j,
k);
401 boundaryPatches_[
patchi][facei][1] = pointLabel(0, j,
k+1);
402 boundaryPatches_[
patchi][facei][2] = pointLabel(0, j+1,
k+1);
403 boundaryPatches_[
patchi][facei][3] = pointLabel(0, j+1,
k);
413 boundaryPatches_[
patchi].setSize(nj*nk);
417 for (
label j=0; j<nj; j++)
419 boundaryPatches_[
patchi][facei][0] = pointLabel(ni, j,
k);
420 boundaryPatches_[
patchi][facei][1] = pointLabel(ni, j+1,
k);
421 boundaryPatches_[
patchi][facei][2] = pointLabel(ni, j+1,
k+1);
422 boundaryPatches_[
patchi][facei][3] = pointLabel(ni, j,
k+1);
434 boundaryPatches_[
patchi].setSize(ni*nk);
435 for (
label i=0; i<ni; i++)
439 boundaryPatches_[
patchi][facei][0] = pointLabel(i, 0,
k);
440 boundaryPatches_[
patchi][facei][1] = pointLabel(i+1, 0,
k);
441 boundaryPatches_[
patchi][facei][2] = pointLabel(i+1, 0,
k+1);
442 boundaryPatches_[
patchi][facei][3] = pointLabel(i, 0,
k+1);
452 boundaryPatches_[
patchi].setSize(ni*nk);
454 for (
label i=0; i<ni; i++)
458 boundaryPatches_[
patchi][facei][0] = pointLabel(i, nj,
k);
459 boundaryPatches_[
patchi][facei][1] = pointLabel(i, nj,
k+1);
460 boundaryPatches_[
patchi][facei][2] = pointLabel(i+1, nj,
k+1);
461 boundaryPatches_[
patchi][facei][3] = pointLabel(i+1, nj,
k);
473 boundaryPatches_[
patchi].setSize(ni*nj);
475 for (
label i=0; i<ni; i++)
477 for (
label j=0; j<nj; j++)
479 boundaryPatches_[
patchi][facei][0] = pointLabel(i, j, 0);
480 boundaryPatches_[
patchi][facei][1] = pointLabel(i, j+1, 0);
481 boundaryPatches_[
patchi][facei][2] = pointLabel(i+1, j+1, 0);
482 boundaryPatches_[
patchi][facei][3] = pointLabel(i+1, j, 0);
492 boundaryPatches_[
patchi].setSize(ni*nj);
494 for (
label i=0; i<ni; i++)
496 for (
label j=0; j<nj; j++)
498 boundaryPatches_[
patchi][facei][0] = pointLabel(i, j, nk);
499 boundaryPatches_[
patchi][facei][1] = pointLabel(i+1, j, nk);
500 boundaryPatches_[
patchi][facei][2] = pointLabel(i+1, j+1, nk);
501 boundaryPatches_[
patchi][facei][3] = pointLabel(i, j+1, nk);
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label)
Reset size of List.
bool flatFaceOrEdge(const label i, const label j, const label k) const
Return true if point i,j,k addresses a block flat face or edge.
const point & blockPoint(const label i) const
Return block point for local label i.
label edgesPointsWeights(pointField(&edgePoints)[12], scalarList(&edgeWeights)[12]) const
Calculate the points and weights for all edges.
label facePointLabel(const label facei, const label i, const label j) const
Face vertex label offset for a particular i,j,k position.
bool vertex(const label i, const label j, const label k) const
Return true if point i,j,k addresses a block vertex.
label pointLabel(const label i, const label j, const label k) const
Vertex label offset for a particular i,j,k position.
const Vector< label > & density() const
Return the mesh density (number of cells) in the i,j,k directions.
void correctFacePoints(FixedList< pointField, 6 > &) const
Correct the location of the given face-points.
label nPoints() const
Return the number of points.
FixedList< pointField, 6 > facePoints(const pointField &points) const
Return the list of face-points for all of the faces of the block.
label nCurvedFaces() const
Number of curved faces in this block.
List< FixedList< label, 8 > > cells() const
Return the cells for filling the block.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
A List of scalars.
vector point
Point is a vector.
Vector< scalar > vector
A scalar version of the templated Vector.