44 namespace surfaceWriters
75 header_(options.getOrDefault(
"header", true)),
76 writeNormal_(options.getOrDefault(
"normal", false))
90 open(surf, outputPath, parallel);
111 void Foam::surfaceWriters::boundaryDataWriter::serialWriteGeometry
122 if (this->isPointData())
135 autoPtr<primitivePatch> ppPtr;
145 if (this->isPointData())
155 os << ppPtr().faceCentres();
164 if (writeNormal_ && !this->isPointData())
177 iofld.note() =
"face data";
179 OFstream
os(iofld.objectPath(), streamOpt_);
183 iofld.writeHeader(
os);
186 os << ppPtr().faceNormals();
203 fileName surfaceDir = outputPath_;
209 const meshedSurfRef& surf = adjustSurface();
213 if (!
isDir(surfaceDir))
230 iopts.
note() = (this->isPointData() ?
"point data" :
"face data");
232 serialWriteGeometry(iopts, surf);
243 Foam::fileName Foam::surfaceWriters::boundaryDataWriter::writeTemplate
245 const word& fieldName,
259 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
263 Info<<
" to " << outputFile <<
endl;
293 iopts.
note() = (this->isPointData() ?
"point data" :
"face data");
295 serialWriteGeometry(iopts, surf);
311 iofld.note() = (this->isPointData() ?
"point data" :
"face data");
313 OFstream
os(iofld.objectPath(), streamOpt_);
317 iofld.writeHeader(
os);
A class for handling file names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
vectorIOField pointIOField
pointIOField is a vectorIOField.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const string & note() const noexcept
Return the optional note.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A simple container for options an IOstream can normally have.
static std::string path(const std::string &str)
Return directory path name (part before last /)
Ignore writing from objectRegistry::writeObject()
bool writeHeader(Ostream &os) const
Write header with current type()
A class for managing references or pointers (no reference counting)
fileName objectPath() const
The complete path + object name.
Macros for easy insertion into run-time selection tables.
Abstract definition of a meshed surface defined by faces and points.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
virtual fileName write()
Write surface geometry to file.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Implements a meshed surface by referencing another meshed surface or faces/points components...
A class for handling words, derived from Foam::string.
boundaryDataWriter()
Default construct.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
A surfaceWriter for outputting to a form usable for the timeVaryingMapped boundary condition...
virtual const faceList & faces() const =0
The faces used for the surface.
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
Istream and Ostream manipulators taking arguments.
OBJstream os(runTime.globalPath()/outputName)
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field...
IOField< vector > vectorIOField
vectorField with IO.
Convenience macros for instantiating surfaceWriter methods.
defineTypeName(abaqusWriter)
static fileName envGlobalPath()
Global case (directory) from environment variable.
defineSurfaceWriterWriteFields(Foam::surfaceWriters::boundaryDataWriter)
static bool master(const label communicator=worldComm)
Am I the master rank.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
messageStream Info
Information stream (stdout output on master, null elsewhere)
Base class for surface writers.
A class for managing temporary objects.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
Do not request registration (bool: false)
virtual const pointField & points() const =0
The points used for the surface.