src/expde/grid/listnb/listnb1.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 // listnb1.h
00015 //
00016 // ------------------------------------------------------------
00017 
00018 #define initialize_nearb false
00019 
00020 // near boundary points
00021 class P_nearb {
00022  public:
00023   P_nearb(Index3D I, P_nearb* Next) : ind(I), next(Next) {};
00024 
00025   // initialize
00026   void initialize(const Grid* gitter, int level);
00027 
00028   // idem
00029   double *varM(const Grid* gitter,int level) const;
00030   double *varP_slow(const Grid* gitter,int var_ebene, Ort1D i,Ort1D j,Ort1D k,
00031                     int level) const;
00032 
00033   // next:
00034   double *varN(const Grid* gitter, int level) const;
00035   double *varS(const Grid* gitter, int level) const;
00036   double *varW(const Grid* gitter, int level) const;
00037   double *varE(const Grid* gitter, int level) const;
00038   double *varT(const Grid* gitter, int level) const;
00039   double *varD(const Grid* gitter, int level) const;
00040   // double next:
00041   double *varND(const Grid* gitter, int level) const;
00042   double *varWN(const Grid* gitter, int level) const;
00043   double *varWT(const Grid* gitter, int level) const;
00044   double *varED(const Grid* gitter, int level) const;
00045   double *varST(const Grid* gitter, int level) const;
00046   double *varES(const Grid* gitter, int level) const;
00047   // third next:
00048   double *varEST(const Grid* gitter, int level) const;
00049   double *varWND(const Grid* gitter, int level) const;
00050 
00051   // double next special
00052   double *varWD(const Grid* gitter, int level) const;
00053   double *varET(const Grid* gitter, int level) const;
00054 
00055   // informations about the neighbour cells:
00056   Celltype  Give_cell_typ(const Grid* grid, dir_sons i, int l) const;
00057   BoCeData* Give_Bo_cell( const Grid* grid, dir_sons i, int l) const;
00058 
00059   // physical coordinates
00060   D3vector coordinate(const Grid* gitter) const;
00061   double coordinateX(const Grid* gitter) const;
00062   double coordinateY(const Grid* gitter) const;
00063   double coordinateZ(const Grid* gitter) const;
00064 
00065   // for iteration:
00066   P_nearb* Next() const { return next; };
00067 
00068   // index of point
00069   Index3D Ind() const { return ind; };
00070 
00071   // for MG
00072   void Set_first_mg_coeff_nearb(Point_mg_coeff_nearb* first) {
00073     cout << "Error: mg coefficients are not allowed in listnbi with i<4" 
00074          << endl;
00075   }
00076   void Set_first_mg_coeff_bo(   Point_mg_coeff_bo*    first) {
00077     cout << "Error: mg coefficients are not allowed in listnbi with i<4" 
00078          << endl;
00079   }
00080   Point_mg_coeff_nearb* Give_first_mg_coeff_nearb() const {
00081     cout << "Error: mg coefficients are not allowed in listnbi with i<4" 
00082          << endl;
00083     return NULL;
00084   }
00085   Point_mg_coeff_bo* Give_first_mg_coeff_bo() const {
00086     cout << "Error: mg coefficients are not allowed in listnbi with i<4" 
00087          << endl;
00088     return NULL;
00089   }
00090  private:
00091   Index3D ind;
00092   P_nearb *next;
00093 };
00094 
00095 
00096 inline void P_nearb::initialize(const Grid* gitter, int level) {
00097 
00098 }
00099 
00100 
00101 
00102 // coordinate
00103 inline D3vector P_nearb::coordinate(const Grid* gitter) const {
00104   return gitter->transform_coord(ind);
00105 };
00106 inline double P_nearb::coordinateX(const Grid* gitter) const {
00107   return gitter->transform_coordX(ind);
00108 };
00109 inline double P_nearb::coordinateY(const Grid* gitter) const {
00110   return gitter->transform_coordY(ind);
00111 };
00112 inline double P_nearb::coordinateZ(const Grid* gitter) const {
00113   return gitter->transform_coordZ(ind);
00114 };
00115 
00116 
00117 
00118 
00119 // next:
00120 inline double *P_nearb::varN(const Grid* gitter, int level)
00121      const {
00122   return gitter->Give_variable(ind.next_NS(Rd,level),level);
00123 };
00124 inline double *P_nearb::varS(const Grid* gitter, int level)
00125      const {
00126   return gitter->Give_variable(ind.next_NS(Ld,level),level);
00127 };
00128 inline double *P_nearb::varE(const Grid* gitter, int level)
00129      const {
00130   return gitter->Give_variable(ind.next_EW(Rd,level),level);
00131 };
00132 inline double *P_nearb::varW(const Grid* gitter, int level)
00133      const {
00134   return gitter->Give_variable(ind.next_EW(Ld,level),level);
00135 };
00136 inline double *P_nearb::varT(const Grid* gitter, int level)
00137      const {
00138   return gitter->Give_variable(ind.next_TD(Rd,level),level);
00139 };
00140 inline double *P_nearb::varD(const Grid* gitter, int level)
00141      const {
00142   return gitter->Give_variable(ind.next_TD(Ld,level),level);
00143 };
00144 // double next:
00145 inline double *P_nearb::varND(const Grid* gitter, int level)
00146      const {
00147   return gitter->Give_variable(ind.next_NS(Rd,level).next_TD(Ld,level),level);
00148 };
00149 inline double *P_nearb::varWN(const Grid* gitter, int level)
00150      const {
00151   return gitter->Give_variable(ind.next_NS(Rd,level).next_EW(Ld,level),
00152                                level);
00153 };
00154 inline double *P_nearb::varWT(const Grid* gitter, int level)
00155      const {
00156   return gitter->Give_variable(ind.next_TD(Rd,level).next_EW(Ld,level),
00157                                level);
00158 };
00159 inline double *P_nearb::varED(const Grid* gitter, int level)
00160      const {
00161   return gitter->Give_variable(ind.next_TD(Ld,level).next_EW(Rd,level),
00162                                level);
00163 };
00164 inline double *P_nearb::varST(const Grid* gitter, int level)
00165      const {
00166   return gitter->Give_variable(ind.next_TD(Rd,level).next_NS(Ld,level),
00167                                level);
00168 };
00169 inline double *P_nearb::varES(const Grid* gitter, int level)
00170      const {
00171   return gitter->Give_variable(ind.next_EW(Rd,level).next_NS(Ld,level),
00172                                level);
00173 };
00174 // third next
00175 inline double *P_nearb::varEST(const Grid* gitter, int level)
00176      const {
00177   return gitter->Give_variable(
00178     ind.next_EW(Rd,level).next_NS(Ld,level).next_TD(Rd,level),level);
00179 };
00180 inline double *P_nearb::varWND(const Grid* gitter, int level)
00181      const {
00182   return gitter->Give_variable(
00183     ind.next_EW(Ld,level).next_NS(Rd,level).next_TD(Ld,level),level);
00184 };
00185 
00186 // double next special:
00187 inline double *P_nearb::varWD(const Grid* gitter, int level)
00188      const {
00189   return gitter->Give_variable(ind.next_WD(level),level);
00190 };
00191 inline double *P_nearb::varET(const Grid* gitter, int level)
00192      const {
00193   return gitter->Give_variable(ind.next_ET(level),level);
00194 };
00195 
00197 
00198 // idem
00199 inline double *P_nearb::varM(const Grid* gitter, int var_ebene) const {
00200   return gitter->Give_variable(ind,var_ebene);
00201 };
00202 
00203 inline double *P_nearb::varP_slow(const Grid* gitter,int var_ebene,
00204                              Ort1D i, Ort1D j, Ort1D k, int level) const {
00205   return gitter->Give_variable_slow(ind.next(i,j,k,level),var_ebene);
00206 };
00207 
00208 // informations about the neighbour cells:
00209 inline Celltype  P_nearb::Give_cell_typ(const Grid* grid, dir_sons i, int l)
00210      const {
00211   return grid->Give_cell_typ(ind.next((dir_sons)i,l+1));
00212 };
00213 inline BoCeData* P_nearb::Give_Bo_cell(const Grid* grid, dir_sons i, int l)
00214      const {
00215   return grid->Give_Bo_cell(ind.next((dir_sons)i,l+1));
00216 };
00217 

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