108 return canReadType(ext, verbose);
167 bool Foam::triSurface::readNative(Istream& is)
170 is >> patches_ >> storedPoints() >> storedFaces();
176 void Foam::triSurface::writeNative(Ostream&
os)
const 182 <<
static_cast<const List<labelledTri>&
>(*this) <<
nl;
188 bool Foam::triSurface::read
190 const fileName&
name,
191 const word& fileType,
198 <<
"No such file " <<
name <<
nl 203 transfer(*
New(
name, fileType));
211 const word& fileType,
212 const bool sortByRegion
215 if (fileType.empty())
224 <<
"Cannot determine format from filename" <<
nl 236 if (fileType ==
"ftr")
241 else if (fileType ==
"stl")
243 writeSTLASCII(
name, sortByRegion);
245 else if (fileType ==
"stlb")
247 writeSTLBINARY(
name);
249 else if (fileType ==
"gts")
251 writeGTS(
name, sortByRegion);
256 List<surfZone> zoneLst = this->sortedZones(
faceMap);
258 MeshedSurfaceProxy<labelledTri> proxy
266 proxy.write(
name, fileType);
271 <<
"Unknown surface format " << fileType
272 <<
" for writing file " <<
name <<
nl 273 <<
"Valid types:" <<
nl 331 const bool sortByRegion
365 for (
const auto&
f : *
this)
367 regionsUsed.
insert(
f.region());
369 for (
const label pointi :
f)
371 if (pointIsUsed.set(pointi))
378 os <<
"Triangles : " << size()
379 <<
" in " << regionsUsed.
size() <<
" region(s)" <<
nl 380 <<
"Vertices : " << pointIsUsed.count() <<
nl 381 <<
"Bounding Box : " << bb <<
endl;
391 s.setDefaultPatches();
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
fileName path() const
Return path = rootPath/caseName. Same as TimePaths::path()
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static fileName checkFile(const IOobject &io, const bool isGlobal=true)
Return fileName to load IOobject from.
void writeStats(Ostream &os) const
Write some statistics.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
const fileName & caseName() const noexcept
Return case name.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
A bounding box defined in terms of min/max extrema points.
static bool canWriteType(const word &fileType, bool verbose=false)
Can we write this file format?
static bool canWriteType(const word &fileType, bool verbose=false)
Can this file format type be written via MeshedSurfaceProxy?
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM format.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
word ext() const
Return file name extension (part after last .)
label size() const noexcept
The number of elements in table.
static fileName relativeFilePath(const IOobject &io, const fileName &f, const bool isGlobal=true)
Return fileName.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void add(const boundBox &bb)
Extend to include the second box.
static fileName triSurfInstance(const Time &)
Name of triSurface directory to use.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
bool has_ext() const
Various checks for extensions.
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
static const word null
An empty word.
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?
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
OBJstream os(runTime.globalPath()/outputName)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
static void check(const int retVal, const char *what)
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
triSurface()
Default construct.
static fileName findFile(const IOobject &io, const bool isGlobal=true)
Use IOobject information to resolve file to load from, or empty if the file does not exist...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const polyBoundaryMesh & patches
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
virtual void scalePoints(const scalar scaleFactor)
Scale points. A non-positive factor is ignored.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Triangulated surface description with patch information.
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))
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
Defines the attributes of an object for which implicit objectRegistry management is supported...
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.