106 return canReadType(ext, verbose);
165bool Foam::triSurface::readNative(
Istream& is)
168 is >> patches_ >> storedPoints() >> storedFaces();
174void Foam::triSurface::writeNative(Ostream&
os)
const
180 <<
static_cast<const List<labelledTri>&
>(*this) <<
nl;
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();
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
Input from file stream, using an ISstream.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
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.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const fileName & caseName() const
Return case name.
fileName path() const
Return path.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
unsigned int count(const bool on=true) const
Count number of bits set.
void set(const bitSet &bitset)
Set specified bits from another bitset.
A bounding box defined in terms of min/max extrema points.
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
void add(const boundBox &bb)
Extend to include the second box.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool checkSupport() const
Check if the patch is fully supported.
A class for handling file names.
virtual bool write()
Write the output fields.
Triangulated surface description with patch information.
static fileName triSurfInstance(const Time &)
Name of triSurface directory to use.
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
triSurface()
Default construct.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format?
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
static fileName findFile(const IOobject &io, const bool isGlobal=true)
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
static fileName relativeFilePath(const IOobject &io, const fileName &f, const bool isGlobal=true)
Return fileName.
void writeStats(Ostream &os) const
Write some statistics.
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
A class for handling words, derived from Foam::string.
word ext() const
Return file name extension (part after last .)
word lessExt() const
Return word without extension (part before last .)
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
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))
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
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?
static void check(const int retVal, const char *what)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Istream & operator>>(Istream &, directionInfo &)
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)