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

dataFieldBase3D.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 
00029 #ifndef DATA_FIELD_BASE_3D_H
00030 #define DATA_FIELD_BASE_3D_H
00031 
00032 #include "core/globalDefs.h"
00033 #include "core/dataFieldBase2D.h"
00034 #include "core/block3D.h"
00035 #include "core/geometry3D.h"
00036 #include "core/array.h"
00037 
00038 namespace plb {
00039 
00041 template<typename T>
00042 class ScalarFieldBase3D {
00043 public:
00044     virtual ~ScalarFieldBase3D() { }
00045 public:
00046     virtual void reset() =0;
00047     virtual T& get(plint iX, plint iY, plint iZ) =0;
00048     virtual T const& get(plint iX, plint iY, plint iZ) const =0;
00049 };
00050 
00052 template<typename T, int nDim>
00053 class TensorFieldBase3D {
00054 public:
00055     virtual ~TensorFieldBase3D() { }
00056 public:
00057     virtual void reset() =0;
00058     virtual Array<T,nDim>& get(plint iX, plint iY, plint iZ) =0;
00059     virtual Array<T,nDim> const& get(plint iX, plint iY, plint iZ) const =0;
00060 };
00061 
00063 
00067 template<typename T>
00068 class NTensorFieldBase3D {
00069 public:
00070     NTensorFieldBase3D(int ndim_) : ndim(ndim_) { }
00071     NTensorFieldBase3D(NTensorFieldBase3D<T> const& rhs) : ndim(rhs.ndim) { }
00072     void swap(NTensorFieldBase3D& rhs) { std::swap(ndim, rhs.ndim); }
00073     virtual ~NTensorFieldBase3D() { }
00074 public:
00075     virtual void reset() =0;
00076     virtual T* get(plint iX, plint iY, plint iZ) =0;
00077     virtual T const* get(plint iX, plint iY, plint iZ) const =0;
00078     plint getNdim() const { return ndim; }
00079 private:
00080     plint ndim;
00081 };
00082 
00083 }  // namespace plb
00084 
00085 
00086 #endif  // DATA_FIELD_BASE_3D_H