initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / pointMesh / pointMeshMapper / pointMapper.H
blobcdd33249b99bac6b222f63dfb7d7113cfcc36015
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::pointMapper
28 Description
29     This object provides mapping and fill-in information for point data
30     between the two meshes after the topological change.  It is
31     constructed from mapPolyMesh.
33 SourceFiles
34     pointMapper.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef pointMapper_H
39 #define pointMapper_H
41 #include "morphFieldMapper.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 // Forward declaration of classes
49 class pointMesh;
50 class mapPolyMesh;
51 class polyMesh;
53 /*---------------------------------------------------------------------------*\
54                            Class pointMapper Declaration
55 \*---------------------------------------------------------------------------*/
57 class pointMapper
59     public morphFieldMapper
61     // Private data
63         //- Reference to pointMesh
64         const pointMesh& pMesh_;
66         //- Reference to mapPolyMesh
67         const mapPolyMesh& mpm_;
69         //- Are there any inserted (unmapped) points
70         bool insertedPoints_;
72         //- Is the mapping direct
73         bool direct_;
76     // Demand-driven private data
78         //- Direct addressing (only one for of addressing is used)
79         mutable labelList* directAddrPtr_;
81         //- Interpolated addressing (only one for of addressing is used)
82         mutable labelListList* interpolationAddrPtr_;
84         //- Interpolation weights
85         mutable scalarListList* weightsPtr_;
87         //- Inserted points
88         mutable labelList* insertedPointLabelsPtr_;
91     // Private Member Functions
93         //- Disallow default bitwise copy construct
94         pointMapper(const pointMapper&);
96         //- Disallow default bitwise assignment
97         void operator=(const pointMapper&);
100         //- Calculate addressing for mapping with inserted points
101         void calcAddressing() const;
103         //- Clear out local storage
104         void clearOut();
107 public:
109     // Constructors
111         //- Construct from mapPolyMesh
112         pointMapper(const pointMesh&, const mapPolyMesh& mpm);
115     // Destructor
117         virtual ~pointMapper();
120     // Member Functions
122         //- Return size
123         virtual label size() const;
125         //- Return size before mapping
126         virtual label sizeBeforeMapping() const;
128         //- Is the mapping direct
129         virtual bool direct() const
130         {
131             return direct_;
132         }
134         //- Return direct addressing
135         virtual const unallocLabelList& directAddressing() const;
137         //- Return interpolated addressing
138         virtual const labelListList& addressing() const;
140         //- Return interpolaion weights
141         virtual const scalarListList& weights() const;
143         //- Are there any inserted points
144         bool insertedObjects() const
145         {
146             return insertedPoints_;
147         }
149         //- Return list of inserted points
150         const labelList& insertedObjectLabels() const;
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 #endif
162 // ************************************************************************* //