43 blockPoints[b.pointLabel(1, j, k)]
44 - blockPoints[b.pointLabel(0, j, k)]
49 blockPoints[b.pointLabel(b.density().x() - 1, j,
k)]
50 - blockPoints[b.pointLabel(b.density().x(), j,
k)]
68 blockPoints[b.pointLabel(i, 0, k)]
69 - blockPoints[b.pointLabel(i, 1, k)]
74 blockPoints[b.pointLabel(i, b.density().y() - 1,
k)]
75 - blockPoints[b.pointLabel(i, b.density().y(),
k)]
93 blockPoints[b.pointLabel(i, j, 0)]
94 - blockPoints[b.pointLabel(i, j, 1)]
99 blockPoints[b.pointLabel(i, j, b.density().z() - 1)]
100 - blockPoints[b.pointLabel(i, j, b.density().z())]
106 void Foam::blockMesh::printCellSizeRange
108 const Pair<scalar>& cellSizes
111 if (cellSizes.first() != cellSizes.second())
113 Info<< scaleFactor_*cellSizes.first() <<
" .. " 114 << scaleFactor_*cellSizes.second();
118 Info<< scaleFactor_*cellSizes.first();
123 void Foam::blockMesh::printCellSizeRanges
126 const FixedList<Pair<scalar>, 4>& cellSizes
129 static const char dNames[3] = {
'i',
'j',
'k'};
131 const scalar d0 =
max 133 max(cellSizes[0].
first(), cellSizes[0].second()),
142 &&
mag(cellSizes[i].second() - cellSizes[0].second())/d0 < 1
e-5;
145 Info<<
" " << dNames[d] <<
" : ";
148 printCellSizeRange(cellSizes[0]);
154 printCellSizeRange(cellSizes[i]);
162 void Foam::blockMesh::createPoints()
const 168 Info<<
"Creating points with scale " << scaleFactor_ <<
endl;
175 const pointField& blockPoints = blocks[blocki].points();
179 Info<<
" Block " << blocki <<
" cell size :" <<
nl;
185 xCellSizes(blocks[blocki], blockPoints, 0, 0),
186 xCellSizes(blocks[blocki], blockPoints, 1, 0),
187 xCellSizes(blocks[blocki], blockPoints, 0, 1),
188 xCellSizes(blocks[blocki], blockPoints, 1, 1)
196 yCellSizes(blocks[blocki], blockPoints, 0, 0),
197 yCellSizes(blocks[blocki], blockPoints, 1, 0),
198 yCellSizes(blocks[blocki], blockPoints, 0, 1),
199 yCellSizes(blocks[blocki], blockPoints, 1, 1)
207 zCellSizes(blocks[blocki], blockPoints, 0, 0),
208 zCellSizes(blocks[blocki], blockPoints, 1, 0),
209 zCellSizes(blocks[blocki], blockPoints, 0, 1),
210 zCellSizes(blocks[blocki], blockPoints, 1, 1)
215 forAll(blockPoints, blockPointi)
221 blockOffsets_[blocki] + blockPointi
223 ] = scaleFactor_ * blockPoints[blockPointi];
229 void Foam::blockMesh::createCells()
const 245 const List<FixedList<label, 8>> blockCells(blocks[blocki].
cells());
247 forAll(blockCells, blockCelli)
251 forAll(cellPoints, cellPointi)
253 cellPoints[cellPointi] =
256 blockCells[blockCelli][cellPointi]
257 + blockOffsets_[blocki]
262 cells_[cellLabel] = cellShape(hex, cellPoints,
true);
272 const polyPatch& patchTopologyFaces
277 labelList blockLabels = patchTopologyFaces.polyPatch::faceCells();
281 forAll(patchTopologyFaces, patchTopologyFaceLabel)
283 const label blocki = blockLabels[patchTopologyFaceLabel];
285 faceList blockFaces = blocks[blocki].blockShape().faces();
287 forAll(blockFaces, blockFaceLabel)
291 blockFaces[blockFaceLabel]
292 == patchTopologyFaces[patchTopologyFaceLabel]
296 blocks[blocki].boundaryPatches()[blockFaceLabel].size();
306 forAll(patchTopologyFaces, patchTopologyFaceLabel)
308 const label blocki = blockLabels[patchTopologyFaceLabel];
310 faceList blockFaces = blocks[blocki].blockShape().faces();
312 forAll(blockFaces, blockFaceLabel)
316 blockFaces[blockFaceLabel]
317 == patchTopologyFaces[patchTopologyFaceLabel]
320 const List<FixedList<label, 4>>& blockPatchFaces =
321 blocks[blocki].boundaryPatches()[blockFaceLabel];
323 forAll(blockPatchFaces, blockFaceLabel)
331 blockPatchFaces[blockFaceLabel][0]
332 + blockOffsets_[blocki]
339 label facePointLabel = 1;
347 blockPatchFaces[blockFaceLabel][facePointLabel]
348 + blockOffsets_[blocki]
366 else if (nUnique == 3)
368 patchFaces[faceLabel++] = face
379 patchFaces.setSize(faceLabel);
385 void Foam::blockMesh::createPatches()
const 394 patches_.
setSize(topoPatches.size());
398 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.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
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.
label k
Boltzmann constant.
vectorField pointField
pointField is a vectorField.
An ordered pair of two objects of type <T> with first() and second() elements.
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 > &)
const doubleScalar e
Elementary charge.
T & first()
Return reference to the first element of the list.