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 face data
29 between the two meshes after the topological change. It is
30 constructed from mapPolyMesh.
35 \*---------------------------------------------------------------------------*/
40 #include "morphFieldMapper.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Forward declaration of classes
52 /*---------------------------------------------------------------------------*\
53 Class faceMapper 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) faces
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* insertedFaceLabelsPtr_;
90 // Private Member Functions
92 //- Disallow default bitwise copy construct
93 faceMapper(const faceMapper&);
95 //- Disallow default bitwise assignment
96 void operator=(const faceMapper&);
99 //- Calculate addressing for mapping with inserted faces
100 void calcAddressing() const;
102 //- Clear out local storage
108 // Static data members
112 //- Construct from mapPolyMesh
113 faceMapper(const mapPolyMesh& mpm);
117 virtual ~faceMapper();
123 virtual label size() const;
125 //- Return size of field before mapping
126 virtual label sizeBeforeMapping() const;
128 //- Return number of internal faces before mapping
129 virtual label internalSizeBeforeMapping() const;
131 //- Is the mapping direct
132 virtual bool direct() const
137 //- Return direct addressing
138 virtual const labelUList& directAddressing() const;
140 //- Return interpolated addressing
141 virtual const labelListList& addressing() const;
143 //- Return interpolaion weights
144 virtual const scalarListList& weights() const;
146 //- Return flux flip map
147 virtual const labelHashSet& flipFaceFlux() const;
149 //- Return number of old internalFaces
150 virtual label nOldInternalFaces() const;
152 //- Return old patch starts
153 virtual const labelList& oldPatchStarts() const;
155 //- Return old patch sizes
156 virtual const labelList& oldPatchSizes() const;
158 //- Are there any inserted faces
159 virtual bool insertedObjects() const
161 return insertedFaces_;
164 //- Return list of inserted faces
165 virtual const labelList& insertedObjectLabels() const;
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 // ************************************************************************* //