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 faPatchMapper_H
43#define faPatchMapper_H
44
45#include "faPatchFieldMapper.H"
46#include "faceMapper.H"
47#include "faPatch.H"
48#include "primitiveFields.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55// Forward declaration of classes
56class faPatch;
57class mapPolyMesh;
58
59/*---------------------------------------------------------------------------*\
60 Class faPatchMapper Declaration
61\*---------------------------------------------------------------------------*/
63class faPatchMapper
64:
66{
67 // Private data
68
69 //- Reference to patch
70 const faPatch& patch_;
71
72 //- Reference to mapPolyMesh
73 const mapPolyMesh& mpm_;
74
75 //- Size before mapping
76 const label sizeBeforeMapping_;
77
78 //- faceCells before mapping
79 const labelList oldEdgeFaces_;
80
81
82 // Demand-driven private data
83
84 mutable bool hasUnmapped_;
85
86 //- Direct addressing
87 mutable labelList* directAddrPtr_;
88
89
90 // Private Member Functions
91
92 //- No copy construct
93 faPatchMapper(const faPatchMapper&) = delete;
94
95 //- No copy assignment
96 void operator=(const faPatchMapper&) = delete;
97
98
99 //- Calculate addressing for mapping with inserted cells
100 void calcAddressing() const;
101
102 //- Clear out local storage
103 void clearOut();
104
105
106public:
107
108 //- Construct from mappers
110 (
111 const faPatch& patch,
112 const mapPolyMesh& mpm
113 );
114
115
116 //- Destructor
117 virtual ~faPatchMapper();
118
119
120 // Member Functions
121
122 //- Return size
123 virtual label size() const
124 {
125 return patch_.size();
126 }
127
128 //- Return size of field before mapping
129 virtual label sizeBeforeMapping() const
130 {
131 return sizeBeforeMapping_;
132 }
133
134 //- Is the mapping direct
135 virtual bool direct() const
136 {
137 return true;
138 }
140 virtual bool hasUnmapped() const
141 {
142 return hasUnmapped_;
143 }
144
145 //- Return direct addressing
146 virtual const labelUList& directAddressing() const;
147
148 //- Return interpolated addressing
149 virtual const labelListList& addressing() const;
150
151 //- Return interpolation weights
152 virtual const scalarListList& weights() const;
153};
154
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158} // End namespace Foam
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#endif
163
164// ************************************************************************* //
A FieldMapper for finite-area patch fields.
Mapping class for a faPatchField. Edge mapping is calculated based on faceCells comparison of old and...
Definition: faPatchMapper.H:65
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?
virtual const labelUList & directAddressing() const
Return direct addressing.
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:78
virtual label size() const
Patch size is the number of edge labels.
Definition: faPatch.H:311
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Namespace for OpenFOAM.
Specialisations of Field<T> for scalar, vector and tensor.