41 return wordHashSet(*writefileExtensionMemberFunctionTablePtr_);
52 return fileFormats::surfaceFormatsCore::checkSupport
94 <<
"Cannot determine format from filename" <<
nl 99 write(
name, ext, surf, streamOpt, options);
106 auto* mfuncPtr = writefileExtensionMemberFunctionTable(fileType);
111 <<
"Unknown file type " << fileType <<
nl <<
nl 112 <<
"Valid types:" <<
nl 117 mfuncPtr(
name, surf, streamOpt, options);
129 const word name(surfName.size() ? surfName : surfaceRegistry::defaultName);
137 t.
timePath()/surfaceRegistry::prefix/
name/surfMesh::meshSubDir
140 if (!
isDir(objectDir))
154 surfMesh::meshSubDir,
156 IOobjectOption::NO_READ,
157 IOobjectOption::NO_WRITE,
158 IOobjectOption::NO_REGISTER
168 IOobject::writeEndDivider(
os);
180 surfMesh::meshSubDir,
182 IOobjectOption::NO_READ,
183 IOobjectOption::NO_WRITE,
184 IOobjectOption::NO_REGISTER
192 if (this->useFaceMap())
194 os << UIndirectList<Face>(this->surfFaces(), this->
faceMap());
198 os << this->surfFaces();
201 IOobject::writeEndDivider(
os);
213 surfMesh::meshSubDir,
215 IOobjectOption::NO_READ,
216 IOobjectOption::NO_WRITE,
217 IOobjectOption::NO_REGISTER
222 OFstream
os(objectDir/
io.name());
226 os << this->surfZones();
228 IOobject::writeEndDivider(
os);
264 for (
const auto&
f : faces_)
266 nTri +=
f.nTriangles();
label nTriangles() const
Count number of triangles.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
fileName timePath() const
Return current time path = path/timeName.
vectorIOField pointIOField
pointIOField is a vectorIOField.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
IOstreamOption writeStreamOption() const noexcept
Get write stream option (format, compression, version)
A simple container for options an IOstream can normally have.
static bool canWriteType(const word &fileType, bool verbose=false)
Can this file format type be written via MeshedSurfaceProxy?
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)
Various functions to operate on Lists.
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.
word ext() const
Return file name extension (part after last .)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
CompactIOList< face, label > faceCompactIOList
Compact IO for a List of face.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
#define DebugInFunction
Report an information message using Foam::Info.
MeshedSurfaceProxy(const pointField &pointLst, const UList< Face > &faceLst, const UList< surfZone > &zoneLst=UList< surfZone >::null(), const labelUList &faceMap=labelUList::null(), const labelUList &faceIdLst=labelUList::null())
Construct from component references.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
OBJstream os(runTime.globalPath()/outputName)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
static wordHashSet writeTypes()
The file format types that can be written via MeshedSurfaceProxy.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.