All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
faceMapper.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::faceMapper
26 
27 Description
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.
31 
32 SourceFiles
33  faceMapper.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef faceMapper_H
38 #define faceMapper_H
39 
40 #include "morphFieldMapper.H"
41 #include "HashSet.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class polyMesh;
50 class mapPolyMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class faceMapper Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class faceMapper
57 :
58  public morphFieldMapper
59 {
60  // Private Data
61 
62  //- Reference to polyMesh
63  const polyMesh& mesh_;
64 
65  //- Reference to mapPolyMesh
66  const mapPolyMesh& mpm_;
67 
68  //- Are there any inserted (unmapped) faces
69  bool insertedFaces_;
70 
71  //- Is the mapping direct
72  bool direct_;
73 
74 
75  // Demand-driven private data
76 
77  //- Direct addressing (only one for of addressing is used)
78  mutable labelList* directAddrPtr_;
79 
80  //- Interpolated addressing (only one for of addressing is used)
81  mutable labelListList* interpolationAddrPtr_;
82 
83  //- Interpolation weights
84  mutable scalarListList* weightsPtr_;
85 
86  //- Inserted faces
87  mutable labelList* insertedFaceLabelsPtr_;
88 
89 
90  // Private Member Functions
91 
92  //- Calculate addressing for mapping with inserted faces
93  void calcAddressing() const;
94 
95  //- Clear out local storage
96  void clearOut();
97 
98 
99 public:
100 
101  // Static Data Members
102 
103  // Constructors
104 
105  //- Construct from mapPolyMesh
106  faceMapper(const mapPolyMesh& mpm);
107 
108  //- Disallow default bitwise copy construction
109  faceMapper(const faceMapper&) = delete;
110 
111 
112  //- Destructor
113  virtual ~faceMapper();
114 
115 
116  // Member Functions
117 
118  //- Return size of field before mapping
119  virtual label sizeBeforeMapping() const;
120 
121  //- Return number of internal faces before mapping
122  virtual label internalSizeBeforeMapping() const;
123 
124  //- Is the mapping direct
125  virtual bool direct() const
126  {
127  return direct_;
128  }
130  virtual bool hasUnmapped() const
131  {
132  return insertedObjects();
133  }
134 
135  //- Return direct addressing
136  virtual const labelUList& directAddressing() const;
137 
138  //- Return interpolated addressing
139  virtual const labelListList& addressing() const;
140 
141  //- Return interpolation weights
142  virtual const scalarListList& weights() const;
143 
144  //- Return flux flip map
145  virtual const labelHashSet& flipFaceFlux() const;
146 
147  //- Return number of old internalFaces
148  virtual label nOldInternalFaces() const;
149 
150  //- Return old patch starts
151  virtual const labelList& oldPatchStarts() const;
152 
153  //- Return old patch sizes
154  virtual const labelList& oldPatchSizes() const;
155 
156  //- Are there any inserted faces
157  virtual bool insertedObjects() const
158  {
159  return insertedFaces_;
160  }
161 
162  //- Return list of inserted faces
163  virtual const labelList& insertedObjectLabels() const;
164 
165 
166  // Member Operators
167 
168  //- Disallow default bitwise assignment
169  void operator=(const faceMapper&) = delete;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
Definition: faceMapper.C:289
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:55
faceMapper(const mapPolyMesh &mpm)
Construct from mapPolyMesh.
Definition: faceMapper.C:204
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
Definition: faceMapper.C:357
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Definition: faceMapper.C:283
Abstract base class to hold the Field mapping for mesh morphs.
virtual bool insertedObjects() const
Are there any inserted faces.
Definition: faceMapper.H:156
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: faceMapper.C:321
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
Definition: faceMapper.C:376
virtual const scalarListList & weights() const
Return interpolation weights.
Definition: faceMapper.C:339
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:124
virtual ~faceMapper()
Destructor.
Definition: faceMapper.C:275
void operator=(const faceMapper &)=delete
Disallow default bitwise assignment.
virtual const labelList & oldPatchStarts() const
Return old patch starts.
Definition: faceMapper.C:388
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual label nOldInternalFaces() const
Return number of old internalFaces.
Definition: faceMapper.C:382
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: faceMapper.C:295
Namespace for OpenFOAM.
virtual const labelList & oldPatchSizes() const
Return old patch sizes.
Definition: faceMapper.C:394
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: faceMapper.H:129