1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 This object provides mapping and fill-in information for point data
29 between the two meshes after the topological change. It is
30 constructed from mapPolyMesh.
35 \*---------------------------------------------------------------------------*/
40 #include "morphFieldMapper.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // Forward declaration of classes
52 /*---------------------------------------------------------------------------*\
53 Class pointMapper Declaration
54 \*---------------------------------------------------------------------------*/
58 public morphFieldMapper
62 //- Reference to pointMesh
63 const pointMesh& pMesh_;
65 //- Reference to mapPolyMesh
66 const mapPolyMesh& mpm_;
68 //- Are there any inserted (unmapped) points
71 //- Is the mapping direct
75 // Demand-driven private data
77 //- Direct addressing (only one for of addressing is used)
78 mutable labelList* directAddrPtr_;
80 //- Interpolated addressing (only one for of addressing is used)
81 mutable labelListList* interpolationAddrPtr_;
83 //- Interpolation weights
84 mutable scalarListList* weightsPtr_;
87 mutable labelList* insertedPointLabelsPtr_;
90 // Private Member Functions
92 //- Disallow default bitwise copy construct
93 pointMapper(const pointMapper&);
95 //- Disallow default bitwise assignment
96 void operator=(const pointMapper&);
99 //- Calculate addressing for mapping with inserted points
100 void calcAddressing() const;
102 //- Clear out local storage
110 //- Construct from mapPolyMesh
111 pointMapper(const pointMesh&, const mapPolyMesh& mpm);
115 virtual ~pointMapper();
121 virtual label size() const;
123 //- Return size before mapping
124 virtual label sizeBeforeMapping() const;
126 //- Is the mapping direct
127 virtual bool direct() const
132 //- Return direct addressing
133 virtual const labelUList& directAddressing() const;
135 //- Return interpolated addressing
136 virtual const labelListList& addressing() const;
138 //- Return interpolaion weights
139 virtual const scalarListList& weights() const;
141 //- Are there any inserted points
142 bool insertedObjects() const
144 return insertedPoints_;
147 //- Return list of inserted points
148 const labelList& insertedObjectLabels() const;
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************************************************************* //