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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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 "DynamicList.H"
32#include "Pstream.H"
33#include "PtrListOps.H"
34#include "globalIndex.H"
35
36// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37
38namespace Foam
39{
40 template<class ZoneType, class MeshType>
42 (
43 debug::debugSwitch("disallowGenericZones", 0)
44 );
45}
46
47
48// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
49
50template<class ZoneType, class MeshType>
52{
53 if (zoneMapPtr_)
54 {
56 << "zone map already calculated"
57 << abort(FatalError);
58 }
59 else
60 {
61 // Count number of objects in all zones
62 label nObjects = 0;
63
64 const PtrList<ZoneType>& zones = *this;
65
66 for (const ZoneType& zn : zones)
67 {
68 nObjects += zn.size();
69 }
70
71 zoneMapPtr_.reset(new Map<label>(2*nObjects));
72 auto& zm = *zoneMapPtr_;
73
74 // Fill in objects of all zones into the map.
75 // The key is the global object index, value is the zone index
76
77 label zonei = 0;
78
79 for (const ZoneType& zn : zones)
80 {
81 const labelList& labels = zn;
82
83 for (const label idx : labels)
84 {
85 zm.insert(idx, zonei);
86 }
87
88 ++zonei;
89 }
90 }
91}
92
93
94template<class ZoneType, class MeshType>
96{
97 if (groupIDsPtr_)
98 {
99 // Use existing cache
100 return !groupIDsPtr_->empty();
101 }
102
103 const PtrList<ZoneType>& zones = *this;
104
105 for (const ZoneType& zn : zones)
106 {
107 if (!zn.inGroups().empty())
108 {
109 return true;
110 }
111 }
113 return false;
114}
115
116
117template<class ZoneType, class MeshType>
120 if (groupIDsPtr_)
121 {
122 return; // Or FatalError
123 }
124
125 groupIDsPtr_.reset(new HashTable<labelList>(16));
126 auto& groupLookup = *groupIDsPtr_;
128 const PtrList<ZoneType>& zones = *this;
129
130 forAll(zones, zonei)
131 {
132 const wordList& groups = zones[zonei].inGroups();
133
134 for (const word& groupName : groups)
135 {
136 groupLookup(groupName).append(zonei);
137 }
138 }
139
140 // Remove groups that clash with zone names
141 forAll(zones, zonei)
142 {
143 if (groupLookup.erase(zones[zonei].name()))
144 {
146 << "Removed group '" << zones[zonei].name()
147 << "' which clashes with zone " << zonei
148 << " of the same name."
150 }
151 }
152}
154
155template<class ZoneType, class MeshType>
157{
158 if
160 readOpt() == IOobject::MUST_READ
161 || readOpt() == IOobject::MUST_READ_IF_MODIFIED
162 || (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
163 )
164 {
165 // Warn for MUST_READ_IF_MODIFIED
166 warnNoRereading<ZoneMesh<ZoneType, MeshType>>();
167
168 PtrList<ZoneType>& zones = *this;
169
170 // Read zones as entries
171 Istream& is = readStream(typeName);
172
173 PtrList<entry> patchEntries(is);
174 zones.resize(patchEntries.size());
175
176 // Transcribe
177 forAll(zones, zonei)
178 {
179 zones.set
180 (
181 zonei,
182 ZoneType::New
184 patchEntries[zonei].keyword(),
185 patchEntries[zonei].dict(),
186 zonei,
187 *this
188 )
189 );
190 }
191
193 close();
194 return true;
195 }
196
197 // Nothing read
198 return false;
199}
201
202// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
203
204template<class ZoneType, class MeshType>
206(
207 const IOobject& io,
208 const MeshType& mesh
209)
210:
211 PtrList<ZoneType>(),
213 mesh_(mesh)
214{
215 readContents();
217
218
219template<class ZoneType, class MeshType>
221(
222 const IOobject& io,
223 const MeshType& mesh,
224 const label size
225)
226:
227 PtrList<ZoneType>(size),
229 mesh_(mesh)
230{
231 // Optionally read contents, otherwise keep size
232 readContents();
233}
234
235
236template<class ZoneType, class MeshType>
238(
239 const IOobject& io,
240 const MeshType& mesh,
241 const PtrList<ZoneType>& pzm
243:
244 PtrList<ZoneType>(),
246 mesh_(mesh)
247{
248 if (!readContents())
250 // Nothing read. Use supplied zones
251 PtrList<ZoneType>& zones = *this;
252 zones.resize(pzm.size());
253
254 forAll(zones, zonei)
256 zones.set(zonei, pzm[zonei].clone(*this));
257 }
258 }
260
261
262// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
263
264template<class ZoneType, class MeshType>
266{
267 clearAddressing();
269
270
271// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
272
273template<class ZoneType, class MeshType>
276{
277 if (!zoneMapPtr_)
278 {
279 calcZoneMap();
280 }
281
282 return *zoneMapPtr_;
284
285
286template<class ZoneType, class MeshType>
288(
289 const label objectIndex
290) const
291{
292 return zoneMap().lookup(objectIndex, -1);
293}
294
295
296template<class ZoneType, class MeshType>
298{
299 return PtrListOps::get<word>(*this, typeOp<ZoneType>());
300}
301
302
303template<class ZoneType, class MeshType>
305{
306 return PtrListOps::get<word>(*this, nameOp<ZoneType>());
307}
308
309
310template<class ZoneType, class MeshType>
313 return this->groupZoneIDs().sortedToc();
314}
316
317template<class ZoneType, class MeshType>
319(
320 const wordRe& matcher
321) const
322{
323 return PtrListOps::names(*this, matcher);
324}
325
326
327template<class ZoneType, class MeshType>
329(
330 const wordRes& matcher
331)
332const
333{
334 return PtrListOps::names(*this, matcher);
335}
336
337
338template<class ZoneType, class MeshType>
340{
341 wordList sorted(this->names());
342 Foam::sort(sorted);
343
344 return sorted;
345}
346
347
348template<class ZoneType, class MeshType>
350(
351 const wordRe& matcher
352) const
353{
354 wordList sorted(this->names(matcher));
355 Foam::sort(sorted);
356
357 return sorted;
358}
359
360
361template<class ZoneType, class MeshType>
363(
364 const wordRes& matcher
365)
366const
367{
368 wordList sorted(this->names(matcher));
369 Foam::sort(sorted);
370
371 return sorted;
372}
373
374
375template<class ZoneType, class MeshType>
377(
378 const wordRe& matcher,
379 const bool useGroups
380) const
381{
382 if (matcher.empty())
383 {
384 return labelList();
385 }
386
387 // Only check groups if requested and they exist
388 const bool checkGroups = (useGroups && this->hasGroupIDs());
389
390 labelHashSet ids;
391
392 if (checkGroups)
393 {
394 ids.resize(2*this->size());
395 }
396
397 if (matcher.isPattern())
398 {
399 if (checkGroups)
400 {
401 const auto& groupLookup = groupZoneIDs();
402 forAllConstIters(groupLookup, iter)
403 {
404 if (matcher.match(iter.key()))
405 {
406 // Hash ids associated with the group
407 ids.insert(iter.val());
408 }
409 }
410 }
411
412 if (ids.empty())
413 {
414 return PtrListOps::findMatching(*this, matcher);
415 }
416 else
417 {
418 ids.insert(PtrListOps::findMatching(*this, matcher));
419 }
420 }
421 else
422 {
423 // Literal string.
424 // Special version of above for reduced memory footprint
425
426 const label zoneId = PtrListOps::firstMatching(*this, matcher);
427
428 if (zoneId >= 0)
429 {
430 return labelList(one{}, zoneId);
431 }
432 else if (checkGroups)
433 {
434 const auto iter = groupZoneIDs().cfind(matcher);
435
436 if (iter.found())
437 {
438 // Hash ids associated with the group
439 ids.insert(iter.val());
440 }
441 }
442 }
443
444 return ids.sortedToc();
445}
446
447
448template<class ZoneType, class MeshType>
450(
451 const wordRes& matcher,
452 const bool useGroups
453) const
454{
455 if (matcher.empty())
456 {
457 return labelList();
458 }
459 else if (matcher.size() == 1)
460 {
461 return this->indices(matcher.first(), useGroups);
462 }
463
464 labelHashSet ids;
465
466 // Only check groups if requested and they exist
467 if (useGroups && this->hasGroupIDs())
468 {
469 ids.resize(2*this->size());
470
471 const auto& groupLookup = groupZoneIDs();
472 forAllConstIters(groupLookup, iter)
473 {
474 if (matcher.match(iter.key()))
475 {
476 // Hash the ids associated with the group
477 ids.insert(iter.val());
478 }
479 }
480 }
481
482 if (ids.empty())
483 {
484 return PtrListOps::findMatching(*this, matcher);
485 }
486 else
487 {
488 ids.insert(PtrListOps::findMatching(*this, matcher));
489 }
490
491 return ids.sortedToc();
492}
493
494
495template<class ZoneType, class MeshType>
497(
498 const wordRe& key
499) const
500{
501 if (key.empty())
502 {
503 return -1;
504 }
505 return PtrListOps::firstMatching(*this, key);
506}
507
508
509template<class ZoneType, class MeshType>
511(
512 const wordRes& matcher
513) const
514{
515 if (matcher.empty())
516 {
517 return -1;
518 }
519 return PtrListOps::firstMatching(*this, matcher);
520}
521
522
523template<class ZoneType, class MeshType>
525(
526 const word& zoneName
527) const
528{
529 if (zoneName.empty())
530 {
531 return -1;
532 }
533
534 label zoneId = PtrListOps::firstMatching(*this, zoneName);
535
536 if (zoneId < 0)
537 {
539 << "Zone named " << zoneName << " not found. "
540 << "List of available zone names: " << names() << endl;
541
542 // Used for -dry-run, for example
543 if (disallowGenericZones != 0)
544 {
545 auto& zm = const_cast<ZoneMesh<ZoneType, MeshType>&>(*this);
546 zoneId = zm.size();
547
548 Info<< "Creating dummy zone " << zoneName << endl;
549 zm.append(new ZoneType(zoneName, zoneId, zm));
550 }
551 }
552
553 return zoneId;
554}
555
556
557template<class ZoneType, class MeshType>
559(
560 const word& zoneName
561) const
562{
563 if (zoneName.empty())
564 {
565 return nullptr;
566 }
567
568 const PtrList<ZoneType>& zones = *this;
569
570 for (auto iter = zones.begin(); iter != zones.end(); ++iter)
571 {
572 const ZoneType* ptr = iter.get();
573
574 if (ptr && zoneName == ptr->name())
575 {
576 return ptr;
577 }
578 }
579
580 // Used for -dry-run, for example
581 if (disallowGenericZones != 0)
582 {
583 auto& zm = const_cast<ZoneMesh<ZoneType, MeshType>&>(*this);
584
585 Info<< "Creating dummy zone " << zoneName << endl;
586 zm.append(new ZoneType(zoneName, zm.size(), zm));
587 }
588
589 return nullptr;
590}
591
592
593template<class ZoneType, class MeshType>
595(
596 const word& zoneName
597)
598{
599 return const_cast<ZoneType*>(this->cfindZone(zoneName));
600}
601
602
603template<class ZoneType, class MeshType>
605(
606 const labelUList& zoneIds
607) const
608{
609 bitSet bitset;
610
611 for (const label zonei : zoneIds)
612 {
613 #ifdef FULLDEBUG
614 if (zonei < 0 || zonei >= this->size())
615 {
617 << ZoneType::typeName << " "
618 << zonei << " out of range [0," << this->size() << ")"
619 << abort(FatalError);
620 }
621 #endif
622
623 bitset.set
624 (
625 static_cast<const labelList&>(this->operator[](zonei))
626 );
627 }
628
629 return bitset;
630}
631
632
633template<class ZoneType, class MeshType>
635(
636 const wordRe& matcher,
637 const bool useGroups
638) const
639{
640 // matcher.empty() is handled by indices()
641 return this->selection(this->indices(matcher, useGroups));
642}
643
644
645template<class ZoneType, class MeshType>
647(
648 const wordRes& matcher,
649 const bool useGroups
650) const
651{
652 // matcher.empty() is handled by indices()
653 return this->selection(this->indices(matcher, useGroups));
654}
655
656
657template<class ZoneType, class MeshType>
660{
661 if (!groupIDsPtr_)
662 {
663 calcGroupIDs();
664 }
665
666 return *groupIDsPtr_;
667}
668
669
670template<class ZoneType, class MeshType>
672(
673 const word& groupName,
674 const labelUList& zoneIDs
675)
676{
677 groupIDsPtr_.clear();
678
679 PtrList<ZoneType>& zones = *this;
680
681 boolList doneZone(zones.size(), false);
682
683 // Add to specified zones
684 for (const label zonei : zoneIDs)
685 {
686 zones[zonei].inGroups().appendUniq(groupName);
687 doneZone[zonei] = true;
688 }
689
690 // Remove from other zones
691 forAll(zones, zonei)
692 {
693 if (!doneZone[zonei])
694 {
695 wordList& groups = zones[zonei].inGroups();
696
697 if (groups.found(groupName))
698 {
699 label newi = 0;
700 forAll(groups, i)
701 {
702 if (groups[i] != groupName)
703 {
704 groups[newi++] = groups[i];
705 }
706 }
707 groups.resize(newi);
708 }
709 }
710 }
711}
712
713
714template<class ZoneType, class MeshType>
716{
717 zoneMapPtr_.clear();
718 groupIDsPtr_.clear();
719
720 PtrList<ZoneType>& zones = *this;
721
722 for (ZoneType& zn : zones)
723 {
724 zn.clearAddressing();
725 }
726}
727
728
729template<class ZoneType, class MeshType>
731{
732 clearAddressing();
734}
735
736
737template<class ZoneType, class MeshType>
739(
740 const bool report
741) const
742{
743 bool hasError = false;
744
745 const PtrList<ZoneType>& zones = *this;
746
747 for (const ZoneType& zn : zones)
748 {
749 hasError |= zn.checkDefinition(report);
750 }
751
752 return hasError;
753}
754
755
756template<class ZoneType, class MeshType>
758(
759 const bool report
760) const
761{
762 if (!Pstream::parRun())
763 {
764 return false;
765 }
766
767 const PtrList<ZoneType>& zones = *this;
768
769 bool hasError = false;
770
771 const wordList localNames(this->names());
772 const wordList localTypes(this->types());
773
774 // Check and report error(s) on master
775
777 (
778 // Don't need to collect master itself
779 (Pstream::master() ? 0 : localNames.size()),
781 );
782
783 const wordList allNames(procAddr.gather(localNames));
784 const wordList allTypes(procAddr.gather(localTypes));
785
786 // Automatically restricted to master
787 for (const int proci : procAddr.subProcs())
788 {
789 const auto procNames(allNames.slice(procAddr.range(proci)));
790 const auto procTypes(allTypes.slice(procAddr.range(proci)));
791
792 if (procNames != localNames || procTypes != localTypes)
793 {
794 hasError = true;
795
796 if (debug || report)
797 {
798 Info<< " ***Inconsistent zones across processors, "
799 "processor 0 has zone names:" << localNames
800 << " zone types:" << localTypes
801 << " processor " << proci
802 << " has zone names:" << procNames
803 << " zone types:" << procTypes
804 << endl;
805 }
806 }
807 }
808
809 Pstream::broadcast(hasError);
810
811 // Check local contents
812 if (!hasError)
813 {
814 for (const ZoneType& zn : zones)
815 {
816 if (zn.checkParallelSync(false))
817 {
818 hasError = true;
819
820 if (debug || (report && Pstream::master()))
821 {
822 Info<< " ***Zone " << zn.name()
823 << " of type " << zn.type()
824 << " is not correctly synchronised"
825 << " across coupled boundaries."
826 << " (coupled faces are either not both"
827 << " present in set or have same flipmap)" << endl;
828 }
829 }
830 }
831 }
832
833 return hasError;
834}
835
836
837template<class ZoneType, class MeshType>
839{
840 PtrList<ZoneType>& zones = *this;
841
842 for (ZoneType& zn : zones)
843 {
844 zn.movePoints(pts);
845 }
846}
847
848
849template<class ZoneType, class MeshType>
851{
852 wordList zoneNames(this->names());
853 if (zoneNames.empty())
854 {
855 this->removeMetaData();
856 }
857 else
858 {
859 dictionary& meta = this->getMetaData();
860 meta.set("names", zoneNames);
861 }
862}
863
864
865template<class ZoneType, class MeshType>
867{
868 os << *this;
869 return os.good();
870}
871
872
873// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
874
875template<class ZoneType, class MeshType>
877(
878 const word& zoneName
879) const
880{
881 const label zonei = findZoneID(zoneName);
882
883 if (zonei < 0)
884 {
886 << "Zone named " << zoneName << " not found." << nl
887 << "Available zone names: " << names() << endl
888 << abort(FatalError);
889 }
890
891 return operator[](zonei);
892}
893
894
895template<class ZoneType, class MeshType>
897(
898 const word& zoneName
899)
900{
901 const label zonei = findZoneID(zoneName);
902
903 if (zonei < 0)
904 {
906 << "Zone named " << zoneName << " not found." << nl
907 << "Available zone names: " << names() << endl
908 << abort(FatalError);
909 }
910
911 return operator[](zonei);
912}
913
914
915template<class ZoneType, class MeshType>
917(
918 const word& zoneName,
919 const bool verbose
920)
921{
922 ZoneType* ptr = findZone(zoneName);
923
924 const bool existing = bool(ptr);
925
926 if (!ptr)
927 {
928 ptr = new ZoneType(zoneName, this->size(), *this);
929 this->append(ptr);
930 }
931
932 if (verbose)
933 {
934 Info<< ZoneType::typeName << ' ' << zoneName
935 << " (" << (existing ? "existing" : "new")
936 << " at index " << ptr->index() << ')'
937 << endl;
938 }
939
940 return *ptr;
941}
942
943
944// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
945
946template<class ZoneType, class MeshType>
947Foam::Ostream& Foam::operator<<
948(
949 Ostream& os,
951)
952{
953 const label sz = zones.size();
954
955 if (sz)
956 {
957 os << sz << nl << token::BEGIN_LIST;
958
959 for (label i=0; i < sz; ++i)
960 {
961 zones[i].writeDict(os);
962 }
963
964 os << token::END_LIST;
965 }
966 else
967 {
968 os << sz << token::BEGIN_LIST << token::END_LIST;
969 }
970
971 return os;
972}
973
974
975// ************************************************************************* //
Functions to operate on Pointer Lists.
globalIndex procAddr(aMesh.nFaces())
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Definition: HashSet.H:191
A HashTable similar to std::unordered_map.
Definition: HashTable.H:123
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
Definition: HashTable.C:137
bool empty() const noexcept
True if the hash table is empty.
Definition: HashTableI.H:59
void resize(const label sz)
Resize the hash table for efficiency.
Definition: HashTable.C:601
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:58
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:139
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
const T * set(const label i) const
Definition: PtrList.H:138
void append(T *ptr)
Append an element to the end of the list.
Definition: PtrListI.H:113
void resize(const label newLen)
Adjust size of PtrList.
Definition: PtrList.C:103
const labelUList & indices() const noexcept
Return the list of sorted indices (updated every sort).
Definition: SortListI.H:54
T & first()
Return the first element of the list.
Definition: UListI.H:202
bool found(const T &val, label pos=0) const
True if the value if found in the list.
Definition: UListI.H:265
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Definition: UListI.H:427
SubList< T > slice(const label pos, label len=-1)
Return SubList slice (non-const access) - no range checking.
Definition: SubList.H:165
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
Definition: UPtrListI.H:113
label size() const noexcept
The number of elements in the list.
Definition: UPtrListI.H:106
T * get(const label i)
Definition: UPtrListI.H:127
iterator begin() noexcept
Return an iterator to begin of UPtrList traversal.
Definition: UPtrListI.H:620
iterator end() noexcept
Return iterator beyond end of UPtrList traversal.
Definition: UPtrListI.H:628
A list of mesh zones.
Definition: ZoneMesh.H:69
label findZoneID(const word &zoneName) const
Find zone index by name, return -1 if not found.
Definition: ZoneMesh.C:525
friend Ostream & operator(Ostream &os, const ZoneMesh< ZoneType, MeshType > &zones)
wordList sortedNames() const
Sorted list of the zone names.
Definition: ZoneMesh.C:339
void setGroup(const word &groupName, const labelUList &zoneIDs)
Set/add group with zones.
Definition: ZoneMesh.C:672
wordList types() const
Return a list of zone types.
Definition: ZoneMesh.C:297
ZoneType * findZone(const word &zoneName)
Find zone by name and return pointer, nullptr on error.
Definition: ZoneMesh.C:595
const ZoneType * cfindZone(const word &zoneName) const
Find zone by name and return const pointer, nullptr on error.
Definition: ZoneMesh.C:559
void updateMetaData()
Update internal meta-data (eg, prior to writing)
Definition: ZoneMesh.C:850
const Map< label > & zoneMap() const
Map of zones containing zone index for all zoned elements.
Definition: ZoneMesh.C:275
static int disallowGenericZones
Debug switch to disallow the use of generic zones.
Definition: ZoneMesh.H:106
void clearAddressing()
Clear addressing.
Definition: ZoneMesh.C:715
~ZoneMesh()
Destructor.
Definition: ZoneMesh.C:265
void clear()
Clear the zones.
Definition: ZoneMesh.C:730
wordList groupNames() const
A list of the zone group names (if any)
Definition: ZoneMesh.C:311
const HashTable< labelList > & groupZoneIDs() const
The zone indices per zone group.
Definition: ZoneMesh.C:659
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
Definition: ZoneMesh.C:288
wordList names() const
A list of the zone names.
Definition: ZoneMesh.C:304
bool checkParallelSync(const bool report=false) const
Check whether all procs have all zones and in same order.
Definition: ZoneMesh.C:758
label findIndex(const wordRe &key) const
Zone index for the first match, return -1 if not found.
Definition: ZoneMesh.C:497
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:66
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition: bitSetI.H:590
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
Definition: dictionary.C:780
const List< fieldInfo > & selection() const
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
void movePoints()
Update for new mesh geometry.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:62
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
Definition: wordRe.H:83
bool isPattern() const noexcept
The wordRe is a pattern, not a literal string.
Definition: wordReI.H:111
bool match(const std::string &text, bool literal=false) const
Smart match as regular expression or as a string.
Definition: wordReI.H:200
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
bool match(const std::string &text, bool literal=false) const
Smart match as literal or regex, stopping on the first match.
Definition: wordResI.H:91
A class for handling words, derived from Foam::string.
Definition: word.H:68
bool
Definition: EEqn.H:20
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
OBJstream os(runTime.globalPath()/outputName)
const labelIOList & zoneIDs
Definition: correctPhi.H:59
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define WarningInFunction
Report a warning using Foam::Warning.
#define FUNCTION_NAME
#define DebugInFunction
Report an information message using Foam::Info.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
Definition: debug.C:225
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
void sort(UList< T > &list)
Sort the list.
Definition: UList.C:342
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Definition: stdFoam.H:278
Extract name (as a word) from an object, typically using its name() method.
Definition: word.H:238
Extract type (as a word) from an object, typically using its type() method.
Definition: word.H:255