faMeshMapper.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::faMeshMapper
28 
29 Description
30  Class holds all the necessary information for mapping fields associated
31  with faMesh
32 
33 Note
34  In order to capture all necessary mesh sizes and mapping data, mapper
35  is created with the OLD mesh, and provides new mesh data.
36  In the process, field mapping information is assembled from the old faMesh
37  and the mapping data
38 
39 Author
40  Zeljko Tukovic, FMENA
41  Hrvoje Jasak, Wikki Ltd.
42 
43 SourceFiles
44  faMeshMapper.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef faMeshMapper_H
49 #define faMeshMapper_H
50 
51 #include "faceMapper.H"
52 #include "faAreaMapper.H"
53 #include "faEdgeMapper.H"
54 #include "faBoundaryMeshMapper.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 // Forward declaration of classes
62 class faMesh;
63 class mapPolyMesh;
64 
65 /*---------------------------------------------------------------------------*\
66  Class faMeshMapper Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class faMeshMapper
70 {
71  // Private data
72 
73  //- Reference to mesh
74  const faMesh& mesh_;
75 
76 
77  // Old mesh data
78 
79  //- Number of old points
80  label nOldPoints_;
81 
82  //- Number of old edges
83  label nOldEdges_;
84 
85  //- Number of old internal edges
86  label nOldInternalEdges_;
87 
88  //- Number of old faces
89  label nOldFaces_;
90 
91  //- Old patch sizes
92  labelList oldPatchSizes_;
93 
94  //- Old patch starts
95  labelList oldPatchStarts_;
96 
97  //- Old patch edgeFaces
98  labelListList oldPatchEdgeFaces_;
99 
100 
101  // Mappers
102 
103  //- Area mapper
104  faAreaMapper areaMap_;
105 
106  //- Edge mapper
107  faEdgeMapper edgeMap_;
108 
109  //- Boundary mapper
110  faBoundaryMeshMapper boundaryMap_;
111 
112 
113  // Private Member Functions
114 
115  //- No copy construct
116  faMeshMapper(const faMeshMapper&) = delete;
117 
118  //- No copy assignment
119  void operator=(const faMeshMapper&) = delete;
120 
121 
122 public:
123 
124  // Constructors
125 
126  //- Construct from components
127  faMeshMapper(const faMesh& mesh, const mapPolyMesh& mpm);
128 
129 
130  // Member Functions
131 
132  //- Return reference to mesh
133  const faMesh& mesh() const
134  {
135  return mesh_;
136  }
137 
138  //- Return reference to objectRegistry storing fields. Can be
139  // removed once fields stored on pointMesh.
140  const objectRegistry& thisDb() const
141  {
142  return mesh_.thisDb();
143  }
144 
145 
146  // Basic sizing information
147 
148  //- Return number of old points
149  label nOldPoints() const
150  {
151  return nOldPoints_;
152  }
153 
154  //- Return number of old edges
155  label nOldEdges() const
156  {
157  return nOldEdges_;
158  };
159 
160  //- Return number of old internal edges
161  label nOldInternalEdges() const
162  {
163  return nOldInternalEdges_;
164  };
165 
166  //- Return number of old faces
167  label nOldFaces() const
168  {
169  return nOldFaces_;
170  };
171 
172  //- Return old patch sizes
173  const labelList& oldPatchSizes() const
174  {
175  return oldPatchSizes_;
176  };
177 
178  //- Return old patch starts
179  const labelList& oldPatchStarts() const
180  {
181  return oldPatchStarts_;
182  };
183 
184  //- Return old patch edgeFaces
185  const labelListList& oldPatchEdgeFaces() const
186  {
187  return oldPatchEdgeFaces_;
188  };
189 
190 
191  // Mappers
192 
193  //- Return surface mapper
194  const faAreaMapper& areaMap() const
195  {
196  return areaMap_;
197  }
198 
199  //- Return edge mapper
200  const faEdgeMapper& edgeMap() const
201  {
202  return edgeMap_;
203  }
204 
205  //- Return boundary mapper
206  const faBoundaryMeshMapper& boundaryMap() const
207  {
208  return boundaryMap_;
209  }
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
Foam::faBoundaryMeshMapper
Foam::faBoundaryMeshMapper.
Definition: faBoundaryMeshMapper.H:48
faAreaMapper.H
Foam::faMeshMapper::boundaryMap
const faBoundaryMeshMapper & boundaryMap() const
Return boundary mapper.
Definition: faMeshMapper.H:205
Foam::faMeshMapper::nOldFaces
label nOldFaces() const
Return number of old faces.
Definition: faMeshMapper.H:166
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::faMeshMapper::mesh
const faMesh & mesh() const
Return reference to mesh.
Definition: faMeshMapper.H:132
Foam::faAreaMapper
FA area mapper.
Definition: faAreaMapper.H:58
Foam::faMeshMapper::oldPatchEdgeFaces
const labelListList & oldPatchEdgeFaces() const
Return old patch edgeFaces.
Definition: faMeshMapper.H:184
Foam::faMeshMapper
Class holds all the necessary information for mapping fields associated with faMesh.
Definition: faMeshMapper.H:68
Foam::faMeshMapper::nOldEdges
label nOldEdges() const
Return number of old edges.
Definition: faMeshMapper.H:154
Foam::faMeshMapper::nOldPoints
label nOldPoints() const
Return number of old points.
Definition: faMeshMapper.H:148
faEdgeMapper.H
faBoundaryMeshMapper.H
faceMapper.H
Foam::faMeshMapper::oldPatchStarts
const labelList & oldPatchStarts() const
Return old patch starts.
Definition: faMeshMapper.H:178
Foam::faEdgeMapper
FA edge mapper. Currently, edge-based finite area data is not mapped, but only resized,...
Definition: faEdgeMapper.H:59
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::faMeshMapper::nOldInternalEdges
label nOldInternalEdges() const
Return number of old internal edges.
Definition: faMeshMapper.H:160
Foam::faMesh::thisDb
virtual const objectRegistry & thisDb() const
Return reference to the mesh database.
Definition: faMesh.C:570
Foam::faMeshMapper::edgeMap
const faEdgeMapper & edgeMap() const
Return edge mapper.
Definition: faMeshMapper.H:199
Foam::List< label >
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::faMeshMapper::thisDb
const objectRegistry & thisDb() const
Return reference to objectRegistry storing fields. Can be.
Definition: faMeshMapper.H:139
Foam::faMeshMapper::areaMap
const faAreaMapper & areaMap() const
Return surface mapper.
Definition: faMeshMapper.H:193
Foam::faMeshMapper::oldPatchSizes
const labelList & oldPatchSizes() const
Return old patch sizes.
Definition: faMeshMapper.H:172