00001 #ifndef __IWAVE_M_TUPLE
00002 #define __IWAVE_M_TUPLE
00003
00004 #include "std_cpp_includes.hh"
00005 #include "utils.h"
00006 #include "except.hh"
00007 #include "write.hh"
00008 #include "model.h"
00009
00010
00011 #define ACTIVE_LINEAR 2
00012 #define ACTIVE_NONLINEAR 1
00013
00018 using RVL::RVLException;
00019
00020 size_t pow2(int);
00021
00022
00023 #define IWAVEMAXDATA 256
00024
00025
00026 class IWaveInfo;
00027
00056 typedef void (*FD_TIMESTEP)(std::vector<RDOM *> dom, bool fwd, int iv, void* fdpars);
00057
00087
00088
00089
00090
00091
00092
00093
00094
00095 typedef int (*FD_MODELINIT)(PARARRAY pars,
00096 FILE * stream,
00097 IMODEL & model);
00098
00100 typedef void (*FD_MODELDEST)(void ** specs);
00101
00102
00123 typedef int (*FD_TIMEGRID)(PARARRAY * pars,
00124 FILE * stream,
00125 grid const & g,
00126 ireal & dt,
00127 ireal & rhs);
00128
00159 typedef int (*FD_STENCIL)(void * specs,
00160 FILE * stream,
00161 int ndim,
00162 IPNT gtype[RDOM_MAX_NARR],
00163 STENCIL * sten);
00164
00179 typedef void (*FD_CHECK)(RDOM * dom,
00180 void * specs,
00181 FILE * stream);
00182
00192 typedef void (*FD_LOOPDEF)(int const * gmin,
00193 int const * gmax,
00194 float tmax,
00195 int input,
00196 FILE * stream,
00197 void * specs);
00198
00199
00200
00201
00202
00203
00204
00205 typedef struct s_field {
00206 std::string field;
00207 int dynamic;
00208 int substep;
00209 IPNT gtype;
00210 } FIELD;
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 typedef struct s_iokeys {
00230 std::string keyword;
00231 int rarrindex;
00232 int input;
00233 int active;
00234 } IOKEY;
00235
00238 class IWaveInfo {
00239 public:
00243 static std::string iwave_model;
00244 static FIELD iwave_fields[];
00245 static IOKEY iwave_iokeys[];
00246 static FD_MODELINIT minit;
00247 static FD_MODELDEST mdest;
00248 static FD_TIMESTEP timestep;
00249 static FD_TIMEGRID timegrid;
00250 static FD_STENCIL createstencil;
00251 static FD_CHECK check;
00252 static FD_LOOPDEF loopdef;
00253
00254
00255
00256 std::string get_iwave_model() const { return this->iwave_model; }
00257 IOKEY * get_iwave_iokeys() const { return &(this->iwave_iokeys[0]); }
00258 FIELD * get_iwave_fields() const { return &(this->iwave_fields[0]); }
00259 FD_MODELINIT get_minit() const { return this->minit; }
00260 FD_MODELDEST get_mdest() const { return this->mdest; }
00261 FD_TIMEGRID get_timegrid() const { return this->timegrid; }
00262 FD_TIMESTEP get_timestep() const { return this->timestep; }
00263 FD_STENCIL get_stencil() const { return this->createstencil;}
00264 FD_CHECK get_check() const { return this->check; }
00265 FD_LOOPDEF get_loopdef() const { return this->loopdef; }
00266
00267 int get_num_fields() const;
00268 int get_num_iokeys() const;
00269
00270
00271
00272 int get_property_iokeys(const std::string keyword,
00273 const std::string property) const;
00274
00275 ostream & write_iwave_fields(ostream & str) const;
00276 ostream & write_iwave_iokeys(ostream & str) const;
00277 };
00278
00279 namespace TSOpt {
00280
00281 using RVL::RVLException;
00282 using RVL::Writeable;
00283
00284
00285
00286
00287
00288 typedef struct s_task_reln {
00289 int iwaveindex;
00290 std::string keyword;
00291 int rarrindex;
00292 bool input;
00293 } TASK_RELN;
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307 void IOTask(std::vector<TASK_RELN *> & tr, int order, bool fwd, IWaveInfo const & ic);
00308
00309 void IOTaskWriter(std::vector<TASK_RELN *> const & tr, ostream & str);
00310
00311 }
00312
00313 #endif