fvPatchMapper.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::fvPatchMapper
26 
27 Description
28  Mapping class for a fvPatchField.
29 
30 SourceFiles
31  fvPatchMapper.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvPatchMapper_H
36 #define fvPatchMapper_H
37 
38 #include "fvPatchFieldMapper.H"
39 #include "faceMapper.H"
40 #include "fvPatch.H"
41 #include "primitiveFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class fvPatch;
50 class mapPolyMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class fvPatchMapper Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class fvPatchMapper
57 :
59 {
60  // Private Data
61 
62  //- Reference to patch
63  const fvPatch& patch_;
64 
65  //- Reference to face mapper
66  const faceMapper& faceMap_;
67 
68  //- Size before mapping
69  const label sizeBeforeMapping_;
70 
71 
72  // Demand-driven private data
73 
74  mutable bool hasUnmapped_;
75 
76  //- Direct addressing (only one for of addressing is used)
77  mutable labelList* directAddrPtr_;
78 
79  //- Interpolated addressing (only one for of addressing is used)
80  mutable labelListList* interpolationAddrPtr_;
81 
82  //- Interpolation weights
83  mutable scalarListList* weightsPtr_;
84 
85 
86  // Private Member Functions
87 
88  //- Calculate addressing for mapping with inserted cells
89  void calcAddressing() const;
90 
91  //- Clear out local storage
92  void clearOut();
93 
94 
95 public:
96 
97  // Static Data Members
98 
99  // Constructors
100 
101  //- Construct from mappers
103  (
104  const fvPatch& patch,
105  const faceMapper& faceMap
106  );
107 
108  //- Disallow default bitwise copy construction
110  (
111  const fvPatchMapper&
112  );
113 
114 
115  //- Destructor
116  virtual ~fvPatchMapper();
117 
118 
119  // Member Functions
120 
121  //- Return size of field before mapping
122  virtual label sizeBeforeMapping() const
123  {
124  return sizeBeforeMapping_;
125  }
126 
127  //- Is the mapping direct
128  virtual bool direct() const
129  {
130  return faceMap_.direct();
131  }
133  virtual bool hasUnmapped() const
134  {
135  return hasUnmapped_;
136  }
137 
138  //- Return direct addressing
139  virtual const labelUList& directAddressing() const;
140 
141  //- Return interpolated addressing
142  virtual const labelListList& addressing() const;
143 
144  //- Return interpolaion weights
145  virtual const scalarListList& weights() const;
146 
147 
148  // Member Operators
149 
150  //- Disallow default bitwise assignment
151  void operator=(const fvPatchMapper&) = delete;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
virtual label sizeBeforeMapping() const
Return size of field before mapping.
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
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:55
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual ~fvPatchMapper()
Destructor.
virtual bool direct() const
Is the mapping direct.
virtual const labelUList & directAddressing() const
Return direct addressing.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual const labelListList & addressing() const
Return interpolated addressing.
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
fvPatchMapper(const fvPatch &patch, const faceMapper &faceMap)
Construct from mappers.
Specialisations of Field<T> for scalar, vector and tensor.
virtual const scalarListList & weights() const
Return interpolaion weights.
void operator=(const fvPatchMapper &)=delete
Disallow default bitwise assignment.
Mapping class for a fvPatchField.
Definition: fvPatchMapper.H:55
Namespace for OpenFOAM.