1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 face data
30 between the two meshes after the topological change. It is
31 constructed from mapPolyMesh.
36 \*---------------------------------------------------------------------------*/
41 #include "morphFieldMapper.H"
42 #include "labelHashSet.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class faceMapper Declaration
55 \*---------------------------------------------------------------------------*/
59 public morphFieldMapper
63 //- Reference to polyMesh
64 const polyMesh& mesh_;
66 //- Reference to mapPolyMesh
67 const mapPolyMesh& mpm_;
69 //- Are there any inserted (unmapped) faces
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* insertedFaceLabelsPtr_;
91 // Private Member Functions
93 //- Disallow default bitwise copy construct
94 faceMapper(const faceMapper&);
96 //- Disallow default bitwise assignment
97 void operator=(const faceMapper&);
100 //- Calculate addressing for mapping with inserted faces
101 void calcAddressing() const;
103 //- Clear out local storage
109 // Static data members
113 //- Construct from mapPolyMesh
114 faceMapper(const mapPolyMesh& mpm);
119 virtual ~faceMapper();
125 virtual label size() const;
127 //- Return size of field before mapping
128 virtual label sizeBeforeMapping() const;
130 //- Return number of internal faces before mapping
131 virtual label internalSizeBeforeMapping() const;
133 //- Is the mapping direct
134 virtual bool direct() const
139 //- Return direct addressing
140 virtual const unallocLabelList& directAddressing() const;
142 //- Return interpolated addressing
143 virtual const labelListList& addressing() const;
145 //- Return interpolaion weights
146 virtual const scalarListList& weights() const;
148 //- Return flux flip map
149 virtual const labelHashSet& flipFaceFlux() const;
151 //- Return number of old internalFaces
152 virtual label nOldInternalFaces() const;
154 //- Return old patch starts
155 virtual const labelList& oldPatchStarts() const;
157 //- Return old patch sizes
158 virtual const labelList& oldPatchSizes() const;
160 //- Are there any inserted faces
161 virtual bool insertedObjects() const
163 return insertedFaces_;
166 //- Return list of inserted faces
167 virtual const labelList& insertedObjectLabels() const;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 // ************************************************************************* //