pointPatchMapper.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-2019 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::pointPatchMapper
26 
27 Description
28  Mapping class for a pointPatchField.
29 
30 SourceFiles
31  pointPatchMapper.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef pointPatchMapper_H
36 #define pointPatchMapper_H
37 
38 #include "pointMapper.H"
39 #include "pointPatchFieldMapper.H"
40 #include "pointPatch.H"
41 #include "primitiveFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class pointPatch;
50 class mapPolyMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class pointPatchMapper Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class pointPatchMapper
57 :
59 {
60  // Private Data
61 
62  //- Reference to patch
63  const pointPatch& patch_;
64 
65  //- Reference to point mapper for internal field
66  const morphFieldMapper& pointMapper_;
67 
68  //- Reference to mapping data
69  const mapPolyMesh& mpm_;
70 
71  //- Size before mapping
72  const label sizeBeforeMapping_;
73 
74 
75  // Demand-driven private data
76 
77  mutable bool hasUnmapped_;
78 
79  //- Direct addressing (only one for of addressing is used)
80  mutable labelList* directAddrPtr_;
81 
82  //- Interpolated addressing (only one for of addressing is used)
83  mutable labelListList* interpolationAddrPtr_;
84 
85  //- Interpolation weights
86  mutable scalarListList* weightsPtr_;
87 
88 
89  // Private Member Functions
90 
91  //- Calculate addressing for mapping with inserted cells
92  void calcAddressing() const;
93 
94  //- Clear out local storage
95  void clearOut();
96 
97 
98 public:
99 
100  // Constructors
101 
102  //- Construct from mappers
104  (
105  const pointPatch& patch,
106  const pointMapper& pointMap,
107  const mapPolyMesh& mpm
108  );
109 
110  //- Disallow default bitwise copy construction
112  (
113  const pointPatchMapper&
114  );
115 
116 
117  //- Destructor
118  virtual ~pointPatchMapper();
119 
120 
121  // Member Functions
123  virtual bool hasUnmapped() const
124  {
125  return hasUnmapped_;
126  }
127 
128  //- Return size of field before mapping
129  virtual label sizeBeforeMapping() const
130  {
131  return sizeBeforeMapping_;
132  }
133 
134  //- Is the mapping direct
135  virtual bool direct() const
136  {
137  return pointMapper_.direct();
138  }
139 
140  //- Return direct addressing
141  virtual const labelUList& directAddressing() const;
142 
143  //- Return interpolated addressing
144  virtual const labelListList& addressing() const;
145 
146  //- Return interpolaion weights
147  virtual const scalarListList& weights() const;
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const pointPatchMapper&) = delete;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
virtual bool direct() const =0
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
virtual const labelUList & directAddressing() const
Return direct addressing.
pointPatchMapper(const pointPatch &patch, const pointMapper &pointMap, const mapPolyMesh &mpm)
Construct from mappers.
virtual bool direct() const
Is the mapping direct.
virtual const scalarListList & weights() const
Return interpolaion weights.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Mapping class for a pointPatchField.
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Abstract base class to hold the Field mapping for mesh morphs.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
void operator=(const pointPatchMapper &)=delete
Disallow default bitwise assignment.
Specialisations of Field<T> for scalar, vector and tensor.
virtual ~pointPatchMapper()
Destructor.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
virtual label sizeBeforeMapping() const
Return size of field before mapping.
This object provides mapping and fill-in information for point data between the two meshes after the ...
Definition: pointMapper.H:55
Namespace for OpenFOAM.
virtual const labelListList & addressing() const
Return interpolated addressing.