AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

GridFunction3.h

Go to the documentation of this file.
00001 #ifndef _included_GridFunction3_h
00002 #define _included_GridFunction3_h
00003 
00009 #include "GridData3.h"
00010 #include "GridDataBlock3.h"
00011 #include "GridHierarchyCalls.h"
00012 
00013 #ifndef GridFunctionName
00014 #define GridFunction(dim)      name2(GridFunction,dim)
00015 #define GridFunctionName
00016 #endif
00017 
00018 #include "GFIterator.h"
00019 
00030 template <class DAGH_GFType>
00031 class GridFunction(3) : public GridFunctionVoid
00032   {
00033 public:
00034    GridData(3)<DAGH_GFType>& operator()(GDIterator(3)<DAGH_GFType>& gfi) {
00035         return operator()(gfi.time(),gfi.level(),gfi.component());
00036   } 
00037 private:
00038    friend class GridHierarchy;
00039 
00041    int* length;
00046    GridDataBlock(3)<DAGH_GFType> ****gdb;
00047 
00048    /* Boundary Value - default is 0 */
00049    DAGH_GFType bvalue;
00050 
00051 #define GF_TYPE DAGH_GFType
00052 #include "GridFunctionInterface3.h"
00053 
00054    /* Initialization Function */
00055    InitFunc ifunc;
00056 
00057    /* Update Functions */
00058    UpdateFunc ufunc;
00059 
00061    BndryUpdateFunc bfunc;
00062 
00064    AdptBndryUpdateFunc abfunc;
00065 
00067    ProlongFunc pfunc;
00068 
00070    RestrictFunc rfunc;
00071 
00072    /* I/O Function */
00073    IOFunc iofunc;
00074 
00075     int myargc; 
00077    char* myargs;
00078 
00079    /*****************************************************************************/
00080    /* Disable assignments */
00081    /*****************************************************************************/
00082 private:
00083    GridFunction(3)(const GridFunction(3)<DAGH_GFType>&);
00084    const GridFunction(3)<DAGH_GFType>& operator= 
00085                         (const GridFunction(3)<DAGH_GFType>&);
00086    /*****************************************************************************/
00087 
00088    /*****************************************************************************/
00089    /* Constructors.... */
00090    /*****************************************************************************/
00091 public:   
00092    GridFunction(3)(char const name[], 
00093                    GridHierarchy &gh);
00094 
00095    /* For backward compatibility */
00096    GridFunction(3)(const char name[], 
00097                        const int t_sten, 
00098                        const int s_sten, 
00099                        GridHierarchy &gh,
00100                        const int cflag = DAGHComm,
00101                        const int extghflag = DAGHNoExternalGhost);
00102 
00103    GridFunction(3)(const char name[], 
00104                        const int t_sten, 
00105                        const int s_sten, 
00106                        const int cfac,
00107                        GridHierarchy &gh,
00108                        const int cflag = DAGHComm,
00109                        const int extghflag = DAGHNoExternalGhost);
00110 
00111    GridFunction(3)(const char name[], 
00112                        const int t_sten, 
00113                        const int s_sten, 
00114                        GridHierarchy &gh,
00115                        const int type, 
00116                        const int cflag,
00117                        const int bflag,
00118                        const int adptbflag,
00119                        const int extghflag = DAGHNoExternalGhost); 
00120 
00121    GridFunction(3)(const char name[], 
00122                        const int t_sten, 
00123                        const int* s_sten, 
00124                        GridHierarchy &gh,
00125                        const int type, 
00126                        const int cflag,
00127                        const int bflag,
00128                        const int adptbflag,
00129                        const int extghflag = DAGHNoExternalGhost);
00130 
00131    /* Add one to set the alignment when rank < dagh.rank */
00132    GridFunction(3)(const char name[], 
00133                        const int t_sten, 
00134                        const int s_sten, 
00135                        GridHierarchy &gh,
00136                        const int type, 
00137                        const int loff, 
00138                        const int cfac,
00139                        const int align, 
00140                        const int cflag,
00141                        const int bflag,
00142                        const int adptbflag,
00143                        const int extghflag);
00144 
00178    GridFunction(3)(const char name[], 
00179                        const int t_sten, 
00180                        const int* s_sten, 
00181                        GridHierarchy &gh,
00182                        const int type, 
00183                        const int loff, 
00184                        const int cfac,
00185                        const int align, 
00186                        const int cflag,
00187                        const int bflag,
00188                        const int adptbflag,
00189                        const int extghflag);
00190 
00191    GridFunction(3)(const char name[], 
00192                        const int t_sten, 
00193                        const int s_sten, 
00194                        const int time,
00195                        const int level,
00196                        GridHierarchy &gh,
00197                        const int type,
00198                        const int loff, 
00199                        const int cfac,
00200                        const int cflag,
00201                        const int bflag,
00202                        const int adptbflag,
00203                        const int extghflag = DAGHNoExternalGhost);
00204    
00206    GridFunction(3)(const char name[], 
00207                        const int t_sten, 
00208                        const int* s_sten, 
00209                        const int time,
00210                        const int level,
00211                        GridHierarchy &gh,
00212                        const int type,
00213                        const int loff, 
00214                        const int cfac,
00215                        const int cflag,
00216                        const int bflag,
00217                        const int adptbflag,
00218                        const int extghflag = DAGHNoExternalGhost);
00219    
00221    GridFunction(3)(const char name[], 
00222                        const GridFunction(3)<DAGH_GFType>& gf,
00223                        const int time,
00224                        const int level,
00225                        const int cflag,
00226                        const int bflag,
00227                        const int adptbflag,
00228                        const int extghflag = DAGHNoExternalGhost);
00229    /*****************************************************************************/
00230 
00231    /*****************************************************************************/
00232    /* Destructor */
00233    /*****************************************************************************/
00234 public:
00235    ~GridFunction(3)();
00236    /*****************************************************************************/
00237 
00238    /*****************************************************************************/
00239    /* Delete Comm Info */
00240    /*****************************************************************************/
00241 private:
00242    void GF_DeleteGDBStorage();
00243    void GF_DeleteGDBStorage(const int t);
00244    void GF_DeleteGDBStorage(const int t, const int l);
00245    void GF_DeleteGhostCommInfo();
00246    void GF_DeleteDataCommInfo();
00247    void GF_DeleteGhostBndryInfo();
00248    void GF_CreateGDBStorage(const int t);  
00249    void GF_CreateGDBStorage(const int t, const int l);  
00250    /*****************************************************************************/
00251 public:
00252    void GF_CreateStorage(const int t)  
00253      { GF_CreateGDBStorage(t + time_sten_rad); }
00254    void GF_CreateStorage(const int t, const int l)  
00255      { GF_CreateGDBStorage(t + time_sten_rad, l); }
00256    void GF_DeleteStorage(const int t) 
00257      { GF_DeleteGDBStorage(t + time_sten_rad); }
00258    void GF_DeleteStorage(const int t, const int l) 
00259      { GF_DeleteGDBStorage(t + time_sten_rad, l); }
00260 
00261    /*****************************************************************************/
00262    /* Compose & Recompose */
00263    /*****************************************************************************/
00264 private:
00265    void GF_Compose();
00266    void GF_Compose(const int T, const int L);
00267    void GF_Compose(const GridFunction(3)<DAGH_GFType>& gf, 
00268                    const int T, const int L);
00269 
00270    void GF_Recompose(int* reuse_possible, GridBoxList** ollist,
00271                      GridBoxList** rlist, GridBoxList** slist,
00272                      GridBoxList** olist); 
00273 
00274 public:
00275    /*****************************************************************************/
00276    /* For checkpointing */
00277    /*****************************************************************************/
00279    void GF_CheckpointRecompose();
00281    void GF_CheckpointRecompose(strstream& ifs);
00283    void GF_Checkpoint(ofstream& ofs);
00285    void GF_Checkpoint(strstream& ofs);
00286    int  GF_Checkpoint_StrStream_Memory();
00290    void GF_CheckpointRestart(int proc=-1); 
00292    void GF_CheckpointRestart(strstream& ifs);
00293 
00294    /*****************************************************************************/
00295 
00296    /*****************************************************************************/
00298 private:
00299    void GF_SetUpGhostCommServers();
00300    /*****************************************************************************/
00301 
00302 private:
00303    /*****************************************************************************/
00305    void GF_GatherGhostCommInfo();
00306    /*****************************************************************************/
00307 
00308    /*****************************************************************************/
00312    void GF_GatherGhostBndryInfo();
00313    /*****************************************************************************/
00314 
00315    /*****************************************************************************/
00316    /* Set Functions */
00317    /*****************************************************************************/
00318 public:
00319    inline void GF_SetInitFunc(void* initf) 
00320      { ifunc = (InitFunc) initf; }
00321    inline void GF_SetUpdateFunc(void* uf) 
00322      { ufunc = (UpdateFunc) uf; }
00323    inline void GF_SetBndryUpdateFunc(void* bf) 
00324      { bfunc = (BndryUpdateFunc) bf; }
00325    inline void GF_SetAdaptiveBndryUpdateFunc(void* abf) 
00326      { abfunc = (AdptBndryUpdateFunc) abf; }
00327    inline void GF_SetProlongFunc(void* pf) 
00328      { pfunc = (ProlongFunc) pf; }
00329    inline void GF_SetRestrictFunc(void* rf) 
00330      { rfunc = (RestrictFunc) rf; }
00331    inline void GF_SetIOFunc(void* iof) 
00332      { iofunc = (IOFunc) iof; }
00333    /*****************************************************************************/
00334 
00335    /*****************************************************************************/
00337    void GF_SetMyArgs(const int c, const char* s) {
00338      assert(c > 0);
00339      if (myargs)
00340        delete [] myargs;
00341      myargc = c;
00342      myargs = new char[myargc];
00343      for (register int i=0; i<myargc; i++)
00344        myargs[i] = s[i];
00345    }
00346 
00347    /*****************************************************************************/
00348    /* Query function status */
00349    /*****************************************************************************/
00350 public:
00351    inline int has_initfunc()
00352      { return (ifunc != (InitFunc) 0); }
00353    inline int has_updatefunc()
00354      { return (ufunc != (UpdateFunc) 0); }
00355    inline int has_bndryupdatefunc()
00356      { return (bfunc != (BndryUpdateFunc) 0); }
00357    inline int has_adaptivebndryupdatefunc()
00358      { return (abfunc != (AdptBndryUpdateFunc) 0); }
00359    inline int has_prolongfunc()
00360      { return (pfunc != (ProlongFunc) 0); }
00361    inline int has_restrictrunc() 
00362      { return (rfunc != (RestrictFunc) 0); }
00363    inline int has_iofunc() 
00364      { return (iofunc != (IOFunc) 0); }
00365    /*****************************************************************************/
00366 
00367 public:
00368    inline void GF_SetBoundaryValue(const DAGH_GFType value) 
00369      { bvalue = value; }
00370 
00371 public:
00372    /*****************************************************************************/
00374    void GF_SwapTimeLevels(const int l, const int t1, const int t2);
00375    void GF_CycleTimeLevels(const int l);
00376    /*****************************************************************************/
00377 
00378    /*****************************************************************************/
00379    /* Queries.... */
00380    /*****************************************************************************/
00381 public:
00382    inline int Length(GridBoxList* gbl) { return (gbl ? gbl->number() : 0); }
00384    inline int len(int lev) const { return (length[lev]); }
00385 
00386    inline int comm() const { return (comm_flag != DAGHNoComm); }
00387    inline int comm(const int t, const int l) const
00388         { return (comm_flag!=DAGHNoComm) &&
00389                  (comm_flag!=DAGHCommCurrentTimeOnly ||
00390                   t==dagh_timeindex(dagh.getCurrentTime(l),l)); }
00391 
00393    inline GridDataBlock(3)<DAGH_GFType>& mygdb(const int t, 
00394                                                    const int l, 
00395                                                    const int c) 
00396         { return (*gdb[dagh_timeindex(t,l)][l][c]); }
00397 
00398    inline int exists(const int t, const int l, const int c) const
00399         { return (gdb[dagh_timeindex(t,l)][l][c] != 
00400                   (GridDataBlock(3)<DAGH_GFType> *)NULL); }
00401 
00402    inline int has_parents(const int t, const int l, const int c) const
00403         { return gdb[dagh_timeindex(t,l)][l][c]->has_parents(); }
00405    inline const int& parents(const int t, const int l, const int c) const 
00406         { return gdb[dagh_timeindex(t,l)][l][c]->parents(); }
00408    inline const GDB_Interaction* parentlist(const int t, const int l, const int c) const 
00409         { return gdb[dagh_timeindex(t,l)][l][c]->parentlist(); }
00410    inline GDB_Interaction* parentlist(const int t, const int l, const int c) 
00411         { return gdb[dagh_timeindex(t,l)][l][c]->parentlist(); }
00412    inline const BBox& parentbox(const int t, const int l, const int c, const int j) const
00413         { return (gdb[dagh_timeindex(t,l)][l][c]->parentbox(j)); }
00414    inline const int& parentidx(const int t, const int l, const int c, const int j) const
00415         { return (gdb[dagh_timeindex(t,l)][l][c]->parentidx(j)); }
00416 
00417    inline int has_children(const int t, const int l, const int c) const
00418         { return gdb[dagh_timeindex(t,l)][l][c]->has_children(); }
00420    inline const int& children(const int t, const int l, const int c) const 
00421         { return gdb[dagh_timeindex(t,l)][l][c]->children(); }
00423    inline const GDB_Interaction* childlist(const int t, const int l, const int c) const 
00424         { return gdb[dagh_timeindex(t,l)][l][c]->childlist(); }
00425    inline GDB_Interaction* childlist(const int t, const int l, const int c) 
00426         { return gdb[dagh_timeindex(t,l)][l][c]->childlist(); }
00427    inline const BBox& childbox(const int t, const int l, const int c, const int j) const
00428         { return (gdb[dagh_timeindex(t,l)][l][c]->childbox(j)); }
00429    inline const int& childidx(const int t, const int l, const int c, const int j) const
00430         { return (gdb[dagh_timeindex(t,l)][l][c]->childidx(j)); }
00431    /*****************************************************************************/
00432 
00433    /*****************************************************************************/
00434    /* set/get current time */
00435    /*****************************************************************************/
00436 public:
00437    inline int GF_StepSize(const int lev) const 
00438      { return (factor()*dagh.stepsize(lev)); }
00439    inline int GF_TimeStep(const int lev) const 
00440      { return (factor()*dagh.timestep(lev)); }
00441    inline double GF_DeltaT(const int l) const
00442      { return (factor()*dagh.delta_t(l)); }
00443    inline double GF_DeltaX(const int dim, const int l) const
00444      { return (factor()*dagh.delta_x(dim,l)); }
00445 
00447    inline int GF_CurrentTime(const int lev) const
00448      { return (dagh.getCurrentTime(lev)); }
00449    inline int GF_PreviousTime(const int lev) const
00450      { return (dagh.getCurrentTime(lev) - GF_TimeStep(lev)); }
00451    inline int GF_NextTime(const int lev) const
00452      { return (dagh.getCurrentTime(lev) + GF_TimeStep(lev)); }
00453 
00454    /*****************************************************************************/
00455    /* time queries based on DAGH current time information */
00456    /*****************************************************************************/
00457 public:
00462    inline int dagh_timevalue(const int t, const int l) const
00463    { return ((t-time_sten_rad)*GF_TimeStep(l) + dagh.getCurrentTime(l)); }
00464 
00466    inline int dagh_timeindex(const int t, const int l) const
00467    { return (time_alias[((t-dagh.getCurrentTime(l))/GF_TimeStep(l)) + time_sten_rad]); }
00468    /*****************************************************************************/
00469 
00470    /*****************************************************************************/
00471    /* physical time queries based on DAGH current time information */
00472    /*****************************************************************************/
00473 public:
00474    inline void set_phystime_timeindex(const int t, const int l, const double pht)
00475    { phys_time[t*dagh.totallevels() + l] = pht; }
00477    inline void set_phystime_timevalue(const int t, const int l, const double pht)
00478    { phys_time[time_alias[((t-dagh.getCurrentTime(l))/GF_TimeStep(l)) + 
00479                          time_sten_rad]*dagh.totallevels() + l] = pht; }
00480 
00481    inline double get_phystime_timeindex(const int t, const int l) const
00482    { return (phys_time[t*dagh.totallevels() + l]); }
00484    inline double get_phystime_timevalue(const int t, const int l) const
00485    { return (phys_time[time_alias[((t-dagh.getCurrentTime(l))/GF_TimeStep(l)) + 
00486                                  time_sten_rad]*dagh.totallevels() + l]); }
00487    /*****************************************************************************/
00488 
00489    /*****************************************************************************/
00490    /* Data Updates */
00491    /*****************************************************************************/
00492 private:
00493    void GF_ReadData(const int time);
00498    void GF_ReadData(const int time, const int level);
00499    void GF_ReadData(const int time, GridData(3)<DAGH_GFType>& into);
00500    /*****************************************************************************/
00501     
00502 public:
00503    inline virtual void GF_WriteGhosts(const int time, const int level) 
00504      {  GF_WriteGhosts(time, level, DAGH_All, DAGH_Both); }
00505 
00510    virtual void GF_WriteGhosts(const int time, const int level, 
00511                                const int axis, const int dir);
00512 
00513 private:
00514    int ipow(int b, int p) 
00515      { register int tmpr = 1; while (p--) tmpr *= b; return tmpr; }
00516    void GF_PeriodicBBoxMove(BBox& from, int& idx, const int& length);
00517 public:
00518    inline virtual void GF_ReadGhosts(const int time, const int level) 
00519      {  GF_ReadGhosts(time, level, DAGH_All, DAGH_Both); }
00520 
00525    virtual void GF_ReadGhosts(const int time, const int level, 
00526                               const int axis, const int dir);
00527 
00528 public:
00530    inline void GF_BndryUpdate(const int time, const int level) { 
00531      GF_AdaptiveBndryUpdate(time,level);
00532      GF_WriteGhosts(time,level); 
00533      GF_ReadGhosts(time,level); 
00534      GF_ExternalBndryUpdate(time,level);
00535    }
00536 
00537    inline virtual void GF_Sync(const int time, const int level) { 
00538      GF_WriteGhosts(time,level); 
00539      GF_ReadGhosts(time,level); 
00540    }
00542    inline virtual void GF_Sync(const int time, const int level, 
00543                                const int axis, const int dir) { 
00544      GF_WriteGhosts(time,level,axis,dir); 
00545      GF_ReadGhosts(time,level,axis,dir); 
00546    }
00547    /*****************************************************************************/
00548 
00549    /*****************************************************************************/
00550    /* Use predefined functions */
00551    /*****************************************************************************/
00552 public:
00553    void GF_Init(const int time, const int level, char *args, const int cnt);
00554    void GF_Init(const int time, const int level, const BBox &bb, char *args, const int cnt);
00555 
00556    void GF_Update(const int time_from, const int time_to, const int level, 
00557                 char *args, const int cnt);
00558    void GF_Update(const int time_from, const int time_to, const int level, const BBox &bb,
00559                 char *args, const int cnt);
00560 
00561    void GF_Prolong(const int tf, const int lf, const int tt, const int lt,
00562                    char *args, const int cnt);
00568    void GF_Prolong(const int tf, const int lf, const int tt, const int lt, 
00569                    const BBox &bb, char *args, const int cnt);
00570 
00571    void GF_Restrict(const int tf, const int lf, const int tt, const int lt, 
00572                     char *args, const int cnt);
00579    void GF_Restrict(const int tf, const int lf, const int tt, const int lt,
00580                     const BBox &bb, char *args, const int cnt);
00581 
00582    void GF_IO(const int time, const int level, char *args, const int cnt);
00583    void GF_IO(const int time, const int level, const BBox &bb, char *args, const int cnt);
00584    /*****************************************************************************/
00585 
00586    /*****************************************************************************/
00587    /* Boundary updates */
00588    /*****************************************************************************/
00593    void GF_AdaptiveBndryUpdate(const int time, const int level);
00598    void GF_ExternalBndryUpdate(const int time, const int level); 
00599 
00600    /*****************************************************************************/
00601 
00602    /*****************************************************************************/
00603    /* Queries */
00604    /*****************************************************************************/
00605    inline const BBox& boundingbbox(const int t, const int l, const int c) const
00606         { return (gdb[dagh_timeindex(t,l)][l][c]->boundingbox()); }
00608    inline BBox boundingbbox(const int t, const int l, const int c)
00609         { return (gdb[dagh_timeindex(t,l)][l][c]->boundingbox()); }
00610 
00611    inline const BBox& interiorbbox(const int t, const int l, const int c) const
00612         { return (gdb[dagh_timeindex(t,l)][l][c]->interiorbox()); }
00614    inline BBox interiorbbox(const int t, const int l, const int c)
00615         { return (gdb[dagh_timeindex(t,l)][l][c]->interiorbox()); }
00616 
00617    inline const BBox& databbox(const int t, const int l, const int c) const
00618         { return (gdb[dagh_timeindex(t,l)][l][c]->databox()); }
00620    inline BBox databbox(const int t, const int l, const int c)
00621         { return (gdb[dagh_timeindex(t,l)][l][c]->databox()); }
00622 
00623    void boundingbboxlist(BBoxList& bbl, const int l);
00624    void intbboxlist(BBoxList& bbl, const int l);
00625    void databboxlist(BBoxList& bbl, const int l);
00626    /*****************************************************************************/
00627 
00628    /*****************************************************************************/
00629    /* Query boundary info */
00630    /*****************************************************************************/
00631    inline int has_externalboundaries(const int t, const int l, const int c) const
00632         { return (gdb[dagh_timeindex(t,l)][l][c]->has_externalboundaries()); }
00633    inline int has_externalboundary(const int t, const int l, const int c, 
00634                                    const int dir) const
00635         { return (gdb[dagh_timeindex(t,l)][l][c]->has_externalboundary(dir)); }
00636    inline int externalboundaries(const int t, const int l, const int c, 
00637                                  const int dir) const
00638         { return (gdb[dagh_timeindex(t,l)][l][c]->externalboundaries(dir)); }
00639    inline int externalboundaries(const int t, const int l, const int c, const int dir) 
00640         { return (gdb[dagh_timeindex(t,l)][l][c]->externalboundaries(dir)); }
00641    
00642    inline const BBoxList* externalbndrylist(const int t, const int l, const int c, 
00643                                             const int dir) const
00644         { return (gdb[dagh_timeindex(t,l)][l][c]->externalbndrylist(dir)); }
00645    inline BBoxList* externalbndrylist(const int t, const int l, const int c, const int dir) 
00646         { return (gdb[dagh_timeindex(t,l)][l][c]->externalbndrylist(dir)); }
00647 
00648    inline int has_adaptiveboundaries(const int t, const int l, const int c) const
00649         { return (gdb[dagh_timeindex(t,l)][l][c]->has_adaptiveboundaries()); }
00650    inline int has_adaptiveboundary(const int t, const int l, const int c, 
00651                                    const int dir) const
00652         { return (gdb[dagh_timeindex(t,l)][l][c]->has_adaptiveboundary(dir)); }
00653    inline const BBox& adaptivebndrybox(const int t, const int l, const int c, 
00654                                        const int dir) const
00655         { return (gdb[dagh_timeindex(t,l)][l][c]->adaptivebndrybox(dir)); }
00656    inline BBox adaptivebndrybox(const int t, const int l, const int c, const int dir) 
00657         { return (gdb[dagh_timeindex(t,l)][l][c]->adaptivebndrybox(dir)); }
00658    /*****************************************************************************/
00659 
00660    /*****************************************************************************/
00661    /**** Operators ****/
00662    /*****************************************************************************/
00663    inline GridData(3)<DAGH_GFType> const &operator () (const int t, 
00664                                                        const int l, const int c) const 
00665         { return (gdb[dagh_timeindex(t,l)][l][c]->griddata()); }
00666 
00668    inline GridData(3)<DAGH_GFType> &operator () (const int t, const int l, const int c) 
00669         { return (gdb[dagh_timeindex(t,l)][l][c]->griddata()); }
00670 
00671    /*********************************************************************/
00672    /* Operators */
00673    /*********************************************************************/
00674    void GF_Fill(const DAGH_GFType& val, const int time, const int level);
00675 
00676    void GF_Copy(const int t1, const int l1, 
00677                 const GridFunction(3)<DAGH_GFType>& rhs, 
00678                 const int t2, const int l2, const BBox& where);
00679    void GF_Copy(const int t1, const int l1, 
00680                 const GridFunction(3)<DAGH_GFType>& rhs, 
00681                 const int t2, const int l2);
00682 
00683    void GF_equals(const int t, const int l, const BBox& where, 
00684                   const DAGH_GFType& val);
00685    void GF_equals(const int t, const int l, 
00686                   const DAGH_GFType& val);
00687    void GF_equals(const int t1, const int l1, 
00688                   const GridFunction(3)<DAGH_GFType>& rhs, 
00689                   const int t2, const int l2, const BBox& where);
00690    void GF_equals(const int t1, const int l1, 
00691                   const GridFunction(3)<DAGH_GFType>& rhs, 
00692                   const int t2, const int l2);
00693 
00694    void GF_plus(const int t, const int l, const BBox& where, 
00695                 const DAGH_GFType& val);
00696    void GF_plus(const int t, const int l, const DAGH_GFType& val);
00697    void GF_plus(const int t1, const int l1, 
00698                 const GridFunction(3)<DAGH_GFType>& rhs, 
00699                 const int t2, const int l2, const BBox& where);
00700    void GF_plus(const int t1, const int l1, 
00701                 const GridFunction(3)<DAGH_GFType>& rhs, 
00702                 const int t2, const int l2);
00703 
00704    void GF_minus(const int t, const int l, const BBox& where, 
00705                  const DAGH_GFType& val);
00706    void GF_minus(const int t, const int l, const DAGH_GFType& val);
00707    void GF_minus(const int t1, const int l1, 
00708                  const GridFunction(3)<DAGH_GFType>& rhs, 
00709                  const int t2, const int l2, const BBox& where);
00710    void GF_minus(const int t1, const int l1, 
00711                  const GridFunction(3)<DAGH_GFType>& rhs, 
00712                  const int t2, const int l2);
00713 
00714    void GF_multiply(const int t, const int l, const BBox& where, 
00715                     const DAGH_GFType& val);
00716    void GF_multiply(const int t, const int l, const DAGH_GFType& val);
00717    void GF_multiply(const int t1, const int l1, 
00718                     const GridFunction(3)<DAGH_GFType>& rhs, 
00719                     const int t2, const int l2, const BBox& where);
00720    void GF_multiply(const int t1, const int l1, 
00721                     const GridFunction(3)<DAGH_GFType>& rhs, 
00722                     const int t2, const int l2);
00723 
00724    void GF_divide(const int t, const int l, const BBox& where, 
00725                   const DAGH_GFType& val);
00726    void GF_divide(const int t, const int l, const DAGH_GFType& val);
00727    void GF_divide(const int t1, const int l1, 
00728                   const GridFunction(3)<DAGH_GFType>& rhs, 
00729                   const int t2, const int l2, const BBox& where);
00730    void GF_divide(const int t1, const int l1,
00731                   const GridFunction(3)<DAGH_GFType>& rhs, 
00732                   const int t2, const int l2);
00733    /*********************************************************************/
00734 
00735    /*********************************************************************/
00736    /* Reduction Ops */
00737    /*********************************************************************/
00738    DAGH_GFType GF_maxval(const int t, const int l);
00739    DAGH_GFType GF_maxval(const int t, const int l, const BBox& where);
00740 
00741    DAGH_GFType GF_minval(const int t, const int l);
00742    DAGH_GFType GF_minval(const int t, const int l, const BBox& where);
00743 
00744    DAGH_GFType GF_sum(const int t, const int l);
00745    DAGH_GFType GF_sum(const int t, const int l, const BBox& where);
00746 
00747    DAGH_GFType GF_product(const int t, const int l);
00748    DAGH_GFType GF_product(const int t, const int l, const BBox& where);
00749 
00750    double GF_norm(const int t, const int l, const int param=DAGHNormL1);
00751    double GF_norm(const int t, const int l, const BBox& where, const int param=DAGHNormL1);
00752    /*********************************************************************/
00753 
00754    /*********************************************************************/
00755    /* IO Support */
00756    /*********************************************************************/
00757    void GF_Write(const int t, const int l, const int gfdtype, char* ioname=0);
00758    void GF_Write(const int t, const int l, const BBox& where, const int gfdtype, char* ioname=0);
00759 
00760    void GF_Read(const int t, const int l, const int gfdtype, char* ioname=0);
00761    void GF_Read(const int t, const int l, const BBox& where, const int gfdtype, char* ioname=0);
00762    /*********************************************************************/
00763 
00764    /*****************************************************************************/
00765    /* Some Rudimentary debugging */
00766    /*****************************************************************************/
00767    ostream& GF_DebugPrintData(ostream& os, const int t, const int l);
00768    ostream& GF_DebugPrintIntData(ostream& os, const int t, const int l);
00769    ostream& GF_DebugPrintDataBlk(ostream& os, const int time, const int level);
00770    ostream& GF_DebugPrintTheData(ostream &os);
00771 
00772    /*****************************************************************************/
00773 
00774 #if (!defined(Want_c_files) && (defined(RS6000) || defined(SPX)))
00775    friend ostream& operator<< (ostream&, const GridFunction(3)<DAGH_GFType>&);
00776 #endif
00777 
00778   };
00779 
00780 #if defined(Want_c_files) || (!defined(RS6000) && !defined(SPX))
00781   #include "GridFunction3.c"
00782 #endif
00783 
00784 #endif


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04