OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

mapDistributeLagrangian.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::mapDistributeLagrangian
00027 
00028 Description
00029     Class containing mesh-to-mesh mapping information for particles
00030 
00031 SourceFiles
00032     mapDistributeLagrangian.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef mapDistributeLagrangian_H
00037 #define mapDistributeLagrangian_H
00038 
00039 #include "mapDistribute.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 class mapPolyMesh;
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class mapDistributeLagrangian Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class mapDistributeLagrangian
00053 {
00054     // Private data
00055 
00056         //- Map to distribute particles
00057         const mapDistribute particleMap_;
00058 
00059         //- Per element in subsetted mesh the cell label
00060         const labelListList constructCellLabels_;
00061 
00062 
00063 public:
00064 
00065     // Constructors
00066 
00067         //- Construct from components
00068         mapDistributeLagrangian
00069         (
00070             const label nNewParticles,
00071             const labelListList& subParticleMap,
00072             const labelListList& constructParticleMap,
00073             const labelListList& constructCellLabels
00074         )
00075         :
00076             particleMap_(nNewParticles, subParticleMap, constructParticleMap),
00077             constructCellLabels_(constructCellLabels)
00078         {}
00079 
00080         //- Construct from components and steal storage
00081         mapDistributeLagrangian
00082         (
00083             const label nNewParticles,
00084             labelListList& subParticleMap,
00085             labelListList& constructParticleMap,
00086             labelListList& constructCellLabels,
00087             const bool reUse
00088         )
00089         :
00090             particleMap_
00091             (
00092                 nNewParticles,
00093                 subParticleMap,
00094                 constructParticleMap,
00095                 reUse
00096             ),
00097             constructCellLabels_(constructCellLabels, reUse)
00098         {}
00099 
00100 
00101     // Member Functions
00102 
00103         // Access
00104 
00105             //- Distribution map
00106             const mapDistribute& particleMap() const
00107             {
00108                 return particleMap_;
00109             }
00110 
00111             //- Per received particle the destination cell label
00112             const labelListList& constructCellLabels() const
00113             {
00114                 return constructCellLabels_;
00115             }
00116 
00117 
00118         // Edit
00119 
00120             //- distribute list of lagrangian data
00121             template<class T>
00122             void distributeLagrangianData(List<T>& lst) const
00123             {
00124                 particleMap_.distribute(lst);
00125             }
00126 
00127             //- Correct for topo change.
00128             void updateMesh(const mapPolyMesh&)
00129             {
00130                 notImplemented
00131                 (
00132                     "mapDistributeLagrangian::updateMesh(const mapPolyMesh&)"
00133                 );
00134             }
00135 };
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 } // End namespace Foam
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #endif
00145 
00146 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd