37 auto& zones = this->storedZones();
42 bool zonesTooBig(
false);
44 const label maxCount = this->size();
54 zn.size() = (maxCount - zn.start());
55 start = (zn.start() + zn.size());
71 <<
"Surface has more faces " << maxCount
72 <<
" than zone addressing ... extending final zone" <<
nl;
80 <<
"Surface has more zone addressing than faces " 82 <<
" ... trucated/resized accordingly" <<
nl;
92 DynamicList<Face>& unsortedFaces,
93 DynamicList<label>& zoneIds,
94 DynamicList<label>& elemIds,
99 const label nInputFaces = unsortedFaces.size();
101 if (sorted || zoneIds.size() != nInputFaces)
108 if (elemIds.size() != nInputFaces)
116 this->storedFaces().transfer(unsortedFaces);
117 this->storedFaceIds().transfer(elemIds);
127 auto& newFaces = this->storedFaces();
128 newFaces.resize(nInputFaces);
134 newFaces[facei].transfer(unsortedFaces[
faceMap[facei]]);
137 auto& newFaceIds = this->storedFaceIds();
138 newFaceIds.resize(elemIds.size());
143 newFaceIds[facei] = elemIds[
faceMap[facei]];
157 auto& zones = this->storedZones();
158 zones.resize(zones.size());
164 if (srfZones[zonei].size() || !cullEmpty)
166 zones[nZone] =
surfZone(srfZones[zonei], nZone);
183 auto& zones = this->storedZones();
184 zones.resize(sizes.
size());
191 if (sizes[zonei] || !cullEmpty)
200 start += sizes[zonei];
216 auto& zones = this->storedZones();
217 zones.resize(sizes.
size());
224 if (sizes[zonei] || !cullEmpty)
228 surfZone::defaultName(nZone),
233 start += sizes[zonei];
253 this->storedZones().clear();
void size(const label n)
Older name for setAddressableSize.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
bool addZonesToFaces()
Propagate zone information on face regions.
A surface zone on a MeshedSurface.
constexpr char nl
The newline '\n' character (0x0a)
label size() const
The size of this zone in the face list.
virtual void removeZones()
Remove surface zones.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void sortFacesAndStore(DynamicList< Face > &unsortedFaces, DynamicList< label > &zoneIds, DynamicList< label > &elemIds, bool sorted)
Sort faces by zones and store sorted faces.
label start() const
The start label of this zone in the face list.
#define WarningInFunction
Report a warning using Foam::Warning.
void checkZones(const bool verbose=true)
Sanity check/resizing on zones.
virtual void addZones(const UList< surfZone > &, const bool cullEmpty=false)
Add surface zones.
List< label > labelList
A List of labels.