59 const scalar expRatio,
63 return nDiv > 1 ?
pow(expRatio, (nDiv - 1)) : 1.0;
73 for (
const label val : list)
103 for (
const T& val : list)
124 if (!zoneName.empty())
157 for (
const point&
p : list)
239 const bool withHeader
252 dummyTimePtr->system(),
281 {8, 0, 3, 11, 12, 4, 7, 15},
282 {1, 9, 10, 2, 5, 13, 14, 6},
283 {8, 9, 1, 0, 12, 13, 5, 4},
284 {3, 2, 10, 11, 7, 6, 14, 15},
285 {8, 9, 10, 11, 0, 1, 2, 3},
286 {4, 5, 6, 7, 12, 13, 14, 15},
287 {0, 1, 2, 3, 4, 5, 6, 7},
288 {8, 9, 10, 11, 12, 13, 14, 15},
310 enum blockTopologyType
321 const bool useRelToGeom =
322 (expansionType::EXPAND_RATIO == outer_.expandType_);
328 boundBox innerCorners(bounds(ctrl.
x(), ctrl.
y(), ctrl.
z()));
336 blockTopologyType outerTopology = INNER_ONLY;
341 outerTopology = FULL_OUTER;
344 radialSizes.
x() *= outer_.relSize_.x();
345 radialSizes.y() *= outer_.relSize_.y();
346 radialSizes.z() *=
min(outer_.relSize_.x(), outer_.relSize_.y());
348 if (outer_.onGround())
350 outerTopology = CLIP_BOTTOM;
351 radialCentre.z() = innerCorners.
min().
z();
352 radialSizes.z() *= 2;
356 outerCorners.
min() = radialCentre - radialSizes;
357 outerCorners.
max() = radialCentre + radialSizes;
359 if (outer_.onGround())
361 outerCorners.
min().
z() = innerCorners.
min().
z();
365 if (outer_.isSphere())
385 queries[0] = outerCorners.
min();
386 queries[1] = outerCorners.
max();
396 outerCorners.
min() = hits[0].hitPoint();
397 outerCorners.
max() = hits[1].hitPoint();
399 else if (outerControl::OUTER_EXTEND == outer_.type_)
401 outerTopology = EXTENDED;
407 outerCount = outer_.nCells_.x();
408 expRatio = outer_.expansion_.x();
414 ctrl.
x().prepend(outerCorners.
min().
x(), outerCount, -expRatio);
415 ctrl.
x().append(outerCorners.
max().
x(), outerCount, expRatio);
418 outerCount = outer_.nCells_.y();
419 expRatio = outer_.expansion_.y();
425 ctrl.
y().prepend(outerCorners.
min().
y(), outerCount, -expRatio);
426 ctrl.
y().append(outerCorners.
max().
y(), outerCount, expRatio);
428 outerCount =
max(outer_.nCells_.x(), outer_.nCells_.y());
429 expRatio =
min(outer_.expansion_.x(), outer_.expansion_.y());
435 if (!outer_.onGround())
437 ctrl.
z().prepend(outerCorners.
min().
z(), outerCount, -expRatio);
439 ctrl.
z().append(outerCorners.
max().
z(), outerCount, expRatio);
442 innerCorners = bounds(ctrl.
x(), ctrl.
y(), ctrl.
z());
443 outerCorners = innerCorners;
455 const label radialCount = outer_.nCells_.
x();
456 scalar expRatio = outer_.expansion_.x();
474 if (EXTENDED == outerTopology)
487 if (outer_.onGround())
502 else if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
515 if (CLIP_BOTTOM == outerTopology)
537 if (outer_.isSphere())
563 if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
565 corners = outerCorners.
points();
567 if (outer_.isSphere())
583 word innerZoneName =
"inner";
584 if (INNER_ONLY == outerTopology || EXTENDED == outerTopology)
586 innerZoneName.clear();
593 hexCount = innerCount;
598 hexVerts[Inner_Block],
605 if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
608 hexCount = innerCount;
609 hexGrade = innerGrading;
611 hexCount.
x() = radialCount;
615 hexGrade.
x() = radialInward;
620 hexGrade.
x() = radialOutward;
626 hexCount = innerCount;
627 hexGrade = innerGrading;
629 hexCount.
y() = radialCount;
633 hexGrade.
y() = radialInward;
638 hexGrade.
y() = radialOutward;
644 hexCount = innerCount;
645 hexGrade = innerGrading;
647 hexCount.
z() = radialCount;
650 if (!outer_.onGround())
652 hexGrade.
z() = radialInward;
657 hexGrade.
z() = radialOutward;
671 if (outer_.isSphere() && outerFaces.size())
680 hex.face(pr.second(), hexVerts[pr.first()]).edges()
699 if (outer_.isSphere() && outerFaces.size())
706 hex.face(pr.second(), hexVerts[pr.first()])
733 hex.face(pr.second(), hexVerts[pr.first()])
742 if (outer_.onGround())
755 hex.face(pr.second(), hexVerts[pr.first()])
769 IOobject::writeEndDivider(os);
807 <<
"Generate blockMeshDict: "
816 this->blockMeshDict(os);
823 Foam::PDRblock::createBlockMesh(
const IOobject& io)
const
829 "blockMeshDict.PDRblockMesh",
845 Foam::PDRblock::meshBlockMesh(
const IOobject& io)
const
850 autoPtr<polyMesh>
meshPtr(createBlockMesh(io)->
mesh(io));
860 outerControl::OUTER_EXTEND == outer_.type_
864 const boundBox innerBox
866 bounds(control_.x(), control_.y(), control_.z())
869 const label nZoneCellsMax =
871 control_.x().nCells()
872 * control_.y().nCells()
873 * control_.z().nCells()
879 List<cellZone*> cz(1);
888 cellZone& innerZone = *(cz[0]);
892 label nZoneCells = 0;
897 celli < cc.size() && nZoneCells < nZoneCellsMax;
901 if (innerBox.contains(cc[celli]))
903 innerZone[nZoneCells] = celli;
908 innerZone.resize(nZoneCells);
910 pmesh.pointZones().clear();
911 pmesh.faceZones().clear();
912 pmesh.cellZones().clear();
913 pmesh.addZones(List<pointZone*>(), List<faceZone*>(), cz);