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  {
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  if (zoneName.empty())
489  {
490  return -1;
491  }
492 
493  label zoneId = findIndexImpl(*this, zoneName);
494 
495  if (zoneId < 0)
496  {
498  << "Zone named " << zoneName << " not found. "
499  << "List of available zone names: " << names() << endl;
500 
501  // Used for -dry-run, for example
502  if (disallowGenericZones != 0)
503  {
504  auto& zm = const_cast<ZoneMesh<ZoneType, MeshType>&>(*this);
505  zoneId = zm.size();
506 
507  Info<< "Creating dummy zone " << zoneName << endl;
508  zm.append(new ZoneType(zoneName, zoneId, zm));
509  }
510  }
511 
512  return zoneId;
513 }
514 
515 
516 template<class ZoneType, class MeshType>
518 (
519  const word& zoneName
520 ) const
521 {
522  if (zoneName.empty())
523  {
524  return nullptr;
525  }
526 
527  const PtrList<ZoneType>& zones = *this;
528 
529  for (auto iter = zones.begin(); iter != zones.end(); ++iter)
530  {
531  const ZoneType* ptr = iter.get();
532 
533  if (ptr && zoneName == ptr->name())
534  {
535  return ptr;
536  }
537  }
538 
539  // Used for -dry-run, for example
540  if (disallowGenericZones != 0)
541  {
542  auto& zm = const_cast<ZoneMesh<ZoneType, MeshType>&>(*this);
543 
544  Info<< "Creating dummy zone " << zoneName << endl;
545  zm.append(new ZoneType(zoneName, zm.size(), zm));
546  }
547 
548  return nullptr;
549 }
550 
551 
552 template<class ZoneType, class MeshType>
554 (
555  const word& zoneName
556 )
557 {
558  return const_cast<ZoneType*>(this->cfindZone(zoneName));
559 }
560 
561 
562 template<class ZoneType, class MeshType>
564 (
565  const labelUList& zoneIds
566 ) const
567 {
568  bitSet bitset;
569 
570  for (const label zonei : zoneIds)
571  {
572  #ifdef FULLDEBUG
573  if (zonei < 0 || zonei >= this->size())
574  {
576  << ZoneType::typeName << " "
577  << zonei << " out of range [0," << this->size() << ")"
578  << abort(FatalError);
579  }
580  #endif
581 
582  bitset.set
583  (
584  static_cast<const labelList&>(this->operator[](zonei))
585  );
586  }
587 
588  return bitset;
589 }
590 
591 
592 template<class ZoneType, class MeshType>
594 (
595  const keyType& key
596 ) const
597 {
598  // key.empty() is handled by indices()
599  return this->selection(this->indices(key));
600 }
601 
602 
603 template<class ZoneType, class MeshType>
605 (
606  const wordRes& matcher
607 ) const
608 {
609  // matcher.empty() is handled by indices()
610  return this->selection(this->indices(matcher));
611 }
612 
613 
614 template<class ZoneType, class MeshType>
616 {
617  deleteDemandDrivenData(zoneMapPtr_);
618 
619  PtrList<ZoneType>& zones = *this;
620 
621  for (ZoneType& zn : zones)
622  {
623  zn.clearAddressing();
624  }
625 }
626 
627 
628 template<class ZoneType, class MeshType>
630 {
631  clearAddressing();
633 }
634 
635 
636 template<class ZoneType, class MeshType>
638 (
639  const bool report
640 ) const
641 {
642  bool inError = false;
643 
644  const PtrList<ZoneType>& zones = *this;
645 
646  for (const ZoneType& zn : zones)
647  {
648  inError |= zn.checkDefinition(report);
649  }
650 
651  return inError;
652 }
653 
654 
655 template<class ZoneType, class MeshType>
657 (
658  const bool report
659 ) const
660 {
661  if (!Pstream::parRun())
662  {
663  return false;
664  }
665 
666  const PtrList<ZoneType>& zones = *this;
667 
668  bool hasError = false;
669 
670  // Collect all names
671  List<wordList> allNames(Pstream::nProcs());
672  allNames[Pstream::myProcNo()] = this->names();
673  Pstream::gatherList(allNames);
674  Pstream::scatterList(allNames);
675 
676  List<wordList> allTypes(Pstream::nProcs());
677  allTypes[Pstream::myProcNo()] = this->types();
678  Pstream::gatherList(allTypes);
679  Pstream::scatterList(allTypes);
680 
681  // Have every processor check but only master print error.
682 
683  for (label proci = 1; proci < allNames.size(); ++proci)
684  {
685  if
686  (
687  (allNames[proci] != allNames[0])
688  || (allTypes[proci] != allTypes[0])
689  )
690  {
691  hasError = true;
692 
693  if (debug || (report && Pstream::master()))
694  {
695  Info<< " ***Inconsistent zones across processors, "
696  "processor 0 has zone names:" << allNames[0]
697  << " zone types:" << allTypes[0]
698  << " processor " << proci << " has zone names:"
699  << allNames[proci]
700  << " zone types:" << allTypes[proci]
701  << endl;
702  }
703  }
704  }
705 
706  // Check contents
707  if (!hasError)
708  {
709  for (const ZoneType& zn : zones)
710  {
711  if (zn.checkParallelSync(false))
712  {
713  hasError = true;
714 
715  if (debug || (report && Pstream::master()))
716  {
717  Info<< " ***Zone " << zn.name()
718  << " of type " << zn.type()
719  << " is not correctly synchronised"
720  << " across coupled boundaries."
721  << " (coupled faces are either not both"
722  << " present in set or have same flipmap)" << endl;
723  }
724  }
725  }
726  }
727 
728  return hasError;
729 }
730 
731 
732 template<class ZoneType, class MeshType>
734 {
735  PtrList<ZoneType>& zones = *this;
736 
737  for (ZoneType& zn : zones)
738  {
739  zn.movePoints(pts);
740  }
741 }
742 
743 
744 template<class ZoneType, class MeshType>
746 {
747  os << *this;
748  return os.good();
749 }
750 
751 
752 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
753 
754 template<class ZoneType, class MeshType>
756 (
757  const word& zoneName
758 ) const
759 {
760  const label zonei = findZoneID(zoneName);
761 
762  if (zonei < 0)
763  {
765  << "Zone named " << zoneName << " not found." << nl
766  << "Available zone names: " << names() << endl
767  << abort(FatalError);
768  }
769 
770  return operator[](zonei);
771 }
772 
773 
774 template<class ZoneType, class MeshType>
776 (
777  const word& zoneName
778 )
779 {
780  const label zonei = findZoneID(zoneName);
781 
782  if (zonei < 0)
783  {
785  << "Zone named " << zoneName << " not found." << nl
786  << "Available zone names: " << names() << endl
787  << abort(FatalError);
788  }
789 
790  return operator[](zonei);
791 }
792 
793 
794 template<class ZoneType, class MeshType>
796 (
797  const word& zoneName,
798  const bool verbose
799 )
800 {
801  ZoneType* ptr = findZone(zoneName);
802 
803  const bool existing = bool(ptr);
804 
805  if (!ptr)
806  {
807  ptr = new ZoneType(zoneName, this->size(), *this);
808  this->append(ptr);
809  }
810 
811  if (verbose)
812  {
813  Info<< ZoneType::typeName << ' ' << zoneName
814  << " (" << (existing ? "existing" : "new")
815  << " at index " << ptr->index() << ')'
816  << endl;
817  }
818 
819  return *ptr;
820 }
821 
822 
823 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
824 
825 template<class ZoneType, class MeshType>
826 Foam::Ostream& Foam::operator<<
827 (
828  Ostream& os,
829  const ZoneMesh<ZoneType, MeshType>& zones
830 )
831 {
832  const label sz = zones.size();
833 
834  if (sz)
835  {
836  os << sz << nl << token::BEGIN_LIST;
837 
838  for (label i=0; i < sz; ++i)
839  {
840  zones[i].writeDict(os);
841  }
842 
843  os << token::END_LIST;
844  }
845  else
846  {
847  os << sz << token::BEGIN_LIST << token::END_LIST;
848  }
849 
850  return os;
851 }
852 
853 
854 // ************************************************************************* //
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:638
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::ZoneMesh::clear
void clear()
Clear the zones.
Definition: ZoneMesh.C:629
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::output
static Ostream & output(Ostream &os, const IntRange< T > &range)
Definition: IntRanges.C:66
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:745
Foam::ZoneMesh::cfindZone
const ZoneType * cfindZone(const word &zoneName) const
Find zone by name and return const pointer, nullptr on error.
Definition: ZoneMesh.C:518
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
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:574
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::ZoneMesh::findIndex
label findIndex(const keyType &key) const
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::PtrList::set
const T * set(const label i) const
Return const pointer to element (can be nullptr),.
Definition: PtrList.H:138
append
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
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:733
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:365
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::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
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:144
Foam::ZoneMesh::findZoneID
label findZoneID(const word &zoneName) const
Find zone index by 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:71
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
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:77
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::UList< label >
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
bool
bool
Definition: EEqn.H:20
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:270
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:564
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:615
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::findZone
ZoneType * findZone(const word &zoneName)
Find zone by name and return pointer, nullptr on error.
Definition: ZoneMesh.C:554
Foam::ZoneMesh::checkParallelSync
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
Definition: ZoneMesh.C:657
Foam::ZoneMesh::types
wordList types() const
Return a list of zone types.
Definition: ZoneMesh.C:324