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-2018 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  //- Disallow default bitwise copy construct
93  (
94  const pointPatchMapper&
95  );
96 
97  //- Disallow default bitwise assignment
98  void operator=(const pointPatchMapper&);
99 
100 
101  //- Calculate addressing for mapping with inserted cells
102  void calcAddressing() const;
103 
104  //- Clear out local storage
105  void clearOut();
106 
107 
108 public:
109 
110  // Static data members
111 
112  // Constructors
113 
114  //- Construct from mappers
116  (
117  const pointPatch& patch,
118  const pointMapper& pointMap,
119  const mapPolyMesh& mpm
120  );
121 
122 
123  //- Destructor
124  virtual ~pointPatchMapper();
125 
126 
127  // Member Functions
128 
129  //- Return size
130  virtual label size() const
131  {
132  return patch_.size();
133  }
135  virtual bool hasUnmapped() const
136  {
137  return hasUnmapped_;
138  }
139 
140  //- Return size of field before mapping
141  virtual label sizeBeforeMapping() const
142  {
143  return sizeBeforeMapping_;
144  }
145 
146  //- Is the mapping direct
147  virtual bool direct() const
148  {
149  return pointMapper_.direct();
150  }
151 
152  //- Return direct addressing
153  virtual const labelUList& directAddressing() const;
154 
155  //- Return interpolated addressing
156  virtual const labelListList& addressing() const;
157 
158  //- Return interpolaion weights
159  virtual const scalarListList& weights() const;
160 
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
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.
virtual bool direct() const
Is the mapping direct.
virtual const scalarListList & weights() const
Return interpolaion weights.
Foam::pointPatchFieldMapper.
virtual bool direct() const =0
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:61
virtual label size() const
Return size.
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.
virtual label size() const =0
Return size.