Loading...
Searching...
No Matches
pointPatchMapper.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::pointPatchMapper
29
30Description
31 Mapping class for a pointPatchField.
32
33SourceFiles
34 pointPatchMapper.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_pointPatchMapper_H
39#define Foam_pointPatchMapper_H
40
41#include "pointMapper.H"
43#include "pointPatch.H"
44#include "primitiveFields.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward Declarations
52class pointPatch;
53class mapPolyMesh;
55/*---------------------------------------------------------------------------*\
56 Class pointPatchMapper Declaration
57\*---------------------------------------------------------------------------*/
58
59class pointPatchMapper
60:
62{
63 // Private Data
64
65 //- Reference to patch
66 const pointPatch& patch_;
67
68 //- Reference to point mapper for internal field
69 const morphFieldMapper& pointMapper_;
70
71 //- Reference to mapping data
72 const mapPolyMesh& mpm_;
73
74 //- Size before mapping
75 const label sizeBeforeMapping_;
76
77
78 // Demand-driven Data
79
80 mutable bool hasUnmapped_;
81
82 //- Direct addressing (only one for of addressing is used)
83 mutable std::unique_ptr<labelList> directAddrPtr_;
84
85 //- Interpolated addressing (only one for of addressing is used)
86 mutable std::unique_ptr<labelListList> interpAddrPtr_;
87
88 //- Interpolation weights
89 mutable std::unique_ptr<scalarListList> weightsPtr_;
90
91
92 // Private Member Functions
93
94 //- No copy construct
95 pointPatchMapper(const pointPatchMapper&) = delete;
96
97 //- No copy assignment
98 void operator=(const pointPatchMapper&) = delete;
99
100
101 //- Calculate addressing for mapping with inserted cells
102 void calcAddressing() const;
103
104
105public:
106
107 // Static data members
108
109 // Constructors
110
111 //- Construct from mappers
112 pointPatchMapper
113 (
114 const pointPatch& patch,
115 const pointMapper& pointMap,
116 const mapPolyMesh& mpm
117 );
118
119
120 //- Destructor
121 virtual ~pointPatchMapper();
122
123
124 // Member Functions
125
126 //- Return size
127 virtual label size() const
128 {
129 return patch_.size();
130 }
131
132 virtual bool hasUnmapped() const
133 {
134 return hasUnmapped_;
135 }
136
137 //- Return size of field before mapping
138 virtual label sizeBeforeMapping() const
139 {
140 return sizeBeforeMapping_;
141 }
142
143 //- Is the mapping direct
144 virtual bool direct() const
145 {
146 return pointMapper_.direct();
147 }
149 //- Return direct addressing
150 virtual const labelUList& directAddressing() const;
151
152 //- Return interpolated addressing
153 virtual const labelListList& addressing() const;
154
155 //- Return interpolaion weights
156 virtual const scalarListList& weights() const;
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Abstract base class to hold the Field mapping for mesh morphs.
This object provides mapping and fill-in information for point data between the two meshes after the ...
Definition pointMapper.H:56
pointPatchFieldMapper()=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 interpolaion weights.
virtual bool hasUnmapped() const
Any unmapped values?
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual ~pointPatchMapper()
Destructor.
virtual bool direct() const
Is the mapping direct.
Basic pointPatch represents a set of points from the mesh.
Definition pointPatch.H:67
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
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.