triSurfacePartitioner.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  triSurfacePartitioner
26 
27 Description
28  Provides information regarding surface partitions on the surface
29  triangulation, and connectivity between various surface partitions.
30 
31 SourceFiles
32  triSurfacePartitioner.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef triSurfacePartitioner_H
37 #define triSurfacePartitioner_H
38 
39 #include "triSurf.H"
40 #include "DynList.H"
41 #include "HashSet.H"
42 
43 #include <map>
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class triSurfacePartitioner Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56  // Private data
57  //- reference to triSurf
58  const triSurf& surface_;
59 
60  //- corner nodes
63 
64  //- information which partitions share an edge with a given partition
66 
67  //- edge partitions
69 
70  //- information which edge groups share a corner
71  //- with a given group
73 
74  //- edge groups between surface patches
75  std::map<std::pair<label, label>, labelHashSet> patchesEdgeGroups_;
76 
77  //- corners shared by edge groups
78  std::map<std::pair<label, label>, labelHashSet> edgeGroupsCorners_;
79 
80  // Private member functions
81  //- calculate patch addressing
83 
84  //- find surface corners
86 
87  //- calculate patch-patches addressing
88  void calculatePatchPatches();
89 
90  //- calculate edge groups
91  void calculateEdgeGroups();
92 
93  //- calculate surface patch to edge groups addressing
95 
96  //- calculate edge groups to corner addressing
98 
99  //- Disallow default bitwise copy construct
101 
102  //- Disallow default bitwise assignment
103  void operator=(const triSurfacePartitioner&);
104 
105 public:
106 
107  // Constructors
108 
109  //- Construct from triSurf
111 
112  // Destructor
113 
115 
116 
117  // Member Functions
118  //- return corner nodes
119  const labelList& corners() const;
120 
121  //- return corner patches
122  const List<DynList<label> >& cornerPatches() const;
123 
124  //- return patch-patches addressing
125  const List<labelHashSet>& patchPatches() const;
126 
127  //- return edge groups. Edges which are not
128  //- feature edges are set to -1
129  const labelList& edgeGroups() const;
130 
131  //- Edge group - edge groups addressing
133 
134  //- Return groups of feature edges shared by the given patches
136  (
137  const label partition1,
138  const label partition2,
139  DynList<label>& edgePartitions
140  ) const;
141 
142  //- return corners shared shared by the given edge groups
144  (
145  const label edgePartition1,
146  const label edgePartition2,
148  ) const;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
Foam::triSurfacePartitioner::calculatePatchPatches
void calculatePatchPatches()
calculate patch-patches addressing
Definition: triSurfacePartitionerCreateAddressing.C:113
Foam::triSurfacePartitioner::patchesEdgeGroups_
std::map< std::pair< label, label >, labelHashSet > patchesEdgeGroups_
edge groups between surface patches
Definition: triSurfacePartitioner.H:74
Foam::triSurfacePartitioner::edgeGroupEdgeGroups
const List< labelHashSet > & edgeGroupEdgeGroups() const
Edge group - edge groups addressing.
Definition: triSurfacePartitioner.C:84
Foam::triSurfacePartitioner::cornersSharedByEdgeGroups
void cornersSharedByEdgeGroups(const label edgePartition1, const label edgePartition2, DynList< label > &corners) const
return corners shared shared by the given edge groups
Definition: triSurfacePartitioner.C:117
Foam::triSurfacePartitioner
Definition: triSurfacePartitioner.H:53
triSurf.H
Foam::triSurfacePartitioner::edgeGroups_
labelList edgeGroups_
edge partitions
Definition: triSurfacePartitioner.H:67
Foam::triSurfacePartitioner::corners_
labelList corners_
corner nodes
Definition: triSurfacePartitioner.H:60
Foam::triSurfacePartitioner::patchPatches_
List< labelHashSet > patchPatches_
information which partitions share an edge with a given partition
Definition: triSurfacePartitioner.H:64
Foam::triSurfacePartitioner::edgeGroupsSharedByPatches
void edgeGroupsSharedByPatches(const label partition1, const label partition2, DynList< label > &edgePartitions) const
Return groups of feature edges shared by the given patches.
Definition: triSurfacePartitioner.C:90
Foam::triSurfacePartitioner::triSurfacePartitioner
triSurfacePartitioner(const triSurfacePartitioner &)
Disallow default bitwise copy construct.
Foam::HashSet< label, Hash< label > >
Foam::triSurfacePartitioner::calculateCornersAndAddressing
void calculateCornersAndAddressing()
find surface corners
Definition: triSurfacePartitionerCreateAddressing.C:57
Foam::triSurfacePartitioner::calculatePatchToEdgeGroups
void calculatePatchToEdgeGroups()
calculate surface patch to edge groups addressing
Definition: triSurfacePartitionerCreateAddressing.C:212
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:59
Foam::triSurfacePartitioner::cornerPatches_
List< DynList< label > > cornerPatches_
Definition: triSurfacePartitioner.H:61
Foam::triSurfacePartitioner::patchPatches
const List< labelHashSet > & patchPatches() const
return patch-patches addressing
Definition: triSurfacePartitioner.C:74
HashSet.H
Foam::triSurfacePartitioner::calculatePatchAddressing
void calculatePatchAddressing()
calculate patch addressing
Definition: triSurfacePartitionerCreateAddressing.C:44
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList< label >
Foam::triSurfacePartitioner::edgeGroupsCorners_
std::map< std::pair< label, label >, labelHashSet > edgeGroupsCorners_
corners shared by edge groups
Definition: triSurfacePartitioner.H:77
Foam::triSurfacePartitioner::calculateEdgeGroups
void calculateEdgeGroups()
calculate edge groups
Definition: triSurfacePartitionerCreateAddressing.C:133
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::surface
Definition: surface.H:55
Foam::triSurfacePartitioner::corners
const labelList & corners() const
return corner nodes
Definition: triSurfacePartitioner.C:64
Foam::triSurfacePartitioner::edgeGroupEdgeGroups_
List< labelHashSet > edgeGroupEdgeGroups_
Definition: triSurfacePartitioner.H:71
Foam::triSurfacePartitioner::surface_
const triSurf & surface_
reference to triSurf
Definition: triSurfacePartitioner.H:57
Foam::triSurfacePartitioner::operator=
void operator=(const triSurfacePartitioner &)
Disallow default bitwise assignment.
Foam::triSurfacePartitioner::edgeGroups
const labelList & edgeGroups() const
Definition: triSurfacePartitioner.C:79
Foam::triSurfacePartitioner::calculateEdgeGroupsToCorners
void calculateEdgeGroupsToCorners()
calculate edge groups to corner addressing
Definition: triSurfacePartitionerCreateAddressing.C:245
Foam::triSurf
Definition: triSurf.H:59
DynList.H
Foam::triSurfacePartitioner::cornerPatches
const List< DynList< label > > & cornerPatches() const
return corner patches
Definition: triSurfacePartitioner.C:69
Foam::triSurfacePartitioner::~triSurfacePartitioner
~triSurfacePartitioner()
Definition: triSurfacePartitioner.C:59