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

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