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