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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::pointPatchMapper
29 
30 Description
31  Mapping class for a pointPatchField.
32 
33 SourceFiles
34  pointPatchMapper.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_pointPatchMapper_H
39 #define Foam_pointPatchMapper_H
40 
41 #include "pointMapper.H"
42 #include "pointPatchFieldMapper.H"
43 #include "pointPatch.H"
44 #include "primitiveFields.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 class pointPatch;
53 class mapPolyMesh;
54 
55 /*---------------------------------------------------------------------------*\
56  Class pointPatchMapper Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class 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 
105 public:
106 
107  // Static data members
108 
109  // Constructors
110 
111  //- Construct from mappers
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 // ************************************************************************* //
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
Is it a direct (non-interpolating) mapper?
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
Any unmapped values?
Abstract base class to hold the Field mapping for mesh morphs.
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:61
virtual label sizeBeforeMapping() const
Return size of field before mapping.
const std::string patch
OpenFOAM patch number as a std::string.
This object provides mapping and fill-in information for point data between the two meshes after the ...
Definition: pointMapper.H:53
Namespace for OpenFOAM.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual label size() const =0
Return size.