Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
surfaceWriter Class Referenceabstract

Base class for surface writers. More...

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

Public Member Functions

 TypeName ("surfaceWriter")
 
 declareRunTimeSelectionTable (autoPtr, surfaceWriter, word,(),())
 
 declareRunTimeSelectionTable (autoPtr, surfaceWriter, wordDict,(const dictionary &writeOpts),(writeOpts))
 
 surfaceWriter ()
 
 surfaceWriter (const dictionary &options)
 
 surfaceWriter (const meshedSurf &surf, bool parallel=Pstream::parRun(), const dictionary &options=dictionary())
 
 surfaceWriter (const pointField &points, const faceList &faces, bool parallel=Pstream::parRun(), const dictionary &options=dictionary())
 
virtual ~surfaceWriter ()
 
virtual bool enabled () const
 
virtual bool separateGeometry () const
 
virtual bool usesFaceIds () const
 
virtual bool needsUpdate () const
 
virtual bool wroteData () const
 
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 hasSurface () const
 
bool empty () const
 
label size () const
 
label nFields () const
 
label nFields (const label n)
 
bool isPointData () const
 
bool isPointData (const bool on)
 
bool useTimeDir () const
 
bool useTimeDir (const bool on)
 
bool verbose () const
 
bool verbose (const bool on)
 
scalar mergeDim () const
 
scalar mergeDim (const scalar dist)
 
bool hasTime () const
 
const wordtimeName () const
 
scalar timeValue () const
 
void setTime (const instant &inst)
 
void setTime (scalar timeValue)
 
void setTime (scalar timeValue, const word &timeName)
 
void unsetTime ()
 
virtual void beginTime (const Time &t)
 
virtual void beginTime (const instant &inst)
 
virtual void endTime ()
 
virtual void open (const fileName &outputPath)
 
virtual void open (const pointField &points, const faceList &faces, const fileName &outputPath, bool parallel)
 
virtual void open (const meshedSurf &surf, const fileName &outputPath, bool parallel)
 
virtual void open (const pointField &points, const faceList &faces, const fileName &outputPath)
 
virtual void open (const meshedSurf &surf, const fileName &outputPath)
 
virtual void close ()
 
virtual fileName write ()=0
 
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
 
template<class Type >
Foam::tmp< Foam::Field< Type > > mergeFieldTemplate (const Field< Type > &fld) const
 

Static Public Member Functions

static bool supportedType (const word &writeType)
 
static autoPtr< surfaceWriterNew (const word &writeType)
 
static autoPtr< surfaceWriterNew (const word &writeType, const dictionary &writeOptions)
 

Static Public Attributes

static scalar defaultMergeDim = 1e-8
 

Protected Member Functions

bool checkOpen () const
 
virtual bool merge () const
 
const meshedSurfsurface () const
 
template<class Type >
tmp< Field< Type > > mergeFieldTemplate (const Field< Type > &fld) const
 
tmp< Field< label > > mergeField (const Field< label > &fld) const
 
tmp< Field< scalar > > mergeField (const Field< scalar > &fld) const
 
tmp< Field< vector > > mergeField (const Field< vector > &fld) const
 
tmp< Field< sphericalTensor > > mergeField (const Field< sphericalTensor > &fld) const
 
tmp< Field< symmTensor > > mergeField (const Field< symmTensor > &fld) const
 
tmp< Field< tensor > > mergeField (const Field< tensor > &fld) const
 
template<class Type >
fileName writeTemplate (const word &fieldName, const Field< Type > &localValues)
 

Protected Attributes

std::reference_wrapper< const meshedSurfsurf_
 
meshedSurfRef surfComp_
 
bool useComponents_
 
bool upToDate_
 
bool wroteGeom_
 
bool parallel_
 
bool useTimeDir_
 
bool isPointData_
 
bool verbose_
 
label nFields_
 
scalar mergeDim_
 
mergedSurf merged_
 
instant currTime_
 
fileName outputPath_
 

Static Protected Attributes

static const meshedSurf::emptySurface emptySurface_
 

Friends

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

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;
    }
}

Format options:

Property Description Required Default
verbose Additional output verbosity no no
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 111 of file surfaceWriter.H.

Constructor & Destructor Documentation

◆ surfaceWriter() [1/4]

Definition at line 133 of file surfaceWriter.C.

References surfaceWriter::close().

Here is the call graph for this function:

◆ surfaceWriter() [2/4]

surfaceWriter ( const dictionary options)
explicit

Definition at line 154 of file surfaceWriter.C.

References dictionary::readIfPresent(), and surfaceWriter::verbose_.

Here is the call graph for this function:

◆ surfaceWriter() [3/4]

surfaceWriter ( const meshedSurf surf,
bool  parallel = Pstream::parRun(),
const dictionary options = dictionary() 
)
explicit

Definition at line 163 of file surfaceWriter.C.

◆ surfaceWriter() [4/4]

surfaceWriter ( const pointField points,
const faceList faces,
bool  parallel = Pstream::parRun(),
const dictionary options = dictionary() 
)

Definition at line 176 of file surfaceWriter.C.

References points.

◆ ~surfaceWriter()

~surfaceWriter ( )
virtual

Definition at line 191 of file surfaceWriter.C.

Member Function Documentation

◆ checkOpen()

bool checkOpen ( ) const
protected

Definition at line 426 of file surfaceWriter.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

Definition at line 439 of file surfaceWriter.C.

References UPstream::parRun().

Here is the call graph for this function:

◆ surface()

const Foam::meshedSurf & surface ( ) const
protected

Definition at line 465 of file surfaceWriter.C.

References UPstream::parRun().

Here is the call graph for this function:

◆ mergeFieldTemplate() [1/2]

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

◆ mergeField() [1/6]

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

◆ mergeField() [2/6]

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

◆ mergeField() [3/6]

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

Definition at line 535 of file surfaceWriter.C.

◆ mergeField() [4/6]

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

Definition at line 536 of file surfaceWriter.C.

◆ mergeField() [5/6]

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

Definition at line 537 of file surfaceWriter.C.

◆ mergeField() [6/6]

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

Definition at line 538 of file surfaceWriter.C.

◆ writeTemplate()

fileName writeTemplate ( const word fieldName,
const Field< Type > &  localValues 
)
inlineprotected
Parameters
fieldNameName of field
localValuesLocal field values to write

Definition at line 200 of file surfaceWriter.H.

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

Here is the call graph for this function:

◆ TypeName()

TypeName ( "surfaceWriter"  )

◆ 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

Definition at line 45 of file surfaceWriter.C.

◆ New() [1/2]

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

◆ New() [2/2]

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

Definition at line 88 of file surfaceWriter.C.

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

Here is the call graph for this function:

◆ enabled()

virtual bool enabled ( ) const
inlinevirtual

Reimplemented in nullWriter.

Definition at line 301 of file surfaceWriter.H.

◆ separateGeometry()

virtual bool separateGeometry ( ) const
inlinevirtual

Reimplemented in ensightWriter, foamWriter, starcdWriter, and proxyWriter.

Definition at line 307 of file surfaceWriter.H.

◆ usesFaceIds()

virtual bool usesFaceIds ( ) const
inlinevirtual

Reimplemented in nastranWriter, abaqusWriter, and starcdWriter.

Definition at line 315 of file surfaceWriter.H.

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Reimplemented in nullWriter.

Definition at line 367 of file surfaceWriter.C.

Referenced by areaWrite::write().

Here is the caller graph for this function:

◆ wroteData()

bool wroteData ( ) const
virtual

Reimplemented in nullWriter.

Definition at line 373 of file surfaceWriter.C.

Referenced by areaWrite::write().

Here is the caller graph for this function:

◆ expire()

bool expire ( )
virtual

Definition at line 379 of file surfaceWriter.C.

◆ clear()

void clear ( )
virtual

Definition at line 309 of file surfaceWriter.C.

◆ setSurface() [1/4]

void setSurface ( const meshedSurf surf,
bool  parallel 
)
virtual

Reimplemented in nullWriter.

Definition at line 320 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

Reimplemented in nullWriter.

Definition at line 334 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

Definition at line 349 of file surfaceWriter.C.

◆ setSurface() [4/4]

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

Definition at line 358 of file surfaceWriter.C.

References points.

◆ hasSurface()

bool hasSurface ( ) const

Definition at line 394 of file surfaceWriter.C.

◆ empty()

bool empty ( ) const

Definition at line 400 of file surfaceWriter.C.

References Foam::returnReduce().

Here is the call graph for this function:

◆ size()

Foam::label size ( ) const

Definition at line 413 of file surfaceWriter.C.

References Foam::returnReduce().

Here is the call graph for this function:

◆ nFields() [1/2]

Foam::label nFields ( ) const
inline

Definition at line 23 of file surfaceWriterI.H.

References surfaceWriter::nFields_.

Referenced by areaWrite::write().

Here is the caller graph for this function:

◆ nFields() [2/2]

Foam::label nFields ( const label  n)
inline

Definition at line 29 of file surfaceWriterI.H.

References n.

◆ isPointData() [1/2]

bool isPointData ( ) const
inline

Definition at line 37 of file surfaceWriterI.H.

◆ isPointData() [2/2]

bool isPointData ( const bool  on)
inline

Definition at line 43 of file surfaceWriterI.H.

◆ useTimeDir() [1/2]

bool useTimeDir ( ) const
inline

Definition at line 51 of file surfaceWriterI.H.

◆ useTimeDir() [2/2]

bool useTimeDir ( const bool  on)
inline

Definition at line 57 of file surfaceWriterI.H.

◆ verbose() [1/2]

bool verbose ( ) const
inline

Definition at line 65 of file surfaceWriterI.H.

◆ verbose() [2/2]

bool verbose ( const bool  on)
inline

Definition at line 71 of file surfaceWriterI.H.

◆ mergeDim() [1/2]

Foam::scalar mergeDim ( ) const
inline

Definition at line 79 of file surfaceWriterI.H.

◆ mergeDim() [2/2]

Foam::scalar mergeDim ( const scalar  dist)
inline

Definition at line 85 of file surfaceWriterI.H.

◆ hasTime()

bool hasTime ( ) const
inline

Definition at line 93 of file surfaceWriterI.H.

◆ timeName()

const Foam::word & timeName ( ) const
inline

Definition at line 99 of file surfaceWriterI.H.

◆ timeValue()

Foam::scalar timeValue ( ) const
inline

Definition at line 105 of file surfaceWriterI.H.

◆ setTime() [1/3]

void setTime ( const instant inst)

Definition at line 199 of file surfaceWriter.C.

◆ setTime() [2/3]

void setTime ( scalar  timeValue)

Definition at line 205 of file surfaceWriter.C.

◆ setTime() [3/3]

void setTime ( scalar  timeValue,
const word timeName 
)

Definition at line 211 of file surfaceWriter.C.

References timeName.

◆ unsetTime()

void unsetTime ( )

Definition at line 218 of file surfaceWriter.C.

◆ beginTime() [1/2]

void beginTime ( const Time t)
virtual

Reimplemented in vtkWriter.

Definition at line 225 of file surfaceWriter.C.

References setTime(), Time::timeName(), and dimensioned::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

Reimplemented in vtkWriter.

Definition at line 231 of file surfaceWriter.C.

References setTime().

Here is the call graph for this function:

◆ endTime()

void endTime ( )
virtual

Reimplemented in vtkWriter.

Definition at line 237 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

Reimplemented in nullWriter.

Definition at line 243 of file surfaceWriter.C.

Referenced by proxyWriter::proxyWriter(), and areaWrite::write().

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

Definition at line 264 of file surfaceWriter.C.

References points.

◆ open() [3/5]

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

Definition at line 251 of file surfaceWriter.C.

◆ open() [4/5]

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

Definition at line 290 of file surfaceWriter.C.

References points.

◆ open() [5/5]

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

Definition at line 278 of file surfaceWriter.C.

◆ close()

void close ( )
virtual

Reimplemented in ensightWriter, and vtkWriter.

Definition at line 302 of file surfaceWriter.C.

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

Here is the caller graph for this function:

◆ write() [1/7]

virtual fileName write ( )
pure virtual

◆ 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

Definition at line 537 of file surfaceWriter.H.

◆ mergeFieldTemplate() [2/2]

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

Definition at line 489 of file surfaceWriter.C.

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

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<<

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

Member Data Documentation

◆ emptySurface_

const Foam::meshedSurf::emptySurface emptySurface_
staticprotected

Definition at line 118 of file surfaceWriter.H.

◆ surf_

std::reference_wrapper<const meshedSurf> surf_
protected

Definition at line 124 of file surfaceWriter.H.

◆ surfComp_

meshedSurfRef surfComp_
protected

Definition at line 127 of file surfaceWriter.H.

◆ useComponents_

bool useComponents_
protected

Definition at line 130 of file surfaceWriter.H.

◆ upToDate_

bool upToDate_
mutableprotected

Definition at line 133 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ wroteGeom_

bool wroteGeom_
mutableprotected

Definition at line 136 of file surfaceWriter.H.

Referenced by surfaceWriter::writeTemplate().

◆ parallel_

bool parallel_
protected

Definition at line 139 of file surfaceWriter.H.

◆ useTimeDir_

bool useTimeDir_
protected

Definition at line 142 of file surfaceWriter.H.

◆ isPointData_

bool isPointData_
protected

Definition at line 145 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ verbose_

bool verbose_
protected

Definition at line 148 of file surfaceWriter.H.

Referenced by surfaceWriter::surfaceWriter().

◆ nFields_

label nFields_
protected

Definition at line 151 of file surfaceWriter.H.

Referenced by surfaceWriter::nFields(), and Foam::operator<<().

◆ mergeDim_

scalar mergeDim_
protected

Definition at line 154 of file surfaceWriter.H.

◆ merged_

mergedSurf merged_
mutableprotected

Definition at line 157 of file surfaceWriter.H.

◆ currTime_

instant currTime_
protected

Definition at line 160 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ outputPath_

fileName outputPath_
protected

Definition at line 163 of file surfaceWriter.H.

Referenced by Foam::operator<<().

◆ defaultMergeDim

Foam::scalar defaultMergeDim = 1e-8
static

Definition at line 218 of file surfaceWriter.H.


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