monitor.h

Go to the documentation of this file.
00001 #ifndef __monitor_h
00002 #define __monitor_h
00003 
00004 #include  <vector>
00005 #include  <iostream>
00006 
00007 #include  "cginfo.h"
00008 #include  "nlinfo.h"
00009 #include  "paramfile.h"
00010 #include  "gascoigne.h"
00011 #include  <string>
00012 
00013 
00014 /*******************************************************************/
00015 
00016 namespace Gascoigne
00017 {
00018 class Monitor
00019 {
00020   int    prec;
00021   int    m_length[10], m_counter;
00022   int    ps, _newmatrix;
00023 
00024  protected:
00025 
00026   std::vector<std::string>  header;
00027   std::string          format;
00028 
00029   std::string directory;
00030 
00031   std::string protokoll, aos, bos;
00032   std::string texfile, numfile;
00033 
00034   void  error_io(const std::string&) const;
00035   void  matrix_info(int);
00036   void  print_message ();
00037 
00038   void  PrintAscii (std::ostream& os, const std::string&) const;
00039   void  PrintAscii (std::ostream& os, int    i) const {os <<i;} 
00040   void  PrintAscii (std::ostream& os, double d) const {os.precision(prec);os <<d;} 
00041   void  PrintAscii (std::ostream& os, const IntVector&) const;
00042   void  PrintAscii (std::ostream& os, const DoubleVector&) const;
00043   void  PrintHeader(std::ostream& os) const;
00044 
00045  public:
00046 
00047   int     control;
00048   char    message[400];
00049 
00050   Monitor();
00051 
00052   void SetAos(const std::string& s) {aos=s;}
00053   void SetBos(const std::string& s) {bos=s;}
00054 
00055   std::string&  aim_of_simulation()   { return aos;}
00056   int   set_print_step   (int i) { return ps = i;}
00057 
00058   void set_directory(const std::string& dir);
00059 
00060   void  failed_step   ();
00061   void  pre_monitor   (char*);
00062   void  post_monitor  ();
00063   void  init          (const ParamFile* pf, int);
00064   void  mesh          (int,int);
00065   void  pre_nonlinear (int);
00066   void  post_nonlinear(const DoubleVector&, double, int,int,int);
00067   void  nonlinear_step(const CGInfo&, const NLInfo&);
00068   int&  new_matrix()  { return _newmatrix;};
00069 
00070   
00071   void  Print          (const std::string& s, std::string se="\n") const;
00072 
00073   void precision(int n) {prec=n;}
00074 
00075   void  PrintResults   (const std::string& s="\n") const;
00076   void  PrintResults   (double) const;
00077   void  PrintResults   (int) const;
00078   void  PrintResults   (const IntVector& iv) const;
00079   void  PrintResults   (const DoubleVector& dv) const;
00080 
00081   void PrintInfoSummary(const NLInfo& nlinfo) const;
00082   void PrintInfoSummary(const CGInfo& nlinfo) const;
00083 };
00084 }
00085 
00086 /*******************************************************************/
00087 
00088 #endif

Generated on Thu Sep 14 10:34:38 2006 for Gascoigne by  doxygen 1.4.7