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-2023 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 "pointPatch.H"
40 #include "primitiveFields.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class pointPatch;
49 class polyTopoChangeMap;
50 
51 /*---------------------------------------------------------------------------*\
52  Class pointPatchMapper Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class pointPatchMapper
56 :
57  public generalFieldMapper
58 {
59  // Private Data
60 
61  //- Reference to patch
62  const pointPatch& patch_;
63 
64  //- Reference to point mapper for internal field
65  const morphFieldMapper& pointMapper_;
66 
67  //- Reference to mapping data
68  const polyTopoChangeMap& map_;
69 
70  //- Size before mapping
71  const label sizeBeforeMapping_;
72 
73 
74  // Demand-driven private data
75 
76  //- Direct addressing (only one for of addressing is used)
77  mutable labelList* directAddrPtr_;
78 
79  //- Interpolated addressing (only one for of addressing is used)
80  mutable labelListList* interpolationAddrPtr_;
81 
82  //- Interpolation weights
83  mutable scalarListList* weightsPtr_;
84 
85 
86  // Private Member Functions
87 
88  //- Calculate addressing for mapping with inserted cells
89  void calcAddressing() const;
90 
91  //- Clear out local storage
92  void clearOut();
93 
94 
95 public:
96 
97  // Constructors
98 
99  //- Construct from mappers
101  (
102  const pointPatch& patch,
103  const pointMapper& pointMap,
104  const polyTopoChangeMap& map
105  );
106 
107  //- Disallow default bitwise copy construction
109  (
110  const pointPatchMapper&
111  ) = delete;
112 
113 
114  //- Destructor
115  virtual ~pointPatchMapper();
116 
117 
118  // Member Functions
119 
120  //- Return size of field before mapping
121  label sizeBeforeMapping() const
122  {
123  return sizeBeforeMapping_;
124  }
125 
126  //- Is the mapping direct?
127  virtual bool direct() const
128  {
129  return pointMapper_.direct();
130  }
131 
132  //- Return direct addressing
133  virtual const labelUList& directAddressing() const;
134 
135  //- Return interpolated addressing
136  virtual const labelListList& addressing() const;
137 
138  //- Return interpolation weights
139  virtual const scalarListList& weights() const;
140 
141 
142  // Member Operators
143 
144  //- Disallow default bitwise assignment
145  void operator=(const pointPatchMapper&) = delete;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
General field mapper supporting both direct and weighted mapping.
virtual bool direct() const =0
Is the mapper direct?
Foam::tmp< Foam::Field< Type > > map(const Field< Type > &mapF) const
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:58
Mapping class for a pointPatchField.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
label sizeBeforeMapping() const
Return size of field before mapping.
virtual const labelUList & directAddressing() const
Return direct addressing.
pointPatchMapper(const pointPatch &patch, const pointMapper &pointMap, const polyTopoChangeMap &map)
Construct from mappers.
virtual ~pointPatchMapper()
Destructor.
void operator=(const pointPatchMapper &)=delete
Disallow default bitwise assignment.
virtual bool direct() const
Is the mapping direct?
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:57
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.
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
Specialisations of Field<T> for scalar, vector and tensor.