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

pointMapper.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::pointMapper
00026 
00027 Description
00028     This object provides mapping and fill-in information for point data
00029     between the two meshes after the topological change.  It is
00030     constructed from mapPolyMesh.
00031 
00032 SourceFiles
00033     pointMapper.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef pointMapper_H
00038 #define pointMapper_H
00039 
00040 #include <OpenFOAM/morphFieldMapper.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 // Forward declaration of classes
00048 class pointMesh;
00049 class mapPolyMesh;
00050 class polyMesh;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class pointMapper Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class pointMapper
00057 :
00058     public morphFieldMapper
00059 {
00060     // Private data
00061 
00062         //- Reference to pointMesh
00063         const pointMesh& pMesh_;
00064 
00065         //- Reference to mapPolyMesh
00066         const mapPolyMesh& mpm_;
00067 
00068         //- Are there any inserted (unmapped) points
00069         bool insertedPoints_;
00070 
00071         //- Is the mapping direct
00072         bool direct_;
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         //- Inserted points
00087         mutable labelList* insertedPointLabelsPtr_;
00088 
00089 
00090     // Private Member Functions
00091 
00092         //- Disallow default bitwise copy construct
00093         pointMapper(const pointMapper&);
00094 
00095         //- Disallow default bitwise assignment
00096         void operator=(const pointMapper&);
00097 
00098 
00099         //- Calculate addressing for mapping with inserted points
00100         void calcAddressing() const;
00101 
00102         //- Clear out local storage
00103         void clearOut();
00104 
00105 
00106 public:
00107 
00108     // Constructors
00109 
00110         //- Construct from mapPolyMesh
00111         pointMapper(const pointMesh&, const mapPolyMesh& mpm);
00112 
00113 
00114     // Destructor
00115 
00116         virtual ~pointMapper();
00117 
00118 
00119     // Member Functions
00120 
00121         //- Return size
00122         virtual label size() const;
00123 
00124         //- Return size before mapping
00125         virtual label sizeBeforeMapping() const;
00126 
00127         //- Is the mapping direct
00128         virtual bool direct() const
00129         {
00130             return direct_;
00131         }
00132 
00133         //- Return direct addressing
00134         virtual const unallocLabelList& directAddressing() const;
00135 
00136         //- Return interpolated addressing
00137         virtual const labelListList& addressing() const;
00138 
00139         //- Return interpolaion weights
00140         virtual const scalarListList& weights() const;
00141 
00142         //- Are there any inserted points
00143         bool insertedObjects() const
00144         {
00145             return insertedPoints_;
00146         }
00147 
00148         //- Return list of inserted points
00149         const labelList& insertedObjectLabels() const;
00150 };
00151 
00152 
00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00154 
00155 } // End namespace Foam
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 #endif
00160 
00161 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines