1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 private member of block. Creates boundary patches for the block
28 \*---------------------------------------------------------------------------*/
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36 void Foam::block::blockBoundary()
38 label ni = blockDef_.n().x();
39 label nj = blockDef_.n().y();
40 label nk = blockDef_.n().z();
45 label wallCellLabel = 0;
48 boundaryPatches_[wallLabel].setSize(nj*nk);
49 for (label k = 0; k <= nk - 1; k++)
51 for (label j = 0; j <= nj - 1; j++)
53 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
56 boundaryPatches_[wallLabel][wallCellLabel][0] =
58 boundaryPatches_[wallLabel][wallCellLabel][1] =
59 vtxLabel(0, j, k + 1);
60 boundaryPatches_[wallLabel][wallCellLabel][2] =
61 vtxLabel(0, j + 1, k + 1);
62 boundaryPatches_[wallLabel][wallCellLabel][3] =
63 vtxLabel(0, j + 1, k);
74 boundaryPatches_[wallLabel].setSize(nj*nk);
76 for (label k = 0; k <= nk - 1; k++)
78 for (label j = 0; j <= nj - 1; j++)
80 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
83 boundaryPatches_[wallLabel][wallCellLabel][0] =
85 boundaryPatches_[wallLabel][wallCellLabel][1] =
87 boundaryPatches_[wallLabel][wallCellLabel][2] =
88 vtxLabel(ni, j+1, k+1);
89 boundaryPatches_[wallLabel][wallCellLabel][3] =
103 boundaryPatches_[wallLabel].setSize(ni*nk);
104 for (label i = 0; i <= ni - 1; i++)
106 for (label k = 0; k <= nk - 1; k++)
108 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
111 boundaryPatches_[wallLabel][wallCellLabel][0] =
113 boundaryPatches_[wallLabel][wallCellLabel][1] =
114 vtxLabel(i + 1, 0, k);
115 boundaryPatches_[wallLabel][wallCellLabel][2] =
116 vtxLabel(i + 1, 0, k + 1);
117 boundaryPatches_[wallLabel][wallCellLabel][3] =
118 vtxLabel(i, 0, k + 1);
120 // update the counter
129 boundaryPatches_[wallLabel].setSize(ni*nk);
131 for (label i = 0; i <= ni - 1; i++)
133 for (label k = 0; k <= nk - 1; k++)
135 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
138 boundaryPatches_[wallLabel][wallCellLabel][0] =
140 boundaryPatches_[wallLabel][wallCellLabel][1] =
141 vtxLabel(i, nj, k + 1);
142 boundaryPatches_[wallLabel][wallCellLabel][2] =
143 vtxLabel(i + 1, nj, k + 1);
144 boundaryPatches_[wallLabel][wallCellLabel][3] =
145 vtxLabel(i + 1, nj, k);
147 // update the counter
158 boundaryPatches_[wallLabel].setSize(ni*nj);
160 for (label i = 0; i <= ni - 1; i++)
162 for (label j = 0; j <= nj - 1; j++)
164 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
167 boundaryPatches_[wallLabel][wallCellLabel][0] =
169 boundaryPatches_[wallLabel][wallCellLabel][1] =
170 vtxLabel(i, j + 1, 0);
171 boundaryPatches_[wallLabel][wallCellLabel][2] =
172 vtxLabel(i + 1, j + 1, 0);
173 boundaryPatches_[wallLabel][wallCellLabel][3] =
174 vtxLabel(i + 1, j, 0);
176 // update the counter
185 boundaryPatches_[wallLabel].setSize(ni*nj);
187 for (label i = 0; i <= ni - 1; i++)
189 for (label j = 0; j <= nj - 1; j++)
191 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
194 boundaryPatches_[wallLabel][wallCellLabel][0] =
196 boundaryPatches_[wallLabel][wallCellLabel][1] =
197 vtxLabel(i + 1, j, nk);
198 boundaryPatches_[wallLabel][wallCellLabel][2] =
199 vtxLabel(i + 1, j + 1, nk);
200 boundaryPatches_[wallLabel][wallCellLabel][3] =
201 vtxLabel(i, j + 1, nk);
203 // update the counter
209 // ************************************************************************* //