00001 #ifndef VTKWRITER_H
00002 #define VTKWRITER_H
00003
00004 #include "SundanceDefs.h"
00005 #include "FieldWriterBase.h"
00006 #include "TSFSmartPtr.h"
00007 #include <fstream>
00008
00009 namespace Sundance
00010 {
00011
00012 using namespace TSF;
00013 using std::string;
00014 using std::ostream;
00015
00016
00017 class VTKWriter : public FieldWriterBase
00018 {
00019 public:
00020
00021 VTKWriter(const string& filename);
00022
00023 virtual ~VTKWriter(){;}
00024
00025
00026 virtual void writeField(const string& name, const Expr& expr) const ;
00027
00028
00029 virtual void writeMesh(const Mesh& mesh) const ;
00030
00031
00032 virtual void writeCommentLine(const string& line) const ;
00033 private:
00034
00035
00036 mutable TSFSmartPtr<ostream> os_;
00037 mutable bool meshHasBeenWritten_;
00038 };
00039 }
00040
00041 #endif