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

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