src/expde/grid/listbo/listbo1.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 // listbo1.h
00015 //
00016 // ------------------------------------------------------------
00017 
00018 
00019 #define initialize_bo true
00020 
00021 // boundary points
00022 class P_Bo2p {
00023  public:
00024   P_Bo2p(Index3D I, dir_3D d, P_Bo2p* Next) : 
00025     ind(I), direction(d), next(Next) {};
00026 
00027   // initialize
00028   void initialize(const Grid* gitter, int level);
00029 
00030   // idem
00031   double *varM(const Grid* gitter) const;
00032   double *varP_slow(const Grid* gitter, int ebene, Ort1D i,Ort1D j,Ort1D k,
00033                     int level) const;
00034 
00035 
00036   // physical coordinates
00037   D3vector coordinate(const Grid* gitter) const;
00038   double coordinateX(const Grid* gitter) const;
00039   double coordinateY(const Grid* gitter) const;
00040   double coordinateZ(const Grid* gitter) const;
00041 
00042   // for iteration:
00043   P_Bo2p* Next() { return next; };
00044 
00045   // give informationen
00046   dir_3D d() const { return direction; }
00047   Index3D Ind() const { return ind; }
00048 
00049   BoCeData* Give_BoData(dir_sons i) const;
00050 
00051   // label for boundary points
00052   bool Give_Label(int num, const Grid* gitter) const;
00053   void Put_Label(bool lab, int num, const Grid* gitter) const;
00054  private:
00055   Index3D ind;
00056   dir_3D  direction;
00057   P_Bo2p *next;
00058 
00059   double* pointer_varM;
00060   BoCeData* bocedatas[8]; 
00061 };
00062 
00063 
00064 inline void P_Bo2p::initialize(const Grid* grid, int l) {
00065   pointer_varM = grid->Give_variable(ind,direction);
00066 
00067   if(direction==Ndir) {
00068     bocedatas[WNDd]=grid->Give_Bo_cell(ind.next(WNDd,l+1));
00069     bocedatas[ENDd]=grid->Give_Bo_cell(ind.next(ENDd,l+1));
00070     bocedatas[WNTd]=grid->Give_Bo_cell(ind.next(WNTd,l+1));
00071     bocedatas[ENTd]=grid->Give_Bo_cell(ind.next(ENTd,l+1));
00072 
00073     bocedatas[WSDd]=NULL;
00074     bocedatas[ESDd]=NULL;
00075     bocedatas[WSTd]=NULL;
00076     bocedatas[ESTd]=NULL;
00077   }
00078   else if(direction==Sdir) {
00079     bocedatas[WSDd]=grid->Give_Bo_cell(ind.next(WSDd,l+1));
00080     bocedatas[ESDd]=grid->Give_Bo_cell(ind.next(ESDd,l+1));
00081     bocedatas[WSTd]=grid->Give_Bo_cell(ind.next(WSTd,l+1));
00082     bocedatas[ESTd]=grid->Give_Bo_cell(ind.next(ESTd,l+1));
00083 
00084     bocedatas[WNDd]=NULL; 
00085     bocedatas[ENDd]=NULL;
00086     bocedatas[WNTd]=NULL;
00087     bocedatas[ENTd]=NULL;
00088   }
00089   else if(direction==Wdir) {
00090     bocedatas[WSDd]=grid->Give_Bo_cell(ind.next(WSDd,l+1));
00091     bocedatas[WNDd]=grid->Give_Bo_cell(ind.next(WNDd,l+1));
00092     bocedatas[WSTd]=grid->Give_Bo_cell(ind.next(WSTd,l+1));
00093     bocedatas[WNTd]=grid->Give_Bo_cell(ind.next(WNTd,l+1));
00094 
00095     bocedatas[ESDd]=NULL; 
00096     bocedatas[ENDd]=NULL;
00097     bocedatas[ESTd]=NULL;
00098     bocedatas[ENTd]=NULL;
00099   }
00100   else if(direction==Edir) {
00101     bocedatas[ESDd]=grid->Give_Bo_cell(ind.next(ESDd,l+1));
00102     bocedatas[ENDd]=grid->Give_Bo_cell(ind.next(ENDd,l+1));
00103     bocedatas[ESTd]=grid->Give_Bo_cell(ind.next(ESTd,l+1));
00104     bocedatas[ENTd]=grid->Give_Bo_cell(ind.next(ENTd,l+1));
00105 
00106     bocedatas[WSDd]=NULL; 
00107     bocedatas[WNDd]=NULL;
00108     bocedatas[WSTd]=NULL;
00109     bocedatas[WNTd]=NULL;
00110   }
00111   else if(direction==Tdir) {
00112     bocedatas[WSTd]=grid->Give_Bo_cell(ind.next(WSTd,l+1));
00113     bocedatas[WNTd]=grid->Give_Bo_cell(ind.next(WNTd,l+1));
00114     bocedatas[ESTd]=grid->Give_Bo_cell(ind.next(ESTd,l+1));
00115     bocedatas[ENTd]=grid->Give_Bo_cell(ind.next(ENTd,l+1));
00116 
00117     bocedatas[WSDd]=NULL;
00118     bocedatas[WNDd]=NULL;
00119     bocedatas[ESDd]=NULL;
00120     bocedatas[ENDd]=NULL;
00121   }
00122   else {
00123     bocedatas[WSDd]=grid->Give_Bo_cell(ind.next(WSDd,l+1));
00124     bocedatas[WNDd]=grid->Give_Bo_cell(ind.next(WNDd,l+1));
00125     bocedatas[ESDd]=grid->Give_Bo_cell(ind.next(ESDd,l+1));
00126     bocedatas[ENDd]=grid->Give_Bo_cell(ind.next(ENDd,l+1));
00127 
00128     bocedatas[WSTd]=NULL;
00129     bocedatas[WNTd]=NULL;
00130     bocedatas[ESTd]=NULL;
00131     bocedatas[ENTd]=NULL;
00132   }
00133 }
00134 
00135 
00136 inline D3vector P_Bo2p::coordinate(const Grid* gitter) const {
00137   return gitter->transform_coord(ind,direction);
00138 };
00139 inline double P_Bo2p::coordinateX(const Grid* gitter) const {
00140   return gitter->transform_coord(ind,direction).x;
00141 };
00142 inline double P_Bo2p::coordinateY(const Grid* gitter) const {
00143   return gitter->transform_coord(ind,direction).y;
00144 };
00145 inline double P_Bo2p::coordinateZ(const Grid* gitter) const {
00146   return gitter->transform_coord(ind,direction).z;
00147 };
00148 
00149 inline bool P_Bo2p::Give_Label(int num, const Grid* gitter) const {
00150   return gitter->Give_label_bo(ind,direction,num);
00151 };
00152 inline void P_Bo2p::Put_Label(bool lab, int num, const Grid* gitter) const {
00153   gitter->Put_label_bo(lab,ind,direction,num);
00154 };
00155 
00156 
00157 
00158 inline double *P_Bo2p::varM(const Grid* gitter) const { 
00159   return pointer_varM;
00160 };
00161 
00162 
00163 inline double *P_Bo2p::varP_slow(const Grid* gitter,int var_ebene,
00164                              Ort1D i, Ort1D j, Ort1D k, int level) const {
00165   return gitter->Give_variable_slow(ind.next(i,j,k,level),var_ebene);
00166 };
00167 
00168 inline BoCeData *P_Bo2p::Give_BoData(dir_sons i) const {
00169   return bocedatas[i];
00170 };

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