44 namespace surfaceWriters
57 Foam::surfaceWriters::debugWriter::mergeField
85 enableMerge_(options.getOrDefault(
"merge", true)),
86 enableWrite_(options.getOrDefault(
"write", false)),
90 Info<<
"Using debug surface writer (" 91 << (this->
isPointData() ?
"point" :
"face") <<
" data):" 108 open(surf, outputPath, parallel);
129 void Foam::surfaceWriters::debugWriter::serialWriteGeometry
140 if (this->isPointData())
153 autoPtr<primitivePatch> ppPtr;
163 if (this->isPointData())
173 os << ppPtr().faceCentres();
191 fileName surfaceDir = outputPath_;
193 if (parallel_ && !enableMerge_)
197 Info<<
"Not merging or writing" <<
nl;
206 const meshedSurf& surf =
surface();
210 autoPtr<Time> dummyTimePtr;
218 Info<<
"Not writing: " << surf.faces().size() <<
" faces" <<
nl;
223 if (!
isDir(surfaceDir))
240 iopts.
note() = (this->isPointData() ?
"point data" :
"face data");
242 serialWriteGeometry(iopts, surf);
255 const word& fieldName,
268 if (parallel_ && !enableMerge_)
272 Info<<
"Not merging or writing" <<
nl;
293 Info<<
"Not writing: " << tfield().size()
294 <<
' ' << pTraits<Type>::typeName
298 const meshedSurf& surf =
surface();
321 iopts.
note() = (this->isPointData() ?
"point data" :
"face data");
323 serialWriteGeometry(iopts, surf);
339 iofld.note() = (this->isPointData() ?
"point data" :
"face data");
341 OFstream
os(iofld.objectPath(), streamOpt_);
345 iofld.writeHeader(
os);
A class for handling file names.
static const Enum< commsTypes > commsTypeNames
Enumerated names for the communication types.
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.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const string & note() const noexcept
Return the optional note.
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
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()
UPstream::commsTypes commType_
Communication type (for field merging)
fileName objectPath() const
The complete path + object name.
Macros for easy insertion into run-time selection tables.
defineSurfaceWriterWriteFields(Foam::surfaceWriters::debugWriter)
Abstract definition of a meshed surface defined by faces and points.
bool isPointData() const noexcept
Are the field data to be treated as point data?
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...
static const char * name(const bool b) noexcept
A string representation of bool as "false" / "true".
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Generic templated field type.
A class for handling words, derived from Foam::string.
virtual fileName write()
Write surface geometry to file.
virtual const faceList & faces() const =0
The faces used for the surface.
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
Istream and Ostream manipulators taking arguments.
tmp< Field< label > > mergeField(const Field< label > &fld) const
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.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
defineTypeName(abaqusWriter)
debugWriter()
Default construct.
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)
virtual bool merge() const
Merge surfaces if they are not already upToDate (parallel) or simply mark the surface as being up-to-...
Base class for surface writers.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A surfaceWriter for special purpose debugging. Its definition and behaviour are subject to change at ...
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.