Go to the documentation of this file.
106 return canReadType(ext, verbose);
165 bool Foam::triSurface::readNative(Istream& is)
168 is >> patches_ >> storedPoints() >> storedFaces();
174 void Foam::triSurface::writeNative(Ostream&
os)
const
180 <<
static_cast<const List<labelledTri>&
>(*this) <<
nl;
186 bool Foam::triSurface::read
188 const fileName&
name,
189 const word& fileType,
196 <<
"No such file " <<
name <<
nl
201 transfer(*
New(
name, fileType));
209 const word& fileType,
210 const bool sortByRegion
213 if (fileType.empty())
222 <<
"Cannot determine format from filename" <<
nl
234 if (fileType ==
"ftr")
239 else if (fileType ==
"stl")
241 writeSTLASCII(
name, sortByRegion);
243 else if (fileType ==
"stlb")
245 writeSTLBINARY(
name);
247 else if (fileType ==
"gts")
249 writeGTS(
name, sortByRegion);
254 List<surfZone> zoneLst = this->sortedZones(
faceMap);
256 MeshedSurfaceProxy<labelledTri> proxy
264 proxy.write(
name, fileType);
269 <<
"Unknown surface format " << fileType
270 <<
" for writing file " <<
name <<
nl
271 <<
"Valid types:" <<
nl
329 const bool sortByRegion
363 for (
const auto&
f : *
this)
365 regionsUsed.
insert(
f.region());
367 for (
const label pointi :
f)
369 if (pointIsUsed.set(pointi))
376 os <<
"Triangles : " << size()
377 <<
" in " << regionsUsed.size() <<
" region(s)" <<
nl
378 <<
"Vertices : " << pointIsUsed.count() <<
nl
379 <<
"Bounding Box : " << bb <<
endl;
389 s.setDefaultPatches();
void writeStats(Ostream &os) const
List< label > labelList
A List of labels.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
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 Foam::string.
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 bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static fileName relativeFilePath(const IOobject &io, const fileName &f, const bool isGlobal=true)
Input from file stream, using an ISstream.
static const boundBox invertedBox
bool read(const char *buf, int32_t &val)
const fileName & caseName() const
void set(const bitSet &bitset)
Istream & operator>>(Istream &, directionInfo &)
Ostream & endl(Ostream &os)
static bool canReadType(const word &fileType, bool verbose=false)
A HashTable with keys but without contents that is similar to std::unordered_set.
unsigned int count(const bool on=true) const
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
static wordHashSet writeTypes()
virtual void scalePoints(const scalar scaleFactor)
static void check(const int retVal, const char *what)
void write(Ostream &os) const
Triangulated surface description with patch information.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
virtual bool check(const char *operation) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
static bool canWriteType(const word &fileType, bool verbose=false)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
static fileName findFile(const IOobject &io, const bool isGlobal=true)
#define FatalErrorInFunction
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool insert(const Key &key)
const polyBoundaryMesh & patches
void write(vtk::formatter &fmt, const Type &val, const label n=1)
A bounding box defined in terms of min/max extrema points.
static wordHashSet readTypes()
word name(const expressions::valueTypeCode typeCode)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
static bool canWriteType(const word &fileType, bool verbose=false)
static fileName triSurfInstance(const Time &)
static bool canRead(const fileName &name, bool verbose=false)
void add(const boundBox &bb)