43 namespace surfaceWriters
74 header_(options.getOrDefault(
"header", true)),
75 writeNormal_(options.getOrDefault(
"normal", false))
89 open(surf, outputPath, parallel);
110 void Foam::surfaceWriters::boundaryDataWriter::serialWriteGeometry
121 if (this->isPointData())
134 autoPtr<primitivePatch> ppPtr;
144 if (this->isPointData())
154 os << ppPtr().faceCentres();
163 if (writeNormal_ && !this->isPointData())
176 iofld.note() =
"face data";
178 OFstream
os(iofld.objectPath(), streamOpt_);
182 iofld.writeHeader(
os);
185 os << ppPtr().faceNormals();
202 fileName surfaceDir = outputPath_;
208 const meshedSurfRef& surf = adjustSurface();
212 if (!
isDir(surfaceDir))
229 iopts.
note() = (this->isPointData() ?
"point data" :
"face data");
231 serialWriteGeometry(iopts, surf);
242 Foam::fileName Foam::surfaceWriters::boundaryDataWriter::writeTemplate
244 const word& fieldName,
258 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
262 Info<<
" to " << outputFile <<
endl;
292 iopts.
note() = (this->isPointData() ?
"point data" :
"face data");
294 serialWriteGeometry(iopts, surf);
310 iofld.note() = (this->isPointData() ?
"point data" :
"face data");
312 OFstream
os(iofld.objectPath(), streamOpt_);
316 iofld.writeHeader(
os);
A class for handling file names.
static autoPtr< Time > NewGlobalTime()
Construct (dummy) global Time - no functionObjects or libraries, using the global path information st...
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.
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...
Convenience macros for instantiating surfaceWriter methods.
defineTypeName(abaqusWriter)
defineSurfaceWriterWriteFields(Foam::surfaceWriters::boundaryDataWriter)
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
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)
IOField< vector > vectorIOField
IO for a Field of vector.
Do not request registration (bool: false)
virtual const pointField & points() const =0
The points used for the surface.