31 void Foam::blockMesh::createPoints()
const 37 Info<<
"Creating points with scale " << scaleFactor_ <<
endl;
44 const pointField& blockPoints = blocks[blocki].points();
48 const Vector<label>& density = blocks[blocki].density();
50 label v0 = blocks[blocki].pointLabel(0, 0, 0);
51 label vi1 = blocks[blocki].pointLabel(1, 0, 0);
52 scalar diStart =
mag(blockPoints[vi1] - blockPoints[v0]);
54 label vinM1 = blocks[blocki].pointLabel(density.x()-1, 0, 0);
55 label vin = blocks[blocki].pointLabel(density.x(), 0, 0);
56 scalar diFinal =
mag(blockPoints[vin] - blockPoints[vinM1]);
58 label vj1 = blocks[blocki].pointLabel(0, 1, 0);
59 scalar djStart =
mag(blockPoints[vj1] - blockPoints[v0]);
60 label vjnM1 = blocks[blocki].pointLabel(0, density.y()-1, 0);
61 label vjn = blocks[blocki].pointLabel(0, density.y(), 0);
62 scalar djFinal =
mag(blockPoints[vjn] - blockPoints[vjnM1]);
64 label vk1 = blocks[blocki].pointLabel(0, 0, 1);
65 scalar dkStart =
mag(blockPoints[vk1] - blockPoints[v0]);
66 label vknM1 = blocks[blocki].pointLabel(0, 0, density.z()-1);
67 label vkn = blocks[blocki].pointLabel(0, 0, density.z());
68 scalar dkFinal =
mag(blockPoints[vkn] - blockPoints[vknM1]);
70 Info<<
" Block " << blocki <<
" cell size :" <<
nl 71 <<
" i : " << scaleFactor_*diStart <<
" .. " 72 << scaleFactor_*diFinal <<
nl 73 <<
" j : " << scaleFactor_*djStart <<
" .. " 74 << scaleFactor_*djFinal <<
nl 75 <<
" k : " << scaleFactor_*dkStart <<
" .. " 76 << scaleFactor_*dkFinal <<
nl 80 forAll(blockPoints, blockPointi)
86 blockOffsets_[blocki] + blockPointi
88 ] = scaleFactor_ * blockPoints[blockPointi];
94 void Foam::blockMesh::createCells()
const 110 const List<FixedList<label, 8>> blockCells(blocks[blocki].
cells());
112 forAll(blockCells, blockCelli)
116 forAll(cellPoints, cellPointi)
118 cellPoints[cellPointi] =
121 blockCells[blockCelli][cellPointi]
122 + blockOffsets_[blocki]
127 cells_[cellLabel] = cellShape(hex, cellPoints,
true);
137 const polyPatch& patchTopologyFaces
142 labelList blockLabels = patchTopologyFaces.polyPatch::faceCells();
146 forAll(patchTopologyFaces, patchTopologyFaceLabel)
148 const label blocki = blockLabels[patchTopologyFaceLabel];
150 faceList blockFaces = blocks[blocki].blockShape().faces();
152 forAll(blockFaces, blockFaceLabel)
156 blockFaces[blockFaceLabel]
157 == patchTopologyFaces[patchTopologyFaceLabel]
161 blocks[blocki].boundaryPatches()[blockFaceLabel].size();
171 forAll(patchTopologyFaces, patchTopologyFaceLabel)
173 const label blocki = blockLabels[patchTopologyFaceLabel];
175 faceList blockFaces = blocks[blocki].blockShape().faces();
177 forAll(blockFaces, blockFaceLabel)
181 blockFaces[blockFaceLabel]
182 == patchTopologyFaces[patchTopologyFaceLabel]
185 const List<FixedList<label, 4>>& blockPatchFaces =
186 blocks[blocki].boundaryPatches()[blockFaceLabel];
188 forAll(blockPatchFaces, blockFaceLabel)
196 blockPatchFaces[blockFaceLabel][0]
197 + blockOffsets_[blocki]
204 label facePointLabel = 1;
212 blockPatchFaces[blockFaceLabel][facePointLabel]
213 + blockOffsets_[blocki]
231 else if (nUnique == 3)
233 patchFaces[faceLabel++] = face
244 patchFaces.setSize(faceLabel);
250 void Foam::blockMesh::createPatches()
const 259 patches_.
setSize(topoPatches.size());
263 patches_[
patchi] = createPatchFaces(topoPatches[
patchi]);
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
PtrList< polyPatch > polyPatchList
container classes for polyPatch
#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 nullptr.
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.
vectorField pointField
pointField is a vectorField.
const polyMesh & topology() const
Return the blockMesh topology as a polyMesh.
List< label > labelList
A List of labels.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
const cellShapeList & cells() const
Return cell shapes list.
dimensioned< scalar > mag(const dimensioned< Type > &)