$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 PARALLEL_MULTI_DATA_FIELD_2D_H 00029 #define PARALLEL_MULTI_DATA_FIELD_2D_H 00030 00031 #include "core/globalDefs.h" 00032 #include "multiBlock/multiDataField2D.h" 00033 00034 #ifdef PLB_MPI_PARALLEL 00035 00036 namespace plb { 00037 00038 template<typename T> 00039 class ParallelScalarAccess2D : public MultiScalarAccess2D<T> { 00040 public: 00041 ParallelScalarAccess2D(); 00042 virtual T& getDistributedScalar ( 00043 plint iX, plint iY, 00044 MultiBlockManagement2D const& multiBlockManagement, 00045 std::map<plint,ScalarField2D<T>*>& fields ); 00046 virtual T const& getDistributedScalar ( 00047 plint iX, plint iY, 00048 MultiBlockManagement2D const& multiBlockManagement, 00049 std::map<plint,ScalarField2D<T>*> const& fields ) const; 00050 virtual ParallelScalarAccess2D<T>* clone() const; 00051 private: 00052 mutable plint locatedBlock; 00053 mutable T distributedScalar; 00054 }; 00055 00056 00057 template<typename T, int nDim> 00058 class ParallelTensorAccess2D : public MultiTensorAccess2D<T,nDim> { 00059 public: 00060 ParallelTensorAccess2D(); 00061 virtual Array<T,nDim>& getDistributedTensor ( 00062 plint iX, plint iY, 00063 MultiBlockManagement2D const& multiBlockManagement, 00064 std::map<plint,TensorField2D<T,nDim>*>& fields ); 00065 virtual Array<T,nDim> const& getDistributedTensor ( 00066 plint iX, plint iY, 00067 MultiBlockManagement2D const& multiBlockManagement, 00068 std::map<plint,TensorField2D<T,nDim>*> const& fields ) const; 00069 virtual ParallelTensorAccess2D<T,nDim>* clone() const; 00070 private: 00071 mutable plint locatedBlock; 00072 mutable Array<T,nDim> distributedTensor; 00073 }; 00074 00075 00076 template<typename T> 00077 class ParallelNTensorAccess2D : public MultiNTensorAccess2D<T> { 00078 public: 00079 ParallelNTensorAccess2D(); 00080 ~ParallelNTensorAccess2D(); 00081 ParallelNTensorAccess2D(ParallelNTensorAccess2D<T> const& rhs); 00082 virtual T* getDistributedNTensor ( 00083 plint iX, plint iY, 00084 MultiBlockManagement2D const& multiBlockManagement, 00085 std::map<plint,NTensorField2D<T>*>& fields ); 00086 virtual T const* getDistributedNTensor ( 00087 plint iX, plint iY, 00088 MultiBlockManagement2D const& multiBlockManagement, 00089 std::map<plint,NTensorField2D<T>*> const& fields ) const; 00090 virtual ParallelNTensorAccess2D<T>* clone() const; 00091 private: 00092 ParallelNTensorAccess2D<T>& operator=(ParallelNTensorAccess2D<T> const& rhs) { return *this; } 00093 private: 00094 mutable T* distributedNTensor; 00095 mutable plint locatedBlock; 00096 }; 00097 00098 } 00099 00100 #endif // PLB_MPI_PARALLEL 00101 00102 #endif // PARALLEL_MULTI_DATA_FIELD_2D_H
1.6.3
1.6.3