| 381 | |
| 382 | |
| 383 | void Foam::block::createBoundary() |
| 384 | { |
| 385 | const label ni = density().x(); |
| 386 | const label nj = density().y(); |
| 387 | const label nk = density().z(); |
| 388 | |
| 389 | label patchi = 0; |
| 390 | label facei = 0; |
| 391 | |
| 392 | // x-direction |
| 393 | |
| 394 | // x-min |
| 395 | boundaryPatches_[patchi].setSize(nj*nk); |
| 396 | for (label k=0; k<nk; k++) |
| 397 | { |
| 398 | for (label j=0; j<nj; j++) |
| 399 | { |
| 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); |
| 404 | |
| 405 | facei++; |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | // x-max |
| 410 | patchi++; |
| 411 | facei = 0; |
| 412 | |
| 413 | boundaryPatches_[patchi].setSize(nj*nk); |
| 414 | |
| 415 | for (label k=0; k<nk; k++) |
| 416 | { |
| 417 | for (label j=0; j<nj; j++) |
| 418 | { |
| 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); |
| 423 | |
| 424 | facei++; |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | // y-direction |
| 429 | |
| 430 | // y-min |
| 431 | patchi++; |
| 432 | facei = 0; |
| 433 | |
| 434 | boundaryPatches_[patchi].setSize(ni*nk); |
| 435 | for (label i=0; i<ni; i++) |
| 436 | { |
| 437 | for (label k=0; k<nk; k++) |
| 438 | { |
| 439 | boundaryPatches_[patchi][facei][0] = pointLabel(i, 0, k); |
| 440 | boundaryPatches_[patchi][facei][1] = pointLabel(i+1, 0, k); |