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-2023 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 polyTopoChangeMap;
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  // Constructors
98 
99  //- Construct from mappers
101  (
102  const fvPatch& patch,
103  const faceMapper& faceMap
104  );
105 
106  //- Disallow default bitwise copy construction
107  fvPatchMapper(const fvPatchMapper&) = delete;
108 
109 
110  //- Destructor
111  virtual ~fvPatchMapper();
112 
113 
114  // Member Functions
115 
116  //- Return size of field before mapping
117  virtual label sizeBeforeMapping() const
118  {
119  return sizeBeforeMapping_;
120  }
121 
122  //- Is the mapping direct
123  virtual bool direct() const
124  {
125  return faceMap_.direct();
126  }
127 
128  virtual bool hasUnmapped() const
129  {
130  return hasUnmapped_;
131  }
132 
133  //- Return direct addressing
134  virtual const labelUList& directAddressing() const;
135 
136  //- Return interpolated addressing
137  virtual const labelListList& addressing() const;
138 
139  //- Return interpolation weights
140  virtual const scalarListList& weights() const;
141 
142 
143  // Member Operators
144 
145  //- Disallow default bitwise assignment
146  void operator=(const fvPatchMapper&) = delete;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:58
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:124
Mapping class for a fvPatchField.
Definition: fvPatchMapper.H:58
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
virtual const labelUList & directAddressing() const
Return direct addressing.
void operator=(const fvPatchMapper &)=delete
Disallow default bitwise assignment.
fvPatchMapper(const fvPatch &patch, const faceMapper &faceMap)
Construct from mappers.
virtual bool direct() const
Is the mapping direct.
virtual ~fvPatchMapper()
Destructor.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Namespace for OpenFOAM.
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
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Specialisations of Field<T> for scalar, vector and tensor.