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
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)
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  }
142 
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 // ************************************************************************* //
Foam::fvPatchMapper
Mapping class for a fvPatchField.
Definition: fvPatchMapper.H:55
Foam::fvPatchMapper::fvPatchMapper
fvPatchMapper(const fvPatchMapper &)
Disallow default bitwise copy construct.
Foam::faceMap
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Definition: blockMeshMergeFast.C:90
Foam::fvPatchMapper::directAddressing
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: fvPatchMapper.C:241
Foam::fvPatchMapper::hasUnmapped_
bool hasUnmapped_
Definition: fvPatchMapper.H:73
Foam::fvPatchMapper::size
virtual label size() const
Return size.
Definition: fvPatchMapper.H:125
fvPatchFieldMapper.H
Foam::fvPatchMapper::patch_
const fvPatch & patch_
Reference to patch.
Definition: fvPatchMapper.H:62
Foam::fvPatchMapper::sizeBeforeMapping
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Definition: fvPatchMapper.H:131
Foam::fvPatchMapper::operator=
void operator=(const fvPatchMapper &)
Disallow default bitwise assignment.
primitiveFields.H
Specialisations of Field<T> for scalar, vector and tensor.
Foam::fvPatchMapper::addressing
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: fvPatchMapper.C:259
Foam::fvPatchMapper::faceMap_
const faceMapper & faceMap_
Reference to face mapper.
Definition: fvPatchMapper.H:65
Foam::fvPatch::size
virtual label size() const
Return size.
Definition: fvPatch.H:161
Foam::label
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
Foam::fvPatchMapper::weights
virtual const scalarListList & weights() const
Return interpolaion weights.
Definition: fvPatchMapper.C:277
Foam::fvPatchMapper::directAddrPtr_
labelList * directAddrPtr_
Direct addressing (only one for of addressing is used)
Definition: fvPatchMapper.H:76
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::fvPatchMapper::clearOut
void clearOut()
Clear out local storage.
Definition: fvPatchMapper.C:203
Foam::fvPatchMapper::hasUnmapped
virtual bool hasUnmapped() const
Are there unmapped values? I.e. do all size() elements get.
Definition: fvPatchMapper.H:142
faceMapper.H
Foam::fvPatchMapper::~fvPatchMapper
virtual ~fvPatchMapper()
Destructor.
Definition: fvPatchMapper.C:233
Foam::faceMapper
This object provides mapping and fill-in information for face data between the two meshes after the t...
Definition: faceMapper.H:55
Foam::faceMapper::direct
virtual bool direct() const
Is the mapping direct.
Definition: faceMapper.H:131
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fvPatchMapper::direct
virtual bool direct() const
Is the mapping direct.
Definition: fvPatchMapper.H:137
Foam::fvPatchMapper::interpolationAddrPtr_
labelListList * interpolationAddrPtr_
Interpolated addressing (only one for of addressing is used)
Definition: fvPatchMapper.H:79
Foam::fvPatchMapper::calcAddressing
void calcAddressing() const
Calculate addressing for mapping with inserted cells.
Definition: fvPatchMapper.C:35
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::UList
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
Foam::fvPatchMapper::weightsPtr_
scalarListList * weightsPtr_
Interpolation weights.
Definition: fvPatchMapper.H:82
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
fvPatch.H
Foam::fvPatchMapper::sizeBeforeMapping_
const label sizeBeforeMapping_
Size before mapping.
Definition: fvPatchMapper.H:68