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

fvSurfaceMapper.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::fvSurfaceMapper
00026 
00027 Description
00028     FV surface mapper.
00029 
00030 SourceFiles
00031     fvSurfaceMapper.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef fvSurfaceMapper_H
00036 #define fvSurfaceMapper_H
00037 
00038 #include <OpenFOAM/morphFieldMapper.H>
00039 #include <finiteVolume/fvMesh.H>
00040 #include <OpenFOAM/faceMapper.H>
00041 #include <OpenFOAM/HashSet.H>
00042 #include <OpenFOAM/mapPolyMesh.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 // Forward declaration of classes
00050 
00051 /*---------------------------------------------------------------------------*\
00052                          Class fvSurfaceMapper Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class fvSurfaceMapper
00056 :
00057     public morphFieldMapper
00058 {
00059     // Private data
00060 
00061         //- Reference to mesh
00062         const fvMesh& mesh_;
00063 
00064         //- Reference to face mapper
00065         const faceMapper& faceMap_;
00066 
00067 
00068     // Demand-driven private data
00069 
00070         //- Direct addressing (only one for of addressing is used)
00071         mutable labelList* directAddrPtr_;
00072 
00073         //- Interpolated addressing (only one for of addressing is used)
00074         mutable labelListList* interpolationAddrPtr_;
00075 
00076         //- Interpolation weights
00077         mutable scalarListList* weightsPtr_;
00078 
00079         //- Inserted faces
00080         mutable labelList* insertedObjectLabelsPtr_;
00081 
00082 
00083 
00084     // Private Member Functions
00085 
00086         //- Disallow default bitwise copy construct
00087         fvSurfaceMapper(const fvSurfaceMapper&);
00088 
00089         //- Disallow default bitwise assignment
00090         void operator=(const fvSurfaceMapper&);
00091 
00092 
00093         //- Calculate addressing
00094         void calcAddressing() const;
00095 
00096         //- Clear out local storage
00097         void clearOut();
00098 
00099 
00100 public:
00101 
00102     // Constructors
00103 
00104         //- Construct from components
00105         fvSurfaceMapper
00106         (
00107             const fvMesh& mesh,
00108             const faceMapper& fMapper
00109         );
00110 
00111 
00112     // Destructor
00113 
00114         virtual ~fvSurfaceMapper();
00115 
00116 
00117     // Member Functions
00118 
00119         //- Return size
00120         virtual label size() const
00121         {
00122             return mesh_.nInternalFaces();
00123         }
00124 
00125         //- Return size of field before mapping
00126         virtual label sizeBeforeMapping() const
00127         {
00128             return faceMap_.internalSizeBeforeMapping();
00129         }
00130 
00131         //- Is the mapping direct
00132         virtual bool direct() const
00133         {
00134             return faceMap_.direct();
00135         }
00136 
00137         //- Return direct addressing
00138         virtual const unallocLabelList& directAddressing() const;
00139 
00140         //- Return interpolated addressing
00141         virtual const labelListList& addressing() const;
00142 
00143         //- Return interpolaion weights
00144         virtual const scalarListList& weights() const;
00145 
00146         //- Are there any inserted faces
00147         virtual bool insertedObjects() const
00148         {
00149             return faceMap_.insertedObjects();
00150         }
00151 
00152         //- Return list of inserted faces
00153         virtual const labelList& insertedObjectLabels() const;
00154 
00155         //- Return flux flip map
00156         const labelHashSet& flipFaceFlux() const
00157         {
00158             return faceMap_.flipFaceFlux();
00159         }
00160 };
00161 
00162 
00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00164 
00165 } // End namespace Foam
00166 
00167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00168 
00169 #endif
00170 
00171 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines