1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. 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 form of addressing is used)
78 mutable labelList* directAddrPtr_;
80 //- Interpolated addressing (only one form 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);
118 virtual ~faceMapper();
124 virtual label size() const;
126 //- Return size of field before mapping
127 virtual label sizeBeforeMapping() const;
129 //- Return number of internal faces before mapping
130 virtual label internalSizeBeforeMapping() const;
132 //- Is the mapping direct
133 virtual bool direct() const
138 //- Return direct addressing
139 virtual const unallocLabelList& directAddressing() const;
141 //- Return interpolated addressing
142 virtual const labelListList& addressing() const;
144 //- Return interpolaion weights
145 virtual const scalarListList& weights() const;
147 //- Return flux flip map
148 virtual const labelHashSet& flipFaceFlux() const;
150 //- Return number of old internalFaces
151 virtual label nOldInternalFaces() const;
153 //- Return old patch starts
154 virtual const labelList& oldPatchStarts() const;
156 //- Return old patch sizes
157 virtual const labelList& oldPatchSizes() const;
159 //- Are there any inserted faces
160 virtual bool insertedObjects() const
162 return insertedFaces_;
165 //- Return list of inserted faces
166 virtual const labelList& insertedObjectLabels() const;
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 } // End namespace Foam
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 // ************************************************************************* //