Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::faPatchMapper
28
29Description
30 Mapping class for a faPatchField. Edge mapping is calculated based on
31 faceCells comparison of old and new patch
32
33Author
34 Zeljko Tukovic, FMENA
35 Hrvoje Jasak, Wikki Ltd.
36
37SourceFiles
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
51namespace Foam
52{
53
54// Forward Declarations
55class faPatch;
56class mapPolyMesh;
58/*---------------------------------------------------------------------------*\
59 Class faPatchMapper Declaration
60\*---------------------------------------------------------------------------*/
61
62class faPatchMapper
63:
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
95public:
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();
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// ************************************************************************* //
faPatchFieldMapper()=default
Default construct.
virtual label size() const
Return size.
virtual label sizeBeforeMapping() const
Return size of field before mapping.
virtual const labelListList & addressing() const
Return interpolated addressing.
virtual const scalarListList & weights() const
Return interpolation weights.
faPatchMapper(const faPatchMapper &)=delete
No copy construct.
virtual bool hasUnmapped() const
Any unmapped values?
virtual const labelUList & directAddressing() const
Return direct addressing.
void operator=(const faPatchMapper &)=delete
No copy assignment.
virtual ~faPatchMapper()
Destructor.
virtual bool direct() const
Is the mapping direct.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.
List< scalarList > scalarListList
List of scalarList.
Definition scalarList.H:35
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
UList< label > labelUList
A UList of labels.
Definition UList.H:75