1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
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.
36 \*---------------------------------------------------------------------------*/
41 #include "morphFieldMapper.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class pointMapper Declaration
55 \*---------------------------------------------------------------------------*/
59 public morphFieldMapper
63 //- Reference to pointMesh
64 const pointMesh& pMesh_;
66 //- Reference to mapPolyMesh
67 const mapPolyMesh& mpm_;
69 //- Are there any inserted (unmapped) points
72 //- Is the mapping 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_;
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
111 //- Construct from mapPolyMesh
112 pointMapper(const pointMesh&, const mapPolyMesh& mpm);
117 virtual ~pointMapper();
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
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
146 return insertedPoints_;
149 //- Return list of inserted points
150 const labelList& insertedObjectLabels() const;
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 // ************************************************************************* //