FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::mapDistributeLagrangian
00026 
00027 Description
00028     Class containing mesh-to-mesh mapping information for particles
00029 
00030 SourceFiles
00031     mapDistributeLagrangian.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef mapDistributeLagrangian_H
00036 #define mapDistributeLagrangian_H
00037 
00038 #include <OpenFOAM/mapDistribute.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 class mapPolyMesh;
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class mapDistributeLagrangian Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class mapDistributeLagrangian
00052 {
00053     // Private data
00054 
00055         //- Map to distribute particles
00056         const mapDistribute particleMap_;
00057 
00058         //- Per element in subsetted mesh the cell label
00059         const labelListList constructCellLabels_;
00060 
00061 
00062 public:
00063 
00064     // Constructors
00065 
00066         //- Construct from components
00067         mapDistributeLagrangian
00068         (
00069             const label nNewParticles,
00070             const labelListList& subParticleMap,
00071             const labelListList& constructParticleMap,
00072             const labelListList& constructCellLabels
00073         )
00074         :
00075             particleMap_(nNewParticles, subParticleMap, constructParticleMap),
00076             constructCellLabels_(constructCellLabels)
00077         {}
00078 
00079         //- Construct from components and steal storage
00080         mapDistributeLagrangian
00081         (
00082             const label nNewParticles,
00083             labelListList& subParticleMap,
00084             labelListList& constructParticleMap,
00085             labelListList& constructCellLabels,
00086             const bool reUse
00087         )
00088         :
00089             particleMap_
00090             (
00091                 nNewParticles,
00092                 subParticleMap,
00093                 constructParticleMap,
00094                 reUse
00095             ),
00096             constructCellLabels_(constructCellLabels, reUse)
00097         {}
00098 
00099 
00100     // Member Functions
00101 
00102         // Access
00103 
00104             //- Distribution map
00105             const mapDistribute& particleMap() const
00106             {
00107                 return particleMap_;
00108             }
00109 
00110             //- Per received particle the destination cell label
00111             const labelListList& constructCellLabels() const
00112             {
00113                 return constructCellLabels_;
00114             }
00115 
00116 
00117         // Edit
00118 
00119             //- distribute list of lagrangian data
00120             template<class T>
00121             void distributeLagrangianData(List<T>& lst) const
00122             {
00123                 particleMap_.distribute(lst);
00124             }
00125 
00126             //- Correct for topo change.
00127             void updateMesh(const mapPolyMesh&)
00128             {
00129                 notImplemented
00130                 (
00131                     "mapDistributeLagrangian::updateMesh(const mapPolyMesh&)"
00132                 );
00133             }
00134 };
00135 
00136 
00137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00138 
00139 } // End namespace Foam
00140 
00141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00142 
00143 #endif
00144 
00145 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines