40 return wordHashSet(*fileExtensionConstructorTablePtr_);
47 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
58 return fileFormats::surfaceFormatsCore::checkSupport
60 readTypes() | ParentType::readTypes(),
75 return fileFormats::surfaceFormatsCore::checkSupport
95 ext =
name.lessExt().ext();
97 return canReadType(ext, verbose);
115 typename writefileExtensionMemberFunctionTable::iterator mfIter =
116 writefileExtensionMemberFunctionTablePtr_->find(ext);
118 if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
123 if (supported.
found(ext))
130 <<
"Unknown file extension " << ext <<
nl <<
nl
131 <<
"Valid types are :" <<
endl
132 << (supported | writeTypes())
138 mfIter()(
name, surf);
162 zoneIds_(move(zoneIds)),
163 zoneToc_(move(zoneTofc))
178 if (zoneSizes.
size())
180 if (zoneNames.
size())
207 zoneIds_(surf.zoneIds()),
208 zoneToc_(surf.zoneToc())
300 zoneIds_.setSize(size());
306 zoneName = zoneToc_[0].name();
308 if (zoneName.empty())
325 zoneIds_.setSize(size());
326 zoneToc_.setSize(zoneLst.
size());
330 const surfZone& zone = zoneLst[zoneI];
331 zoneToc_[zoneI] = zone;
347 zoneIds_.setSize(size());
348 zoneToc_.setSize(sizes.
size());
359 start += sizes[zoneI];
370 zoneIds_.setSize(size());
371 zoneToc_.setSize(sizes.
size());
386 start += sizes[zoneI];
400 if (zoneToc_.empty())
404 else if (zoneToc_.size() == 1)
415 newZones[facei] = zoneIds_[
faceMap[facei]];
428 this->storedFaces().setSize(
s);
430 zoneIds_.setSize(
s, zoneToc_.size() - 1);
453 zoneNames.
insert(zoneI, zoneToc_[zoneI].
name());
466 const label origId = zoneIds_[facei];
469 if (fnd != lookup.
end())
486 label origId = iter.key();
490 if (fnd != zoneNames.
end())
515 faceMap.setSize(zoneIds_.size());
519 label zoneI = lookup[zoneIds_[facei]];
520 faceMap[facei] = zoneLst[zoneI].start() + zoneLst[zoneI].
size()++;
537 const pointField& locPoints = this->localPoints();
538 const List<Face>& locFaces = this->localFaces();
548 newPoints[pointi] = locPoints[pointMap[pointi]];
549 oldToNew[pointMap[pointi]] = pointi;
559 newFaces[facei] = Face(locFaces[origFacei]);
562 Face&
f = newFaces[facei];
565 f[fp] = oldToNew[
f[fp]];
568 newZones[facei] = zoneIds_[origFacei];
590 return subsetMesh(include, pointMap,
faceMap);
606 NullObjectMove<surfZoneList>()
611 zoneIds_.transfer(zoneIds);
628 NullObjectMove<surfZoneList>()
633 zoneIds_.transfer(zoneIds);
648 NullObjectMove<surfZoneList>()
651 zoneIds_.transfer(surf.zoneIds_);
652 zoneToc_.transfer(surf.zoneToc_);
668 NullObjectMove<surfZoneList>()
684 return read(unzipName, unzipName.
ext());
730 this->storedPoints() = surf.points();
731 this->storedFaces() = surf.faces();
732 zoneIds_ = surf.zoneIds_;
733 zoneToc_ = surf.zoneToc_;
#define forAll(list, i)
Loop across all elements in list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A HashTable with keys but without contents.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
A HashTable to objects of type <T> with a label key.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write to file.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
const List< surfZone > & surfZones() const
Const access to the surface zones.
pointField & storedPoints()
Non-const access to global points.
List< Face > & storedFaces()
Non-const access to the faces.
virtual void clear()
Clear all storage.
A List obtained as a section of another List.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
label size() const
Return the number of elements in the UList.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
static wordHashSet writeTypes()
void transfer(UnsortedMeshedSurface< Face > &)
Transfer the contents of the argument and annul the argument.
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
static void write(const fileName &, const UnsortedMeshedSurface< Face > &)
Write to file.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format?
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
virtual ~UnsortedMeshedSurface()
Destructor.
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
void setOneZone()
Set zones to 0 and set a single zone.
virtual void clear()
Clear all storage.
UnsortedMeshedSurface subsetMesh(const labelHashSet &include, labelList &pointMap, labelList &faceMap) const
Return new surface.
void setZones(const surfZoneList &)
Set zone ids and zones.
friend class UnsortedMeshedSurface
virtual void reset(pointField &&, List< Face > &&, List< label > &&zoneIds)
Transfer components (points, faces, zone ids).
static wordHashSet readTypes()
A class for handling file names.
word ext() const
Return file name extension (part after last .)
An identifier for a surface zone on a meshed surface.
A surface zone on a MeshedSurface.
label start() const
Return start label of this zone in the face list.
label size() const
Return size of this zone in the face list.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define InfoInFunction
Report an information message using Foam::Info.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool read(const char *, int32_t &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
HashSet wordHashSet
A HashSet with word keys.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable