![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __OPEN_DX_FILE_H 00005 #define __OPEN_DX_FILE_H 00006 00007 #include <string> 00008 #include <stdio.h> 00009 #include <dolfin/constants.h> 00010 #include <dolfin/Event.h> 00011 #include <dolfin/NewArray.h> 00012 #include <dolfin/GenericFile.h> 00013 00014 namespace dolfin { 00015 00016 class Mesh; 00017 class Function; 00018 00019 class OpenDXFile : public GenericFile { 00020 public: 00021 00022 OpenDXFile(const std::string filename); 00023 ~OpenDXFile(); 00024 00025 // Input 00026 00027 // Output 00028 00029 void operator<< (Mesh& mesh); 00030 void operator<< (Function& u); 00031 00032 private: 00033 00034 void writeHeader (FILE* fp); 00035 void writeMesh (FILE* fp, Mesh& mesh); 00036 void writeMeshData (FILE* fp, Mesh& mesh); 00037 void writeFunction (FILE* fp, Function& u); 00038 void writeSeries (FILE* fp, Function& u); 00039 00040 void removeSeries (FILE* fp); 00041 00042 // Data for each frame 00043 class Frame { 00044 public: 00045 00046 Frame(real time); 00047 ~Frame(); 00048 00049 real time; 00050 00051 }; 00052 00053 // Frame data 00054 NewArray<Frame> frames; 00055 00056 // Start position for latest time series 00057 long series_pos; 00058 00059 // Check if we should save each mesh 00060 bool save_each_mesh; 00061 00062 // Events 00063 Event event_saving_mesh; 00064 Event event_saving_function; 00065 00066 }; 00067 00068 } 00069 00070 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.