fvSurfaceMapper.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 | Copyright (C) 2011-2013 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)
75 
76  //- Interpolation weights
77  mutable scalarListList* weightsPtr_;
78 
79  //- Inserted faces
81 
82 
83 
84  // Private Member Functions
85 
86  //- Disallow default bitwise copy construct
88 
89  //- Disallow default bitwise assignment
90  void operator=(const fvSurfaceMapper&);
91 
92 
93  //- Calculate addressing
94  void calcAddressing() const;
95 
96  //- Clear out local storage
97  void clearOut();
98 
99 
100 public:
101 
102  // Constructors
103 
104  //- Construct from components
106  (
107  const fvMesh& mesh,
108  const faceMapper& fMapper
109  );
110 
111 
112  //- Destructor
113  virtual ~fvSurfaceMapper();
114 
115 
116  // Member Functions
117 
118  //- Return size
119  virtual label size() const
120  {
121  return mesh_.nInternalFaces();
122  }
123 
124  //- Return size of field before mapping
125  virtual label sizeBeforeMapping() const
126  {
128  }
129 
130  //- Is the mapping direct
131  virtual bool direct() const
132  {
133  return faceMap_.direct();
134  }
135 
136  //- Has unmapped elements
137  virtual bool hasUnmapped() const
138  {
139  return insertedObjects();
140  }
141 
142  //- Return direct addressing
143  virtual const labelUList& directAddressing() const;
144 
145  //- Return interpolated addressing
146  virtual const labelListList& addressing() const;
147 
148  //- Return interpolaion weights
149  virtual const scalarListList& weights() const;
150 
151  //- Are there any inserted faces
152  virtual bool insertedObjects() const
153  {
154  return faceMap_.insertedObjects();
155  }
156 
157  //- Return list of inserted faces
158  virtual const labelList& insertedObjectLabels() const;
159 
160  //- Return flux flip map
161  const labelHashSet& flipFaceFlux() const
162  {
163  return faceMap_.flipFaceFlux();
164  }
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Foam::fvSurfaceMapper::faceMap_
const faceMapper & faceMap_
Reference to face mapper.
Definition: fvSurfaceMapper.H:64
Foam::fvSurfaceMapper::mesh_
const fvMesh & mesh_
Reference to mesh.
Definition: fvSurfaceMapper.H:61
Foam::faceMapper::insertedObjects
virtual bool insertedObjects() const
Are there any inserted faces.
Definition: faceMapper.H:163
Foam::fvSurfaceMapper::weightsPtr_
scalarListList * weightsPtr_
Interpolation weights.
Definition: fvSurfaceMapper.H:76
morphFieldMapper.H
Foam::morphFieldMapper
Abstract base class to hold the Field mapping for mesh morphs.
Definition: morphFieldMapper.H:46
mapPolyMesh.H
Foam::fvSurfaceMapper::hasUnmapped
virtual bool hasUnmapped() const
Has unmapped elements.
Definition: fvSurfaceMapper.H:136
Foam::faceMapper::internalSizeBeforeMapping
virtual label internalSizeBeforeMapping() const
Return number of internal faces before mapping.
Definition: faceMapper.C:296
Foam::fvSurfaceMapper::addressing
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: fvSurfaceMapper.C:191
Foam::fvSurfaceMapper::fvSurfaceMapper
fvSurfaceMapper(const fvSurfaceMapper &)
Disallow default bitwise copy construct.
Foam::fvSurfaceMapper::directAddrPtr_
labelList * directAddrPtr_
Direct addressing (only one for of addressing is used)
Definition: fvSurfaceMapper.H:70
Foam::fvSurfaceMapper::clearOut
void clearOut()
Clear out local storage.
Definition: fvSurfaceMapper.C:135
Foam::HashSet< label, Hash< label > >
Foam::fvSurfaceMapper::directAddressing
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: fvSurfaceMapper.C:173
Foam::label
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
Foam::fvSurfaceMapper::size
virtual label size() const
Return size.
Definition: fvSurfaceMapper.H:118
Foam::fvSurfaceMapper::direct
virtual bool direct() const
Is the mapping direct.
Definition: fvSurfaceMapper.H:130
Foam::fvSurfaceMapper::operator=
void operator=(const fvSurfaceMapper &)
Disallow default bitwise assignment.
Foam::fvSurfaceMapper::~fvSurfaceMapper
virtual ~fvSurfaceMapper()
Destructor.
Definition: fvSurfaceMapper.C:165
faceMapper.H
HashSet.H
Foam::faceMapper
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:55
Foam::primitiveMesh::nInternalFaces
label nInternalFaces() const
Definition: primitiveMeshI.H:52
Foam::faceMapper::direct
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:131
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::faceMapper::flipFaceFlux
virtual const labelHashSet & flipFaceFlux() const
Return flux flip map.
Definition: faceMapper.C:383
Foam::fvSurfaceMapper::interpolationAddrPtr_
labelListList * interpolationAddrPtr_
Interpolated addressing (only one for of addressing is used)
Definition: fvSurfaceMapper.H:73
Foam::fvSurfaceMapper::calcAddressing
void calcAddressing() const
Calculate addressing.
Definition: fvSurfaceMapper.C:36
Foam::fvSurfaceMapper::flipFaceFlux
const labelHashSet & flipFaceFlux() const
Return flux flip map.
Definition: fvSurfaceMapper.H:160
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::UList
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
Foam::fvSurfaceMapper::insertedObjectLabels
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
Definition: fvSurfaceMapper.C:227
Foam::fvSurfaceMapper::insertedObjects
virtual bool insertedObjects() const
Are there any inserted faces.
Definition: fvSurfaceMapper.H:151
Foam::fvSurfaceMapper::sizeBeforeMapping
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Definition: fvSurfaceMapper.H:124
Foam::fvSurfaceMapper
FV surface mapper.
Definition: fvSurfaceMapper.H:54
Foam::fvSurfaceMapper::weights
virtual const scalarListList & weights() const
Return interpolaion weights.
Definition: fvSurfaceMapper.C:209
Foam::fvSurfaceMapper::insertedObjectLabelsPtr_
labelList * insertedObjectLabelsPtr_
Inserted faces.
Definition: fvSurfaceMapper.H:79