32 void Foam::blockMesh::createPoints()
const 38 Info<<
"Creating points with scale " << scaleFactor_ <<
endl;
49 const pointField& blockPoints = blocks[blockI].points();
53 const Vector<label>& density = blocks[blockI].meshDensity();
55 label v0 = blocks[blockI].vtxLabel(0, 0, 0);
56 label vi1 = blocks[blockI].vtxLabel(1, 0, 0);
57 scalar diStart =
mag(blockPoints[vi1]-blockPoints[v0]);
59 label vinM1 = blocks[blockI].vtxLabel(density.x()-1, 0, 0);
60 label vin = blocks[blockI].vtxLabel(density.x(), 0, 0);
61 scalar diFinal =
mag(blockPoints[vin]-blockPoints[vinM1]);
63 label vj1 = blocks[blockI].vtxLabel(0, 1, 0);
64 scalar djStart =
mag(blockPoints[vj1]-blockPoints[v0]);
65 label vjnM1 = blocks[blockI].vtxLabel(0, density.y()-1, 0);
66 label vjn = blocks[blockI].vtxLabel(0, density.y(), 0);
67 scalar djFinal =
mag(blockPoints[vjn]-blockPoints[vjnM1]);
69 label vk1 = blocks[blockI].vtxLabel(0, 0, 1);
70 scalar dkStart =
mag(blockPoints[vk1]-blockPoints[v0]);
71 label vknM1 = blocks[blockI].vtxLabel(0, 0, density.z()-1);
72 label vkn = blocks[blockI].vtxLabel(0, 0, density.z());
73 scalar dkFinal =
mag(blockPoints[vkn]-blockPoints[vknM1]);
75 Info<<
" Block " << blockI <<
" cell size :" <<
nl 76 <<
" i : " << scaleFactor_*diStart <<
" .. " 77 << scaleFactor_*diFinal <<
nl 78 <<
" j : " << scaleFactor_*djStart <<
" .. " 79 << scaleFactor_*djFinal <<
nl 80 <<
" k : " << scaleFactor_*dkStart <<
" .. " 81 << scaleFactor_*dkFinal <<
nl 85 forAll(blockPoints, blockPointi)
91 blockOffsets_[blockI] + blockPointi
93 ] = scaleFactor_ * blockPoints[blockPointi];
99 void Foam::blockMesh::createCells()
const 121 forAll(blockCells, blockCelli)
125 forAll(cellPoints, cellPointi)
127 cellPoints[cellPointi] =
130 blockCells[blockCelli][cellPointi]
131 + blockOffsets_[blockI]
136 cells_[cellLabel] = cellShape(hex, cellPoints,
true);
146 const polyPatch& patchTopologyFaces
151 labelList blockLabels = patchTopologyFaces.polyPatch::faceCells();
155 forAll(patchTopologyFaces, patchTopologyFaceLabel)
157 const label blockI = blockLabels[patchTopologyFaceLabel];
159 faceList blockFaces = blocks[blockI].blockShape().faces();
161 forAll(blockFaces, blockFaceLabel)
165 blockFaces[blockFaceLabel]
166 == patchTopologyFaces[patchTopologyFaceLabel]
170 blocks[blockI].boundaryPatches()[blockFaceLabel].size();
180 forAll(patchTopologyFaces, patchTopologyFaceLabel)
182 const label blockI = blockLabels[patchTopologyFaceLabel];
184 faceList blockFaces = blocks[blockI].blockShape().faces();
186 forAll(blockFaces, blockFaceLabel)
190 blockFaces[blockFaceLabel]
191 == patchTopologyFaces[patchTopologyFaceLabel]
195 blocks[blockI].boundaryPatches()[blockFaceLabel];
197 forAll(blockPatchFaces, blockFaceLabel)
205 blockPatchFaces[blockFaceLabel][0]
206 + blockOffsets_[blockI]
213 label facePointLabel = 1;
221 blockPatchFaces[blockFaceLabel][facePointLabel]
222 + blockOffsets_[blockI]
240 else if (nUnique == 3)
242 patchFaces[faceLabel++] = face
253 patchFaces.setSize(faceLabel);
259 void Foam::blockMesh::createPatches()
const 273 patches_.
setSize(topoPatches.size());
277 patches_[
patchi] = createPatchFaces(topoPatches[
patchi]);
289 blocks[blockI].clearGeom();
PtrList< polyPatch > polyPatchList
container classes for polyPatch
const polyMesh & topology() const
Return the blockMesh topology as a polyMesh.
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or NULL.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
PtrList< block > blockList
A PtrList of blocks.
Ostream & endl(Ostream &os)
Add newline and flush stream.
SubList< label > subList
Declare type of subList.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
vectorField pointField
pointField is a vectorField.
void clear()
Clear the list, i.e. set size to zero.
List< label > labelList
A List of labels.
void setSize(const label)
Reset size of List.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
void clearGeom()
Clear geometry (internal points, cells, boundaryPatches)
dimensioned< scalar > mag(const dimensioned< Type > &)
label size() const
Return the number of elements in the UPtrList.