00001
00002
00003
00004
00005
00006 #ifndef SCHEME_GFM_FILEOUTPUT_H
00007 #define SCHEME_GFM_FILEOUTPUT_H
00008
00016 #include "GFMFileOutput.h"
00017
00024 template <class SchemeType, class FixupType, class FlagType, int dim>
00025 class SchemeGFMFileOutput : public SchemeOutBase<SchemeType,dim>,
00026 public GFMFileOutput<typename SchemeType::VectorType,FixupType,FlagType,dim> {
00027 typedef typename SchemeType::VectorType VectorType;
00028 typedef typename VectorType::InternalDataType DataType;
00029 typedef GFMFileOutput<VectorType,FixupType,FlagType,dim> base;
00030 typedef SchemeOutBase<SchemeType,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
00037 SchemeGFMFileOutput(gfm_solver_type& solver, SchemeType &lbm) : out_base(lbm), base(solver) {}
00038
00039 virtual ~SchemeGFMFileOutput() {}
00040
00041 virtual void WriteOut(vec_grid_fct_type& u, grid_fct_type& IOfunc) {
00042 for (int cnt=1; cnt<=base::Ncnt(); cnt++) {
00043 if (base::CompName[cnt-1].c_str()[0] == '-')
00044 continue;
00045 for (int lev=0; lev<=FineLevel(base::GH()); lev++) {
00046 int Time = CurrentTime(base::GH(),lev);
00047 double t = GetPhysicalTime(u,Time,lev);
00048 this->Transform(u,IOfunc,Time,lev,cnt,t);
00049 base::WriteOut(IOfunc,base::CompName[cnt-1].c_str(),Time,lev,t);
00050 }
00051 #ifndef DAGH_NO_MPI
00052 MPI_Barrier(comm_service::comm());
00053 #endif
00054 }
00055 }
00056
00057 virtual void WriteOut(grid_fct_type& IOfunc, const char* name)
00058 { base::WriteOut(IOfunc,name); }
00059
00060 virtual void WriteOut(grid_fct_type& IOfunc, const char* name,
00061 const int& Time, const int& Level, const double& t)
00062 { base::WriteOut(IOfunc,name,Time,Level,t); }
00063
00064 virtual void WriteOut(grid_data_type& IOdata, const char* name,
00065 const int& Time, const int& Level, const double& t) {
00066 base::WriteOut(IOdata,name,Time,Level,t);
00067 }
00068 };
00069
00070 #endif