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 cell 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
51 /*---------------------------------------------------------------------------*\
52 Class cellMapper Declaration
53 \*---------------------------------------------------------------------------*/
57 public morphFieldMapper
61 //- Reference to polyMesh
62 const polyMesh& mesh_;
64 //- Reference to mapPolyMesh
65 const mapPolyMesh& mpm_;
67 //- Are there any inserted (unmapped) cells
70 //- Is the mapping direct
74 // Demand-driven private data
76 //- Direct addressing (only one for of addressing is used)
77 mutable labelList* directAddrPtr_;
79 //- Interpolated addressing (only one for of addressing is used)
80 mutable labelListList* interpolationAddrPtr_;
82 //- Interpolation weights
83 mutable scalarListList* weightsPtr_;
86 mutable labelList* insertedCellLabelsPtr_;
89 // Private Member Functions
91 //- Disallow default bitwise copy construct
92 cellMapper(const cellMapper&);
94 //- Disallow default bitwise assignment
95 void operator=(const cellMapper&);
98 //- Calculate addressing for mapping with inserted cells
99 void calcAddressing() const;
101 //- Clear out local storage
107 // Static data members
111 //- Construct from mapPolyMesh
112 cellMapper(const mapPolyMesh& mpm);
116 virtual ~cellMapper();
122 virtual label size() const;
124 //- Return size before mapping
125 virtual label sizeBeforeMapping() const;
127 //- Is the mapping direct
128 virtual bool direct() const
133 //- Return direct addressing
134 virtual const labelUList& directAddressing() const;
136 //- Return interpolated addressing
137 virtual const labelListList& addressing() const;
139 //- Return interpolaion weights
140 virtual const scalarListList& weights() const;
142 //- Are there any inserted cells
143 bool insertedObjects() const
145 return insertedCells_;
148 //- Return list of inserted cells
149 const labelList& insertedObjectLabels() const;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //