Go to the documentation of this file.
40 namespace surfaceWriters
56 for (
direction cmpt=0; cmpt < pTraits<Type>::nComponents; ++cmpt)
99 open(surf, outputPath, parallel);
114 open(
points, faces, outputPath, parallel);
127 if (useTimeDir() && !
timeName().empty())
130 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
132 outputFile.
ext(
"inp");
136 Info<<
"Writing geometry to " << outputFile <<
endl;
173 const word& fieldName,
188 if (useTimeDir() && !
timeName().empty())
195 outputFile /= fieldName +
'_' + outputPath_.name();
196 outputFile.
ext(
"usr");
200 Info<<
"Writing field " << fieldName <<
" to " << outputFile <<
endl;
209 const auto&
values = tfield();
216 OFstream os(outputFile, streamOpt_);
222 for (
const Type& val :
values)
virtual fileName write()
Write surface geometry to file.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
A class for handling words, derived from Foam::string.
Base class for surface writers.
A class for handling file names.
static std::string path(const std::string &str)
Return directory path name (part before last /)
A class for managing temporary objects.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
defineTypeName(boundaryDataWriter)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Convenience macros for instantiating surfaceWriter methods.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual const pointField & points() const =0
The points used for the surface.
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
The compression enum corresponding to the string.
static void writeData(Ostream &os, const Type &val)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
word ext() const
Return file name extension (part after last .)
starcdWriter()
Default construct.
Output to file stream, using an OSstream.
static bool master(const label communicator=0)
Am I the master process.
virtual const labelList & faceIds() const
Per-face identifier (eg, element Id)
addToRunTimeSelectionTable(surfaceWriter, boundaryDataWriter, word)
A surfaceWriter for STARCD files.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static const UList< T > & null()
Return a UList reference to a nullObject.
defineSurfaceWriterWriteFields(Foam::surfaceWriters::starcdWriter)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?