$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

nearestNeighborLattices3D.hh

Go to the documentation of this file.
00001 /* This file is part of the Palabos library.
00002  *
00003  * Copyright (C) 2011 FlowKit Sarl
00004  * Avenue de Chailly 23
00005  * 1012 Lausanne, Switzerland
00006  * E-mail contact: contact@flowkit.com
00007  *
00008  * The most recent release of Palabos can be downloaded at 
00009  * <http://www.palabos.org/>
00010  *
00011  * The library Palabos is free software: you can redistribute it and/or
00012  * modify it under the terms of the GNU Affero General Public License as
00013  * published by the Free Software Foundation, either version 3 of the
00014  * License, or (at your option) any later version.
00015  *
00016  * The library is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Affero General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Affero General Public License
00022  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00023 */
00024 
00028 #ifndef NEAREST_NEIGHBOR_LATTICES_3D_HH
00029 #define NEAREST_NEIGHBOR_LATTICES_3D_HH
00030 
00031 #include "latticeBoltzmann/nearestNeighborLattices3D.h"
00032 
00033 namespace plb {
00034 
00035 namespace descriptors {
00036 
00037     // D3Q13 ///////////////////////////////////////////////////////////
00038 
00039     template<typename T>
00040     const T D3Q13Constants<T>::invD = (T)1 / (T) d;
00041 
00042     template<typename T>
00043     const int D3Q13Constants<T>::vicinity = 1;
00044 
00045     template<typename T>
00046     const int D3Q13Constants<T>::c
00047         [D3Q13Constants<T>::q][D3Q13Constants<T>::d] =
00048         {
00049             { 0, 0, 0},
00050 
00051             {-1,-1, 0}, {-1, 1, 0}, {-1, 0,-1},
00052             {-1, 0, 1}, { 0,-1,-1}, { 0,-1, 1},
00053 
00054             { 1, 1, 0}, { 1,-1, 0}, { 1, 0, 1},
00055             { 1, 0,-1}, { 0, 1, 1}, { 0, 1,-1}
00056         }; 
00057 
00058     template<typename T>
00059     const int D3Q13Constants<T>::cNormSqr[D3Q13Constants<T>::q] =
00060     { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 };
00061 
00062     template<typename T>
00063     const T D3Q13Constants<T>::t[D3Q13Constants<T>::q] =
00064         {
00065             (T)1/(T)2,
00066 
00067             (T)1/(T)24, (T)1/(T)24, (T)1/(T)24,
00068             (T)1/(T)24, (T)1/(T)24, (T)1/(T)24,
00069 
00070             (T)1/(T)24, (T)1/(T)24, (T)1/(T)24,
00071             (T)1/(T)24, (T)1/(T)24, (T)1/(T)24
00072         };
00073 
00075     template<typename T>
00076     const T D3Q13Constants<T>::cs2 = (T)1 / (T)3;
00077 
00079     template<typename T>
00080     const T D3Q13Constants<T>::invCs2 = (T)3;
00081 
00083     template<typename T>
00084     const T D3Q13Constants<T>::lambda_e = (T)1.5;
00085 
00087     template<typename T>
00088     const T D3Q13Constants<T>::lambda_h = (T)1.8;
00089 
00090     template<typename T>
00091     const char D3Q13Descriptor<T>::name[] = "D3Q19";
00092 
00093     template<typename T>
00094     const char ForcedD3Q13Descriptor<T>::name[] = "ForcedD3Q19";
00095 
00096 
00097     // D3Q15 ///////////////////////////////////////////////////////////
00098 
00099     template<typename T>
00100     const T D3Q15Constants<T>::invD = (T)1 / (T) d;
00101 
00102     template<typename T>
00103     const int D3Q15Constants<T>::vicinity = 1;
00104 
00105     template<typename T>
00106     const int D3Q15Constants<T>::c
00107         [D3Q15Constants<T>::q][D3Q15Constants<T>::d] =
00108         {
00109             { 0, 0, 0},
00110 
00111             {-1, 0, 0}, { 0,-1, 0}, { 0, 0,-1},
00112             {-1,-1,-1}, {-1,-1, 1}, {-1, 1,-1}, {-1, 1, 1},
00113 
00114             { 1, 0, 0}, { 0, 1, 0}, { 0, 0, 1},
00115             { 1, 1, 1}, { 1, 1,-1}, { 1,-1, 1}, { 1,-1,-1},
00116 
00117         }; 
00118 
00119     template<typename T>
00120     const int D3Q15Constants<T>::cNormSqr
00121         [D3Q15Constants<T>::q] =
00122         { 0,  1, 1, 1,  3, 3, 3, 3, 
00123               1, 1, 1,  3, 3, 3, 3 };
00124  
00125     template<typename T>
00126     const T D3Q15Constants<T>::t[D3Q15Constants<T>::q] =
00127         {
00128             (T)2/(T)9,
00129 
00130             (T)1/(T)9, (T)1/(T)9, (T)1/(T)9, 
00131             (T)1/(T)72, (T)1/(T)72, (T)1/(T)72, (T)1/(T)72,
00132 
00133             (T)1/(T)9, (T)1/(T)9, (T)1/(T)9, 
00134             (T)1/(T)72, (T)1/(T)72, (T)1/(T)72, (T)1/(T)72
00135         };
00136 
00137     template<typename T>
00138     const T D3Q15Constants<T>::cs2 = (T)1 / (T)3;
00139 
00140     template<typename T>
00141     const T D3Q15Constants<T>::invCs2 = (T)3;
00142 
00143     template<typename T>
00144     const char D3Q15Descriptor<T>::name[] = "D3Q15";
00145 
00146     template<typename T>
00147     const char ForcedD3Q15Descriptor<T>::name[] = "ForcedD3Q15";
00148 
00149     template<typename T>
00150     const char RhoBarJD3Q15Descriptor<T>::name[] = "RhoBarJD3Q15";
00151 
00152     template<typename T>
00153     const char ForcedRhoBarJD3Q15Descriptor<T>::name[] = "ForcedRhoBarJD3Q15";
00154 
00155 
00156     // D3Q19 ///////////////////////////////////////////////////////////
00157 
00158     template<typename T>
00159     const T D3Q19Constants<T>::invD = (T)1 / (T) d;
00160 
00161     template<typename T>
00162     const int D3Q19Constants<T>::vicinity = 1;
00163 
00164     template<typename T>
00165     const int D3Q19Constants<T>::c
00166         [D3Q19Constants<T>::q][D3Q19Constants<T>::d] =
00167         {
00168             { 0, 0, 0},
00169 
00170             {-1, 0, 0}, { 0,-1, 0}, { 0, 0,-1},
00171             {-1,-1, 0}, {-1, 1, 0}, {-1, 0,-1},
00172             {-1, 0, 1}, { 0,-1,-1}, { 0,-1, 1},
00173 
00174             { 1, 0, 0}, { 0, 1, 0}, { 0, 0, 1},
00175             { 1, 1, 0}, { 1,-1, 0}, { 1, 0, 1},
00176             { 1, 0,-1}, { 0, 1, 1}, { 0, 1,-1}
00177         }; 
00178 
00179     template<typename T>
00180     const int D3Q19Constants<T>::cNormSqr
00181         [D3Q19Constants<T>::q] =
00182         { 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 
00183              1, 1, 1, 2, 2, 2, 2, 2, 2 };
00184  
00185     template<typename T>
00186     const T D3Q19Constants<T>::t[D3Q19Constants<T>::q] =
00187         {
00188             (T)1/(T)3,
00189 
00190             (T)1/(T)18, (T)1/(T)18, (T)1/(T)18, 
00191             (T)1/(T)36, (T)1/(T)36, (T)1/(T)36,
00192             (T)1/(T)36, (T)1/(T)36, (T)1/(T)36,
00193 
00194             (T)1/(T)18, (T)1/(T)18, (T)1/(T)18, 
00195             (T)1/(T)36, (T)1/(T)36, (T)1/(T)36,
00196             (T)1/(T)36, (T)1/(T)36, (T)1/(T)36
00197         };
00198 
00199     template<typename T>
00200     const T D3Q19Constants<T>::cs2 = (T)1 / (T)3;
00201 
00202     template<typename T>
00203     const T D3Q19Constants<T>::invCs2 = (T)3;
00204 
00205     template<typename T>
00206     const char D3Q19Descriptor<T>::name[] = "D3Q19";
00207 
00208     template<typename T>
00209     const char ForcedD3Q19Descriptor<T>::name[] = "ForcedD3Q19";
00210 
00211     template<typename T>
00212     const char RhoBarJD3Q19Descriptor<T>::name[] = "RhoBarJD3Q19";
00213 
00214     template<typename T>
00215     const char ForcedRhoBarJD3Q19Descriptor<T>::name[] = "ForcedRhoBarJD3Q19";
00216     
00217     template<typename T>
00218     const char VelocityD3Q19Descriptor<T>::name[] = "VelocityD3Q19";
00219     
00220     // D3Q27 ///////////////////////////////////////////////////////////
00221 
00222     template<typename T>
00223     const T D3Q27Constants<T>::invD = (T)1 / (T) d;
00224 
00225     template<typename T>
00226     const int D3Q27Constants<T>::vicinity = 1;
00227 
00228     template<typename T>
00229     const int D3Q27Constants<T>::c
00230         [D3Q27Constants<T>::q][D3Q27Constants<T>::d] =
00231         {
00232             { 0, 0, 0},
00233 
00234             {-1, 0, 0}, { 0,-1, 0}, { 0, 0,-1},
00235             {-1,-1, 0}, {-1, 1, 0}, {-1, 0,-1},
00236             {-1, 0, 1}, { 0,-1,-1}, { 0,-1, 1},
00237             {-1,-1,-1}, {-1,-1, 1}, {-1, 1,-1}, {-1, 1, 1},
00238 
00239             { 1, 0, 0}, { 0, 1, 0}, { 0, 0, 1},
00240             { 1, 1, 0}, { 1,-1, 0}, { 1, 0, 1},
00241             { 1, 0,-1}, { 0, 1, 1}, { 0, 1,-1},
00242             { 1, 1, 1}, { 1, 1,-1}, { 1,-1, 1}, { 1,-1,-1}
00243         }; 
00244  
00245 
00246     template<typename T>
00247     const int D3Q27Constants<T>::cNormSqr[D3Q27Constants<T>::q] =
00248     {
00249         0,
00250         1, 1, 1,  2, 2, 2,  2, 2, 2,  3, 3, 3, 3,
00251         1, 1, 1,  2, 2, 2,  2, 2, 2,  3, 3, 3, 3
00252     };
00253 
00254     template<typename T>
00255     const T D3Q27Constants<T>::t[D3Q27Constants<T>::q] =
00256         {
00257             (T)8/(T)27,
00258 
00259             (T)2/(T)27, (T)2/(T)27, (T)2/(T)27, 
00260             (T)1/(T)54, (T)1/(T)54, (T)1/(T)54,
00261             (T)1/(T)54, (T)1/(T)54, (T)1/(T)54,
00262             (T)1/(T)216, (T)1/(T)216, (T)1/(T)216, (T)1/(T)216,
00263 
00264             (T)2/(T)27, (T)2/(T)27, (T)2/(T)27, 
00265             (T)1/(T)54, (T)1/(T)54, (T)1/(T)54,
00266             (T)1/(T)54, (T)1/(T)54, (T)1/(T)54,
00267             (T)1/(T)216, (T)1/(T)216, (T)1/(T)216, (T)1/(T)216
00268         };
00269 
00270     template<typename T>
00271     const T D3Q27Constants<T>::cs2 = (T)1 / (T)3;
00272 
00273     template<typename T>
00274     const T D3Q27Constants<T>::invCs2 = (T)3;
00275 
00276     template<typename T>
00277     const char D3Q27Descriptor<T>::name[] = "D3Q27";
00278 
00279     template<typename T>
00280     const char ForcedD3Q27Descriptor<T>::name[] = "ForcedD3Q27";
00281 
00282     template<typename T>
00283     const char RhoBarJD3Q27Descriptor<T>::name[] = "RhoBarJD3Q27";
00284 
00285     template<typename T>
00286     const char ForcedRhoBarJD3Q27Descriptor<T>::name[] = "ForcedRhoBarJD3Q27";
00287 
00288 }  // namespace descriptors
00289 
00290 }  // namespace plb
00291 
00292 #endif