PDRblockBlockMesh.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2020-2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "PDRblock.H"
29 #include "ListOps.H"
30 #include "gradingDescriptors.H"
31 #include "objectRegistry.H"
32 #include "Time.H"
33 #include "IOdictionary.H"
34 #include "Fstream.H"
35 #include "OTstream.H"
36 #include "edgeHashes.H"
37 
38 #include "cellModel.H"
39 #include "blockMesh.H"
40 #include "polyMesh.H"
41 #include "searchableSphere.H"
42 
43 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Name for the projection geometry
49 static const word projKeyword("project");
50 
51 // Name for the projection geometry
52 static const word projGeomName("sphere");
53 
54 
55 //- Calculate geometric ratio from relative ratio
56 inline scalar relativeToGeometricRatio
57 (
58  const scalar expRatio,
59  const label nDiv
60 )
61 {
62  return nDiv > 1 ? pow(expRatio, (nDiv - 1)) : 1.0;
63 }
64 
65 
66 // Output space-separated flat list. No size prefix.
67 template<class T>
68 static Ostream& outputFlatList(Ostream& os, const UList<T>& list)
69 {
71  label i = 0;
72  for (const label val : list)
73  {
74  if (i++) os << token::SPACE;
75  os << val;
76  }
78 
79  return os;
80 }
81 
82 
83 // Begin indent list
84 static inline Ostream& begIndentList(Ostream& os)
85 {
87  return os;
88 }
89 
90 // End indent list
91 static inline Ostream& endIndentList(Ostream& os)
92 {
94  return os;
95 }
96 
97 
98 // Output list contents (newline separated) indented.
99 template<class T>
100 static Ostream& outputIndent(Ostream& os, const UList<T>& list)
101 {
102  for (const T& val : list)
103  {
104  os << indent << val << nl;
105  }
106  return os;
107 }
108 
109 
110 //
111 static Ostream& serializeHex
112 (
113  Ostream& os,
114  const labelUList& hexVerts,
115  const labelVector& hexCount,
116  const Vector<gradingDescriptors> hexGrade,
117  const word& zoneName = word::null
118 )
119 {
121  outputFlatList(os, hexVerts);
122 
123  if (!zoneName.empty())
124  {
125  os << token::SPACE << zoneName;
126  }
127 
128  os << token::SPACE << hexCount << nl
129  << indent << word("edgeGrading") << nl;
130 
131  begIndentList(os);
132 
133  // Grading (x/y/z)
134  for (const gradingDescriptors& gds : hexGrade)
135  {
136  begIndentList(os);
137  outputIndent(os, gds);
138  endIndentList(os) << nl;
139  }
140 
141  endIndentList(os) << nl;
142  return os;
143 }
144 
145 
146 // Generate list with entries:
147 //
148 // project (x y z) (geometry)
149 //
151 (
152  Ostream& os,
153  const UList<point>& list
154 )
155 {
156  for (const point& p : list)
157  {
159  << p
160  << token::SPACE
162  }
163 
164  return os;
165 }
166 
167 
168 // Generate entry:
169 //
170 // project (beg end) (geometry)
171 //
173 (
174  Ostream& os,
175  const edge& e
176 )
177 {
179 
180  if (e.is_sorted())
181  {
182  os << e.first() << token::SPACE << e.second();
183  }
184  else
185  {
186  os << e.second() << token::SPACE << e.first();
187  }
188 
189  os << token::SPACE
191 
192  return os;
193 }
194 
195 
196 // Generate entry:
197 //
198 // (0 1 2 ..)
199 //
200 static Ostream& serializeFace
201 (
202  Ostream& os,
203  const face& list
204 )
205 {
206  os << indent;
207  outputFlatList(os, list);
208  os << nl;
209  return os;
210 }
211 
212 
213 // Generate entry:
214 //
215 // project (0 1 2 ..) geometry
216 //
218 (
219  Ostream& os,
220  const face& list
221 )
222 {
224  outputFlatList(os, list);
225  os << token::SPACE << projGeomName << nl;
226 
227  return os;
228 }
229 
230 } // namespace Foam
232 
233 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
234 
236 (
237  Ostream& os,
238  const bool withHeader
239 ) const
240 {
241  if (withHeader)
242  {
243  // Use dummy time for fake objectRegistry
244  autoPtr<Time> dummyTimePtr(Time::New());
245 
246  IOdictionary iodict
247  (
248  IOobject
249  (
250  "blockMeshDict",
251  dummyTimePtr->system(),
252  *dummyTimePtr,
256  )
257  );
258 
259  iodict.writeHeader(os);
260  }
261 
263 
264  // The mesh topology will normally be an O-grid with a central (inner)
265  // block and 6 outer blocks.
266  // The inner block is described by (0 1 2 3 4 5 6 7).
267  // The additional points for the outer region: (8 9 19 11 12 13 14 15)
268 
269  // The outer blocks will be addressed according to their
270  // placement w.r.t. the inner block, and defined such that they retain
271  // the same global orientation as the inner block.
272  // For example, face 0 of all blocks will be on the logical x-min side
273  // of the mesh.
274 
275  // List of hex vertices, ordered with outer blocks first to allow
276  // direct addressing by their logical position.
278  hexVerts
279  ({
280  {8, 0, 3, 11, 12, 4, 7, 15}, // x-min block (face 0)
281  {1, 9, 10, 2, 5, 13, 14, 6}, // x-max block (face 1)
282  {8, 9, 1, 0, 12, 13, 5, 4}, // y-min block (face 2)
283  {3, 2, 10, 11, 7, 6, 14, 15}, // y-max block (face 3)
284  {8, 9, 10, 11, 0, 1, 2, 3}, // z-min block (face 4)
285  {4, 5, 6, 7, 12, 13, 14, 15}, // z-max block (face 5)
286  {0, 1, 2, 3, 4, 5, 6, 7}, // Inner box description
287  {8, 9, 10, 11, 12, 13, 14, 15}, // Outer box description
288  });
289 
290  // The face or the logical block index (for the O-grid)
291  enum faceIndex
292  {
293  X_Min = 0,
294  X_Max = 1,
295  Y_Min = 2,
296  Y_Max = 3,
297  Z_Min = 4,
298  Z_Max = 5,
299  Inner_Block = 6, // Inner block description
300  Outer_Block = 7, // Outer bounding box description
301  };
302 
303  // Lists of block/face for outside and ground faces
304  DynamicList<labelPair> outerFaces(8);
305  DynamicList<labelPair> groundFaces(8);
306 
307  // We handle a few fixed topology configurations
308 
309  enum blockTopologyType
310  {
311  INNER_ONLY = 0, // No outer region
312  EXTENDED = 1, // Outer created by extending inner region
313  CLIP_BOTTOM = 5, // Outer O-grid on 5 sides
314  FULL_OUTER = 6 // Outer O-grid on 6 sides
315  };
316 
317 
318 
319  // Expansion ratios need conversion from relative to geometric
320  const bool useRelToGeom =
321  (expansionType::EXPAND_RATIO == outer_.expandType_);
322 
323 
324  // Physical dimensions
325 
326  Vector<gridControl> ctrl(control_);
327  boundBox innerCorners(bounds(ctrl.x(), ctrl.y(), ctrl.z()));
328 
329  boundBox outerCorners;
330 
331 
332  point radialCentre(innerCorners.centre());
333  vector radialSizes(0.5*innerCorners.span());
334 
335  blockTopologyType outerTopology = INNER_ONLY;
336 
337 
338  if (outer_.active())
339  {
340  outerTopology = FULL_OUTER;
341 
342  // Convert from relative size
343  radialSizes.x() *= outer_.relSize_.x();
344  radialSizes.y() *= outer_.relSize_.y();
345  radialSizes.z() *= min(outer_.relSize_.x(), outer_.relSize_.y());
346 
347  if (outer_.onGround())
348  {
349  outerTopology = CLIP_BOTTOM;
350  radialCentre.z() = innerCorners.min().z();
351  radialSizes.z() *= 2;
352  }
353 
354  // Corners for a box
355  outerCorners.min() = radialCentre - radialSizes;
356  outerCorners.max() = radialCentre + radialSizes;
357 
358  if (outer_.onGround())
359  {
360  outerCorners.min().z() = innerCorners.min().z();
361  }
362 
363 
364  if (outer_.isSphere())
365  {
366  // For spheroid projection, don't trust that blockMesh does it
367  // properly. Give some reasonable estimates of the corners.
368 
369  // Use dummy Time for objectRegistry
370  autoPtr<Time> dummyTimePtr(Time::New());
371 
372  const IOobject io
373  (
374  "sphere",
375  *dummyTimePtr,
379  );
380 
381  searchableSphere sphere(io, radialCentre, radialSizes);
382 
383  pointField queries(2);
384  queries[0] = outerCorners.min();
385  queries[1] = outerCorners.max();
386 
387  List<pointIndexHit> hits;
388  sphere.findNearest
389  (
390  queries,
391  scalarField(2, GREAT),
392  hits
393  );
394 
395  outerCorners.min() = hits[0].hitPoint();
396  outerCorners.max() = hits[1].hitPoint();
397  }
398  else if (outerControl::OUTER_EXTEND == outer_.type_)
399  {
400  outerTopology = EXTENDED;
401 
402  // Extend the inner block
403  label outerCount;
404  scalar expRatio;
405 
406  outerCount = outer_.nCells_.x();
407  expRatio = outer_.expansion_.x();
408  if (useRelToGeom)
409  {
410  expRatio = relativeToGeometricRatio(expRatio, outerCount);
411  }
412 
413  ctrl.x().prepend(outerCorners.min().x(), outerCount, -expRatio);
414  ctrl.x().append(outerCorners.max().x(), outerCount, expRatio);
415 
416 
417  outerCount = outer_.nCells_.y();
418  expRatio = outer_.expansion_.y();
419  if (useRelToGeom)
420  {
421  expRatio = relativeToGeometricRatio(expRatio, outerCount);
422  }
423 
424  ctrl.y().prepend(outerCorners.min().y(), outerCount, -expRatio);
425  ctrl.y().append(outerCorners.max().y(), outerCount, expRatio);
426 
427  outerCount = max(outer_.nCells_.x(), outer_.nCells_.y());
428  expRatio = min(outer_.expansion_.x(), outer_.expansion_.y());
429  if (useRelToGeom)
430  {
431  expRatio = relativeToGeometricRatio(expRatio, outerCount);
432  }
433 
434  if (!outer_.onGround())
435  {
436  ctrl.z().prepend(outerCorners.min().z(), outerCount, -expRatio);
437  }
438  ctrl.z().append(outerCorners.max().z(), outerCount, expRatio);
439 
440  // Update corners
441  innerCorners = bounds(ctrl.x(), ctrl.y(), ctrl.z());
442  outerCorners = innerCorners;
443  }
444  }
445 
446 
447  const Vector<gradingDescriptors> innerGrading(grading(ctrl));
448  const labelVector innerCount(sizes(ctrl));
449 
450  labelVector hexCount;
452 
453 
454  const label radialCount = outer_.nCells_.x();
455  scalar expRatio = outer_.expansion_.x();
456 
457  if (useRelToGeom)
458  {
459  expRatio = relativeToGeometricRatio(expRatio, radialCount);
460  }
461 
462  const gradingDescriptors radialInward
463  (
464  gradingDescriptor{-expRatio}
465  );
466 
467  const gradingDescriptors radialOutward
468  (
469  gradingDescriptor{expRatio}
470  );
471 
472 
473  if (EXTENDED == outerTopology)
474  {
475  // The inner block is extended to become the outer faces
476  outerFaces.append
477  ({
478  labelPair(Inner_Block, X_Min),
479  labelPair(Inner_Block, X_Max),
480  labelPair(Inner_Block, Y_Min),
481  labelPair(Inner_Block, Y_Max),
482  labelPair(Inner_Block, Z_Max)
483  });
484 
485  // The ground faces vs outside faces
486  if (outer_.onGround())
487  {
488  groundFaces.append
489  (
490  labelPair(Inner_Block, Z_Min)
491  );
492  }
493  else
494  {
495  outerFaces.append
496  (
497  labelPair(Inner_Block, Z_Min)
498  );
499  }
500  }
501  else if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
502  {
503  // The outside faces
504  outerFaces.append
505  ({
506  labelPair(X_Min, X_Min),
507  labelPair(X_Max, X_Max),
508  labelPair(Y_Min, Y_Min),
509  labelPair(Y_Max, Y_Max),
510  labelPair(Z_Max, Z_Max)
511  });
512 
513  // The ground faces
514  if (CLIP_BOTTOM == outerTopology)
515  {
516  groundFaces.append
517  ({
518  labelPair(X_Min, Z_Min),
519  labelPair(X_Max, Z_Min),
520  labelPair(Y_Min, Z_Min),
521  labelPair(Y_Max, Z_Min),
522  // Note: {Z_Min, Z_Min} will not exist
523  labelPair(Inner_Block, Z_Min)
524  });
525  }
526  else
527  {
528  outerFaces.append
529  (
530  labelPair(Z_Min, Z_Min)
531  );
532  }
533  }
534 
535 
536  if (outer_.isSphere())
537  {
538  os.beginBlock("geometry");
539  {
540  os.beginBlock(projGeomName);
541  {
542  os.writeEntry("type", "sphere");
543  os.writeEntry("origin", radialCentre);
544  os.writeEntry("radius", radialSizes);
545  }
546  os.endBlock();
547  }
548  os.endBlock();
549  }
550 
551  // vertices
552  {
553  os << nl << word("vertices") << nl;
554  begIndentList(os);
555 
556  pointField corners(innerCorners.points());
557 
558  // inner
559  outputIndent(os, corners);
560 
561  // outer
562  if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
563  {
564  corners = outerCorners.points();
565 
566  if (outer_.isSphere())
567  {
568  serializeProjectPoints(os, corners);
569  }
570  else
571  {
572  outputIndent(os, corners);
573  }
574  }
575 
576  endIndentList(os);
577  os.endEntry();
578  }
579 
580 
581  // blocks
582  {
583  word innerZoneName = "inner";
584  if (INNER_ONLY == outerTopology || EXTENDED == outerTopology)
585  {
586  innerZoneName.clear();
587  }
588 
589  os << nl << word("blocks") << nl;
590  begIndentList(os);
591 
592  // Inner block
593  hexCount = innerCount;
594 
596  (
597  os,
598  hexVerts[Inner_Block],
599  hexCount,
600  innerGrading,
601  innerZoneName
602  );
603 
604  // outer
605  if (CLIP_BOTTOM == outerTopology || FULL_OUTER == outerTopology)
606  {
607  // Radial direction = X
608  hexCount = innerCount;
609  hexGrade = innerGrading;
610 
611  hexCount.x() = radialCount;
612 
613  // Face 0: x-min
614  {
615  hexGrade.x() = radialInward;
616  serializeHex(os, hexVerts[X_Min], hexCount, hexGrade);
617  }
618  // Face 1: x-max
619  {
620  hexGrade.x() = radialOutward;
621  serializeHex(os, hexVerts[X_Max], hexCount, hexGrade);
622  }
623 
624 
625  // Radial direction = Y
626  hexCount = innerCount;
627  hexGrade = innerGrading;
628 
629  hexCount.y() = radialCount;
630 
631  // Face 2: y-min
632  {
633  hexGrade.y() = radialInward;
634  serializeHex(os, hexVerts[Y_Min], hexCount, hexGrade);
635  }
636  // Face 3: y-max
637  {
638  hexGrade.y() = radialOutward;
639  serializeHex(os, hexVerts[Y_Max], hexCount, hexGrade);
640  }
641 
642 
643  // Radial direction = Z
644  hexCount = innerCount;
645  hexGrade = innerGrading;
646 
647  hexCount.z() = radialCount;
648 
649  // Face 4: z-min
650  if (!outer_.onGround())
651  {
652  hexGrade.z() = radialInward;
653  serializeHex(os, hexVerts[Z_Min], hexCount, hexGrade);
654  }
655  // Face 5: z-max
656  {
657  hexGrade.z() = radialOutward;
658  serializeHex(os, hexVerts[Z_Max], hexCount, hexGrade);
659  }
660  }
661 
662  endIndentList(os);
663  os.endEntry();
664  }
665 
666 
667  // edges
668  {
669  os << nl << word("edges") << nl;
670  begIndentList(os);
671 
672  if (outer_.isSphere() && outerFaces.size())
673  {
674  // Edges for the outer face of the block
675  edgeHashSet projEdges(32);
676 
677  for (const labelPair& pr : outerFaces)
678  {
679  projEdges.insert
680  (
681  hex.face(pr.second(), hexVerts[pr.first()]).edges()
682  );
683  }
684 
685  for (const edge& e : projEdges.sortedToc())
686  {
688  }
689  }
690 
691  endIndentList(os);
692  os.endEntry();
693  }
694 
695 
696  // faces
697  {
698  os << nl << word("faces") << nl;
699  begIndentList(os);
700 
701  if (outer_.isSphere() && outerFaces.size())
702  {
703  for (const labelPair& pr : outerFaces)
704  {
706  (
707  os,
708  hex.face(pr.second(), hexVerts[pr.first()])
709  );
710  }
711  }
712 
713  endIndentList(os);
714  os.endEntry();
715  }
716 
717 
718  // boundary
719  {
720  os << nl << word("boundary") << nl;
721  begIndentList(os);
722 
723  // outer
724  {
725  os.beginBlock("outer");
726  os.writeEntry("type", word("patch"));
727 
728  os << indent << word("faces") << nl;
729  begIndentList(os);
730 
731  for (const labelPair& pr : outerFaces)
732  {
734  (
735  os,
736  hex.face(pr.second(), hexVerts[pr.first()])
737  );
738  }
739 
740  endIndentList(os);
741  os.endEntry();
742 
743  os.endBlock();
744  }
745 
746  if (outer_.onGround())
747  {
748  os.beginBlock("ground");
749  os.writeEntry("type", word("wall"));
750 
751  os << indent << word("faces") << nl;
752  begIndentList(os);
753 
754  for (const labelPair& pr : groundFaces)
755  {
757  (
758  os,
759  hex.face(pr.second(), hexVerts[pr.first()])
760  );
761  }
762 
763  endIndentList(os);
764  os.endEntry();
765 
766  os.endBlock();
767  }
768 
769  endIndentList(os);
770  os.endEntry();
771  }
772 
773 
774  if (withHeader)
775  {
777  }
779  return os;
780 }
781 
782 
784 {
785  OTstream os;
786  blockMeshDict(os);
787 
788  ITstream is;
789  is.transfer(os.tokens());
791  return dictionary(is);
792 }
793 
794 
796 {
797  IOdictionary iodict
798  (
799  IOobject
800  (
801  io.name(),
802  io.db().time().system(),
803  io.local(),
804  io.db(),
808  )
809  );
810 
811  OFstream os(iodict.objectPath());
812 
813  Info<< nl
814  << "Generate blockMeshDict: "
815  << iodict.db().time().relativePath(os.name()) << endl;
816 
817  // Set precision for points to 10
819 
820  iodict.writeHeader(os);
821 
822  // Just like writeData, but without copying beforehand
823  this->blockMeshDict(os);
824 
826 }
827 
828 
830 Foam::PDRblock::createBlockMesh(const IOobject& io) const
831 {
832  IOdictionary iodict
833  (
834  IOobject
835  (
836  "blockMeshDict.PDRblockMesh",
837  io.db().time().system(),
838  io.local(),
839  io.db(),
843  ),
844  blockMeshDict()
845  );
846 
847  return autoPtr<blockMesh>::New(iodict);
848 }
849 
850 
852 Foam::PDRblock::meshBlockMesh(const IOobject& io) const
853 {
854  const bool oldVerbose = blockMesh::verboseOutput;
855  blockMesh::verboseOutput = false;
856 
857  autoPtr<polyMesh> meshPtr(createBlockMesh(io)->mesh(io));
858 
859  blockMesh::verboseOutput = oldVerbose;
860 
861  // This is a bit ugly.
862  // For extend, we still wish to have an 'inner' cellZone,
863  // but we meshed the entirety.
864 
865  if
866  (
867  outerControl::OUTER_EXTEND == outer_.type_
868  && meshPtr->cellZones().empty()
869  )
870  {
871  const boundBox innerBox
872  (
873  bounds(control_.x(), control_.y(), control_.z())
874  );
875 
876  const label nZoneCellsMax =
877  (
878  control_.x().nCells()
879  * control_.y().nCells()
880  * control_.z().nCells()
881  );
882 
883 
884  polyMesh& pmesh = *meshPtr;
885 
886  List<cellZone*> cz(1);
887  cz[0] = new cellZone
888  (
889  "inner",
890  labelList(nZoneCellsMax),
891  0, // zonei
892  pmesh.cellZones()
893  );
894 
895  cellZone& innerZone = *(cz[0]);
896 
897  const vectorField& cc = pmesh.cellCentres();
898 
899  label nZoneCells = 0;
900 
901  for
902  (
903  label celli = 0;
904  celli < cc.size() && nZoneCells < nZoneCellsMax;
905  ++celli
906  )
907  {
908  if (innerBox.contains(cc[celli]))
909  {
910  innerZone[nZoneCells] = celli;
911  ++nZoneCells;
912  }
913  }
914 
915  innerZone.resize(nZoneCells);
916 
917  pmesh.pointZones().clear();
918  pmesh.faceZones().clear();
919  pmesh.cellZones().clear();
920  pmesh.addZones(List<pointZone*>(), List<faceZone*>(), cz);
921  }
922 
923  return meshPtr;
924 }
925 
926 
927 // ************************************************************************* //
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
scalar relativeToGeometricRatio(const scalar expRatio, const label nDiv)
Calculate geometric ratio from relative ratio.
Definition: PDRblock.C:62
Ostream & indent(Ostream &os)
Indent stream.
Definition: Ostream.H:493
static bool verboseOutput
The default verbosity (true)
Definition: blockMesh.H:396
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:68
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:107
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:160
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
Definition: List.C:326
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
IOstream & hex(IOstream &io)
Definition: IOstream.H:545
void prepend(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to front of list (push_front)
virtual const fileName & name() const override
Read/write access to the name of the stream.
Definition: OSstream.H:128
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
Output to file stream, using an OSstream.
Definition: OFstream.H:49
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
static Ostream & serializeProjectFace(Ostream &os, const face &list)
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: TimeNew.C:26
static unsigned int defaultPrecision() noexcept
Return the default precision.
Definition: IOstream.H:423
Begin list [isseparator].
Definition: token.H:161
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
Definition: OTstream.H:52
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
const Cmpt & y() const noexcept
Access to the vector y component.
Definition: Vector.H:140
Ignore writing from objectRegistry::writeObject()
const point & min() const noexcept
Minimum describing the bounding box.
Definition: boundBoxI.H:162
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:232
static const word projKeyword("project")
static Ostream & outputFlatList(Ostream &os, const UList< T > &list)
bool writeHeader(Ostream &os) const
Write header with current type()
static Ostream & serializeFace(Ostream &os, const face &list)
static Ostream & serializeHex(Ostream &os, const labelUList &hexVerts, const labelVector &hexCount, const Vector< gradingDescriptors > hexGrade, const word &zoneName=word::null)
static Ostream & begIndentList(Ostream &os)
static Ostream & outputIndent(Ostream &os, const UList< T > &list)
UList< label > labelUList
A UList of labels.
Definition: UList.H:78
Various functions to operate on Lists.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
Definition: cellModels.C:150
dictionary blockMeshDict() const
Content for an equivalent blockMeshDict.
void writeBlockMeshDict(const IOobject &io) const
Write an equivalent blockMeshDict.
const point & max() const noexcept
Maximum describing the bounding box.
Definition: boundBoxI.H:168
static Ostream & serializeProjectPoints(Ostream &os, const UList< point > &list)
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
dynamicFvMesh & mesh
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:51
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
Definition: edge.H:59
virtual int precision() const override
Get precision of output field.
Definition: OSstream.C:334
A class for handling words, derived from Foam::string.
Definition: word.H:63
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Time & time() const noexcept
Return time registry.
static const word projGeomName("sphere")
const labelVector & sizes() const
The (i,j,k) addressing dimensions.
Space [isspace].
Definition: token.H:131
const word & system() const noexcept
Return system name.
Definition: TimePathsI.H:118
Handles the specification for grading within a section of a block.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition: IOobject.C:450
static const word null
An empty word.
Definition: word.H:84
End list [isseparator].
Definition: token.H:162
void append(const T &val)
Copy append an element to the end of this list.
Definition: DynamicList.H:584
static Ostream & endIndentList(Ostream &os)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:105
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross-product operators.
Definition: Vector.H:58
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Vector< gradingDescriptors > grading() const
Equivalent edge grading descriptors in (x,y,z) directions.
Definition: PDRblock.C:736
const Cmpt & x() const noexcept
Access to the vector x component.
Definition: Vector.H:135
void append(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to end of list (push_back)
Pair< label > labelPair
A pair of labels.
Definition: Pair.H:51
Specialization of rigidBody to construct a sphere given the mass and radius.
OBJstream os(runTime.globalPath()/outputName)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Definition: Ostream.H:511
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Searching on general spheroid.
static Ostream & serializeProjectEdge(Ostream &os, const edge &e)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const Cmpt & z() const noexcept
Access to the vector z component.
Definition: Vector.H:145
tmp< pointField > points() const
Corner points in an order corresponding to a &#39;hex&#39; cell.
Definition: boundBox.H:374
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Definition: HashTable.C:139
Nothing to be read.
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:72
vector span() const
The bounding box span (from minimum to maximum)
Definition: boundBoxI.H:192
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Vector< label > labelVector
Vector of labels.
Definition: labelVector.H:47
static const Enum< modelType > modelNames
Names of commonly used cellModels corresponding to modelType.
Definition: cellModel.H:98
List< label > labelList
A List of labels.
Definition: List.H:62
volScalarField & p
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition: autoPtr.H:178
point centre() const
The centre (midpoint) of the bounding box.
Definition: boundBoxI.H:186
const fileName & local() const noexcept
Read access to local path component.
Definition: IOobjectI.H:278
List of gradingDescriptor for the sections of a block with additional IO functionality.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Definition: Ostream.H:502
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
const boundBox & bounds() const noexcept
The mesh bounding box.
Definition: PDRblock.H:734
Do not request registration (bool: false)
An input stream of tokens.
Definition: ITstream.H:52
Namespace for OpenFOAM.