faEdgeMapper.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::faEdgeMapper
28
29Description
30 FA edge mapper. Currently, edge-based finite area data is not mapped,
31 but only resized, since edge-based mapping data is not available
32
33Author
34 Zeljko Tukovic, FMENA
35 Hrvoje Jasak, Wikki Ltd.
36
37SourceFiles
38 faEdgeMapper.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef faEdgeMapper_H
43#define faEdgeMapper_H
44
45#include "morphFieldMapper.H"
46#include "faMesh.H"
47#include "faceMapper.H"
48#include "HashSet.H"
49#include "mapPolyMesh.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class faEdgeMapper Declaration
58\*---------------------------------------------------------------------------*/
60class faEdgeMapper
61:
62 public morphFieldMapper
63{
64 // Private data
65
66 //- Reference to mesh
67 const faMesh& mesh_;
68
69 //- Reference to mapPolyMesh
70 //const mapPolyMesh& mpm_;
71
72 //- Old mesh size
73 label sizeBeforeMapping_;
74
75
76 // Demand-driven private data
77
78 mutable bool hasUnmapped_;
79
80 //- Direct addressing
81 mutable labelList* directAddrPtr_;
82
83
84 // Private Member Functions
85
86 //- No copy construct
87 faEdgeMapper(const faEdgeMapper&) = delete;
88
89 //- No copy assignment
90 void operator=(const faEdgeMapper&) = delete;
91
92 //- Calculate addressing
93 void calcAddressing() const;
94
95 //- Clear out local storage
96 void clearOut();
97
98
99public:
100
101 //- Construct from components
103 (
104 const faMesh& mesh,
105 const mapPolyMesh& mpm
106 );
107
108
109 //- Destructor
110 virtual ~faEdgeMapper();
111
112
113 // Member Functions
114
115 //- Return size
116 virtual label size() const
117 {
118 return mesh_.nInternalEdges();
119 }
120
121 //- Return size of field before mapping
122 virtual label sizeBeforeMapping() const
123 {
124 return sizeBeforeMapping_;
125 }
126
127 //- Is the mapping direct
128 virtual bool direct() const
129 {
130 return true;
131 }
133 virtual bool hasUnmapped() const
134 {
135 return hasUnmapped_;
136 }
137
138 //- Return direct addressing
139 virtual const labelUList& directAddressing() const;
140
141 //- Return interpolated addressing
142 virtual const labelListList& addressing() const;
143
144 //- Return interpolation weights
145 virtual const scalarListList& weights() const;
146
147 //- Are there any inserted faces
148 virtual bool insertedObjects() const
149 {
150 return false;
151 }
152
153 //- Return list of inserted faces
154 virtual const labelList& insertedObjectLabels() const
155 {
156 return labelList::null();
157 }
158};
159
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163} // End namespace Foam
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167#endif
168
169// ************************************************************************* //
static const List< label > & null()
Return a null List.
Definition: ListI.H:109
FA edge mapper. Currently, edge-based finite area data is not mapped, but only resized,...
Definition: faEdgeMapper.H:62
virtual label size() const
Return size.
Definition: faEdgeMapper.H:115
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Definition: faEdgeMapper.H:121
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: faEdgeMapper.C:94
virtual const scalarListList & weights() const
Return interpolation weights.
Definition: faEdgeMapper.C:104
virtual bool hasUnmapped() const
Any unmapped values?
Definition: faEdgeMapper.H:132
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: faEdgeMapper.C:83
virtual const labelList & insertedObjectLabels() const
Return list of inserted faces.
Definition: faEdgeMapper.H:153
virtual ~faEdgeMapper()
Destructor.
Definition: faEdgeMapper.C:75
virtual bool insertedObjects() const
Are there any inserted faces.
Definition: faEdgeMapper.H:147
virtual bool direct() const
Is the mapping direct.
Definition: faEdgeMapper.H:127
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
label nInternalEdges() const noexcept
Number of internal faces.
Definition: faMeshI.H:68
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Abstract base class to hold the Field mapping for mesh morphs.
dynamicFvMesh & mesh
Namespace for OpenFOAM.