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