FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Base class for graphics format writing. Entry points are

  • write(..).
    Write to an Ostream a table of points with corresponding values.
  • write(scalar/vector/sphericalTensor/symmTensor/tensor).
    Write single scalar/vector/sphericalTensor/symmTensor/tensor. Default is to write space separated components.
More...

#include <sampling/writer.H>


Detailed Description

template<class Type>
class Foam::writer< Type >

Base class for graphics format writing. Entry points are

  • write(..).
    Write to an Ostream a table of points with corresponding values.
  • write(scalar/vector/sphericalTensor/symmTensor/tensor).
    Write single scalar/vector/sphericalTensor/symmTensor/tensor. Default is to write space separated components.

Example:

// Construct writer of xmgr type
autoPtr<writer<scalar> > scalarFormatter(writer<scalar>::New("xmgr"));

// Output list of points and corresponding values
scalarFormatter().write
(
coordSet
(
points, // sample coordinates
"someLine", // name of coordSet
"distance", // write coordinates as distance to refPoint
points[0]   // reference point
),
"U.component(0)",   // name of values
vals// values
);
Source files

Definition at line 85 of file writer.H.

Inheritance diagram for writer< Type >:

List of all members.

Public Member Functions

 TypeName ("writer")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, writer, word,(),())
 writer ()
 Construct null.
virtual  ~writer ()=0
 Destructor.
virtual fileName  getFileName (const coordSet &, const wordList &) const =0
 Generate file name with correct extension.
virtual void  write (const coordSet &, const wordList &, const List< const Field< Type > * > &, Ostream &) const =0
 General entry point for writing.
virtual void  write (const bool writeTracks, const PtrList< coordSet > &, const wordList &valueSetNames, const List< List< Field< Type > > > &, Ostream &) const =0
 General entry point for writing of multiple coordSets.
virtual Ostream &  write (const scalar, Ostream &) const
 Write scalar as ascii.
template<class VSType >
Ostream &  writeVS (const VSType &, Ostream &) const
virtual Ostream &  write (const vector &, Ostream &) const
 Write vector. Tab separated ascii.
virtual Ostream &  write (const sphericalTensor &, Ostream &) const
 Write sphericalTensor. Tab separated ascii.
virtual Ostream &  write (const symmTensor &, Ostream &) const
 Write symmTensor. Tab separated ascii.
virtual Ostream &  write (const tensor &, Ostream &) const
 Write tensor. Tab separated ascii.

Static Public Member Functions

static autoPtr< writer >  New (const word &writeFormat)
 Return a reference to the selected writer.

Protected Member Functions

fileName  getBaseName (const coordSet &, const wordList &) const
 Generates filename from coordSet and sampled fields.
void  writeCoord (const coordSet &, const label sampleI, Ostream &) const
void  writeTable (const coordSet &, const List< Type > &, Ostream &) const
 Writes single-column ascii write. Column 1 is coordSet coordinate,.
void  writeTable (const coordSet &, const List< const List< Type > * > &, Ostream &os) const
 Writes multi-column ascii write. Column 1 is coordSet coordinate,.
virtual void  writeSeparator (Ostream &os) const
 Writes a separator. Used by write functions.

Constructor & Destructor Documentation

writer (  )

Construct null.

Definition at line 143 of file writer.C.

~writer (  ) [pure virtual]

Destructor.

Definition at line 150 of file writer.C.


Member Function Documentation

Foam::fileName getBaseName ( const coordSet &   points,
const wordList &   valueSets  
) const [protected]

Generates filename from coordSet and sampled fields.

Definition at line 63 of file writer.C.

References forAll, and coordSet::name().

void writeCoord ( const coordSet &   points,
const label   sampleI,
Ostream &   os  
) const [protected]
void writeTable ( const coordSet &   points,
const List< Type > &   values,
Ostream &   os  
) const [protected]

Writes single-column ascii write. Column 1 is coordSet coordinate,.

columns 2 is the value. Uses write() function to write coordinate in correct format.

Definition at line 100 of file writer.C.

References forAll, and Foam::nl.

void writeTable ( const coordSet &   points,
const List< const List< Type > * > &   valuesPtrList,
Ostream &   os  
) const [protected]

Writes multi-column ascii write. Column 1 is coordSet coordinate,.

columns 2..n are the values. Uses write() function to write coordinate in correct format.

Definition at line 118 of file writer.C.

References forAll, and Foam::nl.

void writeSeparator ( Ostream &   os  ) const [protected, virtual]

Writes a separator. Used by write functions.

Reimplemented in csvSetWriter< Type >.

Definition at line 190 of file writer.C.

TypeName ( "writer< Type >"    )

Runtime type information.

declareRunTimeSelectionTable ( autoPtr   ,
writer< Type >   ,
word   ,
()   ,
()    
)
Foam::autoPtr< Foam::writer< Type > > New ( const word &   writeFormat  ) [static]

Return a reference to the selected writer.

Definition at line 35 of file writer.C.

References Foam::exit(), Foam::FatalError, FatalErrorIn, and Foam::nl.

virtual fileName getFileName ( const coordSet &   ,
const wordList &    
) const [pure virtual]
virtual void write ( const coordSet &   ,
const wordList &   ,
const List< const Field< Type > * > &   ,
Ostream &    
) const [pure virtual]

General entry point for writing.

The data is organized in a set of point with one or more values per point

Implemented in csvSetWriter< Type >, gnuplotSetWriter< Type >, jplotSetWriter< Type >, rawSetWriter< Type >, and xmgraceSetWriter< Type >.

virtual void write ( const bool   writeTracks,
const PtrList< coordSet > &   ,
const wordList &   valueSetNames,
const List< List< Field< Type > > > &   ,
Ostream &    
) const [pure virtual]

General entry point for writing of multiple coordSets.

Each coordSet (track) has same data variables. The data is per variable, per track, per point of track. If writeTracks adds connecting lines (wherever applicable)

Implemented in csvSetWriter< Type >, gnuplotSetWriter< Type >, jplotSetWriter< Type >, rawSetWriter< Type >, and xmgraceSetWriter< Type >.

Foam::Ostream & write ( const scalar   value,
Ostream &   os  
) const [virtual]

Write scalar as ascii.

Definition at line 158 of file writer.C.

Foam::Ostream & writeVS ( const VSType &   value,
Ostream &   os  
) const

Definition at line 170 of file writer.C.

References d.

Foam::Ostream & write ( const vector &   value,
Ostream &   os  
) const [virtual]

Write vector. Tab separated ascii.

Definition at line 200 of file writer.C.

Foam::Ostream & write ( const sphericalTensor &   value,
Ostream &   os  
) const [virtual]

Write sphericalTensor. Tab separated ascii.

Definition at line 211 of file writer.C.

Foam::Ostream & write ( const symmTensor &   value,
Ostream &   os  
) const [virtual]

Write symmTensor. Tab separated ascii.

Definition at line 222 of file writer.C.

Foam::Ostream & write ( const tensor &   value,
Ostream &   os  
) const [virtual]

Write tensor. Tab separated ascii.

Definition at line 233 of file writer.C.


The documentation for this class was generated from the following files:
  • src/sampling/sampledSet/writers/writer.H
  • src/sampling/sampledSet/writers/writer.C