coordSetWriter Class Referenceabstract

Base class for writing coordSet(s) and tracks with fields. More...

Inheritance diagram for coordSetWriter:
Collaboration diagram for coordSetWriter:

Public Member Functions

 TypeName ("coordSetWriter")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, coordSetWriter, word,(),())
 
 declareRunTimeSelectionTable (autoPtr, coordSetWriter, wordDict,(const dictionary &writeOptions),(writeOptions))
 
 coordSetWriter ()
 Default construct. More...
 
 coordSetWriter (const dictionary &options)
 Default construct with specified options. More...
 
virtual ~coordSetWriter ()
 Destructor. Calls close() More...
 
virtual bool buffering () const
 True if the format uses internal buffering (eg, column output) More...
 
virtual bool buffering (const bool on)
 Turn internal buffering on/off (only if supported by the writer) More...
 
virtual bool enabled () const
 The writer is enabled. If the writer is not enabled, it may be possible for the caller to skip various preparatory operations. More...
 
virtual bool needsUpdate () const
 Does the writer need an update (eg, lagging behind other changes) More...
 
virtual bool wroteData () const
 Geometry or fields written since the last open? More...
 
virtual bool expire ()
 Mark that content changed and the writer will need an update, and set nFields = 0. More...
 
virtual void clear ()
 Close any open output, remove coordSet associations and expire the writer. More...
 
virtual void setCoordinates (const coordSet *coords)
 Set coordinates, can also be nullptr. More...
 
virtual void setCoordinates (const coordSet &coords)
 Set coordinates. More...
 
virtual void setTracks (const UPtrList< coordSet > &tracks)
 Set track coordinates. More...
 
virtual void setTrackTimes (const UList< scalarField > &times)
 Set track times. More...
 
label numPoints () const
 The number of associated points (local processor) More...
 
label numTracks () const
 The number of coordinate tracks. More...
 
bool hasCoords () const
 Writer is associated with content. More...
 
bool empty () const
 Writer is not associated with content. More...
 
bool is_open () const noexcept
 Test if outputPath has been set. More...
 
label nFields () const noexcept
 The number of expected output fields. More...
 
label nFields (const label n) noexcept
 Set the number of expected output fields. More...
 
bool useTracks () const noexcept
 Prefer tracks to points during single set writing. More...
 
bool useTracks (const bool on) noexcept
 Enable/disable tracks preference. More...
 
bool useTimeDir () const noexcept
 Should a time directory be spliced into the output path? More...
 
bool useTimeDir (const bool on) noexcept
 Enable/disable use of spliced output path. More...
 
bool verbose () const noexcept
 Get output verbosity. More...
 
bool verbose (bool on) noexcept
 Enable/disable verbose output. More...
 
bool hasTime () const
 True if there is a known time. More...
 
const wordtimeName () const
 The current time value/name. More...
 
scalar timeValue () const
 The current time value/name. More...
 
void setTime (const instant &inst)
 Set the current time. More...
 
void setTime (scalar timeValue)
 Set current time from timeValue, auto generating the name. More...
 
void setTime (scalar timeValue, const word &timeName)
 Set current time from timeValue and timeName. More...
 
void unsetTime ()
 Clear the current time. More...
 
virtual void beginTime (const Time &t)
 Begin a time-step. More...
 
virtual void beginTime (const instant &inst)
 Begin a time-step. More...
 
virtual void endTime ()
 End a time-step. More...
 
virtual fileName path () const =0
 Expected (characteristic) output file name - information only. Return empty when is_open() is false. More...
 
virtual void open (const fileName &outputPath)
 Write separate geometry to file. More...
 
virtual void open (const coordSet &coords, const fileName &outputPath)
 Open from components. More...
 
virtual void open (const UPtrList< coordSet > &tracks, const fileName &outputPath)
 Open from components. More...
 
virtual void close (bool force=false)
 Finish output, performing any necessary cleanup. More...
 
virtual InfoProxy< coordSetWriterinfo () const
 Return info proxy, used to print information to a stream. More...
 
virtual fileName write (const word &fieldName, const Field< label > &field)=0
 Write field of label (point data) More...
 
virtual fileName write (const word &fieldName, const List< Field< label >> &fieldValues)=0
 Write track fields of label (point data) More...
 
virtual fileName write (const word &fieldName, const Field< scalar > &field)=0
 Write field of scalar (point data) More...
 
virtual fileName write (const word &fieldName, const List< Field< scalar >> &fieldValues)=0
 Write track fields of scalar (point data) More...
 
virtual fileName write (const word &fieldName, const Field< vector > &field)=0
 Write field of vector (point data) More...
 
virtual fileName write (const word &fieldName, const List< Field< vector >> &fieldValues)=0
 Write track fields of vector (point data) More...
 
virtual fileName write (const word &fieldName, const Field< sphericalTensor > &field)=0
 Write field of sphericalTensor (point data) More...
 
virtual fileName write (const word &fieldName, const List< Field< sphericalTensor >> &fieldValues)=0
 Write track fields of sphericalTensor (point data) More...
 
virtual fileName write (const word &fieldName, const Field< symmTensor > &field)=0
 Write field of symmTensor (point data) More...
 
virtual fileName write (const word &fieldName, const List< Field< symmTensor >> &fieldValues)=0
 Write track fields of symmTensor (point data) More...
 
virtual fileName write (const word &fieldName, const Field< tensor > &field)=0
 Write field of tensor (point data) More...
 
virtual fileName write (const word &fieldName, const List< Field< tensor >> &fieldValues)=0
 Write track fields of tensor (point data) More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > adjustFieldTemplate (const word &fieldName, const tmp< Field< Type >> &tfield) const
 
template<class Type >
Foam::UPtrList< const Foam::Field< Type > > repackageFields (const Field< Type > &field)
 
template<class Type >
Foam::UPtrList< const Foam::Field< Type > > repackageFields (const UList< Field< Type >> &fieldValues)
 

Static Public Member Functions

static dictionary formatOptions (const dictionary &dict, const word &formatName, const word &entryName="formatOptions")
 Same as fileFormats::getFormatOptions. More...
 
static dictionary formatOptions (const dictionary &dict, const dictionary &setDict, const word &formatName, const word &entryName="formatOptions")
 Same as fileFormats::getFormatOptions. More...
 
static bool supportedType (const word &writeType)
 True if New is likely to succeed for this writeType. More...
 
static autoPtr< coordSetWriterNew (const word &writeFormat)
 Return a reference to the selected writer. More...
 
static autoPtr< coordSetWriterNew (const word &writeFormat, const dictionary &writeOptions)
 Return a reference to the selected writer. More...
 
static word suffix (const word &fldName, const word &fileExt=word::null)
 Name suffix based on fieldName (underscore separator) More...
 
static word suffix (const wordList &fieldNames, const word &fileExt=word::null)
 Name suffix based on fieldNames (underscore separator) More...
 

Protected Member Functions

void appendField (const word &fieldName, const Field< label > &vals)
 
void appendField (const word &fieldName, const Field< scalar > &vals)
 
void appendField (const word &fieldName, const Field< vector > &vals)
 
void appendField (const word &fieldName, const Field< sphericalTensor > &vals)
 
void appendField (const word &fieldName, const Field< symmTensor > &vals)
 
void appendField (const word &fieldName, const Field< tensor > &vals)
 
void clearBuffers ()
 Clear out buffering. More...
 
label nDataColumns () const
 The number of buffer data columns, after splitting into components. More...
 
virtual bool writeBuffered ()
 Write buffered data. More...
 
void writeBufferContents (Ostream &os, const coordSet &coords, const char *sep) const
 Write buffered data. More...
 
void getBufferLine (DynamicList< scalar > &buf, const coordSet &coords, const label pointi) const
 Get buffered data line (components) More...
 
fileName getExpectedPath (const word &fileExt=word::null) const
 Get expected (characteristic) output file name - information only. More...
 
fileName getFieldPrefixedPath (const word &fieldName, const word &fileExt=word::null) const
 Get field-prefixed output file name. More...
 
void checkOpen () const
 Verify that the outputPath_ has been set or FatalError. More...
 
virtual bool merge () const
 Perform any merging if not already upToDate (parallel) or simply mark as being up-to-date. More...
 
template<class Type >
tmp< Field< Type > > adjustFieldTemplate (const word &fieldName, const tmp< Field< Type >> &tfield) const
 
template<class Type >
fileName writeTemplate (const word &fieldName, const Field< Type > &values)
 Dummy templated write operation. More...
 
template<class Type >
fileName writeTemplate (const word &fieldName, const List< Field< Type >> &fieldValues)
 Dummy templated write operation. Multiple tracks. More...
 
 coordSetWriter (const coordSetWriter &)=delete
 No copy construct. More...
 
void operator= (const coordSetWriter &)=delete
 No copy assignment. More...
 

Static Protected Member Functions

static void writeLine (Ostream &, const UList< word > &, const char *sep)
 Write line contents (eg, buffered) More...
 
static void writeLine (Ostream &, const UList< scalar > &, const char *sep)
 Write line contents (eg, buffered) More...
 
template<class Type >
static UPtrList< const Field< Type > > repackageFields (const Field< Type > &field)
 Repackage field into a UPtrList. More...
 
template<class Type >
static UPtrList< const Field< Type > > repackageFields (const UList< Field< Type >> &fieldValues)
 Repackage multiple fields into a UPtrList. More...
 
template<class Type >
static void writeTable (Ostream &os, const coordSet &coords, const UList< Type > &values, const char *sep)
 Write coordinates and values. More...
 

Protected Attributes

UPtrList< const coordSetcoords_
 Reference to coordinate set(s) More...
 
List< scalarFieldtrackTimes_
 Track times (eg, streamlines), one per coords_ entry. More...
 
bool upToDate_
 The content is up-to-date? More...
 
bool wroteGeom_
 Track if geometry has been written since the last open. More...
 
bool buffering_
 Writer with buffering output. More...
 
bool useTracks_
 Prefer tracks to points during single set writing. More...
 
bool useTimeDir_
 Insert additional time sub-directory in the output path. More...
 
bool verbose_
 Additional output verbosity. More...
 
label nFields_
 The number of fields. More...
 
instant currTime_
 The current time value/name. More...
 
fileName outputPath_
 The full output directory and file (coords) name. More...
 
scalar geometryScale_
 Output geometry scaling after rotate/translate. More...
 
point geometryCentre_
 The centre of rotation (untranslate, translate) More...
 
coordSystem::cartesian geometryTransform_
 Local coordinate system transformation. More...
 
dictionary fieldLevel_
 Field level to remove (on output) More...
 
dictionary fieldScale_
 Field scaling (on output) More...
 
DynamicList< wordlabelNames_
 
PtrDynList< Field< label > > labelFields_
 
DynamicList< wordscalarNames_
 
PtrDynList< Field< scalar > > scalarFields_
 
DynamicList< wordvectorNames_
 
PtrDynList< Field< vector > > vectorFields_
 
DynamicList< wordsphericalTensorNames_
 
PtrDynList< Field< sphericalTensor > > sphericalTensorFields_
 
DynamicList< wordsymmTensorNames_
 
PtrDynList< Field< symmTensor > > symmTensorFields_
 
DynamicList< wordtensorNames_
 
PtrDynList< Field< tensor > > tensorFields_
 

Friends

Ostreamoperator<< (Ostream &os, const InfoProxy< coordSetWriter > &iproxy)
 Output info proxy. More...
 

Detailed Description

Base class for writing coordSet(s) and tracks with fields.

Example:

    coordSet coords(...);

    // Construct writer of xmgr type
    autoPtr<coordSetWriter> writer(coordSetWriter::New("vtk"));

    writer.open(coords, path/name);

    writer.write("density", rho);
    writer.write("velocity", U);
Source files

Definition at line 82 of file coordSetWriter.H.

Constructor & Destructor Documentation

◆ coordSetWriter() [1/3]

coordSetWriter ( const coordSetWriter )
protecteddelete

No copy construct.

◆ coordSetWriter() [2/3]

Default construct.

Definition at line 100 of file coordSetWriter.C.

◆ coordSetWriter() [3/3]

◆ ~coordSetWriter()

~coordSetWriter ( )
virtual

Destructor. Calls close()

Definition at line 153 of file coordSetWriter.C.

Member Function Documentation

◆ appendField() [1/6]

void appendField ( const word fieldName,
const Field< label > &  vals 
)
inlineprotected

Definition at line 190 of file coordSetWriter.H.

◆ appendField() [2/6]

void appendField ( const word fieldName,
const Field< scalar > &  vals 
)
inlineprotected

Definition at line 191 of file coordSetWriter.H.

◆ appendField() [3/6]

void appendField ( const word fieldName,
const Field< vector > &  vals 
)
inlineprotected

Definition at line 192 of file coordSetWriter.H.

◆ appendField() [4/6]

void appendField ( const word fieldName,
const Field< sphericalTensor > &  vals 
)
inlineprotected

Definition at line 193 of file coordSetWriter.H.

◆ appendField() [5/6]

void appendField ( const word fieldName,
const Field< symmTensor > &  vals 
)
inlineprotected

Definition at line 194 of file coordSetWriter.H.

◆ appendField() [6/6]

void appendField ( const word fieldName,
const Field< tensor > &  vals 
)
inlineprotected

Definition at line 195 of file coordSetWriter.H.

◆ writeLine() [1/2]

void writeLine ( Ostream os,
const UList< word > &  values,
const char *  sep 
)
staticprotected

Write line contents (eg, buffered)

Definition at line 26 of file coordSetWriterBuffers.C.

References forAll, Foam::nl, os(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ writeLine() [2/2]

void writeLine ( Ostream os,
const UList< scalar > &  values,
const char *  sep 
)
staticprotected

Write line contents (eg, buffered)

Definition at line 45 of file coordSetWriterBuffers.C.

References forAll, Foam::nl, os(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ clearBuffers()

void clearBuffers ( )
protected

Clear out buffering.

Definition at line 63 of file coordSetWriterBuffers.C.

References doLocalCode.

◆ nDataColumns()

Foam::label nDataColumns ( ) const
protected

The number of buffer data columns, after splitting into components.

Definition at line 82 of file coordSetWriterBuffers.C.

References doLocalCode.

◆ writeBuffered()

bool writeBuffered ( )
protectedvirtual

Write buffered data.

Reimplemented in gnuplotWriter, csvWriter, and rawWriter.

Definition at line 149 of file coordSetWriterBuffers.C.

◆ writeBufferContents()

void writeBufferContents ( Ostream os,
const coordSet coords,
const char *  sep 
) const
protected

Write buffered data.

Definition at line 156 of file coordSetWriterBuffers.C.

References os(), and UList< T >::size().

Here is the call graph for this function:

◆ getBufferLine()

void getBufferLine ( DynamicList< scalar > &  buf,
const coordSet coords,
const label  pointi 
) const
protected

Get buffered data line (components)

Definition at line 103 of file coordSetWriterBuffers.C.

References DynamicList< T, SizeMin >::append(), DynamicList< T, SizeMin >::clear(), doLocalCode, coordSet::hasVectorAxis(), p, coordSet::scalarCoord(), and coordSet::vectorCoord().

Here is the call graph for this function:

◆ getExpectedPath()

Foam::fileName getExpectedPath ( const word fileExt = word::null) const
protected

Get expected (characteristic) output file name - information only.

Definition at line 389 of file coordSetWriter.C.

References fileName::ext(), fileName::path(), and timeName.

Here is the call graph for this function:

◆ getFieldPrefixedPath()

Foam::fileName getFieldPrefixedPath ( const word fieldName,
const word fileExt = word::null 
) const
protected

Get field-prefixed output file name.

Eg, dir/U_name.raw

Definition at line 415 of file coordSetWriter.C.

References fileName::ext(), fileName::path(), and timeName.

Here is the call graph for this function:

◆ checkOpen()

void checkOpen ( ) const
protected

Verify that the outputPath_ has been set or FatalError.

Definition at line 446 of file coordSetWriter.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and Foam::type().

Here is the call graph for this function:

◆ merge()

bool merge ( ) const
protectedvirtual

Perform any merging if not already upToDate (parallel) or simply mark as being up-to-date.

Definition at line 457 of file coordSetWriter.C.

◆ adjustFieldTemplate() [1/2]

tmp<Field<Type> > adjustFieldTemplate ( const word fieldName,
const tmp< Field< Type >> &  tfield 
) const
protected

◆ repackageFields() [1/4]

static UPtrList<const Field<Type> > repackageFields ( const Field< Type > &  field)
staticprotected

Repackage field into a UPtrList.

◆ repackageFields() [2/4]

static UPtrList<const Field<Type> > repackageFields ( const UList< Field< Type >> &  fieldValues)
staticprotected

Repackage multiple fields into a UPtrList.

◆ writeTable()

void writeTable ( Ostream os,
const coordSet coords,
const UList< Type > &  values,
const char *  sep 
)
staticprotected

Write coordinates and values.

Definition at line 152 of file coordSetWriterTemplates.C.

References Foam::component(), forAll, coordSet::hasVectorAxis(), Foam::expressions::Detail::nComponents(), Foam::nl, os(), p, coordSet::scalarCoord(), Foam::HashTableOps::values(), and coordSet::vectorCoord().

Here is the call graph for this function:

◆ writeTemplate() [1/2]

fileName writeTemplate ( const word fieldName,
const Field< Type > &  values 
)
inlineprotected

Dummy templated write operation.

if (!wroteGeom_) { return this->write(); }

Parameters
fieldNameName of field
valuesLocal field values to write

Definition at line 328 of file coordSetWriter.H.

References fileName::null.

◆ writeTemplate() [2/2]

fileName writeTemplate ( const word fieldName,
const List< Field< Type >> &  fieldValues 
)
inlineprotected

Dummy templated write operation. Multiple tracks.

Definition at line 345 of file coordSetWriter.H.

References fileName::null.

◆ operator=()

void operator= ( const coordSetWriter )
protecteddelete

No copy assignment.

◆ TypeName()

TypeName ( "coordSetWriter"  )

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
coordSetWriter  ,
word  ,
()  ,
()   
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
coordSetWriter  ,
wordDict  ,
(const dictionary &writeOptions)  ,
(writeOptions)   
)

◆ formatOptions() [1/2]

Foam::dictionary formatOptions ( const dictionary dict,
const word formatName,
const word entryName = "formatOptions" 
)
static

Same as fileFormats::getFormatOptions.

Definition at line 76 of file coordSetWriter.C.

References dict, and Foam::fileFormats::getFormatOptions().

Here is the call graph for this function:

◆ formatOptions() [2/2]

Foam::dictionary formatOptions ( const dictionary dict,
const dictionary setDict,
const word formatName,
const word entryName = "formatOptions" 
)
static

Same as fileFormats::getFormatOptions.

Definition at line 87 of file coordSetWriter.C.

References dict, and Foam::fileFormats::getFormatOptions().

Here is the call graph for this function:

◆ supportedType()

bool supportedType ( const word writeType)
static

True if New is likely to succeed for this writeType.

Definition at line 26 of file coordSetWriterNew.C.

◆ New() [1/2]

Foam::autoPtr< Foam::coordSetWriter > New ( const word writeFormat)
static

Return a reference to the selected writer.

Definition at line 37 of file coordSetWriterNew.C.

References Foam::exit(), Foam::FatalError, and FatalErrorInLookup.

Referenced by particleDistribution::read(), streamLineBase::read(), and regionSizeDistribution::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::coordSetWriter > New ( const word writeFormat,
const dictionary writeOptions 
)
static

Return a reference to the selected writer.

Select with extra write option

Definition at line 58 of file coordSetWriterNew.C.

References Foam::exit(), Foam::FatalError, and FatalErrorInLookup.

Here is the call graph for this function:

◆ suffix() [1/2]

Foam::word suffix ( const word fldName,
const word fileExt = word::null 
)
static

Name suffix based on fieldName (underscore separator)

Definition at line 39 of file coordSetWriter.C.

References word::ext().

Here is the call graph for this function:

◆ suffix() [2/2]

Foam::word suffix ( const wordList fieldNames,
const word fileExt = word::null 
)
static

Name suffix based on fieldNames (underscore separator)

Definition at line 56 of file coordSetWriter.C.

References word::ext().

Here is the call graph for this function:

◆ buffering() [1/2]

bool buffering ( ) const
virtual

True if the format uses internal buffering (eg, column output)

Reimplemented in nullWriter.

Definition at line 177 of file coordSetWriterBuffers.C.

◆ buffering() [2/2]

bool buffering ( const bool  on)
virtual

Turn internal buffering on/off (only if supported by the writer)

Reimplemented in xmgraceWriter, gnuplotWriter, csvWriter, and rawWriter.

Definition at line 184 of file coordSetWriterBuffers.C.

◆ enabled()

virtual bool enabled ( ) const
inlinevirtual

The writer is enabled. If the writer is not enabled, it may be possible for the caller to skip various preparatory operations.

This method is primarily useful for the null writer

Reimplemented in nullWriter.

Definition at line 502 of file coordSetWriter.H.

Referenced by searchableSurfaces::checkIntersection().

Here is the caller graph for this function:

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Does the writer need an update (eg, lagging behind other changes)

Reimplemented in nullWriter.

Definition at line 349 of file coordSetWriter.C.

◆ wroteData()

bool wroteData ( ) const
virtual

Geometry or fields written since the last open?

Reimplemented in nullWriter.

Definition at line 355 of file coordSetWriter.C.

◆ expire()

bool expire ( )
virtual

Mark that content changed and the writer will need an update, and set nFields = 0.

May also free up unneeded data. Return false if it was previously already expired.

Definition at line 361 of file coordSetWriter.C.

◆ clear()

void clear ( )
virtual

Close any open output, remove coordSet associations and expire the writer.

Definition at line 265 of file coordSetWriter.C.

◆ setCoordinates() [1/2]

void setCoordinates ( const coordSet coords)
virtual

Set coordinates, can also be nullptr.

Reimplemented in nullWriter.

Definition at line 275 of file coordSetWriter.C.

◆ setCoordinates() [2/2]

void setCoordinates ( const coordSet coords)
virtual

Set coordinates.

Reimplemented in nullWriter.

Definition at line 293 of file coordSetWriter.C.

◆ setTracks()

void setTracks ( const UPtrList< coordSet > &  tracks)
virtual

Set track coordinates.

Reimplemented in nullWriter.

Definition at line 299 of file coordSetWriter.C.

References forAll, UPtrList< T >::get(), and UPtrList< T >::size().

Here is the call graph for this function:

◆ setTrackTimes()

void setTrackTimes ( const UList< scalarField > &  times)
virtual

Set track times.

Definition at line 316 of file coordSetWriter.C.

References UList< T >::size().

Here is the call graph for this function:

◆ numPoints()

Foam::label numPoints ( ) const

The number of associated points (local processor)

Definition at line 329 of file coordSetWriter.C.

References forAll.

◆ numTracks()

Foam::label numTracks ( ) const

The number of coordinate tracks.

Definition at line 343 of file coordSetWriter.C.

◆ hasCoords()

bool hasCoords ( ) const

Writer is associated with content.

Definition at line 377 of file coordSetWriter.C.

◆ empty()

bool empty ( ) const

Writer is not associated with content.

Definition at line 383 of file coordSetWriter.C.

◆ is_open()

bool is_open ( ) const
inlinenoexcept

Test if outputPath has been set.

Definition at line 23 of file coordSetWriterI.H.

References coordSetWriter::outputPath_.

◆ nFields() [1/2]

Foam::label nFields ( ) const
inlinenoexcept

The number of expected output fields.

Currently only used by the legacy VTK format.

Definition at line 29 of file coordSetWriterI.H.

◆ nFields() [2/2]

Foam::label nFields ( const label  n)
inlinenoexcept

Set the number of expected output fields.

Currently only used by the legacy VTK format.

Returns
old value

Definition at line 35 of file coordSetWriterI.H.

References n.

◆ useTracks() [1/2]

bool useTracks ( ) const
inlinenoexcept

Prefer tracks to points during single set writing.

Definition at line 43 of file coordSetWriterI.H.

◆ useTracks() [2/2]

bool useTracks ( const bool  on)
inlinenoexcept

Enable/disable tracks preference.

Returns
old value

Definition at line 49 of file coordSetWriterI.H.

◆ useTimeDir() [1/2]

bool useTimeDir ( ) const
inlinenoexcept

Should a time directory be spliced into the output path?

Definition at line 57 of file coordSetWriterI.H.

◆ useTimeDir() [2/2]

bool useTimeDir ( const bool  on)
inlinenoexcept

Enable/disable use of spliced output path.

Returns
old value

Definition at line 63 of file coordSetWriterI.H.

◆ verbose() [1/2]

bool verbose ( ) const
inlinenoexcept

Get output verbosity.

Definition at line 71 of file coordSetWriterI.H.

◆ verbose() [2/2]

bool verbose ( bool  on)
inlinenoexcept

Enable/disable verbose output.

Returns
old value

Definition at line 77 of file coordSetWriterI.H.

◆ hasTime()

bool hasTime ( ) const
inline

True if there is a known time.

Definition at line 85 of file coordSetWriterI.H.

◆ timeName()

const Foam::word & timeName ( ) const
inline

The current time value/name.

Definition at line 91 of file coordSetWriterI.H.

◆ timeValue()

Foam::scalar timeValue ( ) const
inline

The current time value/name.

Definition at line 97 of file coordSetWriterI.H.

◆ setTime() [1/3]

void setTime ( const instant inst)

Set the current time.

Definition at line 161 of file coordSetWriter.C.

◆ setTime() [2/3]

void setTime ( scalar  timeValue)

Set current time from timeValue, auto generating the name.

Definition at line 167 of file coordSetWriter.C.

◆ setTime() [3/3]

void setTime ( scalar  timeValue,
const word timeName 
)

Set current time from timeValue and timeName.

Definition at line 173 of file coordSetWriter.C.

References timeName.

◆ unsetTime()

void unsetTime ( )

Clear the current time.

Definition at line 180 of file coordSetWriter.C.

◆ beginTime() [1/2]

void beginTime ( const Time t)
virtual

Begin a time-step.

Reimplemented in gltfWriter, xmgraceWriter, and vtkWriter.

Definition at line 187 of file coordSetWriter.C.

References setTime(), Time::timeName(), and dimensioned< Type >::value().

Referenced by vtkWriter::beginTime(), xmgraceWriter::beginTime(), and gltfWriter::beginTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ beginTime() [2/2]

void beginTime ( const instant inst)
virtual

Begin a time-step.

Reimplemented in gltfWriter, xmgraceWriter, and vtkWriter.

Definition at line 193 of file coordSetWriter.C.

References setTime().

Here is the call graph for this function:

◆ endTime()

void endTime ( )
virtual

End a time-step.

Reimplemented in gltfWriter, xmgraceWriter, and vtkWriter.

Definition at line 199 of file coordSetWriter.C.

Referenced by vtkWriter::endTime(), xmgraceWriter::endTime(), and gltfWriter::endTime().

Here is the caller graph for this function:

◆ path()

virtual fileName path ( ) const
pure virtual

Expected (characteristic) output file name - information only. Return empty when is_open() is false.

Implemented in gltfWriter, abaqusWriter, ensightWriter, xmgraceWriter, csvWriter, gnuplotWriter, rawWriter, nastranWriter, nullWriter, and vtkWriter.

◆ open() [1/3]

void open ( const fileName outputPath)
virtual

Write separate geometry to file.

/ TBD: virtual fileName write() = 0;

Open for output on specified path, using existing content

Reimplemented in nullWriter.

Definition at line 214 of file coordSetWriter.C.

◆ open() [2/3]

void open ( const coordSet coords,
const fileName outputPath 
)
virtual

Open from components.

Definition at line 222 of file coordSetWriter.C.

◆ open() [3/3]

void open ( const UPtrList< coordSet > &  tracks,
const fileName outputPath 
)
virtual

Open from components.

Definition at line 234 of file coordSetWriter.C.

◆ close()

void close ( bool  force = false)
virtual

Finish output, performing any necessary cleanup.

Optional force disassociation with any coordSet(s)

Reimplemented in gltfWriter, ensightWriter, xmgraceWriter, and vtkWriter.

Definition at line 245 of file coordSetWriter.C.

References Foam::Info, and Foam::nl.

Referenced by vtkWriter::close(), xmgraceWriter::close(), ensightWriter::close(), and gltfWriter::close().

Here is the caller graph for this function:

◆ info()

virtual InfoProxy<coordSetWriter> info ( ) const
inlinevirtual

Return info proxy, used to print information to a stream.

Definition at line 744 of file coordSetWriter.H.

◆ write() [1/12]

virtual fileName write ( const word fieldName,
const Field< label > &  field 
)
pure virtual

Write field of label (point data)

Parameters
fieldNameName of field
fieldField values

◆ write() [2/12]

virtual fileName write ( const word fieldName,
const List< Field< label >> &  fieldValues 
)
pure virtual

Write track fields of label (point data)

Parameters
fieldNameName of field
fieldValuesPer-track values

◆ write() [3/12]

virtual fileName write ( const word fieldName,
const Field< scalar > &  field 
)
pure virtual

Write field of scalar (point data)

Parameters
fieldNameName of field
fieldField values

◆ write() [4/12]

virtual fileName write ( const word fieldName,
const List< Field< scalar >> &  fieldValues 
)
pure virtual

Write track fields of scalar (point data)

Parameters
fieldNameName of field
fieldValuesPer-track values

◆ write() [5/12]

virtual fileName write ( const word fieldName,
const Field< vector > &  field 
)
pure virtual

Write field of vector (point data)

Parameters
fieldNameName of field
fieldField values

◆ write() [6/12]

virtual fileName write ( const word fieldName,
const List< Field< vector >> &  fieldValues 
)
pure virtual

Write track fields of vector (point data)

Parameters
fieldNameName of field
fieldValuesPer-track values

◆ write() [7/12]

virtual fileName write ( const word fieldName,
const Field< sphericalTensor > &  field 
)
pure virtual

Write field of sphericalTensor (point data)

Parameters
fieldNameName of field
fieldField values

◆ write() [8/12]

virtual fileName write ( const word fieldName,
const List< Field< sphericalTensor >> &  fieldValues 
)
pure virtual

Write track fields of sphericalTensor (point data)

Parameters
fieldNameName of field
fieldValuesPer-track values

◆ write() [9/12]

virtual fileName write ( const word fieldName,
const Field< symmTensor > &  field 
)
pure virtual

Write field of symmTensor (point data)

Parameters
fieldNameName of field
fieldField values

◆ write() [10/12]

virtual fileName write ( const word fieldName,
const List< Field< symmTensor >> &  fieldValues 
)
pure virtual

Write track fields of symmTensor (point data)

Parameters
fieldNameName of field
fieldValuesPer-track values

◆ write() [11/12]

virtual fileName write ( const word fieldName,
const Field< tensor > &  field 
)
pure virtual

Write field of tensor (point data)

Parameters
fieldNameName of field
fieldField values

◆ write() [12/12]

virtual fileName write ( const word fieldName,
const List< Field< tensor >> &  fieldValues 
)
pure virtual

Write track fields of tensor (point data)

Parameters
fieldNameName of field
fieldValuesPer-track values

◆ adjustFieldTemplate() [2/2]

Foam::tmp<Foam::Field<Type> > adjustFieldTemplate ( const word fieldName,
const tmp< Field< Type >> &  tfield 
) const

◆ repackageFields() [3/4]

Foam::UPtrList<const Foam::Field<Type> > repackageFields ( const Field< Type > &  field)

Definition at line 127 of file coordSetWriterTemplates.C.

References field(), and UPtrList< T >::set().

Here is the call graph for this function:

◆ repackageFields() [4/4]

Foam::UPtrList<const Foam::Field<Type> > repackageFields ( const UList< Field< Type >> &  fieldValues)

Definition at line 138 of file coordSetWriterTemplates.C.

References forAll.

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream os,
const InfoProxy< coordSetWriter > &  iproxy 
)
friend

Output info proxy.

Member Data Documentation

◆ coords_

UPtrList<const coordSet> coords_
protected

Reference to coordinate set(s)

Definition at line 91 of file coordSetWriter.H.

◆ trackTimes_

List<scalarField> trackTimes_
protected

Track times (eg, streamlines), one per coords_ entry.

Definition at line 96 of file coordSetWriter.H.

◆ upToDate_

bool upToDate_
mutableprotected

The content is up-to-date?

Definition at line 101 of file coordSetWriter.H.

◆ wroteGeom_

bool wroteGeom_
mutableprotected

Track if geometry has been written since the last open.

Definition at line 106 of file coordSetWriter.H.

◆ buffering_

bool buffering_
mutableprotected

Writer with buffering output.

//- Writing in parallel (via master) bool parallel_;

Definition at line 114 of file coordSetWriter.H.

Referenced by csvWriter::csvWriter(), gnuplotWriter::gnuplotWriter(), rawWriter::rawWriter(), and xmgraceWriter::xmgraceWriter().

◆ useTracks_

bool useTracks_
protected

Prefer tracks to points during single set writing.

Definition at line 119 of file coordSetWriter.H.

◆ useTimeDir_

bool useTimeDir_
protected

Insert additional time sub-directory in the output path.

Definition at line 124 of file coordSetWriter.H.

◆ verbose_

bool verbose_
protected

Additional output verbosity.

Definition at line 129 of file coordSetWriter.H.

Referenced by coordSetWriter::coordSetWriter().

◆ nFields_

label nFields_
protected

The number of fields.

Definition at line 134 of file coordSetWriter.H.

◆ currTime_

instant currTime_
protected

The current time value/name.

Definition at line 139 of file coordSetWriter.H.

◆ outputPath_

fileName outputPath_
protected

The full output directory and file (coords) name.

Definition at line 144 of file coordSetWriter.H.

Referenced by coordSetWriter::is_open().

◆ geometryScale_

scalar geometryScale_
protected

Output geometry scaling after rotate/translate.

Definition at line 149 of file coordSetWriter.H.

Referenced by coordSetWriter::coordSetWriter().

◆ geometryCentre_

point geometryCentre_
protected

The centre of rotation (untranslate, translate)

Definition at line 154 of file coordSetWriter.H.

Referenced by coordSetWriter::coordSetWriter().

◆ geometryTransform_

coordSystem::cartesian geometryTransform_
protected

Local coordinate system transformation.

Definition at line 159 of file coordSetWriter.H.

Referenced by coordSetWriter::coordSetWriter().

◆ fieldLevel_

dictionary fieldLevel_
protected

Field level to remove (on output)

Definition at line 164 of file coordSetWriter.H.

Referenced by coordSetWriter::coordSetWriter().

◆ fieldScale_

dictionary fieldScale_
protected

Field scaling (on output)

Definition at line 169 of file coordSetWriter.H.

Referenced by coordSetWriter::coordSetWriter().

◆ labelNames_

DynamicList<word> labelNames_
protected

Definition at line 190 of file coordSetWriter.H.

◆ labelFields_

PtrDynList<Field< label > > labelFields_
protected

Definition at line 190 of file coordSetWriter.H.

◆ scalarNames_

DynamicList<word> scalarNames_
protected

Definition at line 190 of file coordSetWriter.H.

◆ scalarFields_

PtrDynList<Field< scalar > > scalarFields_
protected

Definition at line 191 of file coordSetWriter.H.

◆ vectorNames_

DynamicList<word> vectorNames_
protected

Definition at line 191 of file coordSetWriter.H.

◆ vectorFields_

PtrDynList<Field< vector > > vectorFields_
protected

Definition at line 192 of file coordSetWriter.H.

◆ sphericalTensorNames_

DynamicList<word> sphericalTensorNames_
protected

Definition at line 192 of file coordSetWriter.H.

◆ sphericalTensorFields_

PtrDynList<Field< sphericalTensor > > sphericalTensorFields_
protected

Definition at line 193 of file coordSetWriter.H.

◆ symmTensorNames_

DynamicList<word> symmTensorNames_
protected

Definition at line 193 of file coordSetWriter.H.

◆ symmTensorFields_

PtrDynList<Field< symmTensor > > symmTensorFields_
protected

Definition at line 194 of file coordSetWriter.H.

◆ tensorNames_

DynamicList<word> tensorNames_
protected

Definition at line 194 of file coordSetWriter.H.

◆ tensorFields_

PtrDynList<Field< tensor > > tensorFields_
protected

Definition at line 195 of file coordSetWriter.H.


The documentation for this class was generated from the following files: