diff --git a/applications/utilities/mesh/generation/PDRblockMesh/PDRblockMesh.C b/applications/utilities/mesh/generation/PDRblockMesh/PDRblockMesh.C index 1b79537983..cba7c7d968 100644 --- a/applications/utilities/mesh/generation/PDRblockMesh/PDRblockMesh.C +++ b/applications/utilities/mesh/generation/PDRblockMesh/PDRblockMesh.C @@ -57,7 +57,6 @@ Usage #include "Time.H" #include "IOdictionary.H" #include "OSspecific.H" -#include "OFstream.H" using namespace Foam; @@ -97,6 +96,22 @@ int main(int argc, char *argv[]) ); argList::addOptionCompat("no-clean", {"noClean", -2006}); + argList::addBoolOption + ( + "no-outer", + "Create without any other region" + ); + argList::addBoolOption + ( + "print-dict", + "Print blockMeshDict equivalent and exit" + ); + argList::addBoolOption + ( + "write-dict", + "Write system/blockMeshDict.PDRblockMesh and exit" + ); + argList::addOption("dict", "file", "Alternative PDRblockMeshDict"); argList::addOption ( @@ -111,6 +126,9 @@ int main(int argc, char *argv[]) // Remove old files, unless disabled const bool removeOldFiles = !args.found("no-clean"); + // Suppress creation of the outer region + const bool noOuterRegion = args.found("no-outer"); + const word regionName(polyMesh::defaultRegion); const word regionPath; @@ -149,8 +167,38 @@ int main(int argc, char *argv[]) Info<< "Creating PDRblockMesh from " << runTime.relativePath(dictIO.objectPath()) << endl; + // Always start from a PDRblock PDRblock blkMesh(meshDict, true); + if (args.found("print-dict")) + { + Info<< nl << "Equivalent blockMeshDict" << nl << nl; + + blkMesh.blockMeshDict(Info, true); + + Info<< "\nEnd\n" << endl; + return 0; + } + + if (args.found("write-dict")) + { + // Generate system/blockMeshDict and exit + blkMesh.writeBlockMeshDict + ( + IOobject + ( + "blockMeshDict.PDRblockMesh", + runTime.system(), // instance + runTime, // registry + IOobject::NO_READ, + IOobject::NO_WRITE, + false // Do not register + ) + ); + + Info<< "\nEnd\n" << endl; + return 0; + } // Instance for resulting mesh if (useTime) @@ -170,14 +218,19 @@ int main(int argc, char *argv[]) Info<< nl << "Creating polyMesh from PDRblockMesh" << endl; + if (noOuterRegion) + { + Info<< "Outer region disabled, using ijk generation" << nl; + } autoPtr meshPtr = - blkMesh.mesh - ( - IOobject(regionName, meshInstance, runTime) - ); + ( + args.found("no-outer") + ? blkMesh.innerMesh(IOobject(regionName, meshInstance, runTime)) + : blkMesh.mesh(IOobject(regionName, meshInstance, runTime)) + ); - const polyMesh& mesh = *meshPtr; + polyMesh& mesh = *meshPtr; // Set the precision of the points data to 10 IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision())); diff --git a/applications/utilities/preProcessing/PDR/pdrFields/PDRmeshArrays.C b/applications/utilities/preProcessing/PDR/pdrFields/PDRmeshArrays.C index 2306381322..d09aa71f19 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/PDRmeshArrays.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/PDRmeshArrays.C @@ -94,7 +94,7 @@ void Foam::PDRmeshArrays::classify << " nPoints:" << pdrBlock.nPoints() << " nCells:" << pdrBlock.nCells() << " nFaces:" << pdrBlock.nFaces() << nl - << " min-edge:" << pdrBlock.minEdgeLen() << nl; + << " min-edge:" << pdrBlock.edgeLimits().min() << nl; Info<< "Classifying ijk indexing... " << nl; diff --git a/etc/caseDicts/annotated/PDRblockMeshDict b/etc/caseDicts/annotated/PDRblockMeshDict new file mode 100644 index 0000000000..c3eb54a377 --- /dev/null +++ b/etc/caseDicts/annotated/PDRblockMeshDict @@ -0,0 +1,97 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2006 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object PDRblockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +//- Point scaling (optional) +scale 1; + +x +{ + points ( -13.28 -0.10 6.0 19.19 ); + nCells ( 10 12 10 ); + ratios ( -5.16 1 5.16 ); +} + +y +{ + points ( -12.98 0 5.50 18.48 ); + nCells ( 10 11 10 ); + ratios ( -5.16 1 5.16 ); +} + +z +{ + points ( 0.00 4.80 17.26 ); + nCells ( 10 10 ); + ratios ( 1 5.16 ); +} + + +defaultPatch +{ + name walls; + type wall; +} + + +// Faces: 0=x-min, 1=x-max, 2=y-min, 3=y-max, 4=z-min, 5=z-max + +boundary +( + outer + { + type patch; + faces ( 0 1 2 3 5 ); + } + + mergingFaces + { + type wall; + faces (); + } + + blockedFaces + { + type wall; + faces (); + } + + ground + { + type wall; + faces ( 4 ); + } +); + + +// Treatment of the outer region + +outer +{ + type sphere; // (none | extend | box | sphere) [default: none] + onGround true; // Module on the ground? [default: false] + expansion relative; // (uniform | ratio | relative) [default: ratio] + + ratios 1.1; + + size 3; // Overall outer/inner size + nCells 10; // Number of cells for outer region + + // size (3 4); + // nCells (10 12); +} + + +// ************************************************************************* // diff --git a/src/mesh/blockMesh/Make/files b/src/mesh/blockMesh/Make/files index 2f88d0e1e3..ab22fd286d 100644 --- a/src/mesh/blockMesh/Make/files +++ b/src/mesh/blockMesh/Make/files @@ -40,7 +40,9 @@ blockMesh/blockMeshMergeTopological.C blockMeshTools/blockMeshTools.C PDRblockMesh/PDRblock.C +PDRblockMesh/PDRblockBlockMesh.C PDRblockMesh/PDRblockCreate.C PDRblockMesh/PDRblockLocation.C +PDRblockMesh/PDRblockOuter.C LIB = $(FOAM_LIBBIN)/libblockMesh diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblock.C b/src/mesh/blockMesh/PDRblockMesh/PDRblock.C index aa6170b924..7a97637c57 100644 --- a/src/mesh/blockMesh/PDRblockMesh/PDRblock.C +++ b/src/mesh/blockMesh/PDRblockMesh/PDRblock.C @@ -28,6 +28,7 @@ License #include "PDRblock.H" #include "ListOps.H" #include "emptyPolyPatch.H" +#include "gradingDescriptors.H" // Output when verbosity is enabled #undef Log @@ -52,21 +53,22 @@ Foam::PDRblock::expansionNames_ namespace Foam { - //- Calculate geometric expansion factor from expansion ratio - inline scalar calcGexp(const scalar expRatio, const label nDiv) - { - return nDiv > 1 ? pow(expRatio, 1.0/(nDiv - 1)) : 0.0; - } - //- Calculate geometric ratio from relative ratio - inline scalar relativeToGeometricRatio - ( - const scalar expRatio, - const label nDiv - ) - { - return nDiv > 1 ? pow(expRatio, (nDiv - 1)) : 1.0; - } +//- Calculate geometric expansion factor from expansion ratio +inline scalar calcGexp(const scalar expRatio, const label nDiv) +{ + return nDiv > 1 ? pow(expRatio, 1.0/(nDiv - 1)) : 0.0; +} + +//- Calculate geometric ratio from relative ratio +inline scalar relativeToGeometricRatio +( + const scalar expRatio, + const label nDiv +) +{ + return nDiv > 1 ? pow(expRatio, (nDiv - 1)) : 1.0; +} } // End namespace Foam @@ -129,32 +131,20 @@ void Foam::PDRblock::adjustSizes() grid_.z().clear(); bounds_ = boundBox::invertedBox; - minEdgeLen_ = Zero; + edgeLimits_.min() = 0; + edgeLimits_.max() = 0; return; } // Adjust boundBox - bounds_.min().x() = grid_.x().first(); - bounds_.min().y() = grid_.y().first(); - bounds_.min().z() = grid_.z().first(); + bounds_ = bounds(grid_.x(), grid_.y(), grid_.z()); - bounds_.max().x() = grid_.x().last(); - bounds_.max().y() = grid_.y().last(); - bounds_.max().z() = grid_.z().last(); + // Min/max edge lengths + edgeLimits_.clear(); - // Min edge length - minEdgeLen_ = GREAT; - - for (direction cmpt=0; cmpt < vector::nComponents; ++cmpt) - { - const label nEdge = grid_[cmpt].nCells(); - - for (label edgei=0; edgei < nEdge; ++edgei) - { - const scalar len = grid_[cmpt].width(edgei); - minEdgeLen_ = min(minEdgeLen_, len); - } - } + edgeLimits_.add(grid_.x().edgeLimits()); + edgeLimits_.add(grid_.y().edgeLimits()); + edgeLimits_.add(grid_.z().edgeLimits()); } @@ -166,14 +156,18 @@ void Foam::PDRblock::readGridControl expansionType expandType ) { - //- The begin/end nodes for each segment - scalarList knots; + gridControl& ctrl = control_[cmpt]; + + // Begin/end nodes for each segment + scalarList& knots = static_cast(ctrl); // The number of division per segment - labelList divisions; + labelList& divisions = ctrl.divisions_; // The expansion ratio per segment - scalarList expansion; + scalarList& expansion = ctrl.expansion_; + + expansion.clear(); // expansion is optional Log << "Reading grid control for " << vector::componentNames[cmpt] << " direction" << nl; @@ -514,6 +508,12 @@ void Foam::PDRblock::readBoundary(const dictionary& dict) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::PDRblock::PDRblock() +: + PDRblock(dictionary::null, false) +{} + + Foam::PDRblock::PDRblock ( const UList& xgrid, @@ -521,7 +521,7 @@ Foam::PDRblock::PDRblock const UList& zgrid ) : - PDRblock() + PDRblock(dictionary::null, false) { // Default boundaries with patchi == shapeFacei patches_.resize(6); @@ -541,13 +541,21 @@ Foam::PDRblock::PDRblock } -Foam::PDRblock::PDRblock(const dictionary& dict, bool verbose) +Foam::PDRblock::PDRblock(const dictionary& dict, bool verboseOutput) : - PDRblock() + ijkMesh(), + meshDict_(dict), + grid_(), + outer_(), + bounds_(), + patches_(), + edgeLimits_(0,0), + verbose_(verboseOutput) { - verbose_ = verbose; - - read(dict); + if (&dict != &dictionary::null) + { + read(dict); + } } @@ -575,6 +583,16 @@ bool Foam::PDRblock::read(const dictionary& dict) readBoundary(dict); + // Outer treatment: (none | extend | box | sphere) + outer_.clear(); + + const dictionary* outerDictPtr = dict.findDict("outer"); + if (outerDictPtr) + { + outer_.read(*outerDictPtr); + } + outer_.report(Info); + return true; } @@ -644,7 +662,7 @@ bool Foam::PDRblock::gridIndex const scalar relTol ) const { - const scalar tol = relTol * minEdgeLen_; + const scalar tol = relTol * edgeLimits_.min(); for (direction cmpt=0; cmpt < labelVector::nComponents; ++cmpt) { @@ -688,4 +706,33 @@ Foam::labelVector Foam::PDRblock::gridIndex } +Foam::Vector Foam::PDRblock::grading() const +{ + return grading(control_); +} + + +Foam::gradingDescriptors Foam::PDRblock::grading(const direction cmpt) const +{ + switch (cmpt) + { + case vector::X : + case vector::Y : + case vector::Z : + { + return control_[cmpt].grading(); + break; + } + + default : + FatalErrorInFunction + << "Not gridControl for direction " << label(cmpt) << endl + << exit(FatalError); + break; + } + + return gradingDescriptors(); +} + + // ************************************************************************* // diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblock.H b/src/mesh/blockMesh/PDRblockMesh/PDRblock.H index 94a841e7c4..0072cd01ea 100644 --- a/src/mesh/blockMesh/PDRblockMesh/PDRblock.H +++ b/src/mesh/blockMesh/PDRblockMesh/PDRblock.H @@ -73,6 +73,8 @@ SourceFiles #include "pointField.H" #include "faceList.H" #include "Enum.H" +#include "vector2D.H" +#include "labelVector2D.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -81,7 +83,9 @@ namespace Foam // Forward Declarations class IOobject; +class blockMesh; class polyMesh; +class gradingDescriptors; /*---------------------------------------------------------------------------*\ Class PDRblock Declaration @@ -96,7 +100,7 @@ public: // Data Types //- The expansion type - enum expansionType + enum expansionType : uint8_t { EXPAND_UNIFORM, //!< Uniform expansion (ie, no expansion) EXPAND_RATIO, //!< End/start ratio @@ -115,7 +119,7 @@ public: { public: - //- The locations are valid if they contain 2 or more points + //- The location list is valid if it contains 2 or more points inline bool valid() const; //- The number of cells in this direction. @@ -136,6 +140,9 @@ public: //- Mid-point location, zero for an empty list. inline scalar centre() const; + //- The difference between min/max values, zero for an empty list. + inline scalar length() const; + //- Check that element index is within valid range. inline void checkIndex(const label i) const; @@ -146,6 +153,13 @@ public: // Treats -1 and nCells positions like a halo cell. inline scalar C(const label i) const; + //- Return min/max edge lengths + scalarMinMax edgeLimits() const; + + //- Return edge grading descriptors for the locations + // \see Foam::gradingDescriptor + gradingDescriptors grading() const; + //- Find the cell index enclosing this location // \return -1 for out-of-bounds label findCell(const scalar p) const; @@ -172,6 +186,33 @@ private: // Private Classes + //- The begin/end nodes for each segment, + //- with divisions and expansion for each segment + struct gridControl + : + public scalarList + { + //- The number of division per segment + labelList divisions_; + + //- The expansion ratio per segment + scalarList expansion_; + + //- Total number of cells in this direction + label nCells() const; + + //- Return edge grading descriptors for the locations + // \see Foam::gradingDescriptor + gradingDescriptors grading() const; + + //- Add point/divisions/expand to end of list (push_back) + void append(const scalar p, label nDiv, scalar expRatio=1); + + //- Add point/divisions/expand to front of list (push_front) + void prepend(const scalar p, label nDiv, scalar expRatio=1); + }; + + //- Extracted patch settings struct boundaryEntry { @@ -188,23 +229,100 @@ private: labelList faces_; }; + //- The begin/end nodes for each segment, + //- with divisions and expansion for each segment + struct outerControl + { + //- The control type + enum controlType : uint8_t + { + OUTER_NONE = 0, //!< No outer region + OUTER_EXTEND, //!< Extend inner region (orthogonal) + OUTER_BOX, //!< Cuboid + OUTER_SPHERE //!< Spherical + }; + + //- Named enumerations for the control type + const static Enum controlNames_; + + //- The control type + controlType type_; + + //- The expansion type + expansionType expandType_; + + //- True if on the ground + bool onGround_; + + //- Relative size(s) for the outer region + vector2D relSize_; + + //- Number of cells in outer region + // Generally only single component is used + labelVector2D nCells_; + + //- Expansion ratio(s) for the outer region + vector2D expansion_; + + + // Constructors + + //- Default construct. NONE + outerControl(); + + + // Member Functions + + //- Reset to default (NONE) values + void clear(); + + //- Is enabled (not NONE) + bool active() const; + + //- Project on to sphere (is SPHERE) + bool isSphere() const; + + //- Is the outer region on the ground? + bool onGround() const; + + //- Define that the outer region is on the ground or not + // \return the old value + bool onGround(const bool on); + + //- Read content from dictionary + void read(const dictionary& dict); + + //- Report information about outer region + void report(Ostream& os) const; + }; + // Private Data - //- Verbosity - bool verbose_; + //- Reference to mesh dictionary + const dictionary& meshDict_; - //- The grid points in all (i,j,k / x,y,z) directions. + //- The grid controls in (i,j,k / x,y,z) directions. + Vector control_; + + //- The grid points in all (i,j,k / x,y,z) directions, + //- after applying the internal subdivisions. Vector grid_; + //- Control for the outer-region (if any) + outerControl outer_; + //- The mesh bounding box boundBox bounds_; //- The boundary patch information PtrList patches_; - //- The min edge length - scalar minEdgeLen_; + //- The min/max edge lengths + scalarMinMax edgeLimits_; + + //- Verbosity + bool verbose_; // Private Member Functions @@ -267,6 +385,35 @@ private: const scalar tol ) const; + //- The bounding box of the grid points + static boundBox bounds + ( + const scalarList& x, //!< X-points, monotonically increasing + const scalarList& y, //!< Y-points, monotonically increasing + const scalarList& z //!< T-points, monotonically increasing + ); + + //- Equivalent edge grading descriptors in (x,y,z) directions. + static Vector grading + ( + const Vector& ctrl + ); + + //- Mesh sizes based on the controls + static labelVector sizes + ( + const Vector& ctrl + ); + + + // Mesh Generation + + //- Create a blockMesh + autoPtr createBlockMesh(const IOobject& io) const; + + //- Create polyMesh via blockMesh + autoPtr meshBlockMesh(const IOobject& io) const; + public: @@ -278,8 +425,8 @@ public: // Constructors - //- Construct zero-size - inline PDRblock(); + //- Default construct, zero-size, inverted bounds etc + PDRblock(); //- Construct from components PDRblock @@ -290,7 +437,7 @@ public: ); //- Construct from dictionary - explicit PDRblock(const dictionary& dict, bool verbose=false); + explicit PDRblock(const dictionary& dict, bool verboseOutput=false); // Member Functions @@ -312,14 +459,23 @@ public: //- The grid point locations in the i,j,k (x,y,z) directions. inline const Vector& grid() const; + //- Equivalent edge grading descriptors in (x,y,z) directions. + Vector grading() const; - // Mesh information + //- Equivalent edge grading descriptors in specified (x,y,z) direction. + gradingDescriptors grading(const direction cmpt) const; + + + // Mesh Information + + //- Mesh sizing as per ijkMesh + using ijkMesh::sizes; //- The mesh bounding box inline const boundBox& bounds() const; - //- The min edge length - inline const scalar& minEdgeLen() const; + //- The min/max edge length + inline const scalarMinMax& edgeLimits() const; //- Cell size in x-direction at i position. inline scalar dx(const label i) const; @@ -379,17 +535,30 @@ public: labelVector findCell(const point& pt) const; //- Obtain i,j,k grid index for point location within specified - // relative tolerance of the minEdgeLen. + // relative tolerance of the min edge length // The value (-1,-1,-1) is returned for out-of-bounds (not found). // and off-grid labelVector gridIndex(const point& pt, const scalar relTol=0.01) const; - // Mesh generation + // Mesh Generation + + //- Output content for an equivalent blockMeshDict + // Optionally generate header/footer content + Ostream& blockMeshDict(Ostream& os, const bool withHeader=false) const; + + //- Content for an equivalent blockMeshDict + dictionary blockMeshDict() const; + + //- Write an equivalent blockMeshDict + void writeBlockMeshDict(const IOobject& io) const; //- Create polyMesh for grid definition and patch information autoPtr mesh(const IOobject& io) const; + //- Create polyMesh for inner-mesh only, + //- ignore any outer block definitions + autoPtr innerMesh(const IOobject& io) const; }; diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblockBlockMesh.C b/src/mesh/blockMesh/PDRblockMesh/PDRblockBlockMesh.C new file mode 100644 index 0000000000..98058904d3 --- /dev/null +++ b/src/mesh/blockMesh/PDRblockMesh/PDRblockBlockMesh.C @@ -0,0 +1,920 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2020 OpenCFD Ltd. +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "PDRblock.H" +#include "ListOps.H" +#include "cellModeller.H" +#include "gradingDescriptors.H" +#include "objectRegistry.H" +#include "Time.H" +#include "IOdictionary.H" +#include "Fstream.H" +#include "OTstream.H" +#include "edgeHashes.H" + +#include "cellModel.H" +#include "blockMesh.H" +#include "polyMesh.H" +#include "searchableSphere.H" + +// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Name for the projection geometry +static const word projKeyword("project"); + +// Name for the projection geometry +static const word projGeomName("sphere"); + + +//- Calculate geometric ratio from relative ratio +inline scalar relativeToGeometricRatio +( + const scalar expRatio, + const label nDiv +) +{ + return nDiv > 1 ? pow(expRatio, (nDiv - 1)) : 1.0; +} + + +// Output space-separated flat list. No size prefix. +template +static Ostream& outputFlatList(Ostream& os, const UList& list) +{ + os << token::BEGIN_LIST; + label i = 0; + for (const label val : list) + { + if (i++) os << token::SPACE; + os << val; + } + os << token::END_LIST; + + return os; +} + + +// Begin indent list +static inline Ostream& begIndentList(Ostream& os) +{ + os << indent << incrIndent << token::BEGIN_LIST << nl; + return os; +} + +// End indent list +static inline Ostream& endIndentList(Ostream& os) +{ + os << decrIndent << indent << token::END_LIST; + return os; +} + + +// Output list contents (newline separated) indented. +template +static Ostream& outputIndent(Ostream& os, const UList& list) +{ + for (const T& val : list) + { + os << indent << val << nl; + } + return os; +} + + +// +static Ostream& serializeHex +( + Ostream& os, + const labelUList& hexVerts, + const labelVector& hexCount, + const Vector hexGrade, + const word& zoneName = word::null +) +{ + os << indent << cellModel::modelNames[cellModel::HEX] << token::SPACE; + outputFlatList(os, hexVerts); + + if (!zoneName.empty()) + { + os << token::SPACE << zoneName; + } + + os << token::SPACE << hexCount << nl + << indent << word("edgeGrading") << nl; + + begIndentList(os); + + // Grading (x/y/z) + for (const gradingDescriptors& gds : hexGrade) + { + begIndentList(os); + outputIndent(os, gds); + endIndentList(os) << nl; + } + + endIndentList(os) << nl; + return os; +} + + +// Generate list with entries: +// +// project (x y z) (geometry) +// +static Ostream& serializeProjectPoints +( + Ostream& os, + const UList& list +) +{ + for (const point& p : list) + { + os << indent << projKeyword << token::SPACE + << p + << token::SPACE + << token::BEGIN_LIST << projGeomName << token::END_LIST << nl; + } + + return os; +} + + +// Generate entry: +// +// project (beg end) (geometry) +// +static Ostream& serializeProjectEdge +( + Ostream& os, + const edge& e +) +{ + os << indent << projKeyword << token::SPACE; + + if (e.sorted()) + { + os << e.first() << token::SPACE << e.second(); + } + else + { + os << e.second() << token::SPACE << e.first(); + } + + os << token::SPACE + << token::BEGIN_LIST << projGeomName << token::END_LIST << nl; + + return os; +} + + +// Generate entry: +// +// (0 1 2 ..) +// +static Ostream& serializeFace +( + Ostream& os, + const face& list +) +{ + os << indent; + outputFlatList(os, list); + os << nl; + return os; +} + + +// Generate entry: +// +// project (0 1 2 ..) geometry +// +static Ostream& serializeProjectFace +( + Ostream& os, + const face& list +) +{ + os << indent << projKeyword << token::SPACE; + outputFlatList(os, list); + os << token::SPACE << projGeomName << nl; + + return os; +} + +} // namespace Foam + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::Ostream& Foam::PDRblock::blockMeshDict +( + Ostream& os, + const bool withHeader +) const +{ + if (withHeader) + { + // Use dummy time for fake objectRegistry + autoPtr