54#ifndef Foam_coordSetWriter_H
55#define Foam_coordSetWriter_H
80Ostream&
operator<<(Ostream&
os,
const InfoProxy<coordSetWriter>&);
131#undef defineBufferMethod
132#define defineBufferMethod(Type) \
135 DynamicList<word> Type##Names_; \
138 PtrDynList<Field<Type>> Type##Fields_; \
141 void appendField(const word& fieldName, const Field<Type>& vals) \
143 Type##Names_.append(fieldName); \
144 Type##Fields_.append(vals.clone()); \
154#undef defineBufferMethod
201 const word& fieldName,
210 virtual bool merge()
const;
248 const word& fieldName,
263 const word& fieldName,
317 const word& writeFormat,
387 virtual void clear();
516 virtual
void close(
bool force = false);
537#undef declareCoordSetWriterWriteMethod
538#define declareCoordSetWriterWriteMethod(Type) \
541 virtual fileName write \
543 const word& fieldName, \
544 const Field<Type>& field \
548 virtual fileName write \
550 const word& fieldName, \
551 const List<Field<Type>>& fieldValues \
562#undef declareCoordSetWriterWriteMethod
563#define declareCoordSetWriterWriteMethod(Type) \
566 virtual fileName write \
568 const word& fieldName, \
569 const Field<Type>& values \
573 virtual fileName write \
575 const word& fieldName, \
576 const List<Field<Type>>& fieldValues \
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Generic templated field type.
A helper class for outputting values to Ostream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Base class for writing coordSet(s) and tracks with fields.
void getBufferLine(DynamicList< scalar > &buf, const coordSet &coords, const label pointi) const
Get buffered data line (components)
virtual void open(const fileName &outputPath)
Write separate geometry to file.
fileName getExpectedPath(const word &fileExt=word::null) const
Get expected (characteristic) output file name - information only.
virtual void endTime()
End a time-step.
virtual bool enabled() const
void writeBufferContents(Ostream &os, const coordSet &coords, const char *sep) const
Write buffered data.
bool useTimeDir_
Insert additional time sub-directory in the output path.
coordSetWriter()
Default construct.
label nDataColumns() const
The number of buffer data columns, after splitting into components.
bool wroteGeom_
Track if geometry has been written since the last open.
bool useTracks() const noexcept
Prefer tracks to points during single set writing.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
bool buffering_
Writer with buffering output.
virtual bool buffering() const
True if the format uses internal buffering (eg, column output)
static UPtrList< const Field< Type > > repackageFields(const Field< Type > &field)
Repackage field into a UPtrList.
declareRunTimeSelectionTable(autoPtr, coordSetWriter, word,(),())
static autoPtr< coordSetWriter > New(const word &writeFormat)
Return a reference to the selected writer.
const word & timeName() const
The current time value/name.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
void unsetTime()
Clear the current time.
virtual void beginTime(const Time &t)
Begin a time-step.
bool hasCoords() const
Writer is associated with content.
label nFields_
The number of fields.
static UPtrList< const Field< Type > > repackageFields(const UList< Field< Type > > &fieldValues)
Repackage multiple fields into a UPtrList.
coordSetWriter(const coordSetWriter &)=delete
No copy construct.
bool empty() const
Writer is not associated with content.
void operator=(const coordSetWriter &)=delete
No copy assignment.
bool upToDate_
The content is up-to-date?
virtual bool writeBuffered()
Write buffered data.
label numPoints() const
The number of associated points (local processor)
static bool supportedType(const word &writeType)
True if New is likely to succeed for this writeType.
bool is_open() const noexcept
Test if outputPath has been set.
void setTime(const instant &inst)
Set the current time.
bool useTracks_
Prefer tracks to points during single set writing.
virtual bool merge() const
static void writeTable(Ostream &os, const coordSet &coords, const UList< Type > &values, const char *sep)
Write coordinates and values.
bool verbose_
Additional output verbosity.
void clearBuffers()
Clear out buffering.
declareRunTimeSelectionTable(autoPtr, coordSetWriter, wordDict,(const dictionary &writeOptions),(writeOptions))
UPtrList< const coordSet > coords_
Reference to coordinate set(s)
virtual bool needsUpdate() const
Does the writer need an update (eg, lagging behind other changes)
static word suffix(const word &fldName, const word &fileExt=word::null)
Name suffix based on fieldName (underscore separator)
instant currTime_
The current time value/name.
bool verbose() const noexcept
Get output verbosity.
List< scalarField > trackTimes_
Track times (eg, streamlines), one per coords_ entry.
virtual fileName path() const =0
TypeName("coordSetWriter")
Runtime type information.
virtual void setCoordinates(const coordSet *coords)
Set coordinates, can also be nullptr.
fileName getFieldPrefixedPath(const word &fieldName, const word &fileExt=word::null) const
Get field-prefixed output file name.
scalar timeValue() const
The current time value/name.
virtual bool wroteData() const
Geometry or fields written since the last open?
virtual void setTrackTimes(const UList< scalarField > ×)
Set track times.
virtual void setTracks(const UPtrList< coordSet > &tracks)
Set track coordinates.
virtual InfoProxy< coordSetWriter > info() const
Return info proxy.
bool hasTime() const
True if there is a known time.
static void writeLine(Ostream &, const UList< word > &, const char *sep)
Write line contents (eg, buffered)
fileName writeTemplate(const word &fieldName, const Field< Type > &values)
Dummy templated write operation.
fileName writeTemplate(const word &fieldName, const List< Field< Type > > &fieldValues)
Dummy templated write operation. Multiple tracks.
virtual void close(bool force=false)
Finish output, performing any necessary cleanup.
virtual ~coordSetWriter()
Destructor. Calls close()
fileName outputPath_
The full output directory and file (coords) name.
label numTracks() const
The number of coordinate tracks.
label nFields() const noexcept
The number of expected output fields.
Holds list of sampling positions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static const fileName null
An empty fileName.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
A class for handling words, derived from Foam::string.
#define declareCoordSetWriterWriteMethod(Type)
#define defineBufferMethod(Type)
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.