cellMapper.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2013 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::cellMapper
28
29Description
30 This object provides mapping and fill-in information for cell data
31 between the two meshes after the topological change. It is
32 constructed from mapPolyMesh.
33
34SourceFiles
35 cellMapper.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef cellMapper_H
40#define cellMapper_H
41
42#include "morphFieldMapper.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49// Forward declaration of classes
50class polyMesh;
51class mapPolyMesh;
52
53/*---------------------------------------------------------------------------*\
54 Class cellMapper Declaration
55\*---------------------------------------------------------------------------*/
57class cellMapper
58:
59 public morphFieldMapper
60{
61 // Private data
62
63 //- Reference to polyMesh
64 const polyMesh& mesh_;
65
66 //- Reference to mapPolyMesh
67 const mapPolyMesh& mpm_;
68
69 //- Are there any inserted (unmapped) cells
70 bool insertedCells_;
71
72 //- Is the mapping direct
73 bool direct_;
74
75
76 // Demand-driven private data
77
78 //- Direct addressing (only one for of addressing is used)
79 mutable labelList* directAddrPtr_;
80
81 //- Interpolated addressing (only one for of addressing is used)
82 mutable labelListList* interpolationAddrPtr_;
83
84 //- Interpolation weights
85 mutable scalarListList* weightsPtr_;
86
87 //- Inserted cells
88 mutable labelList* insertedCellLabelsPtr_;
89
90
91 // Private Member Functions
92
93 //- No copy construct
94 cellMapper(const cellMapper&) = delete;
95
96 //- No copy assignment
97 void operator=(const cellMapper&) = delete;
98
99
100 //- Calculate addressing for mapping with inserted cells
101 void calcAddressing() const;
102
103 //- Clear out local storage
104 void clearOut();
105
106
107public:
108
109 // Static data members
110
111 // Constructors
112
113 //- Construct from mapPolyMesh
114 cellMapper(const mapPolyMesh& mpm);
115
116
117 //- Destructor
118 virtual ~cellMapper();
119
120
121 // Member Functions
122
123 //- Return size
124 virtual label size() const;
125
126 //- Return size before mapping
127 virtual label sizeBeforeMapping() const;
128
129 //- Is the mapping direct
130 virtual bool direct() const
131 {
132 return direct_;
133 }
135 virtual bool hasUnmapped() const
136 {
137 return insertedObjects();
138 }
139
140 //- Return direct addressing
141 virtual const labelUList& directAddressing() const;
142
143 //- Return interpolated addressing
144 virtual const labelListList& addressing() const;
145
146 //- Return interpolaion weights
147 virtual const scalarListList& weights() const;
148
149 //- Are there any inserted cells
150 virtual bool insertedObjects() const
151 {
152 return insertedCells_;
153 }
154
155 //- Return list of inserted cells
156 const virtual labelList& insertedObjectLabels() const;
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
This object provides mapping and fill-in information for cell data between the two meshes after the t...
Definition: cellMapper.H:59
virtual ~cellMapper()
Destructor.
Definition: cellMapper.C:370
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: cellMapper.C:416
virtual const scalarListList & weights() const
Return interpolaion weights.
Definition: cellMapper.C:434
virtual bool hasUnmapped() const
Any unmapped values?
Definition: cellMapper.H:134
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: cellMapper.C:390
virtual label size() const
Return size.
Definition: cellMapper.C:378
virtual const labelList & insertedObjectLabels() const
Return list of inserted cells.
Definition: cellMapper.C:452
virtual label sizeBeforeMapping() const
Return size before mapping.
Definition: cellMapper.C:384
virtual bool insertedObjects() const
Are there any inserted cells.
Definition: cellMapper.H:149
virtual bool direct() const
Is the mapping direct.
Definition: cellMapper.H:129
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Abstract base class to hold the Field mapping for mesh morphs.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Namespace for OpenFOAM.