40 return wordHashSet(*fileExtensionConstructorTablePtr_);
47 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
58 return fileFormats::surfaceFormatsCore::checkSupport
60 readTypes() | ParentType::readTypes(),
75 return fileFormats::surfaceFormatsCore::checkSupport
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);
178 if (zoneSizes.
size())
180 if (zoneNames.
size())
306 zoneName = zoneToc_[0].name();
308 if (zoneName.empty())
326 zoneToc_.setSize(zoneLst.
size());
331 zoneToc_[zoneI] = zone;
348 zoneToc_.setSize(sizes.
size());
359 start += sizes[zoneI];
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]];
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())
519 label zoneI = lookup[zoneIds_[facei]];
520 faceMap[facei] = zoneLst[zoneI].start() + zoneLst[zoneI].
size()++;
548 newPoints[pointi] = locPoints[pointMap[pointi]];
549 oldToNew[pointMap[pointi]] = pointi;
558 const label origFacei = faceMap[facei];
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);
652 zoneToc_.transfer(surf.zoneToc_);
692 return read(unzipName, unzipName.
ext());
696 return read(name, ext);
731 void Foam::UnsortedMeshedSurface<Face>::operator=
740 zoneIds_ = surf.zoneIds_;
741 zoneToc_ = surf.zoneToc_;
746 Foam::UnsortedMeshedSurface<Face>::operator
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
virtual void clear()
Clear all storage.
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
A simple container for copying or transferring objects of type <T>.
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
An identifier for a surface zone on a meshed surface.
An STL-conforming const_iterator.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static wordHashSet writeTypes()
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label size() const
The surface size is the number of faces.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A surface zone on a MeshedSurface.
void size(const label)
Override size to be inconsistent with allocated storage.
const List< Face > & faces() const
Return const access to the faces.
virtual void clear()
Clear all storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void transfer(UnsortedMeshedSurface< Face > &)
Transfer the contents of the argument and annul the argument.
const Field< point > & points() const
Return reference to global points.
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
label size() const
Return number of elements in table.
virtual void reset(const Xfer< pointField > &, const Xfer< List< Face >> &, const Xfer< List< label >> &zoneIds)
Transfer components (points, faces, zone ids).
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual ~UnsortedMeshedSurface()
Destructor.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
bool insert(const label &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
virtual void reset(const Xfer< pointField > &points, const Xfer< List< Face >> &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
A List obtained as a section of another List.
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
stressControl lookup("compactNormalStress") >> compactNormalStress
Xfer< UnsortedMeshedSurface< Face > > xfer()
Transfer contents to the Xfer container.
List< Face > & storedFaces()
Non-const access to the faces.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
static wordHashSet readTypes()
pointField & storedPoints()
Non-const access to global points.
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
HashSet wordHashSet
A HashSet with word keys.
UnsortedMeshedSurface()
Construct null.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool found(const Key &) const
Return true if hashedEntry is found in table.
const List< surfZone > & surfZones() const
Const access to the surface zones.
label start() const
Return start label of this zone in the face list.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
fileName lessExt() const
Return file name without extension (part before last .)
label size() const
Return size of this zone in the face list.
word name(const complex &)
Return a string representation of a complex.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
label size() const
Return the number of elements in the UList.
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
void setSize(const label)
Reset size of List.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write to file.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
void setZones(const surfZoneList &)
Set zone ids and zones.
static void write(const fileName &, const UnsortedMeshedSurface< Face > &)
Write to file.
word ext() const
Return file name extension (part after last .)
UnsortedMeshedSurface subsetMesh(const labelHashSet &include, labelList &pointMap, labelList &faceMap) const
Return new surface.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format?
static autoPtr< UnsortedMeshedSurface > New(const fileName &, const word &ext)
Select constructed from filename (explicit extension)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
const Field< point > & localPoints() const
Return pointField of points in patch.
const List< label > & zoneIds() const
Return const access to the zone ids.
A HashTable to objects of type <T> with a label key.
void setOneZone()
Set zones to 0 and set a single zone.
#define InfoInFunction
Report an information message using Foam::Info.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.