pointPairs.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) 2013-2015 OpenFOAM Foundation
9 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::pointPairs
29
30Description
31 HashSet of unique edges. The edges are stored as a pair of pairs:
32
33 ( (local index, processor index) (local index, processor index) )
34
35 e.g.,
36
37 ( (0 1) (3 1) )
38 ( (0 2) (5 1) )
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef pointPairs_H
43#define pointPairs_H
44
45#include "labelPairHashes.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class pointPairs Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class Triangulation>
57class pointPairs
58:
59 public HashSet<labelPairPair>
60{
61 // Private Typedefs
62
64 typedef typename Triangulation::Vertex_handle Vertex_handle;
65
66
67 // Private Data
68
69 const Triangulation& triangulation_;
70
71
72 // Private Member Functions
73
74 inline labelPairPair orderPointPair
75 (
76 const labelPair& vA,
77 const labelPair& vB
78 ) const;
79
80 inline bool insertPointPair
81 (
82 const labelPair& vA,
83 const labelPair& vB
84 );
85
86 inline bool findPointPair
87 (
88 const labelPair& vA,
89 const labelPair& vB
90 ) const;
91
92
93public:
94
95 // Constructors
96
97 //- Construct from triangulation
98 pointPairs(const Triangulation& triangulation);
99
100
101 //- Destructor
102 ~pointPairs();
103
104
105 // Member Functions
106
107 // Access
109 inline bool isPointPair
110 (
111 const Vertex_handle& vA,
112 const Vertex_handle& vB
113 ) const;
115 inline bool isPointPair
116 (
117 const labelPair& vA,
118 const labelPair& vB
119 ) const;
120
121
122 // Edit
124 inline bool addPointPair
125 (
126 const labelPair& vA,
127 const labelPair& vB
128 );
130 inline bool addPointPair
131 (
132 const labelPair& master,
133 const DynamicList<labelPair>& slaves
134 );
136 inline bool addPointPair
137 (
138 const label vA,
139 const label vB
140 );
142 void reIndex(const Map<label>& oldToNewIndices);
143};
144
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#ifdef NoRepository
153 #include "pointPairs.C"
154#endif
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158#endif
159
160// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
A HashTable with keys but without contents that is similar to std::unordered_set.
Definition: HashSet.H:96
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:69
CellSizeDelaunay::Vertex_handle Vertex_handle
HashSet of unique edges. The edges are stored as a pair of pairs:
Definition: pointPairs.H:59
bool addPointPair(const labelPair &vA, const labelPair &vB)
pointPairs(const Triangulation &triangulation)
Construct from triangulation.
bool isPointPair(const Vertex_handle &vA, const Vertex_handle &vB) const
~pointPairs()
Destructor.
bool isPointPair(const labelPair &vA, const labelPair &vB) const
void reIndex(const Map< label > &oldToNewIndices)
bool addPointPair(const label vA, const label vB)
bool addPointPair(const labelPair &master, const DynamicList< labelPair > &slaves)
A HashTable to objects of type <T> with a labelPair key. The hashing is based on labelPair (FixedList...
Namespace for OpenFOAM.