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-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::pointPatchMapper
28
29Description
30 Mapping class for a pointPatchField.
31
32SourceFiles
33 pointPatchMapper.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef pointPatchMapper_H
38#define pointPatchMapper_H
39
40#include "pointMapper.H"
42#include "pointPatch.H"
43#include "primitiveFields.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward declaration of classes
51class pointPatch;
52class mapPolyMesh;
53
54/*---------------------------------------------------------------------------*\
55 Class pointPatchMapper Declaration
56\*---------------------------------------------------------------------------*/
59:
61{
62 // Private data
63
64 //- Reference to patch
65 const pointPatch& patch_;
66
67 //- Reference to point mapper for internal field
68 const morphFieldMapper& pointMapper_;
69
70 //- Reference to mapping data
71 const mapPolyMesh& mpm_;
72
73 //- Size before mapping
74 const label sizeBeforeMapping_;
75
76
77 // Demand-driven private data
78
79 mutable bool hasUnmapped_;
80
81 //- Direct addressing (only one for of addressing is used)
82 mutable labelList* directAddrPtr_;
83
84 //- Interpolated addressing (only one for of addressing is used)
85 mutable labelListList* interpolationAddrPtr_;
86
87 //- Interpolation weights
88 mutable scalarListList* weightsPtr_;
89
90
91 // Private Member Functions
92
93 //- No copy construct
94 pointPatchMapper(const pointPatchMapper&) = delete;
95
96 //- No copy assignment
97 void operator=(const pointPatchMapper&) = delete;
98
99
100 //- Calculate addressing for mapping with inserted cells
101 void calcAddressing() const;
102
103 //- Clear out local storage
104 void clearOut();
105
106
107public:
108
109 // Static data members
110
111 // Constructors
112
113 //- Construct from mappers
115 (
116 const pointPatch& patch,
117 const pointMapper& pointMap,
118 const mapPolyMesh& mpm
119 );
120
121
122 //- Destructor
123 virtual ~pointPatchMapper();
124
125
126 // Member Functions
127
128 //- Return size
129 virtual label size() const
130 {
131 return patch_.size();
132 }
134 virtual bool hasUnmapped() const
135 {
136 return hasUnmapped_;
137 }
138
139 //- Return size of field before mapping
140 virtual label sizeBeforeMapping() const
141 {
142 return sizeBeforeMapping_;
143 }
144
145 //- Is the mapping direct
146 virtual bool direct() const
147 {
148 return pointMapper_.direct();
149 }
150
151 //- Return direct addressing
152 virtual const labelUList& directAddressing() const;
153
154 //- Return interpolated addressing
155 virtual const labelListList& addressing() const;
156
157 //- Return interpolaion weights
158 virtual const scalarListList& weights() const;
159
160};
161
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165} // End namespace Foam
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169#endif
170
171// ************************************************************************* //
virtual bool direct() const =0
Is it a direct (non-interpolating) mapper?
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
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:60
Foam::pointPatchFieldMapper.
Mapping class for a pointPatchField.
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:64
virtual label size() const =0
Return size.
Namespace for OpenFOAM.
Specialisations of Field<T> for scalar, vector and tensor.