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 // listpa1.h 00019 // 00020 // ------------------------------------------------------------ 00021 00022 #define initialize_pa true 00023 00024 00025 // points of parallel 00026 class P_parallel { 00027 public: 00028 P_parallel(Index3D I, P_parallel* Next) : 00029 ind(I), next(Next) {}; 00030 00031 // initialize 00032 void initialize(const Grid* gitter, int level); 00033 00034 // idem 00035 double *varM(const Grid* gitter, int level) const; 00036 00037 // physical coordinates 00038 D3vector coordinate(const Grid* gitter) const; 00039 double coordinateX(const Grid* gitter) const; 00040 double coordinateY(const Grid* gitter) const; 00041 double coordinateZ(const Grid* gitter) const; 00042 00043 // index of cell 00044 Index3D Ind() const { return ind; }; 00045 00046 // for iteration: 00047 P_parallel* Next() { return next; }; 00048 00049 private: 00050 double* pointer_varM; 00051 00052 Index3D ind; 00053 P_parallel *next; 00054 }; 00055 00056 00057 inline void P_parallel::initialize(const Grid* gitter, int level) { 00058 pointer_varM = gitter->Give_variable(ind,level); 00059 } 00060 00061 // coordinates 00062 inline D3vector P_parallel::coordinate(const Grid* gitter) const { 00063 return gitter->transform_coord(ind); 00064 }; 00065 inline double P_parallel::coordinateX(const Grid* gitter) const { 00066 return gitter->transform_coordX(ind); 00067 }; 00068 inline double P_parallel::coordinateY(const Grid* gitter) const { 00069 return gitter->transform_coordY(ind); 00070 }; 00071 inline double P_parallel::coordinateZ(const Grid* gitter) const { 00072 return gitter->transform_coordZ(ind); 00073 }; 00074 00075 inline double *P_parallel::varM(const Grid* gitter, int level) const { 00076 return pointer_varM; 00077 };