UnsortedMeshedSurface.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-2019 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 "MeshedSurface.H"
30 #include "UnsortedMeshedSurface.H"
31 #include "MeshedSurfaceProxy.H"
32 #include "Fstream.H"
33 #include "Time.H"
34 #include "ListOps.H"
35 #include "polyBoundaryMesh.H"
36 #include "polyMesh.H"
37 
38 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
39 
40 template<class Face>
42 {
43  return wordHashSet(*fileExtensionConstructorTablePtr_);
44 }
45 
46 
47 template<class Face>
49 {
50  return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
51 }
52 
53 
54 template<class Face>
56 (
57  const word& ext,
58  bool verbose
59 )
60 {
61  return fileFormats::surfaceFormatsCore::checkSupport
62  (
63  readTypes() | ParentType::readTypes(),
64  ext,
65  verbose,
66  "reading"
67  );
68 }
69 
70 
71 template<class Face>
73 (
74  const word& ext,
75  bool verbose
76 )
77 {
78  return fileFormats::surfaceFormatsCore::checkSupport
79  (
80  writeTypes(),
81  ext,
82  verbose,
83  "writing"
84  );
85 }
86 
87 
88 template<class Face>
90 (
91  const fileName& name,
92  bool verbose
93 )
94 {
95  word ext = name.ext();
96  if (ext == "gz")
97  {
98  ext = name.lessExt().ext();
99  }
100  return canReadType(ext, verbose);
101 }
102 
103 
104 template<class Face>
106 (
107  const fileName& name,
108  const UnsortedMeshedSurface<Face>& surf,
109  const dictionary& options
110 )
111 {
112  write(name, name.ext(), surf, options);
113 }
114 
115 
116 template<class Face>
118 (
119  const fileName& name,
120  const word& ext,
121  const UnsortedMeshedSurface<Face>& surf,
122  const dictionary& options
123 )
124 {
125  if (debug)
126  {
127  InfoInFunction << "Writing to " << name << endl;
128  }
129 
130  auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(ext);
131 
132  if (!mfIter.found())
133  {
134  // No direct writer, delegate to proxy if possible
135  const wordHashSet& delegate = ProxyType::writeTypes();
136 
137  if (delegate.found(ext))
138  {
139  MeshedSurfaceProxy<Face>(surf).write(name, ext, options);
140  }
141  else
142  {
144  << "Unknown file extension " << ext << nl << nl
145  << "Valid types:" << nl
146  << flatOutput((delegate | writeTypes()).sortedToc()) << nl
147  << exit(FatalError);
148  }
149  }
150  else
151  {
152  mfIter()(name, surf, options);
153  }
154 }
155 
156 
157 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
158 
159 template<class Face>
161 :
162  ParentType()
163 {}
164 
165 
166 template<class Face>
168 (
169  const UnsortedMeshedSurface<Face>& surf
170 )
171 :
172  ParentType(surf.points(), surf.surfFaces()), // Copy construct (no zones)
173  zoneIds_(surf.zoneIds()),
174  zoneToc_(surf.zoneToc())
175 {}
176 
177 
178 template<class Face>
180 (
181  const MeshedSurface<Face>& surf
182 )
183 :
184  ParentType(surf.points(), surf.surfFaces()), // Copy construct (no zones)
185  zoneIds_(),
186  zoneToc_()
187 {
188  setZones(surf.surfZones());
189 }
190 
191 
192 template<class Face>
194 (
196 )
197 :
199 {
200  transfer(surf);
201 }
202 
203 
204 template<class Face>
206 (
207  MeshedSurface<Face>&& surf
208 )
209 :
211 {
212  transfer(surf);
213 }
214 
215 
216 template<class Face>
218 (
219  pointField&& pointLst,
220  List<Face>&& faceLst,
221  List<label>&& zoneIds,
223 )
224 :
225  ParentType(std::move(pointLst), std::move(faceLst)),
226  zoneIds_(std::move(zoneIds)),
227  zoneToc_(tocInfo)
228 {}
229 
230 
231 template<class Face>
233 (
234  const fileName& name,
235  const word& ext
236 )
237 :
239 {
240  read(name, ext);
241 }
242 
243 
244 template<class Face>
246 (
247  const fileName& name
248 )
249 :
251 {
252  read(name);
253 }
254 
255 
256 template<class Face>
258 (
259  Istream& is
260 )
261 :
263 {
264  read(is);
265 }
266 
267 
268 template<class Face>
270 (
271  const Time& t,
272  const word& surfName
273 )
274 :
276 {
277  MeshedSurface<Face> surf(t, surfName);
278  transfer(surf);
279 }
280 
281 
282 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
283 
284 template<class Face>
286 {
287  this->removeZones(); // Parent information is unreliable
288 
289  zoneIds_.resize(size());
290  zoneIds_ = 0;
291 
292  word zoneName;
293  if (zoneToc_.size())
294  {
295  zoneName = zoneToc_[0].name();
296  }
297  if (zoneName.empty())
298  {
299  zoneName = "zone0";
300  }
301 
302  // Assign single default zone
303  zoneToc_.resize(1);
304  zoneToc_[0] = surfZoneIdentifier(zoneName, 0);
305 }
306 
307 
308 template<class Face>
310 (
311  const surfZoneList& zoneLst
312 )
313 {
314  this->removeZones(); // Parent information is unreliable
315 
316  zoneIds_.resize(size());
317  zoneToc_.resize(zoneLst.size());
318 
319  forAll(zoneToc_, zonei)
320  {
321  const surfZone& zone = zoneLst[zonei];
322  zoneToc_[zonei] = zone;
323 
324  // Assign sub-zone Ids
325  SubList<label>(zoneIds_, zone.size(), zone.start()) = zonei;
326  }
327 }
328 
329 
330 template<class Face>
332 (
333  const labelUList& sizes,
334  const UList<word>& names
335 )
336 {
337  this->removeZones(); // Parent information is unreliable
338 
339  zoneIds_.resize(size());
340  zoneToc_.resize(sizes.size());
341 
342  label start = 0;
343  forAll(zoneToc_, zonei)
344  {
345  zoneToc_[zonei] = surfZoneIdentifier(names[zonei], zonei);
346 
347  // Assign sub-zone Ids
348  SubList<label>(zoneIds_, sizes[zonei], start) = zonei;
349 
350  start += sizes[zonei];
351  }
352 }
353 
354 
355 template<class Face>
357 (
358  const labelUList& sizes
359 )
360 {
361  this->removeZones(); // Parent information is unreliable
362 
363  zoneIds_.resize(size());
364  zoneToc_.resize(sizes.size());
365 
366  label start = 0;
367  forAll(zoneToc_, zonei)
368  {
369  zoneToc_[zonei] = surfZoneIdentifier
370  (
371  "zone" + ::Foam::name(zonei),
372  zonei
373  );
374 
375  // Assign sub-zone Ids
376  SubList<label>(zoneIds_, sizes[zonei], start) = zonei;
377 
378  start += sizes[zonei];
379  }
380 }
381 
382 
383 template<class Face>
385 (
386  const labelUList& faceMap
387 )
388 {
389  // Re-assign the zone Ids
390  if (faceMap.empty())
391  {
392  return;
393  }
394 
395  if (zoneToc_.empty())
396  {
397  setOneZone();
398  }
399  else if (zoneToc_.size() == 1)
400  {
401  zoneIds_ = 0; // Optimized for single-zone case
402  }
403  else
404  {
405  List<label> newZones(faceMap.size());
406 
407  forAll(faceMap, facei)
408  {
409  newZones[facei] = zoneIds_[faceMap[facei]];
410  }
411  zoneIds_.transfer(newZones);
412  }
413 }
414 
415 
416 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
417 
418 template<class Face>
420 {
421  is >> this->storedZoneIds()
422  >> this->storedPoints()
423  >> this->storedFaces();
424 
425  is.check(FUNCTION_NAME);
426  return is;
427 }
428 
429 
430 template<class Face>
432 {
433  os << this->zoneIds()
434  << this->points()
435  << this->surfFaces();
436 
437  os.check(FUNCTION_NAME);
438  return os;
439 }
440 
441 
442 template<class Face>
444 {
445  this->storedFaces().resize(s);
446  // if zones extend: set with last zoneId
447  zoneIds_.resize(s, zoneToc_.size() - 1);
448 }
449 
450 
451 template<class Face>
453 {
455  zoneIds_.clear();
456  zoneToc_.clear();
457 }
458 
459 
460 template<class Face>
462 (
464 ) const
465 {
466  // supply some zone names
467  Map<word> zoneNames;
468  forAll(zoneToc_, zonei)
469  {
470  zoneNames.insert(zonei, zoneToc_[zonei].name());
471  }
472 
473  // std::sort() really seems to mix up the order.
474  // and std::stable_sort() might take too long / too much memory
475 
476  // Assuming that we have relatively fewer zones compared to the
477  // number of items, just do it ourselves
478 
479  // Step 1: get zone sizes and store (origId => zoneI)
481  for (const label origId : zoneIds_)
482  {
483  ++(lookup(origId, 0));
484  }
485 
486  // Step 2: assign start/size (and name) to the newZones
487  // re-use the lookup to map (zoneId => zoneI)
488  surfZoneList zoneLst(lookup.size());
489  label start = 0;
490  label zonei = 0;
491  forAllIters(lookup, iter)
492  {
493  const label origId = iter.key();
494 
495  const word zoneName =
496  zoneNames.lookup
497  (
498  origId,
499  "zone" + ::Foam::name(zonei) // default name
500  );
501 
502  zoneLst[zonei] = surfZone
503  (
504  zoneName,
505  0, // initialize with zero size
506  start,
507  zonei
508  );
509 
510  // increment the start for the next zone
511  // and save the (zoneId => zoneI) mapping
512  start += iter();
513  iter() = zonei++;
514  }
515 
516 
517  // Step 3: build the re-ordering
518  faceMap.resize(zoneIds_.size());
519 
520  forAll(zoneIds_, facei)
521  {
522  const label zonei = lookup[zoneIds_[facei]];
523  faceMap[facei] = zoneLst[zonei].start() + zoneLst[zonei].size()++;
524  }
525 
526  // With reordered faces registered in faceMap
527  return zoneLst;
528 }
529 
530 
531 template<class Face>
532 template<class BoolListType>
535 (
536  const BoolListType& include,
537  labelList& pointMap,
539 ) const
540 {
541  const pointField& locPoints = this->localPoints();
542  const List<Face>& locFaces = this->localFaces();
543 
544  // Fill pointMap, faceMap
545  PatchTools::subsetMap(*this, include, pointMap, faceMap);
546 
547  // Create compact coordinate list and forward mapping array
548  pointField newPoints(pointMap.size());
549  labelList oldToNew(locPoints.size());
550  forAll(pointMap, pointi)
551  {
552  newPoints[pointi] = locPoints[pointMap[pointi]];
553  oldToNew[pointMap[pointi]] = pointi;
554  }
555 
556  // Renumber face node labels and compact
557  List<Face> newFaces(faceMap.size());
558  List<label> newZones(faceMap.size());
559 
560  forAll(faceMap, facei)
561  {
562  const label origFacei = faceMap[facei];
563  newFaces[facei] = Face(locFaces[origFacei]);
564 
565  // Renumber labels for face
566  for (label& pointi : newFaces[facei])
567  {
568  pointi = oldToNew[pointi];
569  }
570 
571  newZones[facei] = zoneIds_[origFacei];
572  }
573  oldToNew.clear();
574 
575  // Retain the same zone toc information
576  List<surfZoneIdentifier> subToc(zoneToc_);
577 
578  // Return sub-surface
580  (
581  std::move(newPoints),
582  std::move(newFaces),
583  std::move(newZones),
584  std::move(subToc)
585  );
586 }
587 
588 
589 template<class Face>
591 (
592  const labelHashSet& include
593 ) const
594 {
595  labelList pointMap, faceMap;
596  return subsetMesh(include, pointMap, faceMap);
597 }
598 
599 
600 template<class Face>
602 (
604 )
605 {
606  if (this == &surf)
607  {
608  return; // Self-swap is a no-op
609  }
610 
611  this->clearOut(); // Topology changes
612  surf.clearOut(); // Topology changes
613 
614  this->storedPoints().swap(surf.storedPoints());
615  this->storedFaces().swap(surf.storedFaces());
616  zoneIds_.swap(surf.zoneIds_);
617  zoneToc_.swap(surf.zoneToc_);
618 
619  this->storedZones().clear(); // Should not be there anyhow
620  surf.storedZones().clear();
621 }
622 
623 
624 template<class Face>
626 (
628 )
629 {
630  if (this == &surf)
631  {
632  return; // Self-assignment is a no-op
633  }
634 
635  this->clear();
636 
637  this->storedPoints().transfer(surf.storedPoints());
638  this->storedFaces().transfer(surf.storedFaces());
639  zoneIds_.transfer(surf.zoneIds_);
640  zoneToc_.transfer(surf.zoneToc_);
641 
642  surf.clear();
643 }
644 
645 
646 template<class Face>
648 (
649  MeshedSurface<Face>& surf
650 )
651 {
652  surfZoneList zoneInfo(surf.surfZones());
653  ParentType::transfer(surf);
654 
655  setZones(zoneInfo);
656 }
657 
658 
659 template<class Face>
662 {
663  return autoPtr<labelList>::New(this->storedZoneIds());
664 }
665 
666 
667 // Read from file, determine format from extension
668 template<class Face>
670 {
671  const word ext(name.ext());
672  if (ext == "gz")
673  {
674  fileName unzipName = name.lessExt();
675  return read(unzipName, unzipName.ext());
676  }
677 
678  return read(name, ext);
679 }
680 
681 
682 // Read from file in given format
683 template<class Face>
685 (
686  const fileName& name,
687  const word& ext
688 )
689 {
690  clear();
691 
692  // read via use selector mechanism
693  transfer(New(name, ext)());
694  return true;
695 }
696 
697 
698 template<class Face>
700 (
701  const Time& t,
702  const word& surfName
703 ) const
704 {
705  MeshedSurfaceProxy<Face>(*this).write(t, surfName);
706 }
707 
708 
709 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
710 
711 template<class Face>
713 (
714  const UnsortedMeshedSurface<Face>& surf
715 )
716 {
717  clear();
718 
719  this->storedPoints() = surf.points();
720  this->storedFaces() = surf.surfFaces();
721  zoneIds_ = surf.zoneIds_;
722  zoneToc_ = surf.zoneToc_;
723 }
724 
725 
726 template<class Face>
728 (
730 )
731 {
732  transfer();
733 }
734 
735 
736 template<class Face>
739 {
741  List<surfZone> zoneLst = this->sortedZones(faceMap);
742 
744  (
745  this->points(),
746  this->surfFaces(),
747  zoneLst,
748  faceMap
749  );
750 }
751 
752 
753 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
754 
755 template<class Face>
756 Foam::Istream& Foam::operator>>
757 (
758  Istream& is,
759  UnsortedMeshedSurface<Face>& surf
760 )
761 {
762  return surf.read(is);
763 }
764 
765 
766 template<class Face>
767 Foam::Ostream& Foam::operator<<
768 (
769  Ostream& os,
770  const UnsortedMeshedSurface<Face>& surf
771 )
772 {
773  return surf.write(os);
774 }
775 
776 
777 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
778 
780 
781 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::word::lessExt
word lessExt() const
Return word without extension (part before last .)
Definition: word.C:113
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
InfoInFunction
#define InfoInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:316
MeshedSurfaceProxy.H
Foam::MeshedSurface::surfZones
const surfZoneList & surfZones() const
Const access to the surface zones.
Definition: MeshedSurface.H:370
Foam::UnsortedMeshedSurface::canReadType
static bool canReadType(const word &ext, bool verbose=false)
Can we read this file format type?
Definition: UnsortedMeshedSurface.C:56
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::faceMap
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Definition: blockMeshMergeFast.C:94
Foam::UnsortedMeshedSurface::setZones
void setZones(const surfZoneList &zoneLst)
Set zone ids and zones.
Definition: UnsortedMeshedSurface.C:310
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::UnsortedMeshedSurface::releaseZoneIds
autoPtr< labelList > releaseZoneIds()
Release (clear) stored zoneIds and return for reuse.
Definition: UnsortedMeshedSurface.C:661
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::SubList
A List obtained as a section of another List.
Definition: SubList.H:53
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::zone
Base class for mesh zones.
Definition: zone.H:63
Foam::MeshedSurface::surfFaces
const List< Face > & surfFaces() const
Return const access to the faces.
Definition: MeshedSurface.H:362
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: HashTableFwd.H:46
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::UnsortedMeshedSurface::canWriteType
static bool canWriteType(const word &ext, bool verbose=false)
Can we write this file format type?
Definition: UnsortedMeshedSurface.C:73
Foam::word::ext
word ext() const
Return file name extension (part after last .)
Definition: word.C:126
Foam::UnsortedMeshedSurface::remapFaces
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
Definition: UnsortedMeshedSurface.C:385
polyMesh.H
Foam::HashSet< word >
Foam::MeshedSurfaceProxy
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Definition: MeshedSurface.H:78
Foam::surfZoneIdentifier
Identifies a surface patch/zone by name, patch index and geometricType.
Definition: surfZoneIdentifier.H:58
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
UnsortedMeshedSurface.H
Foam::UnsortedMeshedSurface::zoneIds
virtual const labelList & zoneIds() const
Return const access to the zone ids.
Definition: UnsortedMeshedSurface.H:300
Foam::UnsortedMeshedSurface::UnsortedMeshedSurface
UnsortedMeshedSurface()
Construct null.
Definition: UnsortedMeshedSurface.C:160
Foam::MeshedSurfaceProxy::write
static void write(const fileName &name, const MeshedSurfaceProxy &surf, const dictionary &options)
Write to file, select based on its extension.
Definition: MeshedSurfaceProxy.C:62
Foam::PatchTools::subsetMap
static void subsetMap(const PrimitivePatch< Face, FaceList, PointField, PointType > &p, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap)
Determine the mapping for a sub-patch.
Definition: PatchToolsSearch.C:165
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::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::UnsortedMeshedSurface::transfer
void transfer(UnsortedMeshedSurface< Face > &surf)
Transfer the contents of the argument and annul the argument.
Definition: UnsortedMeshedSurface.C:626
Foam::UnsortedMeshedSurface
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
Definition: MeshedSurface.H:79
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::cellModeller::lookup
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
Definition: cellModeller.H:46
Foam::UnsortedMeshedSurface::zoneToc
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
Definition: UnsortedMeshedSurface.H:306
Foam::radiation::lookup
Lookup type of boundary radiation properties.
Definition: lookup.H:63
forAllIters
#define forAllIters(container, iter)
Iterate across all elements in the container object.
Definition: stdFoam.H:217
Foam::IOstream::check
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:51
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
Foam::fileName::ext
word ext() const
Return file name extension (part after last .)
Definition: fileNameI.H:228
Foam::UnsortedMeshedSurface::readTypes
static wordHashSet readTypes()
Known readable file-types.
Definition: UnsortedMeshedSurface.C:41
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
UnsortedMeshedSurfaceNew.C
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
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
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
Fstream.H
Input/output from file streams.
Foam::flatOutput
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
Definition: FlatOutput.H:85
Foam::UnsortedMeshedSurface::setOneZone
void setOneZone()
Set zones to 0 and set a single zone.
Definition: UnsortedMeshedSurface.C:285
Foam::UnsortedMeshedSurface::clear
virtual void clear()
Clear all storage.
Definition: UnsortedMeshedSurface.C:452
Foam::List< Face >
Foam::surfZone
A surface zone on a MeshedSurface.
Definition: surfZone.H:65
Foam::start
label ListType::const_reference const label start
Definition: ListOps.H:408
Foam::UnsortedMeshedSurface::canRead
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
Definition: UnsortedMeshedSurface.C:90
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
points
const pointField & points
Definition: gmvOutputHeader.H:1
polyBoundaryMesh.H
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:261
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::wordHashSet
HashSet< word > wordHashSet
A HashSet with word keys.
Definition: HashSet.H:412
Foam::UList::size
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
Definition: UListI.H:360
ListOps.H
Various functions to operate on Lists.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::HashTable::found
bool found(const Key &key) const
Return true if hashed entry is found in table.
Definition: HashTableI.H:100
Foam::UnsortedMeshedSurface::subsetMesh
UnsortedMeshedSurface subsetMesh(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Return new surface.
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
Foam::UnsortedMeshedSurface::swap
void swap(MeshedSurface< Face > &surf)=delete
Swap contents - disabled.
Foam::UnsortedMeshedSurface::writeTypes
static wordHashSet writeTypes()
Known writable file-types.
Definition: UnsortedMeshedSurface.C:48
Foam::UnsortedMeshedSurface::sortedZones
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
Definition: UnsortedMeshedSurface.C:462
MeshedSurface.H