74 header_(options.getOrDefault(
"header", true)),
75 writeNormal_(options.getOrDefault(
"normal", false))
89 open(surf, outputPath, parallel);
110void 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);
242Foam::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);
Istream and Ostream manipulators taking arguments.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A primitive field of type <T> with automated input and output.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
const string & note() const noexcept
Return the optional note.
fileName objectPath() const
The complete path + object name.
bool writeHeader(Ostream &os) const
Write header with current type().
A simple container for options an IOstream can normally have.
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
static autoPtr< Time > NewGlobalTime()
Construct (dummy) global Time - no functionObjects or libraries, using the global path information st...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static std::string path(const std::string &str)
Return directory path name (part before last /).
Implements a meshed surface by referencing another meshed surface or faces/points components.
Abstract definition of a meshed surface defined by faces and points.
virtual const faceList & faces() const =0
The faces used for the surface.
virtual const pointField & points() const =0
The points used for the surface.
A class for managing references or pointers (no reference counting).
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Base class for surface writers.
surfaceWriter()
Default construct.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
bool wroteGeom_
Track if geometry has been written since the last open.
bool isPointData() const noexcept
Are the field data to be treated as point data?
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
bool parallel_
Writing in parallel (via master).
tmp< Field< label > > adjustField(const word &fieldName, const tmp< Field< label > > &tfield) const
bool verbose_
Additional output verbosity.
const meshedSurfRef & adjustSurface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and a...
tmp< Field< label > > mergeField(const Field< label > &fld) const
fileName outputPath_
The full output directory and file (surface) name.
A surfaceWriter for outputting to a form usable for the timeVaryingMapped boundary condition....
boundaryDataWriter()
Default construct.
virtual fileName write()
Write surface geometry to file.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
OBJstream os(runTime.globalPath()/outputName)
Namespace for surface writers.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
messageStream Info
Information stream (stdout output on master, null elsewhere).
PrimitivePatch< SubList< face >, const pointField & > primitivePatch
A PrimitivePatch with a SubList addressing for the faces, const reference for the point field.
List< face > faceList
List of faces.
vectorIOField pointIOField
pointIOField is a vectorIOField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
IOField< vector > vectorIOField
IO for a Field of vector.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Convenience macros for instantiating surfaceWriter methods.
#define defineSurfaceWriterWriteFields(ThisClass)