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 cell 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
52 /*---------------------------------------------------------------------------*\
53 Class cellMapper Declaration
54 \*---------------------------------------------------------------------------*/
58 public morphFieldMapper
62 //- Reference to polyMesh
63 const polyMesh& mesh_;
65 //- Reference to mapPolyMesh
66 const mapPolyMesh& mpm_;
68 //- Are there any inserted (unmapped) cells
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* insertedCellLabelsPtr_;
90 // Private Member Functions
92 //- Disallow default bitwise copy construct
93 cellMapper(const cellMapper&);
95 //- Disallow default bitwise assignment
96 void operator=(const cellMapper&);
99 //- Calculate addressing for mapping with inserted cells
100 void calcAddressing() const;
102 //- Clear out local storage
108 // Static data members
112 //- Construct from mapPolyMesh
113 cellMapper(const mapPolyMesh& mpm);
118 virtual ~cellMapper();
124 virtual label size() const;
126 //- Return size before mapping
127 virtual label sizeBeforeMapping() const;
129 //- Is the mapping direct
130 virtual bool direct() const
135 //- Return direct addressing
136 virtual const unallocLabelList& directAddressing() const;
138 //- Return interpolated addressing
139 virtual const labelListList& addressing() const;
141 //- Return interpolaion weights
142 virtual const scalarListList& weights() const;
144 //- Are there any inserted cells
145 bool insertedObjects() const
147 return insertedCells_;
150 //- Return list of inserted cells
151 const labelList& insertedObjectLabels() const;
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 // ************************************************************************* //