featurePointConformer.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 | Copyright (C) 2013-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::featurePointConformer
26 
27 Description
28  The Delaunay vertices required to conform to a feature point can be
29  determined upon initialisation because the feature points are fixed and
30  do not change throughout the meshing process.
31 
32 SourceFiles
33  featurePointConformerI.H
34  featurePointConformer.C
35  featurePointConformerSpecialisations.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef featurePointConformer_H
40 #define featurePointConformer_H
41 
42 // Include uint.H before CGAL headers to define __STDC_LIMIT_MACROS
43 #include "uint.H"
45 #include "vector.H"
46 #include "DynamicList.H"
47 #include "List.H"
49 #include "pointPairs.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 class conformalVoronoiMesh;
57 class cvControls;
58 class conformationSurfaces;
59 class pointFeatureEdgesTypes;
60 class backgroundMeshDecomposition;
61 
62 /*---------------------------------------------------------------------------*\
63  Class featurePointConformer Declaration
64 \*---------------------------------------------------------------------------*/
65 
67 {
68  // Static data
69 
70  //- Tolerance within which two lines are said to be parallel.
71  static const scalar tolParallel;
72 
73 
74  // Private data
75 
76  //- Reference to the mesher.
77  const conformalVoronoiMesh& foamyHexMesh_;
78 
79  //- Reference to the mesher controls.
80  const cvControls& foamyHexMeshControls_;
81 
82  //- Reference to the conformation surfaces.
83  const conformationSurfaces& geometryToConformTo_;
84 
85  //- Store the feature constraining points, to be reinserted after a
86  // triangulation clear.
87  List<Vb> featurePointVertices_;
88 
89  //-
90  mutable pointPairs<Delaunay> ftPtPairs_;
91 
92 
93  // Private Member Functions
94 
95  //- Calculate the shared face normal between two edges geometrically.
96  vector sharedFaceNormal
97  (
98  const extendedFeatureEdgeMesh& feMesh,
99  const label edgeI,
100  const label nextEdgeI
101  ) const;
102 
103  label getSign(const extendedFeatureEdgeMesh::edgeStatus eStatus) const;
104 
105  bool createSpecialisedFeaturePoint
106  (
107  const extendedFeatureEdgeMesh& feMesh,
108  const labelList& pEds,
109  const pointFeatureEdgesTypes& pFEdgesTypes,
111  const label ptI,
112  DynamicList<Vb>& pts
113  ) const;
114 
115 
116  void addMasterAndSlavePoints
117  (
118  const DynamicList<point>& masterPoints,
119  const DynamicList<indexedVertexEnum::vertexType>& masterPointsTypes,
120  const Map<DynamicList<autoPtr<plane>>>& masterPointReflections,
121  DynamicList<Vb>& pts,
122  const label ptI
123  ) const;
124 
125  //- Helper function for conforming to feature points
126  void createMasterAndSlavePoints
127  (
128  const extendedFeatureEdgeMesh& feMesh,
129  const label ptI,
130  DynamicList<Vb>& pts
131  ) const;
132 
133  void createMixedFeaturePoints(DynamicList<Vb>& pts) const;
134 
135  //- Create the points that will conform to the feature
136  void createFeaturePoints(DynamicList<Vb>& pts);
137 
138  //- Disallow default bitwise copy construct
140 
141  //- Disallow default bitwise assignment
142  void operator=(const featurePointConformer&);
143 
144 
145 public:
146 
147  //- Runtime type information
148  ClassName("featurePointConformer");
149 
150 
151  // Constructors
152 
153  //- Construct from components
154  explicit featurePointConformer
155  (
156  const conformalVoronoiMesh& foamyHexMesh
157  );
158 
159 
160  //- Destructor
162 
163 
164  // Member Functions
165 
166  // Access
167 
168  //- Return the feature point vertices for insertion into the
169  // triangulation.
170  inline const List<Vb>& featurePointVertices() const;
171 
172  //- Return the feature point pair table
173  inline const pointPairs<Delaunay>& featurePointPairs() const;
174 
175 
176  // Edit
177 
178  //- Distribute the feature point vertices according to the
179  // supplied background mesh
180  void distribute(const backgroundMeshDecomposition& decomposition);
181 
182  //- Reindex the feature point pairs using the map.
183  void reIndexPointPairs(const Map<label>& oldToNewIndices);
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #include "featurePointConformerI.H"
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
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
const List< Vb > & featurePointVertices() const
Return the feature point vertices for insertion into the.
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
Hold the types of feature edges attached to the point.
const pointPairs< Delaunay > & featurePointPairs() const
Return the feature point pair table.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
System uinteger.
void distribute(const backgroundMeshDecomposition &decomposition)
Distribute the feature point vertices according to the.
~featurePointConformer()
Destructor.
ClassName("featurePointConformer")
Runtime type information.
Controls for the conformalVoronoiMesh mesh generator.
Definition: cvControls.H:53
The Delaunay vertices required to conform to a feature point can be determined upon initialisation be...
void reIndexPointPairs(const Map< label > &oldToNewIndices)
Reindex the feature point pairs using the map.
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
CGAL data structures used for 3D Delaunay meshing.
Namespace for OpenFOAM.
A HashTable to objects of type <T> with a label key.
Definition: Map.H:49