58 const scalar expRatio,
62 return nDiv > 1 ?
pow(expRatio, (nDiv - 1)) : 1.0;
72 for (
const label val : list)
102 for (
const T& val : list)
123 if (!zoneName.empty())
156 for (
const point&
p : list)
238 const bool withHeader
251 dummyTimePtr->system(),
280 {8, 0, 3, 11, 12, 4, 7, 15},
281 {1, 9, 10, 2, 5, 13, 14, 6},
282 {8, 9, 1, 0, 12, 13, 5, 4},
283 {3, 2, 10, 11, 7, 6, 14, 15},
284 {8, 9, 10, 11, 0, 1, 2, 3},
285 {4, 5, 6, 7, 12, 13, 14, 15},
286 {0, 1, 2, 3, 4, 5, 6, 7},
287 {8, 9, 10, 11, 12, 13, 14, 15},
309 enum blockTopologyType
320 const bool useRelToGeom =
335 blockTopologyType outerTopology = INNER_ONLY;
340 outerTopology = FULL_OUTER;
343 radialSizes.
x() *= outer_.relSize_.x();
344 radialSizes.
y() *= outer_.relSize_.y();
345 radialSizes.
z() *=
min(outer_.relSize_.x(), outer_.relSize_.y());
347 if (outer_.onGround())
349 outerTopology = CLIP_BOTTOM;
350 radialCentre.
z() = innerCorners.
min().z();
351 radialSizes.
z() *= 2;
355 outerCorners.
min() = radialCentre - radialSizes;
356 outerCorners.
max() = radialCentre + radialSizes;
358 if (outer_.onGround())
360 outerCorners.
min().z() = innerCorners.
min().z();
364 if (outer_.isSphere())
384 queries[0] = outerCorners.
min();
385 queries[1] = outerCorners.
max();
395 outerCorners.
min() = hits[0].hitPoint();
396 outerCorners.
max() = hits[1].hitPoint();
398 else if (outerControl::OUTER_EXTEND == outer_.type_)
400 outerTopology = EXTENDED;
406 outerCount = outer_.nCells_.x();
407 expRatio = outer_.expansion_.x();
413 ctrl.
x().prepend(outerCorners.
min().x(), outerCount, -expRatio);
414 ctrl.
x().append(outerCorners.
max().x(), outerCount, expRatio);
417 outerCount = outer_.nCells_.y();
418 expRatio = outer_.expansion_.y();
424 ctrl.
y().prepend(outerCorners.
min().y(), outerCount, -expRatio);
425 ctrl.
y().append(outerCorners.
max().y(), outerCount, expRatio);
427 outerCount =
max(outer_.nCells_.x(), outer_.nCells_.y());
428 expRatio =
min(outer_.expansion_.x(), outer_.expansion_.y());
434 if (!outer_.onGround())
436 ctrl.
z().prepend(outerCorners.
min().z(), outerCount, -expRatio);
438 ctrl.
z().append(outerCorners.
max().z(), outerCount, expRatio);
441 innerCorners =
bounds(ctrl.
x(), ctrl.
y(), ctrl.
z());
442 outerCorners = innerCorners;
454 const label radialCount = outer_.nCells_.x();
455 scalar expRatio = outer_.expansion_.x();
473 if (EXTENDED == outerTopology)
486 if (outer_.onGround())
501 else if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
514 if (CLIP_BOTTOM == outerTopology)
536 if (outer_.isSphere())
562 if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
564 corners = outerCorners.
points();
566 if (outer_.isSphere())
582 word innerZoneName =
"inner";
583 if (INNER_ONLY == outerTopology || EXTENDED == outerTopology)
585 innerZoneName.clear();
592 hexCount = innerCount;
597 hexVerts[Inner_Block],
604 if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
607 hexCount = innerCount;
608 hexGrade = innerGrading;
610 hexCount.
x() = radialCount;
614 hexGrade.
x() = radialInward;
619 hexGrade.
x() = radialOutward;
625 hexCount = innerCount;
626 hexGrade = innerGrading;
628 hexCount.
y() = radialCount;
632 hexGrade.
y() = radialInward;
637 hexGrade.
y() = radialOutward;
643 hexCount = innerCount;
644 hexGrade = innerGrading;
646 hexCount.
z() = radialCount;
649 if (!outer_.onGround())
651 hexGrade.
z() = radialInward;
656 hexGrade.
z() = radialOutward;
670 if (outer_.isSphere() && outerFaces.
size())
698 if (outer_.isSphere() && outerFaces.
size())
705 hex.
face(pr.second(), hexVerts[pr.first()])
732 hex.
face(pr.second(), hexVerts[pr.first()])
741 if (outer_.onGround())
754 hex.
face(pr.second(), hexVerts[pr.first()])
806 <<
"Generate blockMeshDict: "
815 this->blockMeshDict(
os);
822Foam::PDRblock::createBlockMesh(
const IOobject&
io)
const
828 "blockMeshDict.PDRblockMesh",
844Foam::PDRblock::meshBlockMesh(
const IOobject&
io)
const
859 outerControl::OUTER_EXTEND == outer_.type_
860 &&
meshPtr->cellZones().empty()
863 const boundBox innerBox
865 bounds(control_.x(), control_.y(), control_.z())
868 const label nZoneCellsMax =
870 control_.x().nCells()
871 * control_.y().nCells()
872 * control_.z().nCells()
878 List<cellZone*> cz(1);
887 cellZone& innerZone = *(cz[0]);
891 label nZoneCells = 0;
896 celli < cc.size() && nZoneCells < nZoneCellsMax;
900 if (innerBox.contains(cc[celli]))
902 innerZone[nZoneCells] = celli;
907 innerZone.
resize(nZoneCells);
909 pmesh.pointZones().clear();
910 pmesh.faceZones().clear();
911 pmesh.cellZones().clear();
912 pmesh.addZones(List<pointZone*>(), List<faceZone*>(), cz);
Various functions to operate on Lists.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
A 1D vector of objects of type <T> with a fixed length <N>.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
const fileName & local() const noexcept
Read access to local path component.
fileName objectPath() const
The complete path + object name.
bool writeHeader(Ostream &os) const
Write header with current type()
static unsigned int defaultPrecision() noexcept
Return the default precision.
An input stream of tokens.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
void resize(const label len)
Adjust allocated size of list.
Output to file stream, using an OSstream.
virtual const fileName & name() const
Read/write access to the name of the stream.
virtual int precision() const
Get precision of output field.
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
const boundBox & bounds() const
The mesh bounding box.
Vector< gradingDescriptors > grading() const
Equivalent edge grading descriptors in (x,y,z) directions.
@ EXPAND_RATIO
End/start ratio.
void writeBlockMeshDict(const IOobject &io) const
Write an equivalent blockMeshDict.
dictionary blockMeshDict() const
Content for an equivalent blockMeshDict.
const word & system() const
Return system name.
fileName relativePath(const fileName &input, const bool caseTag=false) const
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Return the first element of the list.
void size(const label n)
Older name for setAddressableSize.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static bool verboseOutput
The default verbosity (true)
A bounding box defined in terms of min/max extrema points.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
vector span() const
The bounding box span (from minimum to maximum)
point centre() const
The centre (midpoint) of the bounding box.
tmp< pointField > points() const
Corner points in an order corresponding to a 'hex' cell.
Maps a geometry to a set of cell primitives.
Foam::face face(const label modelFacei, const labelUList &pointLabels) const
Return the cell face for specified model face.
static const Enum< modelType > modelNames
Names of commonly used cellModels corresponding to modelType.
reference ref() const
A reference to the entry (Error if not found)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A face is a list of labels corresponding to mesh vertices.
edgeList edges() const
Return list of edges in forward walk order.
Handles the specification for grading within a section of a block.
List of gradingDescriptor for the sections of a block with additional IO functionality.
const labelVector & sizes() const
The (i,j,k) addressing dimensions.
const Time & time() const noexcept
Return time registry.
Searching on general spheroid.
Specialization of rigidBody to construct a sphere given the mass and radius.
@ END_STATEMENT
End entry [isseparator].
@ BEGIN_LIST
Begin list [isseparator].
@ END_LIST
End list [isseparator].
A class for handling words, derived from Foam::string.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Pair< label > labelPair
A pair of labels.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
static const word projKeyword("project")
static Ostream & serializeProjectEdge(Ostream &os, const edge &e)
static Ostream & outputIndent(Ostream &os, const UList< T > &list)
static Ostream & serializeFace(Ostream &os, const face &list)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static Ostream & serializeHex(Ostream &os, const labelUList &hexVerts, const labelVector &hexCount, const Vector< gradingDescriptors > hexGrade, const word &zoneName=word::null)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static const word projGeomName("sphere")
Field< vector > vectorField
Specialisation of Field<T> for vector.
static Ostream & endIndentList(Ostream &os)
static Ostream & serializeProjectPoints(Ostream &os, const UList< point > &list)
static Ostream & serializeProjectFace(Ostream &os, const face &list)
static Ostream & outputFlatList(Ostream &os, const UList< T > &list)
static Ostream & begIndentList(Ostream &os)
scalar relativeToGeometricRatio(const scalar expRatio, const label nDiv)
Calculate geometric ratio from relative ratio.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
constexpr char nl
The newline '\n' character (0x0a)