Go to the documentation of this file.
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);
110 Info<<
"UnsortedMeshedSurface::write"
111 "(const fileName&, const UnsortedMeshedSurface&) : "
112 "writing to " <<
name
116 const word ext =
name.ext();
118 typename writefileExtensionMemberFunctionTable::iterator mfIter =
119 writefileExtensionMemberFunctionTablePtr_->find(ext);
121 if (mfIter == writefileExtensionMemberFunctionTablePtr_->end())
126 if (supported.found(ext))
128 MeshedSurfaceProxy<Face>(surf).write(
name);
133 <<
"Unknown file extension " << ext <<
nl <<
nl
134 <<
"Valid types are :" <<
endl
135 << (supported | writeTypes())
141 mfIter()(
name, surf);
181 if (zoneSizes.
size())
183 if (zoneNames.
size())
185 setZones(zoneSizes, zoneNames);
303 zoneIds_.setSize(size());
309 zoneName = zoneToc_[0].name();
311 if (zoneName.empty())
328 zoneIds_.setSize(size());
329 zoneToc_.setSize(zoneLst.
size());
334 zoneToc_[zoneI] =
zone;
350 zoneIds_.setSize(size());
351 zoneToc_.setSize(sizes.
size());
362 start += sizes[zoneI];
373 zoneIds_.setSize(size());
374 zoneToc_.setSize(sizes.
size());
389 start += sizes[zoneI];
403 if (zoneToc_.empty())
407 else if (zoneToc_.size() == 1)
418 newZones[faceI] = zoneIds_[
faceMap[faceI]];
431 this->storedFaces().setSize(
s);
433 zoneIds_.setSize(
s, zoneToc_.size() - 1);
456 zoneNames.insert(zoneI, zoneToc_[zoneI].
name());
469 const label origId = zoneIds_[faceI];
489 label origId = iter.key();
493 if (fnd != zoneNames.end())
518 faceMap.setSize(zoneIds_.size());
523 faceMap[faceI] = zoneLst[zoneI].start() + zoneLst[zoneI].
size()++;
540 const pointField& locPoints = this->localPoints();
541 const List<Face>& locFaces = this->localFaces();
544 PatchTools::subsetMap(*
this, include, pointMap,
faceMap);
551 newPoints[pointI] = locPoints[pointMap[pointI]];
552 oldToNew[pointMap[pointI]] = pointI;
562 newFaces[faceI] = Face(locFaces[origFaceI]);
565 Face&
f = newFaces[faceI];
568 f[fp] = oldToNew[
f[fp]];
571 newZones[faceI] = zoneIds_[origFaceI];
593 return subsetMesh(include, pointMap,
faceMap);
614 zoneIds_.transfer(zoneIds());
636 zoneIds_.transfer(zoneIds());
644 UnsortedMeshedSurface<Face>& surf
654 zoneIds_.transfer(surf.zoneIds_);
655 zoneToc_.transfer(surf.zoneToc_);
664 MeshedSurface<Face>& surf
674 setZones(surf.surfZones());
695 return read(unzipName, unzipName.
ext());
708 const fileName&
name,
727 MeshedSurfaceProxy<Face>(*this).write(t, surfName);
741 this->storedPoints() = surf.points();
742 this->storedFaces() = surf.faces();
743 zoneIds_ = surf.zoneIds_;
744 zoneToc_ = surf.zoneToc_;
static void write(const fileName &, const UnsortedMeshedSurface< Face > &)
Write to file.
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)
A class for handling words, derived from string.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
A class for handling file names.
static bool canWriteType(const word &ext, const bool verbose=false)
Can we write this file format?
#define forAll(list, i)
Loop across all elements in list.
virtual void reset(const Xfer< pointField > &, const Xfer< List< Face > > &, const Xfer< List< label > > &zoneIds)
Transfer components (points, faces, zone ids).
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
bool read(const char *, int32_t &)
A List obtained as a section of another List.
virtual ~UnsortedMeshedSurface()
Destructor.
Xfer< UnsortedMeshedSurface< Face > > xfer()
Transfer contents to the Xfer container.
An STL-conforming const_iterator.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
A HashTable to objects of type <T> with a label key.
void setSize(const label, const Face &)
Disable setSize with value.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool read(const fileName &, const word &ext)
Read from file. Chooses reader based on explicit extension.
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
A HashTable with keys but without contents.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A simple container for copying or transferring objects of type <T>.
const List< Face > & faces() const
Return const access to the faces.
An identifier for a surface zone on a meshed surface.
const List< surfZone > & surfZones() const
Const access to the surface zones.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
const List< label > & zoneIds() const
Return const access to the zone ids.
static bool canReadType(const word &ext, const bool verbose=false)
Can we read this file format?
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
word ext() const
Return file name extension (part after last .)
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))
static wordHashSet readTypes()
errorManipArg< error, int > exit(error &err, const int errNo=1)
UnsortedMeshedSurface subsetMesh(const labelHashSet &include, labelList &pointMap, labelList &faceMap) const
Return new surface.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
void setOneZone()
Set zones to 0 and set a single zone.
Xfer< T > xferCopy(const T &)
Construct by copying the contents of the arg.
virtual void clear()
Clear all storage.
A surface zone on a MeshedSurface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
HashSet wordHashSet
A HashSet with word keys.
void size(const label)
Override size to be inconsistent with allocated storage.
label size() const
Return the number of elements in the UList.
void setZones(const surfZoneList &)
Set zone ids and zones.
static wordHashSet writeTypes()
void transfer(UnsortedMeshedSurface< Face > &)
Transfer the contents of the argument and annul the argument.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
word name(const complex &)
Return a string representation of a complex.
friend class UnsortedMeshedSurface
static bool canRead(const fileName &, const bool verbose=false)
Can we read this file format?
stressControl lookup("compactNormalStress") >> compactNormalStress