167bool Foam::triSurface::readNative(Istream& is)
170 is >> patches_ >> storedPoints() >> storedFaces();
176void Foam::triSurface::writeNative(
Ostream&
os)
const
188bool Foam::triSurface::read
191 const word& fileType,
198 <<
"No such file " <<
name <<
nl
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);
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();
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 as an ISstream, normally using std::ifstream for the actual input.
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 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
static bool canWriteType(const word &fileType, bool verbose=false)
Can this file format type be written via MeshedSurfaceProxy?
static wordHashSet writeTypes()
The file format types that can be written via MeshedSurfaceProxy.
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.
static wordHashSet readTypes()
Known readable file-types, without friends or proxies.
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
fileName path() const
The path for the case = rootPath/caseName.
const fileName & caseName() const noexcept
The case name.
void size(const label n)
Older name for setAddressableSize.
static wordHashSet readTypes()
Known readable file-types, without friends or proxies.
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.
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,...
A class for handling file names.
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?
List< surfZone > sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
void transfer(triSurface &surf)
Alter contents by transferring (triangles, points) components.
static wordHashSet writeTypes()
Known writable file-types, including via friends or proxies.
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.
static bool canReadType(const word &fileType, bool verbose=false)
Can we read this file format?
void write(Ostream &os) const
Write to Ostream in simple OpenFOAM 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.
const List< labelledTri > & surfFaces() const noexcept
Return const access to the faces.
static wordHashSet readTypes()
Known readable file-types, including via friends or proxies.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
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))
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
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.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
bool read(const char *buf, int32_t &val)
Same as readInt32.
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?
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
static void check(const int retVal, const char *what)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
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.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).