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 -------------------------------------------------------------------------------
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::faEdgeMapper
28 
29 Description
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 
33 Author
34  Zeljko Tukovic, FMENA
35  Hrvoje Jasak, Wikki Ltd.
36 
37 SourceFiles
38  faEdgeMapper.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef Foam_faEdgeMapper_H
43 #define Foam_faEdgeMapper_H
44 
45 #include "morphFieldMapper.H"
46 #include "faMesh.H"
47 #include "faceMapper.H"
48 #include "mapPolyMesh.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class faEdgeMapper Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class faEdgeMapper
60 :
61  public morphFieldMapper
62 {
63  // Private Data
64 
65  //- Reference to mesh
66  // currently unused: const faMesh& mesh_;
67 
68  //- Reference to mapPolyMesh
69  // currently unused: const mapPolyMesh& mpm_;
70 
71  //- The size of the mapper = mesh_.nInternalEdges()
72  const label mapperLen_;
73 
74  //- Size before mapping (old mesh size)
75  const label sizeBeforeMapping_;
76 
77 
78  // Demand-Driven Data
79 
80  mutable bool hasUnmapped_;
81 
82  //- Direct addressing
83  mutable std::unique_ptr<labelList> directAddrPtr_;
84 
85 
86  // Private Member Functions
87 
88  //- Calculate addressing
89  void calcAddressing() const;
90 
91 public:
92 
93  // Generated Methods
94 
95  //- No copy construct
96  faEdgeMapper(const faEdgeMapper&) = delete;
97 
98  //- No copy assignment
99  void operator=(const faEdgeMapper&) = delete;
100 
101 
102  // Constructors
103 
104  //- Construct from components
106  (
107  const faMesh& mesh,
108  const mapPolyMesh& mpm
109  );
110 
111 
112  //- Destructor
113  virtual ~faEdgeMapper();
114 
115 
116  // Member Functions
117 
118  //- Return mapper size
119  virtual label size() const;
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  }
132 
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;
144  //- Return interpolation weights
145  virtual const scalarListList& weights() const;
146 
147  //- Are there any inserted edges
148  virtual bool insertedObjects() const
149  {
150  return false;
151  }
152 
153  //- Return list of inserted edges
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 // ************************************************************************* //
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:133
virtual bool direct() const
Is the mapping direct.
Definition: faEdgeMapper.H:151
faEdgeMapper(const faEdgeMapper &)=delete
No copy construct.
virtual const labelUList & directAddressing() const
Return direct addressing.
Definition: faEdgeMapper.C:79
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual const labelListList & addressing() const
Return interpolated addressing.
Definition: faEdgeMapper.C:90
virtual bool insertedObjects() const
Are there any inserted edges.
Definition: faEdgeMapper.H:179
dynamicFvMesh & mesh
Abstract base class to hold the Field mapping for mesh morphs.
virtual const labelList & insertedObjectLabels() const
Return list of inserted edges.
Definition: faEdgeMapper.H:187
FA edge mapper. Currently, edge-based finite area data is not mapped, but only resized, since edge-based mapping data is not available.
Definition: faEdgeMapper.H:54
virtual const scalarListList & weights() const
Return interpolation weights.
Definition: faEdgeMapper.C:100
virtual label sizeBeforeMapping() const
Return size of field before mapping.
Definition: faEdgeMapper.H:143
void operator=(const faEdgeMapper &)=delete
No copy assignment.
virtual bool hasUnmapped() const
Any unmapped values?
Definition: faEdgeMapper.H:156
virtual ~faEdgeMapper()
Destructor.
Definition: faEdgeMapper.C:67
static const List< label > & null() noexcept
Return a null List (reference to a nullObject). Behaves like an empty List.
Definition: List.H:137
Namespace for OpenFOAM.
virtual label size() const
Return mapper size.
Definition: faEdgeMapper.C:73