Loading...
Searching...
No Matches
fvPatchMapper.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2013 OpenFOAM Foundation
9 Copyright (C) 2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fvPatchMapper
29
30Description
31 Mapping class for a fvPatchField.
32
33SourceFiles
34 fvPatchMapper.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_fvPatchMapper_H
39#define Foam_fvPatchMapper_H
40
41#include "fvPatchFieldMapper.H"
42#include "faceMapper.H"
43#include "fvPatch.H"
44#include "primitiveFields.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
52class fvPatch;
53class mapPolyMesh;
55/*---------------------------------------------------------------------------*\
56 Class fvPatchMapper Declaration
57\*---------------------------------------------------------------------------*/
58
59class fvPatchMapper
60:
62{
63 // Private data
64
65 //- Reference to patch
66 const fvPatch& patch_;
67
68 //- Reference to face mapper
69 const faceMapper& faceMap_;
70
71 //- Size before mapping
72 const label sizeBeforeMapping_;
73
74
75 // Demand-Driven Data
76
77 mutable bool hasUnmapped_;
78
79 //- Direct addressing (only one for of addressing is used)
80 mutable std::unique_ptr<labelList> directAddrPtr_;
81
82 //- Interpolated addressing (only one for of addressing is used)
83 mutable std::unique_ptr<labelListList> interpAddrPtr_;
84
85 //- Interpolation weights
86 mutable std::unique_ptr<scalarListList> weightsPtr_;
87
88
89 // Private Member Functions
90
91 //- No copy construct
92 fvPatchMapper(const fvPatchMapper&) = delete;
93
94 //- No copy assignment
95 void operator=(const fvPatchMapper&) = delete;
96
97
98 //- Calculate addressing for mapping with inserted cells
99 void calcAddressing() const;
100
101
102public:
103
104 // Constructors
105
106 //- Construct from mappers
107 fvPatchMapper
108 (
109 const fvPatch& patch,
110 const faceMapper& faceMap
111 );
112
113
114 //- Destructor
115 virtual ~fvPatchMapper();
116
117
118 // Member Functions
119
120 //- Return size
121 virtual label size() const
122 {
123 return patch_.size();
124 }
125
126 //- Return size of field before mapping
127 virtual label sizeBeforeMapping() const
128 {
129 return sizeBeforeMapping_;
130 }
131
132 //- Is the mapping direct
133 virtual bool direct() const
134 {
135 return faceMap_.direct();
136 }
137
138 virtual bool hasUnmapped() const
139 {
140 return hasUnmapped_;
141 }
142
143 //- Return direct addressing
144 virtual const labelUList& directAddressing() const;
145
146 //- Return interpolated addressing
147 virtual const labelListList& addressing() const;
149 //- Return interpolation weights
150 virtual const scalarListList& weights() const;
151};
152
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156} // End namespace Foam
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160#endif
162// ************************************************************************* //
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition faceMapper.H:56
fvPatchFieldMapper()=default
Default construct.
virtual label size() const
Return size.
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
Any unmapped values?
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual bool direct() const
Is the mapping direct.
virtual ~fvPatchMapper()
Destructor.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
UList< label > labelUList
A UList of labels.
Definition UList.H:75
Specialisations of Field<T> for scalar, vector and tensor.