ZoneMesh.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-2020 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 "ZoneMesh.H"
30 #include "entry.H"
31 #include "demandDrivenData.H"
32 #include "Pstream.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38  template<class ZoneType, class MeshType>
40  (
41  debug::debugSwitch("disallowGenericZones", 0)
42  );
43 }
44 
45 
46 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
47 
48 template<class ZoneType, class MeshType>
50 {
51  if (zoneMapPtr_)
52  {
54  << "zone map already calculated"
55  << abort(FatalError);
56  }
57  else
58  {
59  // Count number of objects in all zones
60  label nObjects = 0;
61 
62  const PtrList<ZoneType>& zones = *this;
63 
64  for (const ZoneType& zn : zones)
65  {
66  nObjects += zn.size();
67  }
68 
69  zoneMapPtr_ = new Map<label>(2*nObjects);
70  Map<label>& zm = *zoneMapPtr_;
71 
72  // Fill in objects of all zones into the map.
73  // The key is the global object index, value is the zone index
74 
75  label zonei = 0;
76 
77  for (const ZoneType& zn : zones)
78  {
79  const labelList& labels = zn;
80 
81  for (const label idx : labels)
82  {
83  zm.insert(idx, zonei);
84  }
85 
86  ++zonei;
87  }
88  }
89 }
90 
91 
92 template<class ZoneType, class MeshType>
94 {
95  if
96  (
97  readOpt() == IOobject::MUST_READ
98  || readOpt() == IOobject::MUST_READ_IF_MODIFIED
99  || (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
100  )
101  {
102  // Warn for MUST_READ_IF_MODIFIED
103  warnNoRereading<ZoneMesh<ZoneType, MeshType>>();
104 
105  PtrList<ZoneType>& zones = *this;
106 
107  // Read zones
108  Istream& is = readStream(typeName);
109 
110  PtrList<entry> patchEntries(is);
111  zones.resize(patchEntries.size());
112 
113  forAll(zones, zonei)
114  {
115  zones.set
116  (
117  zonei,
119  (
120  patchEntries[zonei].keyword(),
121  patchEntries[zonei].dict(),
122  zonei,
123  *this
124  )
125  );
126  }
127 
128  // Check state of IOstream
129  is.check(FUNCTION_NAME);
130 
131  close();
132 
133  return true;
134  }
135 
136  // Nothing read
137  return false;
138 }
139 
140 
141 // Templated implementation for names()
142 template<class ZoneType, class MeshType>
143 template<class UnaryMatchPredicate>
145 (
146  const PtrList<ZoneType>& list,
147  const UnaryMatchPredicate& matcher,
148  const bool doSort
149 )
150 {
151  const label len = list.size();
152 
153  wordList output(len);
154 
155  label count = 0;
156  for (label i = 0; i < len; ++i)
157  {
158  const word& itemName = list[i].name();
159 
160  if (matcher(itemName))
161  {
162  output[count++] = itemName;
163  }
164  }
165 
166  output.resize(count);
167 
168  if (doSort)
169  {
170  Foam::sort(output);
171  }
172 
173  return output;
174 }
175 
176 
177 template<class ZoneType, class MeshType>
178 template<class UnaryMatchPredicate>
180 (
181  const PtrList<ZoneType>& list,
182  const UnaryMatchPredicate& matcher
183 )
184 {
185  const label len = list.size();
186 
187  labelList output(len);
188 
189  label count = 0;
190  for (label i = 0; i < len; ++i)
191  {
192  if (matcher(list[i].name()))
193  {
194  output[count++] = i;
195  }
196  }
197 
198  output.resize(count);
199 
200  return output;
201 }
202 
203 
204 template<class ZoneType, class MeshType>
205 template<class UnaryMatchPredicate>
207 (
208  const PtrList<ZoneType>& list,
209  const UnaryMatchPredicate& matcher
210 )
211 {
212  const label len = list.size();
213 
214  for (label i = 0; i < len; ++i)
215  {
216  if (matcher(list[i].name()))
217  {
218  return i;
219  }
220  }
221 
222  return -1;
223 }
224 
225 
226 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
227 
228 template<class ZoneType, class MeshType>
230 (
231  const IOobject& io,
232  const MeshType& mesh
233 )
234 :
236  regIOobject(io),
237  mesh_(mesh),
238  zoneMapPtr_(nullptr)
239 {
240  read();
241 }
242 
243 
244 template<class ZoneType, class MeshType>
246 (
247  const IOobject& io,
248  const MeshType& mesh,
249  const label size
250 )
251 :
252  PtrList<ZoneType>(size),
253  regIOobject(io),
254  mesh_(mesh),
255  zoneMapPtr_(nullptr)
256 {
257  // Optionally read contents, otherwise keep size
258  read();
259 }
260 
261 
262 template<class ZoneType, class MeshType>
264 (
265  const IOobject& io,
266  const MeshType& mesh,
267  const PtrList<ZoneType>& pzm
268 )
269 :
271  regIOobject(io),
272  mesh_(mesh),
273  zoneMapPtr_(nullptr)
274 {
275  if (!read())
276  {
277  // Nothing read. Use supplied zones
278  PtrList<ZoneType>& zones = *this;
279  zones.resize(pzm.size());
280 
281  forAll(zones, zonei)
282  {
283  zones.set(zonei, pzm[zonei].clone(*this).ptr());
284  }
285  }
286 }
287 
288 
289 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
290 
291 template<class ZoneType, class MeshType>
293 {
294  clearAddressing();
295 }
296 
297 
298 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
299 
300 template<class ZoneType, class MeshType>
303 {
304  if (!zoneMapPtr_)
305  {
306  calcZoneMap();
307  }
308 
309  return *zoneMapPtr_;
310 }
311 
312 
313 template<class ZoneType, class MeshType>
315 (
316  const label objectIndex
317 ) const
318 {
319  return zoneMap().lookup(objectIndex, -1);
320 }
321 
322 
323 template<class ZoneType, class MeshType>
325 {
326  const PtrList<ZoneType>& zones = *this;
327 
328  wordList list(zones.size());
329 
330  forAll(zones, zonei)
331  {
332  list[zonei] = zones[zonei].type();
333  }
334 
335  return list;
336 }
337 
338 
339 template<class ZoneType, class MeshType>
341 {
342  const PtrList<ZoneType>& zones = *this;
343 
344  wordList list(zones.size());
345 
346  forAll(zones, zonei)
347  {
348  list[zonei] = zones[zonei].name();
349  }
350 
351  return list;
352 }
353 
354 
355 template<class ZoneType, class MeshType>
357 (
358  const wordRe& matcher
359 ) const
360 {
361  return namesImpl(*this, matcher, false);
362 }
363 
364 
365 template<class ZoneType, class MeshType>
367 (
368  const wordRes& matcher
369 )
370 const
371 {
372  return namesImpl(*this, matcher, false);
373 }
374 
375 
376 template<class ZoneType, class MeshType>
378 {
379  wordList sorted(this->names());
380  Foam::sort(sorted);
381 
382  return sorted;
383 }
384 
385 
386 template<class ZoneType, class MeshType>
388 (
389  const wordRe& matcher
390 ) const
391 {
392  return namesImpl(*this, matcher, true);
393 }
394 
395 
396 template<class ZoneType, class MeshType>
398 (
399  const wordRes& matcher
400 )
401 const
402 {
403  return namesImpl(*this, matcher, true);
404 }
405 
406 
407 template<class ZoneType, class MeshType>
409 (
410  const keyType& key
411 ) const
412 {
413  if (key.empty())
414  {
415  return labelList();
416  }
417  else if (key.isPattern())
418  {
419  // Match as regex
420  regExp matcher(key);
421  return indicesImpl(*this, matcher);
422  }
423  else
424  {
425  // Compare as literal string
426  const word& matcher = key;
427  return indicesImpl(*this, matcher);
428  }
429 }
430 
431 
432 template<class ZoneType, class MeshType>
434 (
435  const wordRes& matcher
436 ) const
437 {
438  if (matcher.empty())
439  {
440  return labelList();
441  }
442 
443  return indicesImpl(*this, matcher);
444 }
445 
446 
447 template<class ZoneType, class MeshType>
449 (
450  const keyType& key
451 ) const
452 {
453  if (key.empty())
454  {
455  return -1;
456  }
457  else if (key.isPattern())
458  {
459  // Find as regex
460  regExp matcher(key);
461  return findIndexImpl(*this, matcher);
462  }
463  else
464  {
465  // Find as literal string
466  const word& matcher = key;
467  return findIndexImpl(*this, matcher);
468  }
469 }
470 
471 
472 template<class ZoneType, class MeshType>
474 (
475  const wordRes& matcher
476 ) const
477 {
478  return (matcher.empty() ? -1 : findIndexImpl(*this, matcher));
479 }
480 
481 
482 template<class ZoneType, class MeshType>
484 (
485  const word& zoneName
486 ) const
487 {
488  label zoneId = findIndexImpl(*this, zoneName);
489 
490  if (zoneId >= 0)
491  {
492  return zoneId;
493  }
494 
495  // Zone not found
497  << "Zone named " << zoneName << " not found. "
498  << "List of available zone names: " << names() << endl;
499 
500  if (disallowGenericZones != 0)
501  {
502  // Create a new ...
503 
504  Info<< "Creating dummy zone " << zoneName << endl;
506  dict.set("type", ZoneType::typeName);
507  dict.set(ZoneType::labelsName, labelList());
508 
509  // flipMap only really applicable for face zones, but should not get
510  // in the way for cell- and point-zones...
511  dict.set("flipMap", boolList());
512 
513  auto& zm = const_cast<ZoneMesh<ZoneType, MeshType>&>(*this);
514  zoneId = zm.size();
515 
516  zm.append(new ZoneType(zoneName, dict, zoneId, zm));
517  }
518 
519  return zoneId;
520 }
521 
522 
523 template<class ZoneType, class MeshType>
525 (
526  const labelUList& zoneIds
527 ) const
528 {
529  bitSet bitset;
530 
531  for (const label zonei : zoneIds)
532  {
533  #ifdef FULLDEBUG
534  if (zonei < 0 || zonei >= this->size())
535  {
537  << ZoneType::typeName << " "
538  << zonei << " out of range [0," << this->size() << ")"
539  << abort(FatalError);
540  }
541  #endif
542 
543  bitset.set
544  (
545  static_cast<const labelList&>(this->operator[](zonei))
546  );
547  }
548 
549  return bitset;
550 }
551 
552 
553 template<class ZoneType, class MeshType>
555 (
556  const keyType& key
557 ) const
558 {
559  return this->selection(this->indices(key));
560 }
561 
562 
563 template<class ZoneType, class MeshType>
565 (
566  const wordRes& matcher
567 ) const
568 {
569  return this->selection(this->indices(matcher));
570 }
571 
572 
573 template<class ZoneType, class MeshType>
575 (
576  const word& zoneName
577 ) const
578 {
579  const PtrList<ZoneType>& zones = *this;
580 
581  for (auto iter = zones.begin(); iter != zones.end(); ++iter)
582  {
583  const ZoneType* ptr = iter.get();
584 
585  if (ptr && zoneName == ptr->name())
586  {
587  return ptr;
588  }
589  }
590 
591  return nullptr;
592 }
593 
594 
595 template<class ZoneType, class MeshType>
597 (
598  const word& zoneName
599 )
600 {
601  PtrList<ZoneType>& zones = *this;
602 
603  for (auto iter = zones.begin(); iter != zones.end(); ++iter)
604  {
605  ZoneType* ptr = iter.get();
606 
607  if (ptr && zoneName == ptr->name())
608  {
609  return ptr;
610  }
611  }
612 
613  return nullptr;
614 }
615 
616 
617 template<class ZoneType, class MeshType>
619 {
620  deleteDemandDrivenData(zoneMapPtr_);
621 
622  PtrList<ZoneType>& zones = *this;
623 
624  for (ZoneType& zn : zones)
625  {
626  zn.clearAddressing();
627  }
628 }
629 
630 
631 template<class ZoneType, class MeshType>
633 {
634  clearAddressing();
636 }
637 
638 
639 template<class ZoneType, class MeshType>
641 (
642  const bool report
643 ) const
644 {
645  bool inError = false;
646 
647  const PtrList<ZoneType>& zones = *this;
648 
649  for (const ZoneType& zn : zones)
650  {
651  inError |= zn.checkDefinition(report);
652  }
653 
654  return inError;
655 }
656 
657 
658 template<class ZoneType, class MeshType>
660 (
661  const bool report
662 ) const
663 {
664  if (!Pstream::parRun())
665  {
666  return false;
667  }
668 
669  const PtrList<ZoneType>& zones = *this;
670 
671  bool hasError = false;
672 
673  // Collect all names
674  List<wordList> allNames(Pstream::nProcs());
675  allNames[Pstream::myProcNo()] = this->names();
676  Pstream::gatherList(allNames);
677  Pstream::scatterList(allNames);
678 
679  List<wordList> allTypes(Pstream::nProcs());
680  allTypes[Pstream::myProcNo()] = this->types();
681  Pstream::gatherList(allTypes);
682  Pstream::scatterList(allTypes);
683 
684  // Have every processor check but only master print error.
685 
686  for (label proci = 1; proci < allNames.size(); ++proci)
687  {
688  if
689  (
690  (allNames[proci] != allNames[0])
691  || (allTypes[proci] != allTypes[0])
692  )
693  {
694  hasError = true;
695 
696  if (debug || (report && Pstream::master()))
697  {
698  Info<< " ***Inconsistent zones across processors, "
699  "processor 0 has zone names:" << allNames[0]
700  << " zone types:" << allTypes[0]
701  << " processor " << proci << " has zone names:"
702  << allNames[proci]
703  << " zone types:" << allTypes[proci]
704  << endl;
705  }
706  }
707  }
708 
709  // Check contents
710  if (!hasError)
711  {
712  for (const ZoneType& zn : zones)
713  {
714  if (zn.checkParallelSync(false))
715  {
716  hasError = true;
717 
718  if (debug || (report && Pstream::master()))
719  {
720  Info<< " ***Zone " << zn.name()
721  << " of type " << zn.type()
722  << " is not correctly synchronised"
723  << " across coupled boundaries."
724  << " (coupled faces are either not both"
725  << " present in set or have same flipmap)" << endl;
726  }
727  }
728  }
729  }
730 
731  return hasError;
732 }
733 
734 
735 template<class ZoneType, class MeshType>
737 {
738  PtrList<ZoneType>& zones = *this;
739 
740  for (ZoneType& zn : zones)
741  {
742  zn.movePoints(pts);
743  }
744 }
745 
746 
747 template<class ZoneType, class MeshType>
749 {
750  os << *this;
751  return os.good();
752 }
753 
754 
755 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
756 
757 template<class ZoneType, class MeshType>
759 (
760  const word& zoneName
761 ) const
762 {
763  const label zonei = findZoneID(zoneName);
764 
765  if (zonei < 0)
766  {
768  << "Zone named " << zoneName << " not found." << nl
769  << "Available zone names: " << names() << endl
770  << abort(FatalError);
771  }
772 
773  return operator[](zonei);
774 }
775 
776 
777 template<class ZoneType, class MeshType>
779 (
780  const word& zoneName
781 )
782 {
783  const label zonei = findZoneID(zoneName);
784 
785  if (zonei < 0)
786  {
788  << "Zone named " << zoneName << " not found." << nl
789  << "Available zone names: " << names() << endl
790  << abort(FatalError);
791  }
792 
793  return operator[](zonei);
794 }
795 
796 
797 template<class ZoneType, class MeshType>
799 (
800  const word& zoneName,
801  const bool verbose
802 )
803 {
804  PtrList<ZoneType>& zones = *this;
805 
806  label zoneId = findZoneID(zoneName);
807 
808  if (zoneId < 0)
809  {
810  zoneId = zones.size();
811  zones.resize(zoneId+1);
812  zones.set(zoneId, new ZoneType(zoneName, zoneId, *this));
813 
814  if (verbose)
815  {
816  Info<< ZoneType::typeName << " " << zoneName
817  << " (new at index " << zoneId << ")"
818  << endl;
819  }
820  }
821  else
822  {
823  if (verbose)
824  {
825  Info<< ZoneType::typeName << " " << zoneName
826  << " (existing at index " << zoneId << ")"
827  << endl;
828  }
829  }
830 
831  return zones[zoneId];
832 }
833 
834 
835 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
836 
837 template<class ZoneType, class MeshType>
838 Foam::Ostream& Foam::operator<<
839 (
840  Ostream& os,
841  const ZoneMesh<ZoneType, MeshType>& zones
842 )
843 {
844  const label sz = zones.size();
845 
846  if (sz)
847  {
848  os << sz << nl << token::BEGIN_LIST;
849 
850  for (label i=0; i < sz; ++i)
851  {
852  zones[i].writeDict(os);
853  }
854 
855  os << token::END_LIST;
856  }
857  else
858  {
859  os << sz << token::BEGIN_LIST << token::END_LIST;
860  }
861 
862  return os;
863 }
864 
865 
866 // ************************************************************************* //
Foam::ZoneMesh::zoneMap
const Map< label > & zoneMap() const
Map of zones containing zone index for all zoned elements.
Definition: ZoneMesh.C:302
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::ZoneMesh::checkDefinition
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
Definition: ZoneMesh.C:641
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::ZoneMesh::clear
void clear()
Clear the zones.
Definition: ZoneMesh.C:632
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::namesImpl
static wordList namesImpl(const PtrList< coordinateSystem > &list, const UnaryMatchPredicate &matcher, const bool doSort)
Definition: coordinateSystems.C:52
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
ZoneMesh.H
Foam::ZoneMesh::writeData
bool writeData(Ostream &os) const
writeData member function required by regIOobject
Definition: ZoneMesh.C:748
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:64
Foam::debug::debugSwitch
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
Definition: debug.C:225
Foam::keyType::isPattern
bool isPattern() const
The keyType is treated as a pattern, not as literal string.
Definition: keyTypeI.H:128
demandDrivenData.H
Template functions to aid in the implementation of demand driven data.
Foam::bitSet::set
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition: bitSetI.H:563
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::boolList
List< bool > boolList
A List of bools.
Definition: List.H:69
Foam::ZoneMesh::findIndex
label findIndex(const keyType &key) const
Return zone index for the first match, return -1 if not found.
Definition: ZoneMesh.C:449
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::HashSetOps::bitset
bitSet bitset(const labelHashSet &locations)
Transform the on locations to a bitSet.
Definition: HashOps.C:72
Foam::wordRe
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition: wordRe.H:72
entry.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::findIndexImpl
label findIndexImpl(const faPatchList &list, const UnaryMatchPredicate &matcher)
Definition: faBoundaryMesh.C:95
Foam::indicesImpl
static labelList indicesImpl(const faPatchList &list, const UnaryMatchPredicate &matcher)
Definition: faBoundaryMesh.C:68
Foam::deleteDemandDrivenData
void deleteDemandDrivenData(DataPtr &dataPtr)
Definition: demandDrivenData.H:42
Foam::ZoneMesh::~ZoneMesh
~ZoneMesh()
Destructor.
Definition: ZoneMesh.C:292
Foam::keyType
A class for handling keywords in dictionaries.
Definition: keyType.H:60
Foam::ZoneMesh::movePoints
void movePoints(const pointField &pts)
Correct zone mesh after moving points.
Definition: ZoneMesh.C:736
Foam::Field< vector >
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:360
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::sort
void sort(UList< T > &a)
Definition: UList.C:254
Foam::ZoneMesh
A list of mesh zones.
Definition: cellZoneMeshFwd.H:44
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::regExpCxx
Wrapper around C++11 regular expressions.
Definition: regExpCxx.H:72
Foam::List::resize
void resize(const label newSize)
Adjust allocated size of list.
Definition: ListI.H:139
Foam::blockMeshTools::read
void read(Istream &, label &, const dictionary &)
In-place read with dictionary lookup.
Definition: blockMeshTools.C:33
Foam::ZoneMesh::whichZone
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
Definition: ZoneMesh.C:315
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Pstream.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:137
Foam::PtrList::set
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
Definition: PtrListI.H:143
Foam::ZoneMesh::findZoneID
label findZoneID(const word &zoneName) const
Find zone index given a name, return -1 if not found.
Definition: ZoneMesh.C:484
Foam::ZoneMesh::operator
friend Ostream & operator(Ostream &os, const ZoneMesh< ZoneType, MeshType > &zones)
Foam::ZoneMesh::names
wordList names() const
A list of the zone names.
Definition: ZoneMesh.C:340
Foam::PtrList::resize
void resize(const label newLen)
Adjust size of PtrList.
Definition: PtrList.C:103
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::ZoneMesh::sortedNames
wordList sortedNames() const
Sorted list of the zone names.
Definition: ZoneMesh.C:377
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:68
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:372
clear
patchWriters clear()
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::BitOps::count
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Definition: BitOps.H:74
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
Foam::UList< label >
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:265
Foam::ZoneMesh::disallowGenericZones
static int disallowGenericZones
Debug switch to disallow the use of generic zones.
Definition: ZoneMesh.H:123
Foam::ZoneMesh::selection
bitSet selection(const labelUList &zoneIds) const
Definition: ZoneMesh.C:525
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::ZoneMesh::clearAddressing
void clearAddressing()
Clear addressing.
Definition: ZoneMesh.C:618
Foam::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:224
Foam::ZoneMesh::indices
labelList indices(const keyType &key) const
Return zone indices for all matches.
Definition: ZoneMesh.C:409
Foam::ZoneMesh::zonePtr
const ZoneType * zonePtr(const word &zoneName) const
Lookup zone by name and return const pointer, nullptr on error.
Definition: ZoneMesh.C:575
Foam::ZoneMesh::checkParallelSync
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
Definition: ZoneMesh.C:660
Foam::ZoneMesh::types
wordList types() const
Return a list of zone types.
Definition: ZoneMesh.C:324