Go to the documentation of this file.
43 return wordHashSet(*fileExtensionConstructorTablePtr_);
50 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
61 return fileFormats::surfaceFormatsCore::checkSupport
63 readTypes() | ParentType::readTypes(),
78 return fileFormats::surfaceFormatsCore::checkSupport
100 return canReadType(ext, verbose);
130 auto mfIter = writefileExtensionMemberFunctionTablePtr_->cfind(ext);
135 const wordHashSet& delegate = ProxyType::writeTypes();
137 if (delegate.
found(ext))
144 <<
"Unknown file extension " << ext <<
nl <<
nl
145 <<
"Valid types:" <<
nl
146 <<
flatOutput((delegate | writeTypes()).sortedToc()) <<
nl
152 mfIter()(
name, surf, options);
225 ParentType(std::move(pointLst), std::move(faceLst)),
226 zoneIds_(std::move(zoneIds)),
289 zoneIds_.resize(size());
295 zoneName = zoneToc_[0].name();
297 if (zoneName.empty())
316 zoneIds_.resize(size());
317 zoneToc_.resize(zoneLst.size());
322 zoneToc_[zonei] =
zone;
339 zoneIds_.resize(size());
340 zoneToc_.resize(sizes.
size());
350 start += sizes[zonei];
363 zoneIds_.resize(size());
364 zoneToc_.resize(sizes.
size());
378 start += sizes[zonei];
395 if (zoneToc_.empty())
399 else if (zoneToc_.size() == 1)
409 newZones[facei] = zoneIds_[
faceMap[facei]];
411 zoneIds_.transfer(newZones);
421 is >> this->storedZoneIds()
422 >> this->storedPoints()
423 >> this->storedFaces();
433 os << this->zoneIds()
435 << this->surfFaces();
445 this->storedFaces().resize(
s);
447 zoneIds_.resize(
s, zoneToc_.size() - 1);
470 zoneNames.insert(zonei, zoneToc_[zonei].
name());
481 for (
const label origId : zoneIds_)
493 const label origId = iter.key();
495 const word zoneName =
518 faceMap.resize(zoneIds_.size());
523 faceMap[facei] = zoneLst[zonei].start() + zoneLst[zonei].size()++;
532 template<
class BoolListType>
536 const BoolListType& include,
541 const pointField& locPoints = this->localPoints();
542 const List<Face>& locFaces = this->localFaces();
552 newPoints[pointi] = locPoints[pointMap[pointi]];
553 oldToNew[pointMap[pointi]] = pointi;
563 newFaces[facei] = Face(locFaces[origFacei]);
566 for (
label& pointi : newFaces[facei])
568 pointi = oldToNew[pointi];
571 newZones[facei] = zoneIds_[origFacei];
581 std::move(newPoints),
596 return subsetMesh(include, pointMap,
faceMap);
614 this->storedPoints().
swap(surf.storedPoints());
615 this->storedFaces().swap(surf.storedFaces());
616 zoneIds_.swap(surf.zoneIds_);
617 zoneToc_.swap(surf.zoneToc_);
619 this->storedZones().clear();
620 surf.storedZones().
clear();
637 this->storedPoints().transfer(surf.storedPoints());
638 this->storedFaces().transfer(surf.storedFaces());
639 zoneIds_.transfer(surf.zoneIds_);
640 zoneToc_.transfer(surf.zoneToc_);
653 ParentType::transfer(surf);
675 return read(unzipName, unzipName.
ext());
719 this->storedPoints() = surf.points();
721 zoneIds_ = surf.zoneIds_;
722 zoneToc_ = surf.zoneToc_;
759 UnsortedMeshedSurface<Face>& surf
762 return surf.read(is);
770 const UnsortedMeshedSurface<Face>& surf
773 return surf.write(os);
int debug
Static debugging option.
word lessExt() const
Return word without extension (part before last .)
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
#define InfoInFunction
Report an information message using Foam::Info.
const surfZoneList & surfZones() const
Const access to the surface zones.
static bool canReadType(const word &ext, bool verbose=false)
Can we read this file format type?
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
void setZones(const surfZoneList &zoneLst)
Set zone ids and zones.
A class for handling words, derived from Foam::string.
autoPtr< labelList > releaseZoneIds()
Release (clear) stored zoneIds and return for reuse.
A class for handling file names.
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))
A List obtained as a section of another List.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Base class for mesh zones.
const List< Face > & surfFaces() const
Return const access to the faces.
A HashTable to objects of type <T> with a label key.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool canWriteType(const word &ext, bool verbose=false)
Can we write this file format type?
word ext() const
Return file name extension (part after last .)
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Identifies a surface patch/zone by name, patch index and geometricType.
#define forAll(list, i)
Loop across all elements in list.
virtual const labelList & zoneIds() const
Return const access to the zone ids.
UnsortedMeshedSurface()
Construct null.
static void write(const fileName &name, const MeshedSurfaceProxy &surf, const dictionary &options)
Write to file, select based on its extension.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void transfer(UnsortedMeshedSurface< Face > &surf)
Transfer the contents of the argument and annul the argument.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
word name(const complex &c)
Return string representation of complex.
const cellModel * lookup(const word &modelName)
Deprecated(2017-11) equivalent to cellModel::ptr static method.
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
Lookup type of boundary radiation properties.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
word ext() const
Return file name extension (part after last .)
static wordHashSet readTypes()
Known readable file-types.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Input/output from file streams.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
void setOneZone()
Set zones to 0 and set a single zone.
virtual void clear()
Clear all storage.
A surface zone on a MeshedSurface.
label ListType::const_reference const label start
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
HashSet< word > wordHashSet
A HashSet with word keys.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool found(const Key &key) const
Return true if hashed entry is found in table.
UnsortedMeshedSurface subsetMesh(const BoolListType &include, labelList &pointMap, labelList &faceMap) const
Return new surface.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
void swap(MeshedSurface< Face > &surf)=delete
Swap contents - disabled.
static wordHashSet writeTypes()
Known writable file-types.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.