nullWriter Class Reference

Suppresses output of geometry and fields. More...

Inheritance diagram for nullWriter:
Collaboration diagram for nullWriter:

Public Member Functions

 TypeNameNoDebug ("none")
 Declare type-name, virtual type (without debug switch) More...
 
 nullWriter ()
 Default construct. More...
 
 nullWriter (const dictionary &options)
 Construct with some output options. More...
 
 nullWriter (const meshedSurf &surf, const fileName &outputPath, bool parallel=UPstream::parRun(), const dictionary &options=dictionary())
 Construct from components. More...
 
 nullWriter (const pointField &points, const faceList &faces, const fileName &outputPath, bool parallel=UPstream::parRun(), const dictionary &options=dictionary())
 Construct from components. More...
 
virtual ~nullWriter ()=default
 Destructor. More...
 
virtual bool needsUpdate () const
 False: never needs an update. More...
 
virtual bool wroteData () const
 True: like a /dev/null device. More...
 
virtual bool enabled () const
 False: The null writer is never enabled, which lets the caller skip various (possibly expensive) preparatory operations. More...
 
virtual void setSurface (const meshedSurf &s, bool parallel)
 Change association with a surface (no-op). More...
 
virtual void setSurface (const pointField &points, const faceList &faces, bool parallel)
 Change association with a surface (no-op). More...
 
virtual void open (const fileName &outputPath)
 Open for output on specified path, using existing surface (no-op) More...
 
virtual fileName write ()
 Write separate surface geometry to file. More...
 
 declareSurfaceWriterWriteMethod (label)
 
 declareSurfaceWriterWriteMethod (scalar)
 
 declareSurfaceWriterWriteMethod (vector)
 
 declareSurfaceWriterWriteMethod (sphericalTensor)
 
 declareSurfaceWriterWriteMethod (symmTensor)
 
 declareSurfaceWriterWriteMethod (tensor)
 
- Public Member Functions inherited from surfaceWriter
 TypeName ("surfaceWriter")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, surfaceWriter, word,(),())
 
 declareRunTimeSelectionTable (autoPtr, surfaceWriter, wordDict,(const dictionary &writeOpts),(writeOpts))
 
 surfaceWriter ()
 Default construct. More...
 
 surfaceWriter (const dictionary &options)
 Default construct with specified options. More...
 
virtual ~surfaceWriter ()
 Destructor. Calls close() More...
 
virtual bool separateGeometry () const
 True if the surface format requires geometry in a separate file. More...
 
virtual bool usesFaceIds () const
 True if the writer format uses faceIds as part of its output. More...
 
virtual bool expire ()
 Mark that surface changed and the writer will need an update, and set nFields = 0. More...
 
virtual void clear ()
 Close any open output, remove association with a surface and expire the writer. The parallel flag remains untouched. More...
 
virtual void setSurface (const meshedSurf &surf)
 Change association with a surface, expire the writer with the current parallel/serial treatment. More...
 
virtual void setSurface (const pointField &points, const faceList &faces)
 Change association with a surface, expire the writer with the current parallel/serial treatment. More...
 
bool is_open () const noexcept
 Test if outputPath has been set. More...
 
bool hasSurface () const
 Writer is associated with a surface. More...
 
bool empty () const
 The surface to write is empty if the global number of faces is zero. More...
 
label size () const
 The global number of faces for the associated surface. 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 isPointData () const noexcept
 Are the field data to be treated as point data? More...
 
bool isPointData (const bool on) noexcept
 Set handling of field data to face/point data. 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 (const bool on) noexcept
 Enable/disable verbose output. More...
 
scalar mergeDim () const noexcept
 The current value of the point merge dimension (metre) More...
 
scalar mergeDim (const scalar dist) noexcept
 Change the point merge dimension (metre) More...
 
scalar scale () const noexcept
 The current value of the geometry scaling. More...
 
scalar scale (const scalar factor) noexcept
 Change the geometry scaling. More...
 
const coordSystem::cartesiantransform () const noexcept
 The current (cartesian) coordinate system transformation. 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 void open (const pointField &points, const faceList &faces, const fileName &outputPath, bool parallel)
 Open from components. More...
 
virtual void open (const meshedSurf &surf, const fileName &outputPath, bool parallel)
 Open from components. More...
 
virtual void open (const pointField &points, const faceList &faces, const fileName &outputPath)
 Open from components, with the current parallel/serial treatment. More...
 
virtual void open (const meshedSurf &surf, const fileName &outputPath)
 Open from components, with the current parallel/serial treatment. More...
 
virtual void close ()
 Finish output, performing any necessary cleanup. More...
 
virtual fileName write (const word &fieldName, const Field< label > &values)=0
 Write field of label (per face or vertex) More...
 
virtual fileName write (const word &fieldName, const Field< scalar > &values)=0
 Write field of scalar (per face or vertex) More...
 
virtual fileName write (const word &fieldName, const Field< vector > &values)=0
 Write field of vector (per face or vertex) More...
 
virtual fileName write (const word &fieldName, const Field< sphericalTensor > &values)=0
 Write field of sphericalTensor (per face or vertex) More...
 
virtual fileName write (const word &fieldName, const Field< symmTensor > &values)=0
 Write field of symmTensor (per face or vertex) More...
 
virtual fileName write (const word &fieldName, const Field< tensor > &values)=0
 Write field of tensor (per face or vertex) More...
 
virtual InfoProxy< surfaceWriterinfo () const noexcept
 Return info proxy, used to print information to a stream. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > mergeFieldTemplate (const Field< Type > &fld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > adjustFieldTemplate (const word &fieldName, const tmp< Field< Type >> &tfield) const
 

Additional Inherited Members

- Static Public Member Functions inherited from surfaceWriter
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 &surfDict, 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< surfaceWriterNew (const word &writeType)
 Return a reference to the selected surfaceWriter. More...
 
static autoPtr< surfaceWriterNew (const word &writeType, const dictionary &writeOptions)
 Return a reference to the selected surfaceWriter. More...
 
- Static Public Attributes inherited from surfaceWriter
static scalar defaultMergeDim = 1e-8
 The default merge dimension (1e-8) More...
 
- Protected Member Functions inherited from surfaceWriter
void checkOpen () const
 Verify that the outputPath_ has been set or FatalError. More...
 
virtual bool merge () const
 Merge surfaces if they are not already upToDate (parallel) or simply mark the surface as being up-to-date. More...
 
const meshedSurfsurface () const
 Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) More...
 
const meshedSurfRefadjustSurface () const
 Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and apply any coordinate system changes and/or output scaling. More...
 
template<class Type >
tmp< Field< Type > > mergeFieldTemplate (const Field< Type > &fld) const
 Gather (merge) fields with renumbering and shrinking for point data. More...
 
template<class Type >
tmp< Field< Type > > adjustFieldTemplate (const word &fieldName, const tmp< Field< Type >> &tfield) const
 Apply refLevel and fieldScaling. More...
 
tmp< Field< label > > mergeField (const Field< label > &fld) const
 
tmp< Field< label > > adjustField (const word &fieldName, const tmp< Field< label >> &tfield) const
 
tmp< Field< scalar > > mergeField (const Field< scalar > &fld) const
 
tmp< Field< scalar > > adjustField (const word &fieldName, const tmp< Field< scalar >> &tfield) const
 
tmp< Field< vector > > mergeField (const Field< vector > &fld) const
 
tmp< Field< vector > > adjustField (const word &fieldName, const tmp< Field< vector >> &tfield) const
 
tmp< Field< sphericalTensor > > mergeField (const Field< sphericalTensor > &fld) const
 
tmp< Field< sphericalTensor > > adjustField (const word &fieldName, const tmp< Field< sphericalTensor >> &tfield) const
 
tmp< Field< symmTensor > > mergeField (const Field< symmTensor > &fld) const
 
tmp< Field< symmTensor > > adjustField (const word &fieldName, const tmp< Field< symmTensor >> &tfield) const
 
tmp< Field< tensor > > mergeField (const Field< tensor > &fld) const
 
tmp< Field< tensor > > adjustField (const word &fieldName, const tmp< Field< tensor >> &tfield) const
 
template<class Type >
fileName writeTemplate (const word &fieldName, const Field< Type > &localValues)
 Dummy templated write operation. More...
 
- Protected Attributes inherited from surfaceWriter
meshedSurfRef surf_
 Reference to surface or surface components. More...
 
mergedSurf mergedSurf_
 Surface after merging (parallel) More...
 
meshedSurfRef adjustedSurf_
 The surface after point coordinate transforms and scaling. More...
 
scalar mergeDim_
 Dimension for merging. 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...
 
bool upToDate_
 The topology/surface is up-to-date? More...
 
bool wroteGeom_
 Track if geometry has been written since the last open. More...
 
bool parallel_
 Writing in parallel (via master) More...
 
bool useTimeDir_
 Insert additional time sub-directory in the output path. More...
 
bool isPointData_
 Is point vs cell data. More...
 
bool verbose_
 Additional output verbosity. More...
 
UPstream::commsTypes commType_
 Communication type (for field merging) More...
 
label nFields_
 The number of fields. More...
 
instant currTime_
 The current time value/name. More...
 
fileName outputPath_
 The full output directory and file (surface) name. More...
 
dictionary fieldLevel_
 Field level to remove (on output) More...
 
dictionary fieldScale_
 Field scaling (on output) More...
 

Detailed Description

Suppresses output of geometry and fields.

Source files

Definition at line 48 of file nullSurfaceWriter.H.

Constructor & Destructor Documentation

◆ nullWriter() [1/4]

Default construct.

Definition at line 40 of file nullSurfaceWriter.C.

◆ nullWriter() [2/4]

nullWriter ( const dictionary options)
explicit

Construct with some output options.

Definition at line 46 of file nullSurfaceWriter.C.

◆ nullWriter() [3/4]

nullWriter ( const meshedSurf surf,
const fileName outputPath,
bool  parallel = UPstream::parRun(),
const dictionary options = dictionary() 
)

Construct from components.

Definition at line 53 of file nullSurfaceWriter.C.

◆ nullWriter() [4/4]

nullWriter ( const pointField points,
const faceList faces,
const fileName outputPath,
bool  parallel = UPstream::parRun(),
const dictionary options = dictionary() 
)

Construct from components.

Definition at line 65 of file nullSurfaceWriter.C.

◆ ~nullWriter()

virtual ~nullWriter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeNameNoDebug()

TypeNameNoDebug ( "none"  )

Declare type-name, virtual type (without debug switch)

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

False: never needs an update.

Reimplemented from surfaceWriter.

Definition at line 79 of file nullSurfaceWriter.C.

◆ wroteData()

bool wroteData ( ) const
virtual

True: like a /dev/null device.

Reimplemented from surfaceWriter.

Definition at line 85 of file nullSurfaceWriter.C.

◆ enabled()

bool enabled ( ) const
virtual

False: The null writer is never enabled, which lets the caller skip various (possibly expensive) preparatory operations.

Reimplemented from surfaceWriter.

Definition at line 91 of file nullSurfaceWriter.C.

◆ setSurface() [1/2]

void setSurface ( const meshedSurf s,
bool  parallel 
)
virtual

Change association with a surface (no-op).

Reimplemented from surfaceWriter.

Definition at line 98 of file nullSurfaceWriter.C.

◆ setSurface() [2/2]

void setSurface ( const pointField points,
const faceList faces,
bool  parallel 
)
virtual

Change association with a surface (no-op).

Reimplemented from surfaceWriter.

Definition at line 106 of file nullSurfaceWriter.C.

◆ open()

void open ( const fileName outputPath)
virtual

Open for output on specified path, using existing surface (no-op)

Reimplemented from surfaceWriter.

Definition at line 114 of file nullSurfaceWriter.C.

◆ write()

Foam::fileName write ( )
virtual

Write separate surface geometry to file.

Implements surfaceWriter.

Definition at line 118 of file nullSurfaceWriter.C.

References fileName::null.

◆ declareSurfaceWriterWriteMethod() [1/6]

declareSurfaceWriterWriteMethod ( label  )

◆ declareSurfaceWriterWriteMethod() [2/6]

declareSurfaceWriterWriteMethod ( scalar  )

◆ declareSurfaceWriterWriteMethod() [3/6]

declareSurfaceWriterWriteMethod ( vector  )

◆ declareSurfaceWriterWriteMethod() [4/6]

declareSurfaceWriterWriteMethod ( sphericalTensor  )

◆ declareSurfaceWriterWriteMethod() [5/6]

declareSurfaceWriterWriteMethod ( symmTensor  )

◆ declareSurfaceWriterWriteMethod() [6/6]

declareSurfaceWriterWriteMethod ( tensor  )

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