$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 00025 /* Main author: Orestis Malaspinas. 00026 */ 00027 00031 #ifndef ADIABATIC_BOUNDARY_PROCESSOR_2D_HH 00032 #define ADIABATIC_BOUNDARY_PROCESSOR_2D_HH 00033 00034 #include "complexDynamics/adiabaticBoundaryProcessor2D.h" 00035 #include "finiteDifference/fdStencils1D.h" 00036 00037 namespace plb { 00038 00039 template<typename T, template<typename U> class Descriptor, int direction, int orientation> 00040 void FlatAdiabaticBoundaryFunctional2D<T,Descriptor,direction,orientation>::process ( 00041 Box2D domain, BlockLattice2D<T,Descriptor>& lattice ) 00042 { 00043 for (plint iX=domain.x0; iX<=domain.x1; ++iX) 00044 { 00045 for (plint iY=domain.y0; iY<=domain.y1; ++iY) 00046 { 00047 plint iX_prev = iX + ( (direction==0) ? (-orientation) : 0 ); 00048 plint iY_prev = iY + ( (direction==1) ? (-orientation) : 0 ); 00049 00050 plint iX_prev_2 = iX + ( (direction==0) ? (-2*orientation) : 0 ); 00051 plint iY_prev_2 = iY + ( (direction==1) ? (-2*orientation) : 0 ); 00052 00053 T temperature_1 = lattice.get(iX_prev,iY_prev).computeDensity(); 00054 T temperature_2 = lattice.get(iX_prev_2,iY_prev_2).computeDensity(); 00055 00056 T temperature = fd::boundaryZeroGradient(temperature_1, temperature_2); 00057 lattice.get(iX,iY).defineDensity(temperature); 00058 } 00059 } 00060 } 00061 00062 template<typename T, template<typename U> class Descriptor, int direction, int orientation> 00063 FlatAdiabaticBoundaryFunctional2D<T,Descriptor,direction,orientation>* 00064 FlatAdiabaticBoundaryFunctional2D<T,Descriptor,direction,orientation>::clone() const 00065 { 00066 return new FlatAdiabaticBoundaryFunctional2D<T,Descriptor,direction,orientation>(*this); 00067 } 00068 00069 template<typename T, template<typename U> class Descriptor, int direction, int orientation> 00070 void FlatAdiabaticBoundaryFunctional2D<T,Descriptor,direction,orientation>::getTypeOfModification ( 00071 std::vector<modif::ModifT>& modified ) const 00072 { 00073 modified[0] = modif::staticVariables; 00074 } 00075 00076 template<typename T, template<typename U> class Descriptor, int direction, int orientation> 00077 BlockDomain::DomainT FlatAdiabaticBoundaryFunctional2D<T,Descriptor,direction,orientation>::appliesTo() const 00078 { 00079 return BlockDomain::bulkAndEnvelope; 00080 } 00081 00082 } // namespace plb 00083 00084 #endif // NEUMANN_CONDITION_2D_HH
1.6.3
1.6.3