$treeview $search $mathjax
|
Palabos
Version 1.1
$projectbrief
|
$projectbrief
|
$searchbox |
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 00029 #ifndef EQUILIBRIUM_BOUNDARY_DYNAMICS_HH 00030 #define EQUILIBRIUM_BOUNDARY_DYNAMICS_HH 00031 00032 #include "boundaryCondition/equilibriumBoundaryDynamics.h" 00033 #include "core/cell.h" 00034 #include "core/dynamicsIdentifiers.h" 00035 00036 namespace plb { 00037 00038 00039 /* *************** Class EquilibriumVelocityBoundaryDynamics ************* */ 00040 00041 template<typename T, template<typename U> class Descriptor, 00042 int direction, int orientation> 00043 int EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>::id = 00044 meta::registerCompositeDynamics<T,Descriptor, EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation> > 00045 ( std::string("Boundary_EquilibriumVelocity_")+util::val2str(direction) + 00046 std::string("_")+util::val2str(orientation) ); 00047 00048 template<typename T, template<typename U> class Descriptor, 00049 int direction, int orientation> 00050 EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>:: 00051 EquilibriumVelocityBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_, bool automaticPrepareCollision) 00052 : VelocityDirichletBoundaryDynamics<T,Descriptor,direction,orientation>(baseDynamics_, automaticPrepareCollision) 00053 { } 00054 00055 template<typename T, template<typename U> class Descriptor, 00056 int direction, int orientation> 00057 EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>* 00058 EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>::clone() const 00059 { 00060 return new EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>(*this); 00061 } 00062 00063 template<typename T, template<typename U> class Descriptor, 00064 int direction, int orientation> 00065 int EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>::getId() const { 00066 return id; 00067 } 00068 00069 template<typename T, template<typename U> class Descriptor, 00070 int direction, int orientation> 00071 void EquilibriumVelocityBoundaryDynamics<T,Descriptor,direction,orientation>:: 00072 completePopulations(Cell<T,Descriptor>& cell) const 00073 { 00074 T rhoBar; 00075 Array<T,Descriptor<T>::d> j; 00076 this -> computeRhoBarJ(cell, rhoBar, j); 00077 T jSqr = VectorTemplate<T,Descriptor>::normSqr(j); 00078 00079 for (plint iPop=0; iPop<Descriptor<T>::q; ++iPop) { 00080 cell[iPop] = this->getBaseDynamics().computeEquilibrium(iPop, rhoBar, j, jSqr); 00081 } 00082 } 00083 00084 00085 /* *************** Class EquilibriumDensityBoundaryDynamics ************* */ 00086 00087 template<typename T, template<typename U> class Descriptor, 00088 int direction, int orientation> 00089 int EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>::id = 00090 meta::registerCompositeDynamics<T,Descriptor, EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation> > 00091 ( std::string("Boundary_EquilibriumDensity_")+util::val2str(direction) + 00092 std::string("_")+util::val2str(orientation) ); 00093 00094 template<typename T, template<typename U> class Descriptor, 00095 int direction, int orientation> 00096 EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>:: 00097 EquilibriumDensityBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_, bool automaticPrepareCollision) 00098 : DensityDirichletBoundaryDynamics<T,Descriptor,direction,orientation>(baseDynamics_, automaticPrepareCollision) 00099 { } 00100 00101 template<typename T, template<typename U> class Descriptor, 00102 int direction, int orientation> 00103 EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>* 00104 EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>::clone() const 00105 { 00106 return new EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>(*this); 00107 } 00108 00109 template<typename T, template<typename U> class Descriptor, 00110 int direction, int orientation> 00111 int EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>::getId() const { 00112 return id; 00113 } 00114 00115 template<typename T, template<typename U> class Descriptor, 00116 int direction, int orientation> 00117 void EquilibriumDensityBoundaryDynamics<T,Descriptor,direction,orientation>:: 00118 completePopulations(Cell<T,Descriptor>& cell) const 00119 { 00120 T rhoBar; 00121 Array<T,Descriptor<T>::d> j; 00122 this -> computeRhoBarJ(cell, rhoBar, j); 00123 T jSqr = VectorTemplate<T,Descriptor>::normSqr(j); 00124 00125 for (plint iPop=0; iPop<Descriptor<T>::q; ++iPop) { 00126 cell[iPop] = this->getBaseDynamics().computeEquilibrium(iPop, rhoBar, j, jSqr); 00127 } 00128 } 00129 00130 00131 /* *************** Class EquilibriumDensityAndVelocityBoundaryDynamics ************* */ 00132 00133 template<typename T, template<typename U> class Descriptor> 00134 int EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>::id = 00135 meta::registerCompositeDynamics<T,Descriptor, EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor> > 00136 ("Boundary_EquilibriumDensityAndVelocity"); 00137 00138 template<typename T, template<typename U> class Descriptor> 00139 EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>:: 00140 EquilibriumDensityAndVelocityBoundaryDynamics(Dynamics<T,Descriptor>* baseDynamics_, bool automaticPrepareCollision) 00141 : StoreDensityAndVelocityDynamics<T,Descriptor>(baseDynamics_, automaticPrepareCollision) 00142 { } 00143 00144 template<typename T, template<typename U> class Descriptor> 00145 EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>* 00146 EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>::clone() const 00147 { 00148 return new EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>(*this); 00149 } 00150 00151 template<typename T, template<typename U> class Descriptor> 00152 int EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>::getId() const { 00153 return id; 00154 } 00155 00156 template<typename T, template<typename U> class Descriptor> 00157 void EquilibriumDensityAndVelocityBoundaryDynamics<T,Descriptor>::completePopulations(Cell<T,Descriptor>& cell) const 00158 { 00159 T rhoBar; 00160 Array<T,Descriptor<T>::d> j; 00161 this -> computeRhoBarJ(cell, rhoBar, j); 00162 T jSqr = VectorTemplate<T,Descriptor>::normSqr(j); 00163 00164 for (plint iPop=0; iPop<Descriptor<T>::q; ++iPop) { 00165 cell[iPop] = this->getBaseDynamics().computeEquilibrium(iPop, rhoBar, j, jSqr); 00166 } 00167 } 00168 00169 } // namespace plb 00170 00171 #endif // EQUILIBRIUM_BOUNDARY_DYNAMICS_HH
1.6.3
1.6.3