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-2018 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
496  if (debug)
497  {
499  << "Zone named " << zoneName << " not found. "
500  << "List of available zone names: " << names() << endl;
501  }
502 
503  if (disallowGenericZones != 0)
504  {
505  // Create a new ...
506 
507  Info<< "Creating dummy zone " << zoneName << endl;
509  dict.set("type", ZoneType::typeName);
510  dict.set(ZoneType::labelsName, labelList());
511 
512  // flipMap only really applicable for face zones, but should not get
513  // in the way for cell- and point-zones...
514  dict.set("flipMap", boolList());
515 
516  auto& zm = const_cast<ZoneMesh<ZoneType, MeshType>&>(*this);
517  zoneId = zm.size();
518 
519  zm.append(new ZoneType(zoneName, dict, zoneId, zm));
520  }
521 
522  return zoneId;
523 }
524 
525 
526 template<class ZoneType, class MeshType>
528 (
529  const labelUList& zoneIds
530 ) const
531 {
532  bitSet bitset;
533 
534  for (const label zonei : zoneIds)
535  {
536  #ifdef FULLDEBUG
537  if (zonei < 0 || zonei >= this->size())
538  {
540  << ZoneType::typeName << " "
541  << zonei << " out of range [0," << this->size() << ")"
542  << abort(FatalError);
543  }
544  #endif
545 
546  bitset.set
547  (
548  static_cast<const labelList&>(this->operator[](zonei))
549  );
550  }
551 
552  return bitset;
553 }
554 
555 
556 template<class ZoneType, class MeshType>
558 (
559  const keyType& key
560 ) const
561 {
562  return this->selection(this->indices(key));
563 }
564 
565 
566 template<class ZoneType, class MeshType>
568 (
569  const wordRes& matcher
570 ) const
571 {
572  return this->selection(this->indices(matcher));
573 }
574 
575 
576 template<class ZoneType, class MeshType>
578 (
579  const word& zoneName
580 ) const
581 {
582  const PtrList<ZoneType>& zones = *this;
583 
584  for (auto iter = zones.begin(); iter != zones.end(); ++iter)
585  {
586  const ZoneType* ptr = iter.get();
587 
588  if (ptr && zoneName == ptr->name())
589  {
590  return ptr;
591  }
592  }
593 
594  return nullptr;
595 }
596 
597 
598 template<class ZoneType, class MeshType>
600 (
601  const word& zoneName
602 )
603 {
604  PtrList<ZoneType>& zones = *this;
605 
606  for (auto iter = zones.begin(); iter != zones.end(); ++iter)
607  {
608  ZoneType* ptr = iter.get();
609 
610  if (ptr && zoneName == ptr->name())
611  {
612  return ptr;
613  }
614  }
615 
616  return nullptr;
617 }
618 
619 
620 template<class ZoneType, class MeshType>
622 {
623  deleteDemandDrivenData(zoneMapPtr_);
624 
625  PtrList<ZoneType>& zones = *this;
626 
627  for (ZoneType& zn : zones)
628  {
629  zn.clearAddressing();
630  }
631 }
632 
633 
634 template<class ZoneType, class MeshType>
636 {
637  clearAddressing();
639 }
640 
641 
642 template<class ZoneType, class MeshType>
644 (
645  const bool report
646 ) const
647 {
648  bool inError = false;
649 
650  const PtrList<ZoneType>& zones = *this;
651 
652  for (const ZoneType& zn : zones)
653  {
654  inError |= zn.checkDefinition(report);
655  }
656 
657  return inError;
658 }
659 
660 
661 template<class ZoneType, class MeshType>
663 (
664  const bool report
665 ) const
666 {
667  if (!Pstream::parRun())
668  {
669  return false;
670  }
671 
672  const PtrList<ZoneType>& zones = *this;
673 
674  bool hasError = false;
675 
676  // Collect all names
677  List<wordList> allNames(Pstream::nProcs());
678  allNames[Pstream::myProcNo()] = this->names();
679  Pstream::gatherList(allNames);
680  Pstream::scatterList(allNames);
681 
682  List<wordList> allTypes(Pstream::nProcs());
683  allTypes[Pstream::myProcNo()] = this->types();
684  Pstream::gatherList(allTypes);
685  Pstream::scatterList(allTypes);
686 
687  // Have every processor check but only master print error.
688 
689  for (label proci = 1; proci < allNames.size(); ++proci)
690  {
691  if
692  (
693  (allNames[proci] != allNames[0])
694  || (allTypes[proci] != allTypes[0])
695  )
696  {
697  hasError = true;
698 
699  if (debug || (report && Pstream::master()))
700  {
701  Info<< " ***Inconsistent zones across processors, "
702  "processor 0 has zone names:" << allNames[0]
703  << " zone types:" << allTypes[0]
704  << " processor " << proci << " has zone names:"
705  << allNames[proci]
706  << " zone types:" << allTypes[proci]
707  << endl;
708  }
709  }
710  }
711 
712  // Check contents
713  if (!hasError)
714  {
715  for (const ZoneType& zn : zones)
716  {
717  if (zn.checkParallelSync(false))
718  {
719  hasError = true;
720 
721  if (debug || (report && Pstream::master()))
722  {
723  Info<< " ***Zone " << zn.name()
724  << " of type " << zn.type()
725  << " is not correctly synchronised"
726  << " across coupled boundaries."
727  << " (coupled faces are either not both"
728  << " present in set or have same flipmap)" << endl;
729  }
730  }
731  }
732  }
733 
734  return hasError;
735 }
736 
737 
738 template<class ZoneType, class MeshType>
740 {
741  PtrList<ZoneType>& zones = *this;
742 
743  for (ZoneType& zn : zones)
744  {
745  zn.movePoints(pts);
746  }
747 }
748 
749 
750 template<class ZoneType, class MeshType>
752 {
753  os << *this;
754  return os.good();
755 }
756 
757 
758 // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
759 
760 template<class ZoneType, class MeshType>
762 (
763  const word& zoneName
764 ) const
765 {
766  const label zonei = findZoneID(zoneName);
767 
768  if (zonei < 0)
769  {
771  << "Zone named " << zoneName << " not found." << nl
772  << "Available zone names: " << names() << endl
773  << abort(FatalError);
774  }
775 
776  return operator[](zonei);
777 }
778 
779 
780 template<class ZoneType, class MeshType>
782 (
783  const word& zoneName
784 )
785 {
786  const label zonei = findZoneID(zoneName);
787 
788  if (zonei < 0)
789  {
791  << "Zone named " << zoneName << " not found." << nl
792  << "Available zone names: " << names() << endl
793  << abort(FatalError);
794  }
795 
796  return operator[](zonei);
797 }
798 
799 
800 template<class ZoneType, class MeshType>
802 (
803  const word& zoneName,
804  const bool verbose
805 )
806 {
807  PtrList<ZoneType>& zones = *this;
808 
809  label zoneId = findZoneID(zoneName);
810 
811  if (zoneId < 0)
812  {
813  zoneId = zones.size();
814  zones.resize(zoneId+1);
815  zones.set(zoneId, new ZoneType(zoneName, zoneId, *this));
816 
817  if (verbose)
818  {
819  Info<< ZoneType::typeName << " " << zoneName
820  << " (new at index " << zoneId << ")"
821  << endl;
822  }
823  }
824  else
825  {
826  if (verbose)
827  {
828  Info<< ZoneType::typeName << " " << zoneName
829  << " (existing at index " << zoneId << ")"
830  << endl;
831  }
832  }
833 
834  return zones[zoneId];
835 }
836 
837 
838 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
839 
840 template<class ZoneType, class MeshType>
841 Foam::Ostream& Foam::operator<<
842 (
843  Ostream& os,
844  const ZoneMesh<ZoneType, MeshType>& zones
845 )
846 {
847  const label sz = zones.size();
848 
849  if (sz)
850  {
851  os << sz << nl << token::BEGIN_LIST;
852 
853  for (label i=0; i < sz; ++i)
854  {
855  zones[i].writeDict(os);
856  }
857 
858  os << token::END_LIST;
859  }
860  else
861  {
862  os << sz << token::BEGIN_LIST << token::END_LIST;
863  }
864 
865  return os;
866 }
867 
868 
869 // ************************************************************************* //
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:644
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:74
Foam::ZoneMesh::clear
void clear()
Clear the zones.
Definition: ZoneMesh.C:635
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
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:316
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:751
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: HashTableFwd.H:46
Foam::boolList
List< bool > boolList
A List of bools.
Definition: List.H:72
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:337
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:290
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::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::ZoneMesh::movePoints
void movePoints(const pointField &pts)
Correct zone mesh after moving points.
Definition: ZoneMesh.C:739
Foam::Field< vector >
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
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:241
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:65
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:67
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
clear
patchWriters clear()
Foam::nl
constexpr char nl
Definition: Ostream.H:372
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:261
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:528
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:621
Foam::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:216
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:578
Foam::ZoneMesh::checkParallelSync
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
Definition: ZoneMesh.C:663
Foam::ZoneMesh::types
wordList types() const
Return a list of zone types.
Definition: ZoneMesh.C:324