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 internal
29 face data between the two meshes after topological changes.
30 It is constructed from mapPolyMesh.
34 University of Massachusetts Amherst
40 \*---------------------------------------------------------------------------*/
42 #ifndef topoSurfaceMapper_H
43 #define topoSurfaceMapper_H
45 #include "topoMapper.H"
46 #include "morphFieldMapper.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class topoSurfaceMapper Declaration
55 \*---------------------------------------------------------------------------*/
57 class topoSurfaceMapper
59 public morphFieldMapper
63 //- Reference to polyMesh
64 const polyMesh& mesh_;
66 //- Reference to mapPolyMesh
67 const mapPolyMesh& mpm_;
69 //- Reference to the topoMapper
70 const topoMapper& tMapper_;
72 //- Is the mapping direct
75 //- Size before mapping
76 mutable label sizeBeforeMapping_;
78 // Demand-driven private data
81 mutable labelList* directAddrPtr_;
83 //- Interpolated addressing
84 mutable labelListList* interpolationAddrPtr_;
86 //- Inverse-distance weights
87 mutable scalarListList* weightsPtr_;
90 mutable labelList* insertedFaceLabelsPtr_;
92 // Private Member Functions
94 //- Disallow default bitwise copy construct
95 topoSurfaceMapper(const topoSurfaceMapper&);
97 //- Disallow default bitwise assignment
98 void operator=(const topoSurfaceMapper&);
100 //- Calculate the insertedFaceLabels list
101 void calcInsertedFaceLabels() const;
103 //- Calculate addressing for mapping
104 void calcAddressing() const;
106 //- Clear out local storage
113 //- Construct from mapPolyMesh
116 const mapPolyMesh& mpm,
117 const topoMapper& mapper
122 virtual ~topoSurfaceMapper();
127 virtual label size() const;
129 //- Return size before mapping
130 virtual label sizeBeforeMapping() const;
132 //- Is the mapping direct
133 virtual bool direct() const;
135 //- Return direct addressing
136 virtual const unallocLabelList& directAddressing() const;
138 //- Return interpolation addressing
139 virtual const labelListList& addressing() const;
142 virtual const scalarListList& weights() const;
144 //- Are there any inserted faces
145 virtual bool insertedObjects() const;
147 //- Return list of inserted faces
148 virtual const labelList& insertedObjectLabels() const;
150 //- Return flux flip map
151 const labelHashSet& flipFaceFlux() const;
153 //- Map the internal field
154 template <class Type>
155 void mapInternalField
157 const word& fieldName,
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 # include "topoSurfaceMapperTemplates.C"
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 // ************************************************************************* //