All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fvSurfaceMapper.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::fvSurfaceMapper
26 
27 Description
28  FV surface mapper.
29 
30 SourceFiles
31  fvSurfaceMapper.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvSurfaceMapper_H
36 #define fvSurfaceMapper_H
37 
38 #include "morphFieldMapper.H"
39 #include "fvMesh.H"
40 #include "faceMapper.H"
41 #include "HashSet.H"
42 #include "mapPolyMesh.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of classes
50 
51 /*---------------------------------------------------------------------------*\
52  Class fvSurfaceMapper Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class fvSurfaceMapper
56 :
57  public morphFieldMapper
58 {
59  // Private Data
60 
61  //- Reference to mesh
62  const fvMesh& mesh_;
63 
64  //- Reference to face mapper
65  const faceMapper& faceMap_;
66 
67 
68  // Demand-driven private data
69 
70  //- Direct addressing (only one for of addressing is used)
71  mutable labelList* directAddrPtr_;
72 
73  //- Interpolated addressing (only one for of addressing is used)
74  mutable labelListList* interpolationAddrPtr_;
75 
76  //- Interpolation weights
77  mutable scalarListList* weightsPtr_;
78 
79  //- Inserted faces
80  mutable labelList* insertedObjectLabelsPtr_;
81 
82 
83 
84  // Private Member Functions
85 
86  //- Calculate addressing
87  void calcAddressing() const;
88 
89  //- Clear out local storage
90  void clearOut();
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const fvMesh& mesh,
101  const faceMapper& fMapper
102  );
103 
104  //- Disallow default bitwise copy construction
105  fvSurfaceMapper(const fvSurfaceMapper&) = delete;
106 
107 
108  //- Destructor
109  virtual ~fvSurfaceMapper();
110 
111 
112  // Member Functions
113 
114  //- Return size of field before mapping
115  virtual label sizeBeforeMapping() const
116  {
117  return faceMap_.internalSizeBeforeMapping();
118  }
119 
120  //- Is the mapping direct
121  virtual bool direct() const
122  {
123  return faceMap_.direct();
124  }
125 
126  //- Has unmapped elements
127  virtual bool hasUnmapped() const
128  {
129  return insertedObjects();
130  }
131 
132  //- Return direct addressing
133  virtual const labelUList& directAddressing() const;
134 
135  //- Return interpolated addressing
136  virtual const labelListList& addressing() const;
137 
138  //- Return interpolation weights
139  virtual const scalarListList& weights() const;
140 
141  //- Are there any inserted faces
142  virtual bool insertedObjects() const
143  {
144  return faceMap_.insertedObjects();
145  }
146 
147  //- Return list of inserted faces
148  virtual const labelList& insertedObjectLabels() const;
149 
150  //- Return flux flip map
151  const labelHashSet& flipFaceFlux() const
152  {
153  return faceMap_.flipFaceFlux();
154  }
155 
156 
157  // Member Operators
158 
159  //- Disallow default bitwise assignment
160  void operator=(const fvSurfaceMapper&) = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
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
virtual bool insertedObjects() const
Are there any inserted faces.
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:55
fvSurfaceMapper(const fvMesh &mesh, const faceMapper &fMapper)
Construct from components.
virtual bool direct() const
Is the mapping direct.
FV surface mapper.
virtual bool hasUnmapped() const
Has unmapped elements.
void operator=(const fvSurfaceMapper &)=delete
Disallow default bitwise assignment.
virtual ~fvSurfaceMapper()
Destructor.
dynamicFvMesh & mesh
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 labelUList & directAddressing() const
Return direct addressing.
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
Definition: faceMapper.C:376
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 const labelList & insertedObjectLabels() const
Return list of inserted faces.
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:124
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual const scalarListList & weights() const
Return interpolation weights.
const labelHashSet & flipFaceFlux() const
Return flux flip map.
virtual const labelListList & addressing() const
Return interpolated addressing.
Namespace for OpenFOAM.