Main Page | User's guide | Class Hierarchy | Class List | File List | Class Members

baseclass.hxx

00001 // Copyright (C) 2002-2004 Vivien Mallet
00002 //
00003 // This file is part of Multivac library.
00004 // Multivac library provides front-tracking algorithms.
00005 // 
00006 // Multivac is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 2 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // Multivac is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License (file "license") for more details.
00015 //
00016 // For more information, please see the Multivac home page:
00017 //     http://spacetown.free.fr/fronts/
00018 
00019 
00020 #ifndef FILE_SAVER_BASECLASS_HXX
00021 
00022 
00023 #include "../errors.cxx"
00024 #include <stdio.h>
00025 #include <string>
00026 #include <fstream>
00027 
00028 
00029 namespace Multivac
00030 {
00031 
00032 
00034   // CSAVER //
00036 
00038 
00043   template <class T>
00044   class CSaver
00045   {
00046 
00047     /**************
00048      * ATTRIBUTES *
00049      **************/
00050 
00051   protected:
00053     string TimeFile;
00054 
00057     string CurvesFile;
00059     string CurveLengthsFile;
00061     string PhiFile;
00063     string FFile;
00064 
00066     string XFile;
00068     string YFile;
00070     string PointsFile;
00072     string EdgesFile;
00074     string TrianglesFile;
00075 
00078     int Period;
00080     int LastSaved;
00081 
00082 
00083     /*****************************
00084      * CONSTRUCTORS & DESTRUCTOR *
00085      *****************************/
00086 
00087   public:
00088 
00089     CSaver()  throw();
00090     CSaver(string TimeFileName,
00091            string CurvesFileName, string CurveLengthsName,
00092            string PhiFileName, string FFileName, string XFileName,
00093            string YFileName, string PointsFileName, string EdgesFileName,
00094            string TrianglesFileName, int Period_);
00095 
00096     virtual ~CSaver()  throw();
00097 
00098 
00099     /***********
00100      * METHODS *
00101      ***********/
00102 
00103   public:
00104   
00105     virtual void SaveAtTheBeginning(CMesh<T>& Mesh,
00106                                     CSpeedFunction<T>& F,
00107                                     CLevelSet<T>& Phi,
00108                                     CInitializer<T>& Initializer) = 0;
00109     virtual void SaveAtCurrentIteration(CMesh<T>& Mesh,
00110                                         CSpeedFunction<T>& F,
00111                                         CLevelSet<T>& Phi,
00112                                         T time, int iter,
00113                                         CInitializer<T>& Initializer) = 0;
00114     virtual void SaveAtTheEnd(CMesh<T>& Mesh, CSpeedFunction<T>& F,
00115                               CLevelSet<T>& Phi, Vector<T>& time,
00116                               int iter, CInitializer<T>& Initializer) = 0;
00117 
00118   private:
00119     void CheckAndInit(string FileName);
00120 
00121   };  // CSaver.
00122 
00123 }  // namespace Multivac.
00124 
00125 
00126 #define FILE_SAVER_BASECLASS_HXX
00127 #endif

Generated on Mon Apr 19 01:59:14 2004 for Multivac by doxygen 1.3.6-20040222