Sundance::FieldWriter Class Reference

FieldWriter is the user level object for writing fields and meshes to output stream. More...

Inheritance diagram for Sundance::FieldWriter:

Playa::Handle< FieldWriterBase >

List of all members.

Public Member Functions

 FieldWriter ()
 Empty ctor.
 FieldWriter (Handleable< FieldWriterBase > *rawPtr)
 Construct a FieldWriter with a raw pointer to a FieldWriterBase.
 FieldWriter (const RefCountPtr< FieldWriterBase > &smartPtr)
 Construct a FieldWriter with a smart pointer to a FieldWriterBase.
void addMesh (const Mesh &mesh) const
 add a mesh to the list of things to be written
void addField (const std::string &name, const Playa::Handle< FieldBase > &field)
 add a field, tagging it with the given std::string as a name
void setUndefinedValue (const double &x)
 set the numerical value to be written at cells on which a field is undefined.
void impersonateParallelProc (int nProc, int rank)
 Tell the writer to pretend that it is running as one of nProc processes with the given rank.
void write () const
 write to stream


Detailed Description

FieldWriter is the user level object for writing fields and meshes to output stream.

Example:

Write fields u0 and w0 to a VTK file "results.vtu"

 FieldWriter vtkWriter = new VTKWriter("results");
 vtkWriter.addField(u0);
 vtkWriter.addField(w0);
 vtkWriter.write();

Example:

Write verbose mesh information to cout

 FieldWriter writer = new VerboseFieldWriter();
 writer.addMesh(mesh);
 writer.write();

Definition at line 59 of file SundanceFieldWriter.hpp.


Constructor & Destructor Documentation

Sundance::FieldWriter::FieldWriter (  )  [inline]

Empty ctor.

Definition at line 63 of file SundanceFieldWriter.hpp.

Sundance::FieldWriter::FieldWriter ( Handleable< FieldWriterBase > *  rawPtr  )  [inline]

Construct a FieldWriter with a raw pointer to a FieldWriterBase.

Definition at line 63 of file SundanceFieldWriter.hpp.

Sundance::FieldWriter::FieldWriter ( const RefCountPtr< FieldWriterBase > &  smartPtr  )  [inline]

Construct a FieldWriter with a smart pointer to a FieldWriterBase.

Definition at line 63 of file SundanceFieldWriter.hpp.


Member Function Documentation

void FieldWriter::addField ( const std::string &  name,
const Playa::Handle< FieldBase > &  field 
)

void FieldWriter::addMesh ( const Mesh mesh  )  const

void Sundance::FieldWriter::impersonateParallelProc ( int  nProc,
int  rank 
) [inline]

Tell the writer to pretend that it is running as one of nProc processes with the given rank.

This is used when partitioning meshes in serial.

Definition at line 80 of file SundanceFieldWriter.hpp.

References Playa::Handle< FieldWriterBase >::ptr().

Referenced by Sundance::serialPartition().

void FieldWriter::setUndefinedValue ( const double &  x  ) 

set the numerical value to be written at cells on which a field is undefined.

Default value is 0.0.

Definition at line 62 of file SundanceFieldWriter.cpp.

References Playa::Handle< FieldWriterBase >::ptr().

void FieldWriter::write (  )  const

Site Contact