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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::pointPatchMapper
28 
29 Description
30  Mapping class for a pointPatchField.
31 
32 SourceFiles
33  pointPatchMapper.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef pointPatchMapper_H
38 #define pointPatchMapper_H
39 
40 #include "pointMapper.H"
41 #include "pointPatchFieldMapper.H"
42 #include "pointPatch.H"
43 #include "primitiveFields.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class pointPatch;
52 class mapPolyMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class pointPatchMapper Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class pointPatchMapper
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 
107 public:
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  }
133 
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 // ************************************************************************* //
pointMapper.H
Foam::pointPatchMapper::direct
virtual bool direct() const
Is the mapping direct.
Definition: pointPatchMapper.H:145
Foam::morphFieldMapper
Abstract base class to hold the Field mapping for mesh morphs.
Definition: morphFieldMapper.H:49
Foam::pointPatchMapper::weights
virtual const scalarListList & weights() const
Return interpolaion weights.
Definition: pointPatchMapper.C:185
pointPatchFieldMapper.H
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::pointPatchMapper::directAddressing
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: pointPatchMapper.C:149
Foam::FieldMapper::direct
virtual bool direct() const =0
primitiveFields.H
Specialisations of Field<T> for scalar, vector and tensor.
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::pointPatchMapper::~pointPatchMapper
virtual ~pointPatchMapper()
Destructor.
Definition: pointPatchMapper.C:141
Foam::pointMapper
This object provides mapping and fill-in information for point data between the two meshes after the ...
Definition: pointMapper.H:57
Foam::pointPatchMapper::addressing
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: pointPatchMapper.C:167
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointPatch::size
virtual label size() const =0
Return size.
Foam::pointPatchMapper::size
virtual label size() const
Return size.
Definition: pointPatchMapper.H:128
Foam::pointPatchMapper::hasUnmapped
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: pointPatchMapper.H:133
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::List< label >
Foam::UList< label >
Foam::pointPatchMapper::sizeBeforeMapping
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Definition: pointPatchMapper.H:139
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::pointPatchMapper
Mapping class for a pointPatchField.
Definition: pointPatchMapper.H:57
pointPatch.H