UnsortedMeshedSurface.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "MeshedSurface.H"
30 #include "UnsortedMeshedSurface.H"
31 #include "MeshedSurfaceProxy.H"
32 #include "Fstream.H"
33 #include "Time.H"
34 #include "ListOps.H"
35 #include "polyBoundaryMesh.H"
36 #include "polyMesh.H"
37 
38 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
39 
40 template<class Face>
42 {
43  return wordHashSet(*fileExtensionConstructorTablePtr_);
44 }
45 
46 
47 template<class Face>
49 {
50  return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
51 }
52 
53 
54 template<class Face>
56 (
57  const word& fileType,
58  bool verbose
59 )
60 {
61  return fileFormats::surfaceFormatsCore::checkSupport
62  (
63  readTypes() | MeshReference::readTypes(),
64  fileType,
65  verbose,
66  "reading"
67  );
68 }
69 
70 
71 template<class Face>
73 (
74  const word& fileType,
75  bool verbose
76 )
77 {
78  return fileFormats::surfaceFormatsCore::checkSupport
79  (
80  writeTypes(),
81  fileType,
82  verbose,
83  "writing"
84  );
85 }
86 
87 
88 template<class Face>
90 (
91  const fileName& name,
92  bool verbose
93 )
94 {
95  const word ext =
96  (
97  name.has_ext("gz")
98  ? name.stem().ext()
99  : name.ext()
100  );
102  return canReadType(ext, verbose);
103 }
104 
105 
106 template<class Face>
108 (
109  const fileName& name,
110  const UnsortedMeshedSurface<Face>& surf,
111  IOstreamOption streamOpt,
112  const dictionary& options
113 )
114 {
115  write(name, name.ext(), surf, streamOpt, options);
116 }
117 
118 
119 template<class Face>
121 (
122  const fileName& name,
123  const word& fileType,
124  const UnsortedMeshedSurface<Face>& surf,
125  IOstreamOption streamOpt,
126  const dictionary& options
127 )
128 {
129  if (fileType.empty())
130  {
131  // Handle empty/missing type
132 
133  const word ext(name.ext());
134 
135  if (ext.empty())
136  {
138  << "Cannot determine format from filename" << nl
139  << " " << name << nl
140  << exit(FatalError);
141  }
142 
143  write(name, ext, surf, streamOpt, options);
144  return;
145  }
146 
147 
148  DebugInFunction << "Writing to " << name << nl;
149 
150  auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType);
151 
152  if (!mfuncPtr)
153  {
154  // Delegate to proxy if possible
155  const wordHashSet delegate(ProxyType::writeTypes());
156 
157  if (!delegate.found(fileType))
158  {
160  << "Unknown write format " << fileType << nl << nl
161  << "Valid types:" << nl
162  << flatOutput((delegate | writeTypes()).sortedToc()) << nl
163  << exit(FatalError);
164  }
165 
166  MeshedSurfaceProxy<Face>(surf).write
167  (
168  name, fileType, streamOpt, options
169  );
170  }
171  else
172  {
173  mfuncPtr(name, surf, streamOpt, options);
174  }
175 }
176 
177 
178 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
179 
180 template<class Face>
182 :
183  MeshReference()
184 {}
185 
186 
187 template<class Face>
189 (
190  const UnsortedMeshedSurface<Face>& surf
191 )
192 :
193  MeshReference(surf.points(), surf.surfFaces()), // Copy construct (no zones)
194  zoneIds_(surf.zoneIds()),
195  zoneToc_(surf.zoneToc())
196 {}
197 
198 
199 template<class Face>
201 (
202  const MeshedSurface<Face>& surf
203 )
204 :
205  MeshReference(surf.points(), surf.surfFaces()), // Copy construct (no zones)
206  zoneIds_(),
207  zoneToc_()
208 {
209  setZones(surf.surfZones());
210 }
211 
212 
213 template<class Face>
215 (
217 )
218 :
219  UnsortedMeshedSurface<Face>()
220 {
221  transfer(surf);
222 }
223 
224 
225 template<class Face>
227 (
228  MeshedSurface<Face>&& surf
229 )
230 :
231  UnsortedMeshedSurface<Face>()
232 {
233  transfer(surf);
234 }
235 
236 
237 template<class Face>
239 (
240  pointField&& pointLst,
241  List<Face>&& faceLst,
242  List<label>&& zoneIds,
244 )
245 :
246  MeshReference(std::move(pointLst), std::move(faceLst)),
247  zoneIds_(std::move(zoneIds)),
248  zoneToc_(tocInfo)
249 {}
250 
251 
252 template<class Face>
254 (
255  const fileName& name,
256  const word& ext
257 )
258 :
259  UnsortedMeshedSurface<Face>()
260 {
261  read(name, ext);
262 }
263 
264 
265 template<class Face>
267 (
268  const fileName& name
269 )
270 :
271  UnsortedMeshedSurface<Face>()
272 {
273  read(name);
274 }
275 
276 
277 template<class Face>
279 (
280  Istream& is
281 )
282 :
283  UnsortedMeshedSurface<Face>()
284 {
285  readIstream(is);
286 }
287 
288 
289 template<class Face>
291 (
292  const Time& runTime
293 )
294 :
295  UnsortedMeshedSurface<Face>()
296 {
298  transfer(surf);
299 }
300 
301 
302 template<class Face>
304 (
305  const Time& runTime,
306  const word& surfName
307 )
308 :
309  UnsortedMeshedSurface<Face>()
310 {
311  MeshedSurface<Face> surf(runTime, surfName);
312  transfer(surf);
313 }
314 
315 
316 template<class Face>
318 (
319  const IOobject& io,
320  const dictionary& dict,
321  const bool isGlobal
322 )
323 :
324  UnsortedMeshedSurface<Face>()
325 {
326  fileName fName
327  (
329  );
330 
331  this->read(fName, dict.getOrDefault<word>("fileType", word::null));
332 
333  this->scalePoints(dict.getOrDefault<scalar>("scale", 0));
334 }
335 
336 
337 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
338 
339 template<class Face>
341 {
342  this->removeZones(); // Parent information is unreliable
343 
344  zoneIds_.resize(size());
345  zoneIds_ = 0;
346 
347  // Assign single default zone
348  zoneToc_.resize(1);
349 
350  zoneToc_[0].index() = 0;
351 
352  if (zoneToc_[0].name().empty())
353  {
354  zoneToc_[0].name() = "zone0";
355  }
356 }
357 
358 
359 template<class Face>
361 (
362  const surfZoneList& zoneLst
363 )
364 {
365  this->removeZones(); // Parent information is unreliable
366 
367  zoneIds_.resize(size());
368  zoneToc_.resize(zoneLst.size());
369 
370  forAll(zoneToc_, zonei)
371  {
372  const surfZone& zone = zoneLst[zonei];
373  zoneToc_[zonei] = zone;
374 
375  // Assign sub-zone Ids
376  SubList<label>(zoneIds_, zone.range()) = zonei;
377  }
378 }
379 
380 
381 template<class Face>
383 (
384  const labelUList& sizes,
385  const UList<word>& names
386 )
387 {
388  this->removeZones(); // Parent information is unreliable
389 
390  zoneIds_.resize(size());
391  zoneToc_.resize(sizes.size());
392 
393  label start = 0;
394  forAll(zoneToc_, zonei)
395  {
396  zoneToc_[zonei] = surfZoneIdentifier(names[zonei], zonei);
397 
398  // Assign sub-zone Ids
399  SubList<label>(zoneIds_, sizes[zonei], start) = zonei;
400 
401  start += sizes[zonei];
402  }
403 }
404 
405 
406 template<class Face>
408 (
409  const labelUList& sizes
410 )
411 {
412  this->removeZones(); // Parent information is unreliable
413 
414  zoneIds_.resize(size());
415  zoneToc_.resize(sizes.size());
416 
417  label start = 0;
418  forAll(zoneToc_, zonei)
419  {
420  zoneToc_[zonei] = surfZoneIdentifier
421  (
423  zonei
424  );
425 
426  // Assign sub-zone Ids
427  SubList<label>(zoneIds_, sizes[zonei], start) = zonei;
428 
429  start += sizes[zonei];
430  }
431 }
432 
433 
434 template<class Face>
436 (
437  const labelUList& faceMapNewToOld
438 )
439 {
440  // Re-assign the zone Ids
441  if (faceMapNewToOld.empty())
442  {
443  return;
444  }
445 
446  if (zoneToc_.empty())
447  {
448  setOneZone();
449  }
450  else if (zoneToc_.size() == 1)
451  {
452  zoneIds_ = 0; // Optimized for single-zone case
453  }
454  else
455  {
456  List<label> newZonesIds(faceMapNewToOld.size());
457 
458  forAll(faceMapNewToOld, facei)
459  {
460  newZonesIds[facei] = zoneIds_[faceMapNewToOld[facei]];
461  }
462  zoneIds_.transfer(newZonesIds);
463  }
464 }
465 
466 
467 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
468 
469 template<class Face>
471 {
472  is >> this->storedZoneIds()
473  >> this->storedPoints()
474  >> this->storedFaces();
475 
476  is.check(FUNCTION_NAME);
477  return true;
478 }
479 
480 
481 template<class Face>
483 {
484  os << this->zoneIds()
485  << this->points()
486  << this->surfFaces();
487 
489 }
490 
491 
492 template<class Face>
494 {
495  this->storedFaces().resize(s);
496  // if zones extend: set with last zoneId
497  zoneIds_.resize(s, zoneToc_.size() - 1);
498 }
499 
500 
501 template<class Face>
503 {
505  zoneIds_.clear();
506  zoneToc_.clear();
507 }
508 
509 
510 template<class Face>
512 (
514 ) const
515 {
516  // supply some zone names
517  Map<word> zoneNames;
518  forAll(zoneToc_, zonei)
519  {
520  zoneNames.insert(zonei, zoneToc_[zonei].name());
521  }
522 
523  // std::sort() really seems to mix up the order.
524  // and std::stable_sort() might take too long / too much memory
525 
526  // Assuming that we have relatively fewer zones compared to the
527  // number of items, just do it ourselves
528 
529  // Step 1: get zone sizes and store (origId => zoneI)
530  Map<label> lookup;
531  for (const label origId : zoneIds_)
532  {
533  ++(lookup(origId, 0));
534  }
535 
536  // Step 2: assign start/size (and name) to the newZones
537  // re-use the lookup to map (zoneId => zoneI)
538  surfZoneList zoneLst(lookup.size());
539  label start = 0;
540  label zonei = 0;
541  forAllIters(lookup, iter)
542  {
543  const label origId = iter.key();
544 
545  const word zoneName =
546  zoneNames.lookup
547  (
548  origId,
550  );
551 
552  zoneLst[zonei] = surfZone
553  (
554  zoneName,
555  0, // initialize with zero size
556  start,
557  zonei
558  );
559 
560  // increment the start for the next zone
561  // and save the (zoneId => zoneI) mapping
562  start += iter();
563  iter() = zonei++;
564  }
565 
566 
567  // Step 3: build the re-ordering
568  faceMap.resize(zoneIds_.size());
569 
570  forAll(zoneIds_, facei)
571  {
572  const label zonei = lookup[zoneIds_[facei]];
573  faceMap[facei] = zoneLst[zonei].start() + zoneLst[zonei].size()++;
574  }
575 
576  // With reordered faces registered in faceMap
577  return zoneLst;
578 }
579 
580 
581 template<class Face>
584 (
585  const labelList& pointMap,
586  const labelList& faceMap
587 ) const
588 {
589  const pointField& locPoints = this->localPoints();
590  const List<Face>& locFaces = this->localFaces();
591 
592  // Subset of points (compact)
593  pointField newPoints(UIndirectList<point>(locPoints, pointMap));
594 
595  // Inverse point mapping - same as ListOps invert() without checks
596  labelList oldToNew(locPoints.size(), -1);
597  forAll(pointMap, pointi)
598  {
599  oldToNew[pointMap[pointi]] = pointi;
600  }
601 
602  // Subset of faces
603  List<Face> newFaces(UIndirectList<Face>(locFaces, faceMap));
604 
605  // Renumber face node labels
606  for (auto& f : newFaces)
607  {
608  for (label& vert : f)
609  {
610  vert = oldToNew[vert];
611  }
612  }
613  oldToNew.clear();
614 
615  // Subset of zones
616  List<label> newZones(UIndirectList<label>(zoneIds_, faceMap));
617 
618  // Retain the same zone toc information
619  List<surfZoneIdentifier> subToc(zoneToc_);
620 
621  // Construct the sub-surface
622  return UnsortedMeshedSurface<Face>
623  (
624  std::move(newPoints),
625  std::move(newFaces),
626  std::move(newZones),
627  std::move(subToc)
628  );
629 }
630 
631 
632 template<class Face>
635 (
636  const UList<bool>& include,
637  labelList& pointMap,
639 ) const
640 {
641  this->subsetMeshMap(include, pointMap, faceMap);
642  return this->subsetMeshImpl(pointMap, faceMap);
643 }
644 
645 
646 template<class Face>
649 (
650  const bitSet& include,
651  labelList& pointMap,
653 ) const
654 {
655  this->subsetMeshMap(include, pointMap, faceMap);
656  return this->subsetMeshImpl(pointMap, faceMap);
657 }
658 
659 
660 template<class Face>
663 (
664  const UList<bool>& include
665 ) const
666 {
667  labelList pointMap, faceMap;
668  return this->subsetMesh(include, pointMap, faceMap);
669 }
670 
671 
672 template<class Face>
675 (
676  const bitSet& include
677 ) const
678 {
679  labelList pointMap, faceMap;
680  return this->subsetMesh(include, pointMap, faceMap);
681 }
682 
683 
684 template<class Face>
686 (
688 )
689 {
690  if (this == &surf)
691  {
692  return; // Self-swap is a no-op
693  }
694 
695  this->clearOut(); // Topology changes
696  surf.clearOut(); // Topology changes
697 
698  this->storedPoints().swap(surf.storedPoints());
699  this->storedFaces().swap(surf.storedFaces());
700  zoneIds_.swap(surf.zoneIds_);
701  zoneToc_.swap(surf.zoneToc_);
702 
703  this->storedZones().clear(); // Should not be there anyhow
704  surf.storedZones().clear();
705 }
706 
707 
708 template<class Face>
710 (
712 )
713 {
714  if (this == &surf)
715  {
716  return; // Self-assignment is a no-op
717  }
718 
719  this->clear();
720 
721  this->storedPoints().transfer(surf.storedPoints());
722  this->storedFaces().transfer(surf.storedFaces());
723  zoneIds_.transfer(surf.zoneIds_);
724  zoneToc_.transfer(surf.zoneToc_);
726  surf.clear();
727 }
728 
729 
730 template<class Face>
732 (
733  MeshedSurface<Face>& surf
734 )
735 {
736  surfZoneList zoneInfo(surf.surfZones());
737 
738  this->clear();
739 
740  MeshReference::transfer(surf);
742  setZones(zoneInfo);
743 }
744 
745 
746 template<class Face>
749 {
750  return autoPtr<labelList>::New(this->storedZoneIds());
751 }
752 
753 
754 template<class Face>
756 {
757  this->clear();
758  transfer(*New(name));
759  return true;
760 }
761 
762 
763 template<class Face>
765 (
766  const fileName& name,
767  const word& fileType
768 )
769 {
770  this->clear();
771  transfer(*New(name, fileType));
772  return true;
773 }
774 
775 
776 template<class Face>
778 (
779  const Time& t,
780  const word& surfName
781 ) const
782 {
783  MeshedSurfaceProxy<Face>(*this).write(t, surfName);
784 }
785 
786 
787 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
788 
789 template<class Face>
791 (
792  const UnsortedMeshedSurface<Face>& surf
793 )
794 {
795  if (&surf == this)
796  {
797  return; // Self-assignment is a no-op
798  }
799 
800  clear();
801 
802  this->storedPoints() = surf.points();
803  this->storedFaces() = surf.surfFaces();
804  zoneIds_ = surf.zoneIds_;
805  zoneToc_ = surf.zoneToc_;
806 }
807 
808 
809 template<class Face>
811 (
813 )
814 {
815  transfer();
816 }
817 
818 
819 template<class Face>
822 {
824  List<surfZone> zoneLst = this->sortedZones(faceMap);
825 
826  return MeshedSurfaceProxy<Face>
827  (
828  this->points(),
829  this->surfFaces(),
830  zoneLst,
831  faceMap
832  );
833 }
834 
835 
836 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
837 
838 template<class Face>
839 Foam::Istream& Foam::operator>>
840 (
841  Istream& is,
842  UnsortedMeshedSurface<Face>& surf
843 )
844 {
845  surf.readIstream(is);
846  return is;
847 }
848 
849 
850 template<class Face>
851 Foam::Ostream& Foam::operator<<
852 (
853  Ostream& os,
854  const UnsortedMeshedSurface<Face>& surf
855 )
856 {
857  surf.writeOstream(os);
858  return os;
859 }
860 
861 
862 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
863 
865 
866 // ************************************************************************* //
A surface geometry mesh, in which the surface zone information is conveyed by the &#39;zoneId&#39; associated...
Definition: MeshedSurface.H:76
virtual void clear()
Clear all storage.
dictionary dict
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
A class for handling file names.
Definition: fileName.H:72
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
static wordHashSet writeTypes()
Known writable file-types, without friends or proxies.
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:45
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
void swap(MeshedSurface< Face > &surf)=delete
Swap contents - disabled.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
void transfer(UnsortedMeshedSurface< Face > &surf)
Transfer the contents of the argument and annul the argument.
engineTime & runTime
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
autoPtr< labelList > releaseZoneIds()
Release (clear) stored zoneIds and return for reuse.
A simple container for options an IOstream can normally have.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
surfZoneList & storedZones()
Non-const access to the zones.
UList< label > labelUList
A UList of labels.
Definition: UList.H:78
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Various functions to operate on Lists.
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, select based on its extension.
word ext() const
Return file name extension (part after last .)
Definition: wordI.H:171
bool insert(const label &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
Definition: HashTableI.H:152
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
A List obtained as a section of another List.
Definition: SubList.H:50
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
const pointField & points
bool has_ext() const
Various checks for extensions.
Definition: stringI.H:43
List< Face > & storedFaces()
Non-const access to the faces.
Base class for mesh zones.
Definition: zone.H:59
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:137
A class for handling words, derived from Foam::string.
Definition: word.H:63
static word defaultName(const label n=-1)
Default zone name: "zone" or "zoneN".
#define DebugInFunction
Report an information message using Foam::Info.
static wordHashSet readTypes()
Known readable file-types, without friends or proxies.
pointField & storedPoints()
Non-const access to global points.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
Definition: stdFoam.H:336
static const word null
An empty word.
Definition: word.H:84
patchWriters clear()
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition: HashSet.H:73
const Field< point_type > & points() const noexcept
Return reference to global points.
UnsortedMeshedSurface()
Default construct.
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
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
UnsortedMeshedSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
const List< Face > & surfFaces() const
Return const access to the faces.
static void write(const fileName &name, const UnsortedMeshedSurface< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, select based on its extension.
void read(Istream &, label &val, const dictionary &)
In-place read with dictionary lookup.
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format? Also checks friend types.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:75
labelList f(nPoints)
virtual void remapFaces(const labelUList &faceMapNewToOld)
Set new zones from faceMap.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
const T & lookup(const label &key, const T &deflt) const
Return hashed entry if it exists, or return the given default.
Definition: HashTableI.H:222
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format? Also checks friend types.
List< surfZone > surfZoneList
List of surfZone.
Definition: surfZoneList.H:32
void setZones(const surfZoneList &zoneLst)
Set zone ids and zones.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to &#39;true&#39; entries.
Definition: BitOps.C:195
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
List< label > labelList
A List of labels.
Definition: List.H:62
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
const surfZoneList & surfZones() const
Const access to the surface zones.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition: autoPtr.H:178
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool read(const fileName &name, const word &fileType)
Read from file with given format type.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
A HashTable to objects of type <T> with a label key.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:225
void setOneZone()
Set zones to 0 and set a single zone.