mergedSurf.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-2018 OpenCFD 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::mergedSurf
28 
29 Description
30  Simple class to manage surface merging information.
31 
32  Merging is done with PatchTools::gatherAndMerge()
33 
34 SourceFiles
35  mergedSurf.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef mergedSurf_H
40 #define mergedSurf_H
41 
42 #include "meshedSurf.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class mergedSurf Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class mergedSurf
54 :
55  public meshedSurf
56 {
57  pointField points_;
58  faceList faces_;
59  labelList zones_;
60  labelList pointsMap_;
61 
62 
63 public:
64 
65  // Constructors
66 
67  //- Construct null
68  mergedSurf() = default;
69 
70  //- Copy construct null
71  mergedSurf(const mergedSurf&) = default;
72 
73  //- Move construct
74  mergedSurf(mergedSurf&&) = default;
75 
76  //- Construct and merge.
78  (
79  const meshedSurf& unmergedSurface,
80  const scalar mergeDim
81  );
82 
83  //- Construct and merge.
85  (
86  const pointField& unmergedPoints,
87  const faceList& unmergedFaces,
88  const scalar mergeDim
89  );
90 
91  //- Construct and merge
93  (
94  const pointField& unmergedPoints,
95  const faceList& unmergedFaces,
96  const labelList& originalIds,
97  const scalar mergeDim
98  );
99 
100 
101  //- Destructor
102  virtual ~mergedSurf() = default;
103 
104 
105  // Access Member Functions
106 
107  //- Can use (parallel only)
108  static bool use();
109 
110  //- Number of faces
111  label size() const
112  {
113  return faces_.size();
114  }
115 
116  //- Const access to (global) points used for the surface
117  virtual const pointField& points() const
118  {
119  return points_;
120  }
121 
122  //- Const access to the surface faces
123  virtual const faceList& faces() const
124  {
125  return faces_;
126  }
127 
128  //- Per-face zone/region information
129  virtual const labelList& zoneIds() const
130  {
131  return zones_;
132  }
133 
134  //- Map for reordered points (old-to-new)
135  const labelList& pointsMap() const
136  {
137  return pointsMap_;
138  }
139 
140 
141  // Edit
142 
143  //- Clear all storage
144  void clear();
145 
146  //- Merge meshed surfaces (in parallel only).
147  bool merge
148  (
149  const meshedSurf& unmergedSurface,
150  const scalar mergeDim
151  );
152 
153  //- Merge meshed surfaces (in parallel only).
154  bool merge
155  (
156  const pointField& unmergedPoints,
157  const faceList& unmergedFaces,
158  const scalar mergeDim
159  );
160 
161  //- Merge meshed surfaces (in parallel only).
162  bool merge
163  (
164  const pointField& unmergedPoints,
165  const faceList& unmergedFaces,
166  const labelList& originalIds,
167  const scalar mergeDim
168  );
169 
170 
171  // Member Operators
172 
173  //- Copy assignment
174  mergedSurf& operator=(const mergedSurf&) = default;
175 
176  //- Move assignment
177  mergedSurf& operator=(mergedSurf&&) = default;
178 
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
Foam::mergedSurf::size
label size() const
Number of faces.
Definition: mergedSurf.H:110
Foam::mergedSurf::operator=
mergedSurf & operator=(const mergedSurf &)=default
Copy assignment.
Foam::mergedSurf::clear
void clear()
Clear all storage.
Definition: mergedSurf.C:81
Foam::meshedSurf
Abstract definition of a meshed surface defined by faces and points.
Definition: meshedSurf.H:49
Foam::mergedSurf::pointsMap
const labelList & pointsMap() const
Map for reordered points (old-to-new)
Definition: mergedSurf.H:134
Foam::mergedSurf::faces
virtual const faceList & faces() const
Const access to the surface faces.
Definition: mergedSurf.H:122
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::Field< vector >
Foam::mergedSurf
Simple class to manage surface merging information.
Definition: mergedSurf.H:52
Foam::mergedSurf::merge
bool merge(const meshedSurf &unmergedSurface, const scalar mergeDim)
Merge meshed surfaces (in parallel only).
Definition: mergedSurf.C:91
Foam::mergedSurf::mergedSurf
mergedSurf()=default
Construct null.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mergedSurf::zoneIds
virtual const labelList & zoneIds() const
Per-face zone/region information.
Definition: mergedSurf.H:128
Foam::mergedSurf::use
static bool use()
Can use (parallel only)
Definition: mergedSurf.C:75
Foam::List< face >
Foam::mergedSurf::~mergedSurf
virtual ~mergedSurf()=default
Destructor.
Foam::mergedSurf::points
virtual const pointField & points() const
Const access to (global) points used for the surface.
Definition: mergedSurf.H:116
meshedSurf.H