fvPatchMapper.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 | Copyright (C) 2011-2013 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::fvPatchMapper
26 
27 Description
28  Mapping class for a fvPatchField.
29 
30 SourceFiles
31  fvPatchMapper.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvPatchMapper_H
36 #define fvPatchMapper_H
37 
38 #include "fvPatchFieldMapper.H"
39 #include "faceMapper.H"
40 #include "fvPatch.H"
41 #include "primitiveFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class fvPatch;
50 class mapPolyMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class fvPatchMapper Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class fvPatchMapper
57 :
58  public fvPatchFieldMapper
59 {
60  // Private data
61 
62  //- Reference to patch
63  const fvPatch& patch_;
64 
65  //- Reference to face mapper
66  const faceMapper& faceMap_;
67 
68  //- Size before mapping
69  const label sizeBeforeMapping_;
70 
71 
72  // Demand-driven private data
73 
74  mutable bool hasUnmapped_;
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  //- Disallow default bitwise copy construct
90  (
91  const fvPatchMapper&
92  );
93 
94  //- Disallow default bitwise assignment
95  void operator=(const fvPatchMapper&);
96 
97 
98  //- Calculate addressing for mapping with inserted cells
99  void calcAddressing() const;
100 
101  //- Clear out local storage
102  void clearOut();
103 
104 
105 public:
106 
107  // Static data members
108 
109  // Constructors
110 
111  //- Construct from mappers
113  (
114  const fvPatch& patch,
115  const faceMapper& faceMap
116  );
117 
118 
119  //- Destructor
120  virtual ~fvPatchMapper();
121 
122 
123  // Member Functions
124 
125  //- Return size
126  virtual label size() const
127  {
128  return patch_.size();
129  }
130 
131  //- Return size of field before mapping
132  virtual label sizeBeforeMapping() const
133  {
134  return sizeBeforeMapping_;
135  }
136 
137  //- Is the mapping direct
138  virtual bool direct() const
139  {
140  return faceMap_.direct();
141  }
143  virtual bool hasUnmapped() const
144  {
145  return hasUnmapped_;
146  }
147 
148  //- Return direct addressing
149  virtual const labelUList& directAddressing() const;
150 
151  //- Return interpolated addressing
152  virtual const labelListList& addressing() const;
153 
154  //- Return interpolaion weights
155  virtual const scalarListList& weights() const;
156 
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
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
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:55
virtual const scalarListList & weights() const
Return interpolaion weights.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual ~fvPatchMapper()
Destructor.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const labelUList & directAddressing() const
Return direct addressing.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual label size() const
Return size.
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
Definition: fvPatch.H:161
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
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
Specialisations of Field<T> for scalar, vector and tensor.
Mapping class for a fvPatchField.
Definition: fvPatchMapper.H:55
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:131
Namespace for OpenFOAM.
virtual bool direct() const
Is the mapping direct.