src/expde/grid/listint/listint1.h

Go to the documentation of this file.
00001 //    expde: expression templates for partial differential equations.
00002 //    Copyright (C) 2000  Christoph Pflaum
00003 //    This program is free software; you can redistribute it and/or modify
00004 //    it under the terms of the GNU General Public License as published by
00005 //    the Free Software Foundation; either version 2 of the License, or
00006 //    (at your option) any later version.
00007 //
00008 //    This program is distributed in the hope that it will be useful,
00009 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //    GNU General Public License for more details.
00012 
00013 // ------------------------------------------------------------
00014 // listint1.h
00015 //
00016 // ------------------------------------------------------------
00017 
00018 #define initialize_interior false
00019 
00020 
00021 class P_interior {
00022  public:
00023   P_interior(Index3D I, P_interior* Next) : ind(I), next(Next) {};
00024 
00025   // initialize
00026   void initialize(const Grid* gitter, int var_ebene);
00027 
00028   // same level
00029   // --------------
00030   // idem:
00031   double *varM(const Grid* gitter,int lev) const;
00032   // next:
00033   double *varN(const Grid* gitter, int level) const;
00034   double *varS(const Grid* gitter, int level) const;
00035   double *varW(const Grid* gitter, int level) const;
00036   double *varE(const Grid* gitter, int level) const;
00037   double *varT(const Grid* gitter, int level) const;
00038   double *varD(const Grid* gitter, int level) const;
00039   // double next:
00040   double *varND(const Grid* gitter, int level) const;
00041   double *varWN(const Grid* gitter, int level) const;
00042   double *varWT(const Grid* gitter, int level) const;
00043   double *varED(const Grid* gitter, int level) const;
00044   double *varST(const Grid* gitter, int level) const;
00045   double *varES(const Grid* gitter, int level) const;
00046   // third next:
00047   double *varEST(const Grid* gitter, int level) const;
00048   double *varWND(const Grid* gitter, int level) const;
00049 
00050   // finer level
00051   // --------------
00052   // idem:
00053   double *var_fine_M(const Grid* gitter, int level) const;
00054   // next:
00055   double *var_fine_N(const Grid* gitter, int level) const;
00056   double *var_fine_S(const Grid* gitter, int level) const;
00057   double *var_fine_W(const Grid* gitter, int level) const;
00058   double *var_fine_E(const Grid* gitter, int level) const;
00059   double *var_fine_T(const Grid* gitter, int level) const;
00060   double *var_fine_D(const Grid* gitter, int level) const;
00061   // double next:
00062   double *var_fine_ND(const Grid* gitter, int level) const;
00063   double *var_fine_WN(const Grid* gitter, int level) const;
00064   double *var_fine_WT(const Grid* gitter, int level) const;
00065   double *var_fine_ED(const Grid* gitter, int level) const;
00066   double *var_fine_ST(const Grid* gitter, int level) const;
00067   double *var_fine_ES(const Grid* gitter, int level) const;
00068   // third next:
00069   double *var_fine_EST(const Grid* gitter, int level) const;
00070   double *var_fine_WND(const Grid* gitter, int level) const;
00071 
00072   // coarse level
00073   // --------------
00074   // idem:
00075   double *var_coarse_M(const Grid* gitter, int level) const;
00076   // next:
00077   double *var_coarse_N(const Grid* gitter, int level) const;
00078   double *var_coarse_S(const Grid* gitter, int level) const;
00079   double *var_coarse_W(const Grid* gitter, int level) const;
00080   double *var_coarse_E(const Grid* gitter, int level) const;
00081   double *var_coarse_T(const Grid* gitter, int level) const;
00082   double *var_coarse_D(const Grid* gitter, int level) const;
00083   // double next:
00084   double *var_coarse_ND(const Grid* gitter, int level) const;
00085   double *var_coarse_WN(const Grid* gitter, int level) const;
00086   double *var_coarse_WT(const Grid* gitter, int level) const;
00087   double *var_coarse_ED(const Grid* gitter, int level) const;
00088   double *var_coarse_ST(const Grid* gitter, int level) const;
00089   double *var_coarse_ES(const Grid* gitter, int level) const;
00090   // third next:
00091   double *var_coarse_EST(const Grid* gitter, int level) const;
00092   double *var_coarse_WND(const Grid* gitter, int level) const;
00093 
00094   // double next special
00095   double *varWD(const Grid* gitter, int level) const;
00096   double *varET(const Grid* gitter, int level) const;
00097 
00098   // physical coordinates of the point
00099   D3vector coordinate(const Grid* gitter) const;
00100   double coordinateX(const Grid* gitter) const;
00101   double coordinateY(const Grid* gitter) const;
00102   double coordinateZ(const Grid* gitter) const;
00103 
00104   // for iteration:
00105   P_interior* Next() { return next; };
00106 
00107   // index of the point
00108   Index3D Ind() const { return ind; };
00109  private:
00110   Index3D ind;
00111   P_interior *next;
00112 };
00113 
00114 
00115 
00116 // coordinates
00117 inline D3vector P_interior::coordinate(const Grid* gitter) const {
00118   return gitter->transform_coord(ind);
00119 };
00120 inline double P_interior::coordinateX(const Grid* gitter) const {
00121   return gitter->transform_coordX(ind);
00122 };
00123 inline double P_interior::coordinateY(const Grid* gitter) const {
00124   return gitter->transform_coordY(ind);
00125 };
00126 inline double P_interior::coordinateZ(const Grid* gitter) const {
00127   return gitter->transform_coordZ(ind);
00128 };
00129 
00130 
00131 // initialize
00132 inline void P_interior::initialize(const Grid* gitter, int var_ebene) {
00133 };
00134 
00135 
00136 // same level
00137 // --------------
00138 // idem:
00139 inline double *P_interior::varM(const Grid* gitter, int lev) const {
00140   return gitter->Give_variable(ind,lev);
00141 };
00142 // next:
00143 inline double *P_interior::varN(const Grid* gitter, int level)
00144      const {
00145   return gitter->Give_variable(ind.next_NS(Rd,level),level);
00146 };
00147 inline double *P_interior::varS(const Grid* gitter, int level)
00148      const {
00149   return gitter->Give_variable(ind.next_NS(Ld,level),level);
00150 };
00151 inline double *P_interior::varE(const Grid* gitter, int level)
00152      const {
00153   return gitter->Give_variable(ind.next_EW(Rd,level),level);
00154 };
00155 inline double *P_interior::varW(const Grid* gitter, int level)
00156      const {
00157   return gitter->Give_variable(ind.next_EW(Ld,level),level);
00158 };
00159 inline double *P_interior::varT(const Grid* gitter, int level)
00160      const {
00161   return gitter->Give_variable(ind.next_TD(Rd,level),level);
00162 };
00163 inline double *P_interior::varD(const Grid* gitter, int level)
00164      const {
00165   return gitter->Give_variable(ind.next_TD(Ld,level),level);
00166 };
00167 // double next:
00168 inline double *P_interior::varND(const Grid* gitter, int level)
00169      const {
00170   return gitter->Give_variable(ind.next_NS(Rd,level).next_TD(Ld,level),
00171                                level);
00172 };
00173 inline double *P_interior::varWN(const Grid* gitter, int level)
00174      const {
00175   return gitter->Give_variable(ind.next_NS(Rd,level).next_EW(Ld,level),
00176                                level);
00177 };
00178 inline double *P_interior::varWT(const Grid* gitter, int level)
00179      const {
00180   return gitter->Give_variable(ind.next_TD(Rd,level).next_EW(Ld,level),
00181                                level);
00182 };
00183 inline double *P_interior::varED(const Grid* gitter, int level)
00184      const {
00185   return gitter->Give_variable(ind.next_TD(Ld,level).next_EW(Rd,level),
00186                                level);
00187 };
00188 inline double *P_interior::varST(const Grid* gitter, int level)
00189      const {
00190   return gitter->Give_variable(ind.next_TD(Rd,level).next_NS(Ld,level),
00191                                level);
00192 };
00193 inline double *P_interior::varES(const Grid* gitter, int level)
00194      const {
00195   return gitter->Give_variable(ind.next_EW(Rd,level).next_NS(Ld,level),
00196                                level);
00197 };
00198 
00199 // double next special:
00200 inline double *P_interior::varWD(const Grid* gitter, int level)
00201      const {
00202   return gitter->Give_variable(ind.next_WD(level),level);
00203 };
00204 inline double *P_interior::varET(const Grid* gitter, int level)
00205      const {
00206   return gitter->Give_variable(ind.next_ET(level),level);
00207 };
00208 
00209 // third next:
00210 inline double *P_interior::varEST(const Grid* gitter, int level)
00211      const {
00212   return gitter->Give_variable(
00213     ind.next_EW(Rd,level).next_NS(Ld,level).next_TD(Rd,level),level);
00214 };
00215 inline double *P_interior::varWND(const Grid* gitter, int level)
00216      const {
00217   return gitter->Give_variable(
00218     ind.next_EW(Ld,level).next_NS(Rd,level).next_TD(Ld,level),level);
00219 };
00220 
00221 
00222 
00223 // finer level
00224 // --------------
00225 // idem:
00226 inline double *P_interior::var_fine_M(const Grid* gitter, int level) const {
00227   return gitter->Give_variable(ind,level+1);
00228 };
00229 // next:
00230 inline double *P_interior::var_fine_N(const Grid* gitter, int level)
00231      const {
00232   return gitter->Give_variable(ind.next_NS(Rd,level+1),level+1);
00233 };
00234 inline double *P_interior::var_fine_S(const Grid* gitter, int level)
00235      const {
00236   return gitter->Give_variable(ind.next_NS(Ld,level+1),level+1);
00237 };
00238 inline double *P_interior::var_fine_E(const Grid* gitter, int level)
00239      const {
00240   return gitter->Give_variable(ind.next_EW(Rd,level+1),level+1);
00241 };
00242 inline double *P_interior::var_fine_W(const Grid* gitter, int level)
00243      const {
00244   return gitter->Give_variable(ind.next_EW(Ld,level+1),level+1);
00245 };
00246 inline double *P_interior::var_fine_T(const Grid* gitter, int level)
00247      const {
00248   return gitter->Give_variable(ind.next_TD(Rd,level+1),level+1);
00249 };
00250 inline double *P_interior::var_fine_D(const Grid* gitter, int level)
00251      const {
00252   return gitter->Give_variable(ind.next_TD(Ld,level+1),level+1);
00253 };
00254 // double next:
00255 inline double *P_interior::var_fine_ND(const Grid* gitter, int level)
00256      const {
00257   return gitter->Give_variable(ind.next_NS(Rd,level+1).next_TD(Ld,level+1),
00258                                level+1);
00259 };
00260 inline double *P_interior::var_fine_WN(const Grid* gitter, int level)
00261      const {
00262   return gitter->Give_variable(ind.next_NS(Rd,level+1).next_EW(Ld,level+1),
00263                                level+1);
00264 };
00265 inline double *P_interior::var_fine_WT(const Grid* gitter, int level)
00266      const {
00267   return gitter->Give_variable(ind.next_TD(Rd,level+1).next_EW(Ld,level+1),
00268                                level+1);
00269 };
00270 inline double *P_interior::var_fine_ED(const Grid* gitter, int level)
00271      const {
00272   return gitter->Give_variable(ind.next_TD(Ld,level+1).next_EW(Rd,level+1),
00273                                level+1);
00274 };
00275 inline double *P_interior::var_fine_ST(const Grid* gitter, int level)
00276      const {
00277   return gitter->Give_variable(ind.next_TD(Rd,level+1).next_NS(Ld,level+1),
00278                                level+1);
00279 };
00280 inline double *P_interior::var_fine_ES(const Grid* gitter, int level)
00281      const {
00282   return gitter->Give_variable(ind.next_EW(Rd,level+1).next_NS(Ld,level+1),
00283                                level+1);
00284 };
00285 // third next:
00286 inline double *P_interior::var_fine_EST(const Grid* gitter, int level)
00287      const {
00288   return gitter->Give_variable(
00289     ind.next_EW(Rd,level+1).next_NS(Ld,level+1).next_TD(Rd,level+1),level+1);
00290 };
00291 inline double *P_interior::var_fine_WND(const Grid* gitter, int level)
00292      const {
00293   return gitter->Give_variable(
00294     ind.next_EW(Ld,level+1).next_NS(Rd,level+1).next_TD(Ld,level+1),level+1);
00295 };
00296 
00297 // Coarse level
00298 // --------------
00299 // idem:
00300 inline double *P_interior::var_coarse_M(const Grid* gitter, int level) const {
00301   return gitter->Give_variable(ind,level-1);
00302 };
00303 // next:
00304 inline double *P_interior::var_coarse_N(const Grid* gitter, int level)
00305      const {
00306   return gitter->Give_variable(ind.next_NS(Rd,level),level-1);
00307 };
00308 inline double *P_interior::var_coarse_S(const Grid* gitter, int level)
00309      const {
00310   return gitter->Give_variable(ind.next_NS(Ld,level),level-1);
00311 };
00312 inline double *P_interior::var_coarse_E(const Grid* gitter, int level)
00313      const {
00314   return gitter->Give_variable(ind.next_EW(Rd,level),level-1);
00315 };
00316 inline double *P_interior::var_coarse_W(const Grid* gitter, int level)
00317      const {
00318   return gitter->Give_variable(ind.next_EW(Ld,level),level-1);
00319 };
00320 inline double *P_interior::var_coarse_T(const Grid* gitter, int level)
00321      const {
00322   return gitter->Give_variable(ind.next_TD(Rd,level),level-1);
00323 };
00324 inline double *P_interior::var_coarse_D(const Grid* gitter, int level)
00325      const {
00326   return gitter->Give_variable(ind.next_TD(Ld,level),level-1);
00327 };
00328 // double next:
00329 inline double *P_interior::var_coarse_ND(const Grid* gitter, int level)
00330      const {
00331   return gitter->Give_variable(ind.next_ND(level),level-1);
00332 };
00333 inline double *P_interior::var_coarse_WN(const Grid* gitter, int level)
00334      const {
00335   return gitter->Give_variable(ind.next_WN(level),level-1);
00336 };
00337 inline double *P_interior::var_coarse_WT(const Grid* gitter, int level)
00338      const {
00339   return gitter->Give_variable(ind.next_WT(level),level-1);
00340 };
00341 inline double *P_interior::var_coarse_ED(const Grid* gitter, int level)
00342      const {
00343   return gitter->Give_variable(ind.next_ED(level),level-1);
00344 };
00345 inline double *P_interior::var_coarse_ST(const Grid* gitter, int level)
00346      const {
00347   return gitter->Give_variable(ind.next_ST(level),level-1);
00348 };
00349 inline double *P_interior::var_coarse_ES(const Grid* gitter, int level)
00350      const {
00351   return gitter->Give_variable(ind.next_ES(level),level-1);
00352 };
00353 // third next:
00354 inline double *P_interior::var_coarse_EST(const Grid* gitter, int level)
00355      const {
00356   return gitter->Give_variable(ind.next_EST(level),level-1);
00357 };
00358 inline double *P_interior::var_coarse_WND(const Grid* gitter, int level)
00359      const {
00360   return gitter->Give_variable(ind.next_WND(level),level-1);
00361 };

Generated on Mon Jan 16 13:23:41 2006 for IPPL by  doxygen 1.4.6