00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "error.H"
00031 #include "block.H"
00032
00033
00034
00035
00036 void Foam::block::blockBoundary()
00037 {
00038 label ni = blockDef_.n().x();
00039 label nj = blockDef_.n().y();
00040 label nk = blockDef_.n().z();
00041
00042
00043
00044 label wallLabel = 0;
00045 label wallCellLabel = 0;
00046
00047
00048 boundaryPatches_[wallLabel].setSize(nj*nk);
00049 for (label k = 0; k <= nk - 1; k++)
00050 {
00051 for (label j = 0; j <= nj - 1; j++)
00052 {
00053 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
00054
00055
00056 boundaryPatches_[wallLabel][wallCellLabel][0] =
00057 vtxLabel(0, j, k);
00058 boundaryPatches_[wallLabel][wallCellLabel][1] =
00059 vtxLabel(0, j, k + 1);
00060 boundaryPatches_[wallLabel][wallCellLabel][2] =
00061 vtxLabel(0, j + 1, k + 1);
00062 boundaryPatches_[wallLabel][wallCellLabel][3] =
00063 vtxLabel(0, j + 1, k);
00064
00065
00066 wallCellLabel++;
00067 }
00068 }
00069
00070
00071 wallLabel++;
00072 wallCellLabel = 0;
00073
00074 boundaryPatches_[wallLabel].setSize(nj*nk);
00075
00076 for (label k = 0; k <= nk - 1; k++)
00077 {
00078 for (label j = 0; j <= nj - 1; j++)
00079 {
00080 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
00081
00082
00083 boundaryPatches_[wallLabel][wallCellLabel][0] =
00084 vtxLabel(ni, j, k);
00085 boundaryPatches_[wallLabel][wallCellLabel][1] =
00086 vtxLabel(ni, j+1, k);
00087 boundaryPatches_[wallLabel][wallCellLabel][2] =
00088 vtxLabel(ni, j+1, k+1);
00089 boundaryPatches_[wallLabel][wallCellLabel][3] =
00090 vtxLabel(ni, j, k+1);
00091
00092
00093 wallCellLabel++;
00094 }
00095 }
00096
00097
00098
00099
00100 wallLabel++;
00101 wallCellLabel = 0;
00102
00103 boundaryPatches_[wallLabel].setSize(ni*nk);
00104 for (label i = 0; i <= ni - 1; i++)
00105 {
00106 for (label k = 0; k <= nk - 1; k++)
00107 {
00108 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
00109
00110
00111 boundaryPatches_[wallLabel][wallCellLabel][0] =
00112 vtxLabel(i, 0, k);
00113 boundaryPatches_[wallLabel][wallCellLabel][1] =
00114 vtxLabel(i + 1, 0, k);
00115 boundaryPatches_[wallLabel][wallCellLabel][2] =
00116 vtxLabel(i + 1, 0, k + 1);
00117 boundaryPatches_[wallLabel][wallCellLabel][3] =
00118 vtxLabel(i, 0, k + 1);
00119
00120
00121 wallCellLabel++;
00122 }
00123 }
00124
00125
00126 wallLabel++;
00127 wallCellLabel = 0;
00128
00129 boundaryPatches_[wallLabel].setSize(ni*nk);
00130
00131 for (label i = 0; i <= ni - 1; i++)
00132 {
00133 for (label k = 0; k <= nk - 1; k++)
00134 {
00135 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
00136
00137
00138 boundaryPatches_[wallLabel][wallCellLabel][0] =
00139 vtxLabel(i, nj, k);
00140 boundaryPatches_[wallLabel][wallCellLabel][1] =
00141 vtxLabel(i, nj, k + 1);
00142 boundaryPatches_[wallLabel][wallCellLabel][2] =
00143 vtxLabel(i + 1, nj, k + 1);
00144 boundaryPatches_[wallLabel][wallCellLabel][3] =
00145 vtxLabel(i + 1, nj, k);
00146
00147
00148 wallCellLabel++;
00149 }
00150 }
00151
00152
00153
00154
00155 wallLabel++;
00156 wallCellLabel = 0;
00157
00158 boundaryPatches_[wallLabel].setSize(ni*nj);
00159
00160 for (label i = 0; i <= ni - 1; i++)
00161 {
00162 for (label j = 0; j <= nj - 1; j++)
00163 {
00164 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
00165
00166
00167 boundaryPatches_[wallLabel][wallCellLabel][0] =
00168 vtxLabel(i, j, 0);
00169 boundaryPatches_[wallLabel][wallCellLabel][1] =
00170 vtxLabel(i, j + 1, 0);
00171 boundaryPatches_[wallLabel][wallCellLabel][2] =
00172 vtxLabel(i + 1, j + 1, 0);
00173 boundaryPatches_[wallLabel][wallCellLabel][3] =
00174 vtxLabel(i + 1, j, 0);
00175
00176
00177 wallCellLabel++;
00178 }
00179 }
00180
00181
00182 wallLabel++;
00183 wallCellLabel = 0;
00184
00185 boundaryPatches_[wallLabel].setSize(ni*nj);
00186
00187 for (label i = 0; i <= ni - 1; i++)
00188 {
00189 for (label j = 0; j <= nj - 1; j++)
00190 {
00191 boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
00192
00193
00194 boundaryPatches_[wallLabel][wallCellLabel][0] =
00195 vtxLabel(i, j, nk);
00196 boundaryPatches_[wallLabel][wallCellLabel][1] =
00197 vtxLabel(i + 1, j, nk);
00198 boundaryPatches_[wallLabel][wallCellLabel][2] =
00199 vtxLabel(i + 1, j + 1, nk);
00200 boundaryPatches_[wallLabel][wallCellLabel][3] =
00201 vtxLabel(i, j + 1, nk);
00202
00203
00204 wallCellLabel++;
00205 }
00206 }
00207 }
00208
00209