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

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