Loading...
Searching...
No Matches
faAreaMapper.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::faAreaMapper
28
29Description
30 FA area mapper.
31
32Author
33 Zeljko Tukovic, FMENA
34 Hrvoje Jasak, Wikki Ltd.
35
36SourceFiles
37 faAreaMapper.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Foam_faAreaMapper_H
42#define Foam_faAreaMapper_H
43
44#include "morphFieldMapper.H"
45#include "faMesh.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
52/*---------------------------------------------------------------------------*\
53 Class faAreaMapper Declaration
54\*---------------------------------------------------------------------------*/
55
56class faAreaMapper
57:
58 public morphFieldMapper
59{
60 // Private Data
61
62 //- Reference to mesh mapper
63 const faMesh& mesh_;
64
65 //- Reference to mapPolyMesh
66 const mapPolyMesh& mpm_;
67
68 //- Size before mapping (old mesh size)
69 const label sizeBeforeMapping_;
70
71 //- Is the mapping direct
72 bool direct_;
73
74
75 // Demand-Driven Data
76
77 mutable bool hasUnmapped_;
78
79 //- New face labels after mapping
80 mutable std::unique_ptr<labelList> newFaceLabelsPtr_;
81
82 //- New face labels after mapping
83 mutable std::unique_ptr<labelList> newFaceLabelsMapPtr_;
84
85
86 //- Direct addressing (only one form of addressing is used)
87 mutable std::unique_ptr<labelList> directAddrPtr_;
88
89 //- Interpolated addressing (only one form of addressing is used)
90 mutable std::unique_ptr<labelListList> interpAddrPtr_;
91
92 //- Interpolation weights
93 mutable std::unique_ptr<scalarListList> weightsPtr_;
94
95 //- Inserted faces
96 mutable std::unique_ptr<labelList> insertedObjectsPtr_;
97
98
99 // Private Member Functions
100
101 //- Calculate addressing
102 void calcAddressing() const;
103
104
105public:
106
107 // Generated Methods
108
109 //- No copy construct
110 faAreaMapper(const faAreaMapper&) = delete;
111
112 //- No copy assignment
113 void operator=(const faAreaMapper&) = delete;
114
115
116 // Constructors
117
118 //- Construct from components
120 (
121 const faMesh& mesh,
122 const mapPolyMesh& mpm
123 );
124
125
126 //- Destructor
127 virtual ~faAreaMapper();
128
130 // Member Functions
131
132 //- Return new face labels
133 const labelList& newFaceLabels() const;
135 //- Return new face labels map
136 // For new faces return old face index if it exists
137 // If the face has been added, index will be -1
138 const labelList& newFaceLabelsMap() const;
139
140 //- Return size
141 virtual label size() const
142 {
143 return newFaceLabels().size();
144 }
145
146 //- Return size of field before mapping
147 virtual label sizeBeforeMapping() const
148 {
149 return sizeBeforeMapping_;
150 }
151
152 //- Is the mapping direct
153 virtual bool direct() const
154 {
155 return direct_;
156 }
157
158 virtual bool hasUnmapped() const
159 {
160 return hasUnmapped_;
161 }
162
163 //- Return direct addressing
164 virtual const labelUList& directAddressing() const;
165
166 //- Return interpolated addressing
167 virtual const labelListList& addressing() const;
168
169 //- Return interpolation weights
170 virtual const scalarListList& weights() const;
171
172 //- Are there any inserted faces
173 virtual bool insertedObjects() const
174 {
175 return !insertedObjectLabels().empty();
176 }
177
178 //- Return list of inserted faces
179 virtual const labelList& insertedObjectLabels() const;
180};
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185} // End namespace Foam
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188
189#endif
190
191// ************************************************************************* //
bool empty() const noexcept
True if List is empty (ie, size() is zero).
Definition UList.H:701
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
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.
virtual bool hasUnmapped() const
Any unmapped values?
faAreaMapper(const faAreaMapper &)=delete
No copy construct.
virtual const labelUList & directAddressing() const
Return direct addressing.
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
const labelList & newFaceLabelsMap() const
Return new face labels map.
virtual bool insertedObjects() const
Are there any inserted faces.
virtual ~faAreaMapper()
Destructor.
const labelList & newFaceLabels() const
Return new face labels.
void operator=(const faAreaMapper &)=delete
No copy assignment.
virtual bool direct() const
Is the mapping direct.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition faMesh.H:140
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
morphFieldMapper()=default
Default construct.
dynamicFvMesh & mesh
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