faPatchMapper.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) 2016-2017 Wikki Ltd
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::faPatchMapper
28 
29 Description
30  Mapping class for a faPatchField. Edge mapping is calculated based on
31  faceCells comparison of old and new patch
32 
33 Author
34  Zeljko Tukovic, FMENA
35  Hrvoje Jasak, Wikki Ltd.
36 
37 SourceFiles
38  faPatchMapper.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef Foam_faPatchMapper_H
43 #define Foam_faPatchMapper_H
44 
45 #include "faPatchFieldMapper.H"
46 #include "faceMapper.H"
47 #include "faPatch.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward Declarations
55 class faPatch;
56 class mapPolyMesh;
57 
58 /*---------------------------------------------------------------------------*\
59  Class faPatchMapper Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class faPatchMapper
63 :
64  public faPatchFieldMapper
65 {
66  // Private Data
67 
68  //- Reference to patch
69  const faPatch& patch_;
70 
71  //- Reference to mapPolyMesh
72  const mapPolyMesh& mpm_;
73 
74  //- Size before mapping
75  const label sizeBeforeMapping_;
76 
77  //- faceCells before mapping
78  const labelList oldEdgeFaces_;
79 
80 
81  // Demand-Driven Data
82 
83  mutable bool hasUnmapped_;
84 
85  //- Direct addressing
86  mutable std::unique_ptr<labelList> directAddrPtr_;
87 
88 
89  // Private Member Functions
90 
91  //- Calculate addressing for mapping with inserted cells
92  void calcAddressing() const;
93 
94 
95 public:
96 
97  // Generated Methods
98 
99  //- No copy construct
100  faPatchMapper(const faPatchMapper&) = delete;
101 
102  //- No copy assignment
103  void operator=(const faPatchMapper&) = delete;
104 
105 
106  // Constructors
107 
108  //- Construct from mappers
109  faPatchMapper(const faPatch& patch, const mapPolyMesh& mpm);
110 
111 
112  //- Destructor
113  virtual ~faPatchMapper();
114 
115 
116  // Member Functions
117 
118  //- Return size
119  virtual label size() const
120  {
121  return patch_.size();
122  }
123 
124  //- Return size of field before mapping
125  virtual label sizeBeforeMapping() const
126  {
127  return sizeBeforeMapping_;
128  }
129 
130  //- Is the mapping direct
131  virtual bool direct() const
132  {
133  return true;
134  }
135 
136  virtual bool hasUnmapped() const
137  {
138  return hasUnmapped_;
139  }
140 
141  //- Return direct addressing
142  virtual const labelUList& directAddressing() const;
143 
144  //- Return interpolated addressing
145  virtual const labelListList& addressing() const;
146 
147  //- Return interpolation weights
148  virtual const scalarListList& weights() const;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 #endif
159 
160 // ************************************************************************* //
virtual bool hasUnmapped() const
Any unmapped values?
faPatchMapper(const faPatchMapper &)=delete
No copy construct.
virtual ~faPatchMapper()
Destructor.
virtual label size() const
Return size.
virtual bool direct() const
Is the mapping direct.
virtual label size() const
Patch size is the number of edge labels, but can be overloaded.
Definition: faPatch.H:392
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual const labelUList & directAddressing() const
Return direct addressing.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:72
const std::string patch
OpenFOAM patch number as a std::string.
Mapping class for a faPatchField. Edge mapping is calculated based on faceCells comparison of old and...
Definition: faPatchMapper.H:57
void operator=(const faPatchMapper &)=delete
No copy assignment.
A FieldMapper for finite-area patch fields.
virtual const scalarListList & weights() const
Return interpolation weights.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual const labelListList & addressing() const
Return interpolated addressing.
Namespace for OpenFOAM.