00001
00002
00003
00004
00005
00006 #ifndef AMROC_F77_GFM_FILEOUTPUT_H
00007 #define AMROC_F77_GFM_FILEOUTPUT_H
00008
00016 #include "F77Interfaces/F77FileOutput.h"
00017 #include "GFMFileOutput.h"
00018
00026 template <class VectorType, class FixupType, class FlagType, int dim>
00027 class F77GFMFileOutput : public F77OutBase<VectorType,dim>,
00028 public GFMFileOutput<VectorType,FixupType,FlagType,dim> {
00029 typedef GFMFileOutput<VectorType,FixupType,FlagType,dim> base;
00030 typedef F77OutBase<VectorType,dim> out_base;
00031 public:
00032 typedef typename base::vec_grid_fct_type vec_grid_fct_type;
00033 typedef typename base::grid_fct_type grid_fct_type;
00034 typedef typename base::grid_data_type grid_data_type;
00035 typedef typename base::gfm_solver_type gfm_solver_type;
00036 typedef typename out_base::generic_func_type generic_func_type;
00037
00038 F77GFMFileOutput(gfm_solver_type& solver, generic_func_type out) : out_base(out), base(solver) {}
00039
00040 virtual ~F77GFMFileOutput() {}
00041
00042 virtual void WriteOut(vec_grid_fct_type& u, grid_fct_type& IOfunc) {
00043 if (!out_base::f_out) return;
00044 for (int cnt=1; cnt<=base::Ncnt(); cnt++) {
00045 if (base::CompName[cnt-1].c_str()[0] == '-')
00046 continue;
00047 for (int lev=0; lev<=FineLevel(base::GH()); lev++) {
00048 int Time = CurrentTime(base::GH(),lev);
00049 double t = GetPhysicalTime(u,Time,lev);
00050 this->Transform(u,IOfunc,Time,lev,cnt,t);
00051 base::WriteOut(IOfunc,base::CompName[cnt-1].c_str(),Time,lev,t);
00052 }
00053 #ifndef DAGH_NO_MPI
00054 MPI_Barrier(comm_service::comm());
00055 #endif
00056 }
00057 }
00058
00059 virtual void WriteOut(grid_fct_type& IOfunc, const char* name)
00060 { base::WriteOut(IOfunc,name); }
00061
00062 virtual void WriteOut(grid_fct_type& IOfunc, const char* name,
00063 const int& Time, const int& Level, const double& t)
00064 { base::WriteOut(IOfunc,name,Time,Level,t); }
00065
00066 virtual void WriteOut(grid_data_type& IOdata, const char* name,
00067 const int& Time, const int& Level, const double& t) {
00068 base::WriteOut(IOdata,name,Time,Level,t);
00069 }
00070 };
00071
00072 #endif