src/expde/grid/listbo/listbo2.h

Go to the documentation of this file.
00001 //    expde: expression templates for partial differential equations.
00002 //    Copyright (C) 2001  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 //                 SEE  Notice1.doc made by 
00014 //                 LAWRENCE LIVERMORE NATIONAL LABORATORY
00015 //
00016 
00017 // ------------------------------------------------------------
00018 // listbo2.h
00019 //
00020 // ------------------------------------------------------------
00021 
00022 
00023 #define initialize_bo true
00024 
00025 // boundary points
00026 class P_Bo2p {
00027  public:
00028   P_Bo2p(Index3D I, dir_3D d, P_Bo2p* Next) : 
00029     ind(I), direction(d), next(Next) {};
00030 
00031   // initialize
00032   void initialize(const Grid* gitter, int level);
00033 
00034   // idem
00035   double *varM(const Grid* gitter) const;
00036   double *varP_slow(const Grid* gitter, int ebene, Ort1D i,Ort1D j,Ort1D k,
00037                     int level) const;
00038 
00039 
00040   // physical coordinates
00041   D3vector coordinate(const Grid* gitter) const;
00042   double coordinateX(const Grid* gitter) const;
00043   double coordinateY(const Grid* gitter) const;
00044   double coordinateZ(const Grid* gitter) const;
00045 
00046   // for iteration:
00047   P_Bo2p* Next() { return next; };
00048 
00049   // give informationen
00050   dir_3D d() const { return direction; }
00051   Index3D Ind() const { return ind; }
00052 
00053   // label for boundary points
00054   bool Give_Label(int num, const Grid* gitter) const;
00055   void Put_Label(bool lab, int num, const Grid* gitter) const;
00056  private:
00057   Index3D ind;
00058   dir_3D  direction;
00059   P_Bo2p *next;
00060 
00061   double* pointer_varM;
00062 };
00063 
00064 
00065 inline void P_Bo2p::initialize(const Grid* gitter, int level) {
00066   pointer_varM = gitter->Give_variable(ind,direction);
00067 }
00068 
00069 
00070 inline D3vector P_Bo2p::coordinate(const Grid* gitter) const {
00071   return gitter->transform_coord(ind,direction);
00072 };
00073 inline double P_Bo2p::coordinateX(const Grid* gitter) const {
00074   return gitter->transform_coord(ind,direction).x;
00075 };
00076 inline double P_Bo2p::coordinateY(const Grid* gitter) const {
00077   return gitter->transform_coord(ind,direction).y;
00078 };
00079 inline double P_Bo2p::coordinateZ(const Grid* gitter) const {
00080   return gitter->transform_coord(ind,direction).z;
00081 };
00082 
00083 inline bool P_Bo2p::Give_Label(int num, const Grid* gitter) const {
00084   return gitter->Give_label_bo(ind,direction,num);
00085 };
00086 inline void P_Bo2p::Put_Label(bool lab, int num, const Grid* gitter) const {
00087   gitter->Put_label_bo(lab,ind,direction,num);
00088 };
00089 
00090 
00091 
00092 inline double *P_Bo2p::varM(const Grid* gitter) const { 
00093   return pointer_varM;
00094 };
00095 
00096 
00097 inline double *P_Bo2p::varP_slow(const Grid* gitter,int var_ebene,
00098                              Ort1D i, Ort1D j, Ort1D k, int level) const {
00099   return gitter->Give_variable_slow(ind.next(i,j,k,level),var_ebene);
00100 };
00101 
00102 

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