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

parallelMultiDataField3D.h

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 PARALLEL_MULTI_DATA_FIELD_3D_H
00029 #define PARALLEL_MULTI_DATA_FIELD_3D_H
00030 
00031 #include "core/globalDefs.h"
00032 #include "multiBlock/multiDataField3D.h"
00033 
00034 #ifdef PLB_MPI_PARALLEL
00035 
00036 namespace plb {
00037 
00038 template<typename T>
00039 class ParallelScalarAccess3D : public MultiScalarAccess3D<T> {
00040 public:
00041     ParallelScalarAccess3D();
00042     virtual T& getDistributedScalar (
00043             plint iX, plint iY, plint iZ,
00044             MultiBlockManagement3D const& multiBlockManagement,
00045             std::map<plint,ScalarField3D<T>*>& fields );
00046     virtual T const& getDistributedScalar (
00047             plint iX, plint iY, plint iZ,
00048             MultiBlockManagement3D const& multiBlockManagement,
00049             std::map<plint,ScalarField3D<T>*> const& fields ) const;
00050     virtual ParallelScalarAccess3D<T>* clone() const;
00051 private:
00052     mutable plint locatedBlock;
00053     mutable T distributedScalar;
00054 };
00055 
00056 
00057 template<typename T, int nDim>
00058 class ParallelTensorAccess3D : public MultiTensorAccess3D<T,nDim> {
00059 public:
00060     ParallelTensorAccess3D();
00061     virtual Array<T,nDim>& getDistributedTensor (
00062             plint iX, plint iY, plint iZ,
00063             MultiBlockManagement3D const& multiBlockManagement,
00064             std::map<plint,TensorField3D<T,nDim>*>& fields );
00065     virtual Array<T,nDim> const& getDistributedTensor (
00066             plint iX, plint iY, plint iZ,
00067             MultiBlockManagement3D const& multiBlockManagement,
00068             std::map<plint,TensorField3D<T,nDim>*> const& fields ) const;
00069     virtual ParallelTensorAccess3D<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 ParallelNTensorAccess3D : public MultiNTensorAccess3D<T> {
00078 public:
00079     ParallelNTensorAccess3D();
00080     ~ParallelNTensorAccess3D();
00081     ParallelNTensorAccess3D(ParallelNTensorAccess3D<T> const& rhs);
00082     virtual T* getDistributedNTensor (
00083             plint iX, plint iY, plint iZ,
00084             MultiBlockManagement3D const& multiBlockManagement,
00085             std::map<plint,NTensorField3D<T>*>& fields );
00086     virtual T const* getDistributedNTensor (
00087             plint iX, plint iY, plint iZ,
00088             MultiBlockManagement3D const& multiBlockManagement,
00089             std::map<plint,NTensorField3D<T>*> const& fields ) const;
00090     virtual ParallelNTensorAccess3D<T>* clone() const;
00091 private:
00092     ParallelNTensorAccess3D<T>& operator=(ParallelNTensorAccess3D<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_3D_H