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);
269 <<
"Unknown surface format " << fileType
270 <<
" for writing file " <<
name <<
nl
271 <<
"Valid types:" <<
nl
329 const bool sortByRegion
346 d.
path()/triSurfInstance(d)/typeName/(d.
caseName() +
".ftr")
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
Write some statistics.
word lessExt() const
Return word without extension (part before last .)
label size() const noexcept
The number of elements in table.
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)
Does the name exist (as DIRECTORY or FILE) in the file system?
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)
Return fileName.
Input from file stream, using an ISstream.
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
bool read(const char *buf, int32_t &val)
Same as readInt32.
void set(const bitSet &bitset)
Set specified bits from another bitset.
Istream & operator>>(Istream &, directionInfo &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
word ext() const
Return file name extension (part after last .)
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, select based on its extension.
unsigned int count(const bool on=true) const
Count number of bits set.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
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...
word name(const complex &c)
Return string representation of complex.
triSurface()
Default construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format?
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)
Global function forwards to reuseTmpDimensionedField::New.
static fileName findFile(const IOobject &io, const bool isGlobal=true)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fileName & caseName() const
Return case name.
fileName path() const
Return path.
Input/output from file streams.
FlatOutput< Container > flatOutput(const Container &obj, label len=0)
Global flatOutput function.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
static const word null
An empty word.
const polyBoundaryMesh & patches
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
A bounding box defined in terms of min/max extrema points.
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
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 fileName triSurfInstance(const Time &)
Name of triSurface directory to use.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
void add(const boundBox &bb)
Extend to include the second box.