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 "generalFieldMapper.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 :
58  public generalFieldMapper
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  //- Direct addressing (only one for of addressing is used)
75  mutable labelList* directAddrPtr_;
76 
77  //- Interpolated addressing (only one for of addressing is used)
78  mutable labelListList* interpolationAddrPtr_;
79 
80  //- Interpolation weights
81  mutable scalarListList* weightsPtr_;
82 
83 
84  // Private Member Functions
85 
86  //- Calculate addressing for mapping with inserted cells
87  void calcAddressing() const;
88 
89  //- Clear out local storage
90  void clearOut();
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from mappers
99  (
100  const fvPatch& patch,
101  const faceMapper& faceMap
102  );
103 
104  //- Disallow default bitwise copy construction
105  fvPatchMapper(const fvPatchMapper&) = delete;
106 
107 
108  //- Destructor
109  virtual ~fvPatchMapper();
110 
111 
112  // Member Functions
113 
114  //- Return size of field before mapping
115  label sizeBeforeMapping() const
116  {
117  return sizeBeforeMapping_;
118  }
119 
120  //- Is the mapping direct?
121  virtual bool direct() const
122  {
123  return faceMap_.direct();
124  }
125 
126  //- Return direct addressing
127  virtual const labelUList& directAddressing() const;
128 
129  //- Return interpolated addressing
130  virtual const labelListList& addressing() const;
131 
132  //- Return interpolation weights
133  virtual const scalarListList& weights() const;
134 
135 
136  // Member Operators
137 
138  //- Disallow default bitwise assignment
139  void operator=(const fvPatchMapper&) = delete;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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:116
Mapping class for a fvPatchField.
Definition: fvPatchMapper.H:58
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
label sizeBeforeMapping() const
Return size of field before mapping.
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
General field mapper supporting both direct and weighted mapping.
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.