$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 00028 #ifndef SERIAL_MULTI_DATA_FIELD_3D_HH 00029 #define SERIAL_MULTI_DATA_FIELD_3D_HH 00030 00031 #include "serialMultiDataField3D.h" 00032 00033 /* *************** Class SerialScalarAccess3D ************************ */ 00034 00035 namespace plb { 00036 template<typename T> 00037 SerialScalarAccess3D<T>::SerialScalarAccess3D() 00038 : locatedBlock(0) 00039 { } 00040 00041 template<typename T> 00042 T& SerialScalarAccess3D<T>::getDistributedScalar ( 00043 plint iX, plint iY, plint iZ, 00044 MultiBlockManagement3D const& multiBlockManagement, 00045 std::map<plint,ScalarField3D<T>*>& fields ) 00046 { 00047 plint localX, localY, localZ; 00048 #ifdef PLB_DEBUG 00049 bool ok = 00050 #endif 00051 multiBlockManagement.findInLocalBulk ( 00052 iX,iY,iZ, locatedBlock, localX, localY, localZ ); 00053 PLB_PRECONDITION( ok ); 00054 return fields[locatedBlock] -> get(localX,localY,localZ); 00055 } 00056 00057 template<typename T> 00058 T const& SerialScalarAccess3D<T>::getDistributedScalar ( 00059 plint iX, plint iY, plint iZ, 00060 MultiBlockManagement3D const& multiBlockManagement, 00061 std::map<plint,ScalarField3D<T>*> const& fields ) const 00062 { 00063 plint localX, localY, localZ; 00064 #ifdef PLB_DEBUG 00065 bool ok = 00066 #endif 00067 multiBlockManagement.findInLocalBulk 00068 (iX,iY,iZ, locatedBlock, localX, localY, localZ); 00069 PLB_PRECONDITION( ok ); 00070 return fields.find(locatedBlock)->second -> get(localX,localY,localZ); 00071 } 00072 00073 00074 template<typename T> 00075 SerialScalarAccess3D<T>* SerialScalarAccess3D<T>::clone() const { 00076 return new SerialScalarAccess3D(*this); 00077 } 00078 00079 00080 /* *************** Class SerialTensorAccess3D ************************ */ 00081 00082 template<typename T, int nDim> 00083 SerialTensorAccess3D<T,nDim>::SerialTensorAccess3D() 00084 : locatedBlock(0) 00085 { } 00086 00087 template<typename T, int nDim> 00088 Array<T,nDim>& SerialTensorAccess3D<T,nDim>::getDistributedTensor ( 00089 plint iX, plint iY, plint iZ, 00090 MultiBlockManagement3D const& multiBlockManagement, 00091 std::map<plint,TensorField3D<T,nDim>*>& fields ) 00092 { 00093 plint localX, localY, localZ; 00094 #ifdef PLB_DEBUG 00095 bool ok = 00096 #endif 00097 multiBlockManagement.findInLocalBulk 00098 (iX,iY,iZ, locatedBlock, localX, localY, localZ); 00099 PLB_PRECONDITION( ok ); 00100 return fields[locatedBlock] -> get(localX,localY,localZ); 00101 } 00102 00103 template<typename T, int nDim> 00104 Array<T,nDim> const& SerialTensorAccess3D<T,nDim>::getDistributedTensor ( 00105 plint iX, plint iY, plint iZ, 00106 MultiBlockManagement3D const& multiBlockManagement, 00107 std::map<plint,TensorField3D<T,nDim>*> const& fields ) const 00108 { 00109 plint localX, localY, localZ; 00110 #ifdef PLB_DEBUG 00111 bool ok = 00112 #endif 00113 multiBlockManagement.findInLocalBulk 00114 (iX,iY,iZ, locatedBlock, localX, localY, localZ); 00115 PLB_PRECONDITION( ok ); 00116 return fields.find(locatedBlock)->second -> get(localX,localY,localZ); 00117 } 00118 00119 00120 template<typename T, int nDim> 00121 SerialTensorAccess3D<T,nDim>* SerialTensorAccess3D<T,nDim>::clone() const { 00122 return new SerialTensorAccess3D(*this); 00123 } 00124 00125 00126 00127 /* *************** Class SerialNTensorAccess3D ************************ */ 00128 00129 template<typename T> 00130 SerialNTensorAccess3D<T>::SerialNTensorAccess3D() 00131 : locatedBlock(0) 00132 { } 00133 00134 template<typename T> 00135 T* SerialNTensorAccess3D<T>::getDistributedNTensor ( 00136 plint iX, plint iY, plint iZ, 00137 MultiBlockManagement3D const& multiBlockManagement, 00138 std::map<plint,NTensorField3D<T>*>& fields ) 00139 { 00140 plint localX, localY, localZ; 00141 #ifdef PLB_DEBUG 00142 bool ok = 00143 #endif 00144 multiBlockManagement.findInLocalBulk 00145 (iX,iY,iZ, locatedBlock, localX, localY, localZ); 00146 PLB_PRECONDITION( ok ); 00147 typename std::map<plint,NTensorField3D<T>*>::const_iterator it = fields.find(locatedBlock); 00148 PLB_ASSERT( it != fields.end() ); 00149 return it->second -> get(localX,localY,localZ); 00150 } 00151 00152 template<typename T> 00153 T const* SerialNTensorAccess3D<T>::getDistributedNTensor ( 00154 plint iX, plint iY, plint iZ, 00155 MultiBlockManagement3D const& multiBlockManagement, 00156 std::map<plint,NTensorField3D<T>*> const& fields ) const 00157 { 00158 plint localX, localY, localZ; 00159 #ifdef PLB_DEBUG 00160 bool ok = 00161 #endif 00162 multiBlockManagement.findInLocalBulk 00163 (iX,iY,iZ, locatedBlock, localX, localY, localZ); 00164 PLB_PRECONDITION( ok ); 00165 typename std::map<plint,NTensorField3D<T>*>::const_iterator it = fields.find(locatedBlock); 00166 PLB_ASSERT( it != fields.end() ); 00167 return it->second -> get(localX,localY,localZ); 00168 } 00169 00170 00171 template<typename T> 00172 SerialNTensorAccess3D<T>* SerialNTensorAccess3D<T>::clone() const { 00173 return new SerialNTensorAccess3D(*this); 00174 } 00175 00176 } // namespace plb 00177 00178 #endif // SERIAL_MULTI_DATA_FIELD_3D_HH
1.6.3
1.6.3