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

multiGridDataField3D.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 
00025 /* Main author: Daniel Lagrava
00026  **/
00027 
00028 #ifndef MULTI_GRID_DATA_FIELD_3D_H
00029 #define MULTI_GRID_DATA_FIELD_3D_H
00030 
00031 #include "core/globalDefs.h"
00032 #include "core/globalDefs.h"
00033 #include "core/plbDebug.h"
00034 #include "core/dataFieldBase3D.h"
00035 #include "core/dataFieldBase3D.h"
00036 #include "atomicBlock/dataField3D.h"
00037 #include "multiBlock/multiBlock3D.h"
00038 #include "multiGrid/multiGrid3D.h"
00039 
00040 namespace plb {
00041 
00042 template<typename T>
00043 class MultiGridScalarField3D : public ScalarFieldBase3D<T>, public MultiGrid3D {
00044     public:
00045         MultiGridScalarField3D (
00046                         MultiGridManagement3D management_,
00047                         std::vector<BlockCommunicator3D* > communicators_,
00048                         std::vector<CombinedStatistics*> combinedStatistics_, 
00049                         plint behaviorLevel_=0 );
00050 
00051         MultiGridScalarField3D (
00052                         MultiGridManagement3D management_,
00053                         plint behaviorLevel_=0 );
00054                         
00055         
00056                         
00057         MultiGridScalarField3D(MultiGridScalarField3D<T> const& rhs);
00058         MultiGridScalarField3D(MultiGrid3D const& rhs);
00059         MultiGridScalarField3D(MultiGrid3D const& rhs, Box3D subDomain, bool crop=true);
00060         
00061         ~MultiGridScalarField3D();
00062         
00063     /* ************ ScalarFieldBase3D ************* */
00064     public:
00065         void reset();
00066         T& get(plint iX, plint iY, plint iZ);
00067         T const& get(plint iX, plint iY, plint iZ) const;
00068         
00069     /* ************ MultiGrid3D ************* */    
00070     public:
00071         MultiScalarField3D<T>& getComponent(plint level);
00072         MultiScalarField3D<T> const& getComponent(plint level) const;
00073         int getBlockId() const;
00074         std::auto_ptr<MultiScalarField3D<T> > convertToCoarsest(plint dimDx, plint dimDt);
00075         std::auto_ptr<MultiScalarField3D<T> > convertToFinest(plint dimDx, plint dimDt);
00076    
00077     private:
00079         void allocateFields();
00080         void allocateFields( std::vector<BlockCommunicator3D* > communicators,
00081                              std::vector<CombinedStatistics*> combinedStatistics );
00082     private:
00083         std::vector<MultiScalarField3D<T> *> fields;
00084 };
00085 
00086 
00087 template<typename T, int nDim>
00088 class MultiGridTensorField3D : public TensorFieldBase3D<T,nDim>, public MultiGrid3D {
00089     public:
00090         MultiGridTensorField3D (
00091                         MultiGridManagement3D management_,
00092                         std::vector<BlockCommunicator3D* > communicators_,
00093                         std::vector<CombinedStatistics*> combinedStatistics_, 
00094                         plint behaviorLevel_=0 );
00095 
00096         MultiGridTensorField3D (
00097                         MultiGridManagement3D management_,
00098                         plint behaviorLevel_=0 );
00099                         
00100         MultiGridTensorField3D(MultiGridTensorField3D<T,nDim> const& rhs);
00101         MultiGridTensorField3D(MultiGrid3D const& rhs);
00102         MultiGridTensorField3D(MultiGrid3D const& rhs, Box3D subDomain, bool crop=true);
00103 
00104         ~MultiGridTensorField3D();
00105         
00106     /* ************ TensorFieldBase3D ************* */
00107     public:
00108         void reset();
00109         virtual Array<T,nDim>& get(plint iX, plint iY, plint iZ);
00110         virtual Array<T,nDim> const& get(plint iX, plint iY, plint iZ) const;
00111         
00112     /* ************ MultiGrid3D ************* */    
00113     public:
00114         MultiTensorField3D<T,nDim>& getComponent(plint level);
00115         MultiTensorField3D<T,nDim> const& getComponent(plint level) const;
00116         int getBlockId() const;
00117         std::auto_ptr<MultiTensorField3D<T,nDim> > convertToCoarsest(plint dimDx, plint dimDt);
00118         std::auto_ptr<MultiTensorField3D<T,nDim> > convertToFinest(plint dimDx, plint dimDt);
00119     private:
00121         void allocateFields();
00122         void allocateFields( std::vector<BlockCommunicator3D* > communicators,
00123                              std::vector<CombinedStatistics*> combinedStatistics );
00124 
00125     private:
00126         std::vector<MultiTensorField3D<T,nDim> *> fields;
00127 };
00128 
00129 
00130 
00131 } // namespace plb
00132 
00133 #endif  // MULTI_GRID_DATA_FIELD_3D_H
00134