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);
110 Info<<
"UnsortedMeshedSurface::write" 111 "(const fileName&, const UnsortedMeshedSurface&) : " 112 "writing to " << name
118 typename writefileExtensionMemberFunctionTable::iterator mfIter =
119 writefileExtensionMemberFunctionTablePtr_->find(ext);
121 if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
126 if (supported.
found(ext))
134 "UnsortedMeshedSurface::write" 135 "(const fileName&, const UnsortedMeshedSurface&)" 136 ) <<
"Unknown file extension " << ext <<
nl <<
nl 137 <<
"Valid types are :" <<
endl 138 << (supported | writeTypes())
144 mfIter()(
name, surf);
184 if (zoneSizes.
size())
186 if (zoneNames.
size())
312 zoneName = zoneToc_[0].name();
314 if (zoneName.empty())
332 zoneToc_.setSize(zoneLst.
size());
337 zoneToc_[zoneI] = zone;
354 zoneToc_.setSize(sizes.
size());
365 start += sizes[zoneI];
377 zoneToc_.setSize(sizes.
size());
392 start += sizes[zoneI];
406 if (zoneToc_.empty())
410 else if (zoneToc_.size() == 1)
421 newZones[faceI] = zoneIds_[faceMap[faceI]];
436 zoneIds_.
setSize(s, zoneToc_.size() - 1);
459 zoneNames.
insert(zoneI, zoneToc_[zoneI].
name());
472 const label origId = zoneIds_[faceI];
475 if (fnd != lookup.
end())
492 label origId = iter.key();
496 if (fnd != zoneNames.
end())
525 label zoneI = lookup[zoneIds_[faceI]];
526 faceMap[faceI] = zoneLst[zoneI].start() + zoneLst[zoneI].
size()++;
554 newPoints[pointI] = locPoints[pointMap[pointI]];
555 oldToNew[pointMap[pointI]] = pointI;
564 const label origFaceI = faceMap[faceI];
565 newFaces[faceI] = Face(locFaces[origFaceI]);
568 Face&
f = newFaces[faceI];
571 f[fp] = oldToNew[f[fp]];
574 newZones[faceI] = zoneIds_[origFaceI];
596 return subsetMesh(include, pointMap, faceMap);
658 zoneToc_.transfer(surf.zoneToc_);
698 return read(unzipName, unzipName.
ext());
702 return read(name, ext);
737 void Foam::UnsortedMeshedSurface<Face>::operator=
746 zoneIds_ = surf.zoneIds_;
747 zoneToc_ = surf.zoneToc_;
752 Foam::UnsortedMeshedSurface<Face>::operator
label start() const
Return start label of this zone in the face list.
word ext() const
Return file name extension (part after last .)
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
HashSet wordHashSet
A HashSet with word keys.
label size() const
Return size of this zone in the face list.
const List< surfZone > & surfZones() const
Const access to the surface zones.
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 ))
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Xfer< T > xferCopy(const T &)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
An STL-conforming const_iterator.
word name(const complex &)
Return a string representation of a complex.
Xfer< UnsortedMeshedSurface< Face > > xfer()
Transfer contents to the Xfer container.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write to file.
bool insert(const label &, const T &newElmt)
Insert a new hashedEntry.
A HashTable to objects of type <T> with a label key.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
A simple container for copying or transferring objects of type <T>.
#define forAllIter(Container, container, iter)
const List< label > & zoneIds() const
Return const access to the zone ids.
A class for handling words, derived from string.
static autoPtr< UnsortedMeshedSurface > New(const fileName &, const word &ext)
Select constructed from filename (explicit 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.
UnsortedMeshedSurface()
Construct null.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
void setOneZone()
Set zones to 0 and set a single zone.
pointField & storedPoints()
Non-const access to global points.
virtual void clear()
Clear all storage.
virtual void clear()
Clear all storage.
An identifier for a surface zone on a meshed surface.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const Field< point > & localPoints() const
Return pointField of points in patch.
void clear()
Clear the list, i.e. set size to zero.
static wordHashSet readTypes()
void setSize(const label)
Reset size of List.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const List< Face > & faces() const
Return const access to the faces.
label size() const
The surface size is the number of faces.
stressControl lookup("compactNormalStress") >> compactNormalStress
virtual void reset(const Xfer< pointField > &points, const Xfer< List< Face > > &faces, const Xfer< surfZoneList > &zones)
Reset primitive data (points, faces and zones)
label size() const
Return the number of elements in the UList.
void transfer(UnsortedMeshedSurface< Face > &)
Transfer the contents of the argument and annul the argument.
static wordHashSet writeTypes()
label size() const
Return number of elements in table.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format?
A surface zone on a MeshedSurface.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
UnsortedMeshedSurface subsetMesh(const labelHashSet &include, labelList &pointMap, labelList &faceMap) const
Return new surface.
virtual ~UnsortedMeshedSurface()
Destructor.
A class for handling file names.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A HashTable with keys but without contents.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
fileName lessExt() const
Return file name without extension (part before last .)
static void subsetMap(const PrimitivePatch< Face, FaceList, PointField, PointType > &, const BoolListType &includeFaces, labelList &pointMap, labelList &faceMap)
Determine the mapping for a sub-patch.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
A List obtained as a section of another List.
List< Face > & storedFaces()
Non-const access to the faces.
void setZones(const surfZoneList &)
Set zone ids and zones.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
static void write(const fileName &, const UnsortedMeshedSurface< Face > &)
Write to file.
bool found(const Key &) const
Return true if hashedEntry is found in table.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
const Field< point > & points() const
Return reference to global points.
virtual void reset(const Xfer< pointField > &, const Xfer< List< Face > > &, const Xfer< List< label > > &zoneIds)
Transfer components (points, faces, zone ids).
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?