surfaceWriter Class Referenceabstract

Base class for surface writers. More...

Inheritance diagram for surfaceWriter:
[legend]
Collaboration diagram for surfaceWriter:
[legend]

Public Member Functions

 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 enabled () const
 
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 needsUpdate () const
 Does the writer need an update (eg, lagging behind surface changes) More...
 
virtual bool wroteData () const
 Geometry or fields written since the last open? More...
 
virtual bool expire ()
 
virtual void clear ()
 
virtual void setSurface (const meshedSurf &surf, bool parallel)
 
virtual void setSurface (const pointField &points, const faceList &faces, bool parallel)
 
virtual void setSurface (const meshedSurf &surf)
 
virtual void setSurface (const pointField &points, const faceList &faces)
 
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 fileName &outputPath)
 Open for output on specified path, using existing surface. 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 ()=0
 Write separate surface geometry to file. 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
 Return info proxy. 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
 

Static Public Member Functions

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

static scalar defaultMergeDim = 1e-8
 The default merge dimension (1e-8) More...
 

Protected Member Functions

void checkOpen () const
 Verify that the outputPath_ has been set or FatalError. More...
 
virtual bool merge () const
 
const meshedSurfsurface () const
 
const meshedSurfRefadjustSurface () const
 
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

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...
 
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...
 
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...
 

Friends

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

Detailed Description

Base class for surface writers.

The surfaceWriter interface is rather large since we need a writer that can either be initially defined without a surface association and have that added at a later stage, or be defined with a surface association.

formatOptions
{
    someFormat // Eg, ensight, vtk, etc
    {
        verbose         true;
        fieldLevel
        {
            "p.*"   1e5;    // Absolute -> gauge [Pa]
            T       273.15; // [K] -> [C]
            U       #eval{ 10/sqrt(3) };  // Uniform magU=10
        }
        fieldScale
        {
            "p.*"   0.01;   // [Pa] -> [mbar]
        }

        scale   1000;  // [m] -> [mm]
        transform
        {
            origin  (0 0 0);
            rotation axisAngle;
            axis    (1 0 0);
            angle   45;
        }

    }
}

Format options:

Property Description Reqd Default
verbose Additional output verbosity no no
scale Output geometry scaling no 1
transform Output coordinate transform no
fieldLevel Subtract field level before scaling no empty dict
fieldScale Output field scaling no empty dict
Note
For surface formats that require geometry in a separate file, it is the responsibility of the implementation (not the caller) to ensure that this occurs.
Source files

Definition at line 158 of file surfaceWriter.H.

Constructor & Destructor Documentation

◆ surfaceWriter() [1/2]

Default construct.

Definition at line 140 of file surfaceWriter.C.

References surfaceWriter::close().

Here is the call graph for this function:

◆ surfaceWriter() [2/2]

surfaceWriter ( const dictionary options)
explicit

Default construct with specified options.

Definition at line 164 of file surfaceWriter.C.

References coordinateSystem::clear(), surfaceWriter::fieldLevel_, surfaceWriter::fieldScale_, dictionary::findDict(), surfaceWriter::geometryScale_, surfaceWriter::geometryTransform_, keyType::LITERAL, dictionary::readIfPresent(), dictionary::subOrEmptyDict(), and surfaceWriter::verbose_.

Here is the call graph for this function:

◆ ~surfaceWriter()

~surfaceWriter ( )
virtual

Destructor. Calls close()

Definition at line 190 of file surfaceWriter.C.

Member Function Documentation

◆ checkOpen()

void checkOpen ( ) const
protected

Verify that the outputPath_ has been set or FatalError.

Definition at line 410 of file surfaceWriter.C.

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

Referenced by rawWriter::writeTemplate().

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

◆ merge()

bool merge ( ) const
protectedvirtual

Merge surfaces if they are not already upToDate (parallel) or simply mark the surface as being up-to-date

Definition at line 421 of file surfaceWriter.C.

References UPstream::parRun().

Here is the call graph for this function:

◆ surface()

const Foam::meshedSurf & surface ( ) const
protected

Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel)

Definition at line 450 of file surfaceWriter.C.

References UPstream::parRun().

Here is the call graph for this function:

◆ adjustSurface()

const Foam::meshedSurfRef & adjustSurface ( ) const
protected

Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and apply any coordinate system changes and/or output scaling.

Definition at line 463 of file surfaceWriter.C.

References meshedSurfRef::clear(), and Foam::magSqr().

Referenced by rawWriter::writeTemplate().

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

◆ mergeFieldTemplate() [1/2]

tmp< Field< Type > > mergeFieldTemplate ( const Field< Type > &  fld) const
protected

Gather (merge) fields with renumbering and shrinking for point data.

◆ adjustFieldTemplate() [1/2]

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

Apply refLevel and fieldScaling.

◆ mergeField() [1/6]

tmp< Field< label > > mergeField ( const Field< label > &  fld) const
protected

Referenced by rawWriter::writeTemplate().

Here is the caller graph for this function:

◆ adjustField() [1/6]

tmp< Field< label > > adjustField ( const word fieldName,
const tmp< Field< label > > &  tfield 
) const
protected

Referenced by rawWriter::writeTemplate().

Here is the caller graph for this function:

◆ mergeField() [2/6]

tmp< Field< scalar > > mergeField ( const Field< scalar > &  fld) const
protected

◆ adjustField() [2/6]

tmp< Field< scalar > > adjustField ( const word fieldName,
const tmp< Field< scalar > > &  tfield 
) const
protected

◆ mergeField() [3/6]

Foam::tmp< Foam::Field< Foam::vector > > mergeField ( const Field< vector > &  fld) const
protected

Definition at line 658 of file surfaceWriter.C.

◆ adjustField() [3/6]

Foam::tmp< Foam::Field< Foam::vector > > adjustField ( const word fieldName,
const tmp< Field< vector > > &  tfield 
) const
protected

Definition at line 658 of file surfaceWriter.C.

◆ mergeField() [4/6]

Foam::tmp< Foam::Field< Foam::sphericalTensor > > mergeField ( const Field< sphericalTensor > &  fld) const
protected

Definition at line 659 of file surfaceWriter.C.

◆ adjustField() [4/6]

Foam::tmp< Foam::Field< Foam::sphericalTensor > > adjustField ( const word fieldName,
const tmp< Field< sphericalTensor > > &  tfield 
) const
protected

Definition at line 659 of file surfaceWriter.C.

◆ mergeField() [5/6]

Foam::tmp< Foam::Field< Foam::symmTensor > > mergeField ( const Field< symmTensor > &  fld) const
protected

Definition at line 660 of file surfaceWriter.C.

◆ adjustField() [5/6]

Foam::tmp< Foam::Field< Foam::symmTensor > > adjustField ( const word fieldName,
const tmp< Field< symmTensor > > &  tfield 
) const
protected

Definition at line 660 of file surfaceWriter.C.

◆ mergeField() [6/6]

Foam::tmp< Foam::Field< Foam::tensor > > mergeField ( const Field< tensor > &  fld) const
protected

Definition at line 661 of file surfaceWriter.C.

◆ adjustField() [6/6]

Foam::tmp< Foam::Field< Foam::tensor > > adjustField ( const word fieldName,
const tmp< Field< tensor > > &  tfield 
) const
protected

Definition at line 661 of file surfaceWriter.C.

◆ writeTemplate()

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

Dummy templated write operation.

Parameters
fieldNameName of field
localValuesLocal field values to write

Definition at line 273 of file surfaceWriter.H.

References fileName::null, surfaceWriter::write(), and surfaceWriter::wroteGeom_.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "surfaceWriter"  )

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
surfaceWriter  ,
word  ,
()  ,
()   
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
surfaceWriter  ,
wordDict  ,
(const dictionary &writeOpts)  ,
(writeOpts)   
)

◆ supportedType()

bool supportedType ( const word writeType)
static

True if New is likely to succeed for this writeType.

Definition at line 52 of file surfaceWriter.C.

◆ New() [1/2]

Foam::autoPtr< Foam::surfaceWriter > New ( const word writeType)
static

Return a reference to the selected surfaceWriter.

Definition at line 64 of file surfaceWriter.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::nl, and MeshedSurfaceProxy< Face >::writeTypes().

Here is the call graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::surfaceWriter > New ( const word writeType,
const dictionary writeOptions 
)
static

Return a reference to the selected surfaceWriter.

Select with extra write option

Definition at line 94 of file surfaceWriter.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and MeshedSurfaceProxy< Face >::writeTypes().

Here is the call graph for this function:

◆ 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 358 of file surfaceWriter.H.

◆ separateGeometry()

virtual bool separateGeometry ( ) const
inlinevirtual

True if the surface format requires geometry in a separate file.

Reimplemented in ensightWriter, foamWriter, proxyWriter, and starcdWriter.

Definition at line 364 of file surfaceWriter.H.

◆ usesFaceIds()

virtual bool usesFaceIds ( ) const
inlinevirtual

True if the writer format uses faceIds as part of its output.

Element ids are used by various CAE formats (abaqus, nastran, starcd, ...)

Reimplemented in abaqusWriter, nastranWriter, and starcdWriter.

Definition at line 372 of file surfaceWriter.H.

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

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

Reimplemented in nullWriter.

Definition at line 360 of file surfaceWriter.C.

Referenced by areaWrite::write().

Here is the caller graph for this function:

◆ wroteData()

bool wroteData ( ) const
virtual

Geometry or fields written since the last open?

Reimplemented in nullWriter.

Definition at line 366 of file surfaceWriter.C.

Referenced by areaWrite::write().

Here is the caller graph for this function:

◆ expire()

bool expire ( )
virtual

Mark that surface 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 372 of file surfaceWriter.C.

◆ clear()

void clear ( )
virtual

Close any open output, remove association with a surface and expire the writer. The parallel flag remains untouched.

Definition at line 308 of file surfaceWriter.C.

◆ setSurface() [1/4]

void setSurface ( const meshedSurf surf,
bool  parallel 
)
virtual

Change association with a surface, expire the writer with defined parallel/serial treatment

Reimplemented in nullWriter.

Definition at line 316 of file surfaceWriter.C.

References UPstream::parRun().

Referenced by areaWrite::write().

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

◆ setSurface() [2/4]

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

Change association with a surface, expire the writer with defined parallel/serial treatment

Reimplemented in nullWriter.

Definition at line 328 of file surfaceWriter.C.

References UPstream::parRun(), and points.

Here is the call graph for this function:

◆ setSurface() [3/4]

void setSurface ( const meshedSurf surf)
virtual

Change association with a surface, expire the writer with the current parallel/serial treatment

Definition at line 341 of file surfaceWriter.C.

◆ setSurface() [4/4]

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

Change association with a surface, expire the writer with the current parallel/serial treatment

Definition at line 350 of file surfaceWriter.C.

References points.

◆ is_open()

bool is_open ( ) const
inlinenoexcept

Test if outputPath has been set.

Definition at line 30 of file surfaceWriterI.H.

References surfaceWriter::outputPath_.

◆ hasSurface()

bool hasSurface ( ) const

Writer is associated with a surface.

Definition at line 388 of file surfaceWriter.C.

◆ empty()

bool empty ( ) const

The surface to write is empty if the global number of faces is zero.

Definition at line 394 of file surfaceWriter.C.

References Foam::returnReduce().

Referenced by rawWriter::writeTemplate().

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

◆ size()

Foam::label size ( ) const

The global number of faces for the associated surface.

Definition at line 402 of file surfaceWriter.C.

References Foam::returnReduce().

Here is the call graph for this function:

◆ 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 36 of file surfaceWriterI.H.

Referenced by areaWrite::write().

Here is the caller graph for this function:

◆ 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 42 of file surfaceWriterI.H.

References n.

◆ isPointData() [1/2]

bool isPointData ( ) const
inlinenoexcept

Are the field data to be treated as point data?

Definition at line 50 of file surfaceWriterI.H.

Referenced by rawWriter::writeTemplate().

Here is the caller graph for this function:

◆ isPointData() [2/2]

bool isPointData ( const bool  on)
inlinenoexcept

Set handling of field data to face/point data.

Returns
old value

Definition at line 56 of file surfaceWriterI.H.

◆ useTimeDir() [1/2]

bool useTimeDir ( ) const
inlinenoexcept

Should a time directory be spliced into the output path?

Definition at line 64 of file surfaceWriterI.H.

Referenced by rawWriter::writeTemplate().

Here is the caller graph for this function:

◆ useTimeDir() [2/2]

bool useTimeDir ( const bool  on)
inlinenoexcept

Enable/disable use of spliced output path.

Returns
old value

Definition at line 70 of file surfaceWriterI.H.

◆ verbose() [1/2]

bool verbose ( ) const
inlinenoexcept

Get output verbosity.

Definition at line 78 of file surfaceWriterI.H.

◆ verbose() [2/2]

bool verbose ( const bool  on)
inlinenoexcept

Enable/disable verbose output.

Returns
old value

Definition at line 84 of file surfaceWriterI.H.

◆ mergeDim() [1/2]

Foam::scalar mergeDim ( ) const
inlinenoexcept

The current value of the point merge dimension (metre)

Definition at line 92 of file surfaceWriterI.H.

◆ mergeDim() [2/2]

Foam::scalar mergeDim ( const scalar  dist)
inlinenoexcept

Change the point merge dimension (metre)

Returns
old value

Definition at line 98 of file surfaceWriterI.H.

◆ scale() [1/2]

Foam::scalar scale ( ) const
inlinenoexcept

The current value of the geometry scaling.

Definition at line 106 of file surfaceWriterI.H.

◆ scale() [2/2]

Foam::scalar scale ( const scalar  factor)
inlinenoexcept

Change the geometry scaling.

Returns
old value

Definition at line 112 of file surfaceWriterI.H.

◆ transform()

const Foam::coordSystem::cartesian & transform ( ) const
inlinenoexcept

The current (cartesian) coordinate system transformation.

Definition at line 122 of file surfaceWriterI.H.

◆ hasTime()

bool hasTime ( ) const
inline

True if there is a known time.

Definition at line 128 of file surfaceWriterI.H.

◆ timeName()

const Foam::word & timeName ( ) const
inline

The current time value/name.

Definition at line 134 of file surfaceWriterI.H.

Referenced by rawWriter::writeTemplate().

Here is the caller graph for this function:

◆ timeValue()

Foam::scalar timeValue ( ) const
inline

The current time value/name.

Definition at line 140 of file surfaceWriterI.H.

◆ setTime() [1/3]

void setTime ( const instant inst)

Set the current time.

Definition at line 198 of file surfaceWriter.C.

◆ setTime() [2/3]

void setTime ( scalar  timeValue)

Set current time from timeValue, auto generating the name.

Definition at line 204 of file surfaceWriter.C.

◆ setTime() [3/3]

void setTime ( scalar  timeValue,
const word timeName 
)

Set current time from timeValue and timeName.

Definition at line 210 of file surfaceWriter.C.

References timeName.

◆ unsetTime()

void unsetTime ( )

Clear the current time.

Definition at line 217 of file surfaceWriter.C.

◆ beginTime() [1/2]

void beginTime ( const Time t)
virtual

Begin a time-step.

Reimplemented in vtkWriter.

Definition at line 224 of file surfaceWriter.C.

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

Referenced by vtkWriter::beginTime(), and areaWrite::write().

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 vtkWriter.

Definition at line 230 of file surfaceWriter.C.

References setTime().

Here is the call graph for this function:

◆ endTime()

void endTime ( )
virtual

End a time-step.

Reimplemented in vtkWriter.

Definition at line 236 of file surfaceWriter.C.

Referenced by vtkWriter::endTime(), and areaWrite::write().

Here is the caller graph for this function:

◆ open() [1/5]

void open ( const fileName outputPath)
virtual

Open for output on specified path, using existing surface.

Reimplemented in nullWriter.

Definition at line 242 of file surfaceWriter.C.

Referenced by abaqusWriter::abaqusWriter(), boundaryDataWriter::boundaryDataWriter(), ensightWriter::ensightWriter(), foamWriter::foamWriter(), nastranWriter::nastranWriter(), rawWriter::rawWriter(), starcdWriter::starcdWriter(), vtkWriter::vtkWriter(), areaWrite::write(), and x3dWriter::x3dWriter().

Here is the caller graph for this function:

◆ open() [2/5]

void open ( const pointField points,
const faceList faces,
const fileName outputPath,
bool  parallel 
)
virtual

Open from components.

Definition at line 262 of file surfaceWriter.C.

References points.

◆ open() [3/5]

void open ( const meshedSurf surf,
const fileName outputPath,
bool  parallel 
)
virtual

Open from components.

Definition at line 249 of file surfaceWriter.C.

◆ open() [4/5]

void open ( const pointField points,
const faceList faces,
const fileName outputPath 
)
virtual

Open from components, with the current parallel/serial treatment.

Definition at line 288 of file surfaceWriter.C.

References points.

◆ open() [5/5]

void open ( const meshedSurf surf,
const fileName outputPath 
)
virtual

Open from components, with the current parallel/serial treatment.

Definition at line 276 of file surfaceWriter.C.

◆ close()

void close ( )
virtual

Finish output, performing any necessary cleanup.

Reimplemented in ensightWriter, and vtkWriter.

Definition at line 301 of file surfaceWriter.C.

Referenced by ensightWriter::close(), vtkWriter::close(), and surfaceWriter::surfaceWriter().

Here is the caller graph for this function:

◆ write() [1/7]

virtual fileName write ( )
pure virtual

Write separate surface geometry to file.

Implemented in abaqusWriter, boundaryDataWriter, ensightWriter, foamWriter, nastranWriter, nullWriter, proxyWriter, rawWriter, starcdWriter, vtkWriter, and x3dWriter.

Referenced by areaWrite::write(), and surfaceWriter::writeTemplate().

Here is the caller graph for this function:

◆ write() [2/7]

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

Write field of label (per face or vertex)

Parameters
fieldNameName of field
valuesField values to write

◆ write() [3/7]

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

Write field of scalar (per face or vertex)

Parameters
fieldNameName of field
valuesField values to write

◆ write() [4/7]

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

Write field of vector (per face or vertex)

Parameters
fieldNameName of field
valuesField values to write

◆ write() [5/7]

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

Write field of sphericalTensor (per face or vertex)

Parameters
fieldNameName of field
valuesField values to write

◆ write() [6/7]

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

Write field of symmTensor (per face or vertex)

Parameters
fieldNameName of field
valuesField values to write

◆ write() [7/7]

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

Write field of tensor (per face or vertex)

Parameters
fieldNameName of field
valuesField values to write

◆ info()

virtual InfoProxy< surfaceWriter > info ( ) const
inlinevirtual

Return info proxy.

Definition at line 607 of file surfaceWriter.H.

◆ mergeFieldTemplate() [2/2]

Foam::tmp< Foam::Field< Type > > mergeFieldTemplate ( const Field< Type > &  fld) const

Definition at line 501 of file surfaceWriter.C.

References fld(), globalIndex::gatherOp(), Foam::inplaceReorder(), splitCell::master(), Foam::New(), and UPstream::parRun().

Here is the call graph for this function:

◆ adjustFieldTemplate() [2/2]

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

Definition at line 540 of file surfaceWriter.C.

References Foam::equal(), Foam::Info, tmp< T >::ref(), keyType::REGEX, tmp< T >::reset(), Foam::setComponent(), and Foam::transform().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

Ostream & operator<< ( Ostream os,
const InfoProxy< surfaceWriter > &  ip 
)
friend

Output info proxy.

Member Data Documentation

◆ surf_

meshedSurfRef surf_
protected

Reference to surface or surface components.

Definition at line 165 of file surfaceWriter.H.

◆ mergedSurf_

mergedSurf mergedSurf_
mutableprotected

Surface after merging (parallel)

Definition at line 168 of file surfaceWriter.H.

◆ adjustedSurf_

meshedSurfRef adjustedSurf_
mutableprotected

The surface after point coordinate transforms and scaling.

Definition at line 171 of file surfaceWriter.H.

◆ mergeDim_

scalar mergeDim_
protected

Dimension for merging.

Definition at line 174 of file surfaceWriter.H.

◆ geometryScale_

scalar geometryScale_
protected

Output geometry scaling after rotate/translate.

Definition at line 177 of file surfaceWriter.H.

Referenced by surfaceWriter::surfaceWriter().

◆ geometryTransform_

coordSystem::cartesian geometryTransform_
protected

Local coordinate system transformation.

Definition at line 180 of file surfaceWriter.H.

Referenced by surfaceWriter::surfaceWriter().

◆ upToDate_

bool upToDate_
mutableprotected

The topology/surface is up-to-date?

Definition at line 188 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ wroteGeom_

bool wroteGeom_
mutableprotected

Track if geometry has been written since the last open.

Definition at line 191 of file surfaceWriter.H.

Referenced by surfaceWriter::writeTemplate(), and rawWriter::writeTemplate().

◆ parallel_

bool parallel_
protected

Writing in parallel (via master)

Definition at line 194 of file surfaceWriter.H.

Referenced by rawWriter::writeTemplate().

◆ useTimeDir_

bool useTimeDir_
protected

Insert additional time sub-directory in the output path.

Definition at line 197 of file surfaceWriter.H.

◆ isPointData_

bool isPointData_
protected

Is point vs cell data.

Definition at line 200 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ verbose_

bool verbose_
protected

Additional output verbosity.

Definition at line 203 of file surfaceWriter.H.

Referenced by surfaceWriter::surfaceWriter(), rawWriter::writeTemplate(), and x3dWriter::x3dWriter().

◆ nFields_

label nFields_
protected

The number of fields.

Definition at line 206 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ currTime_

instant currTime_
protected

The current time value/name.

Definition at line 209 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ outputPath_

fileName outputPath_
protected

The full output directory and file (surface) name.

Definition at line 212 of file surfaceWriter.H.

Referenced by surfaceWriter::is_open(), Foam::operator<<(), and rawWriter::writeTemplate().

◆ fieldLevel_

dictionary fieldLevel_
protected

Field level to remove (on output)

Definition at line 215 of file surfaceWriter.H.

Referenced by surfaceWriter::surfaceWriter().

◆ fieldScale_

dictionary fieldScale_
protected

Field scaling (on output)

Definition at line 218 of file surfaceWriter.H.

Referenced by surfaceWriter::surfaceWriter().

◆ defaultMergeDim

Foam::scalar defaultMergeDim = 1e-8
static

The default merge dimension (1e-8)

Definition at line 292 of file surfaceWriter.H.


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