featurePointConformer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2020 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 
43 #include "vector.H"
44 #include "DynamicList.H"
45 #include "List.H"
47 #include "pointPairs.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 class conformalVoronoiMesh;
55 class cvControls;
56 class conformationSurfaces;
57 class pointFeatureEdgesTypes;
58 class backgroundMeshDecomposition;
59 
60 /*---------------------------------------------------------------------------*\
61  Class featurePointConformer Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66  // Static data
67 
68  //- Tolerance within which two lines are said to be parallel.
69  static const scalar tolParallel;
70 
71 
72  // Private Data
73 
74  //- Reference to the mesher.
75  const conformalVoronoiMesh& foamyHexMesh_;
76 
77  //- Reference to the mesher controls.
78  const cvControls& foamyHexMeshControls_;
79 
80  //- Reference to the conformation surfaces.
81  const conformationSurfaces& geometryToConformTo_;
82 
83  //- Store the feature constraining points, to be reinserted after a
84  // triangulation clear.
85  List<Vb> featurePointVertices_;
86 
87  //-
88  mutable pointPairs<Delaunay> ftPtPairs_;
89 
90 
91  // Private Member Functions
92 
93  //- Calculate the shared face normal between two edges geometrically.
94  vector sharedFaceNormal
95  (
96  const extendedFeatureEdgeMesh& feMesh,
97  const label edgeI,
98  const label nextEdgeI
99  ) const;
100 
101  label getSign(const extendedFeatureEdgeMesh::edgeStatus eStatus) const;
102 
103  bool createSpecialisedFeaturePoint
104  (
105  const extendedFeatureEdgeMesh& feMesh,
106  const labelList& pEds,
107  const pointFeatureEdgesTypes& pFEdgesTypes,
109  const label ptI,
110  DynamicList<Vb>& pts
111  ) const;
112 
113 
114  void addMasterAndSlavePoints
115  (
116  const DynamicList<point>& masterPoints,
117  const DynamicList<indexedVertexEnum::vertexType>& masterPointsTypes,
118  const Map<DynamicList<autoPtr<plane>>>& masterPointReflections,
119  DynamicList<Vb>& pts,
120  const label ptI
121  ) const;
122 
123  //- Helper function for conforming to feature points
124  void createMasterAndSlavePoints
125  (
126  const extendedFeatureEdgeMesh& feMesh,
127  const label ptI,
128  DynamicList<Vb>& pts
129  ) const;
130 
131  void createMixedFeaturePoints(DynamicList<Vb>& pts) const;
132 
133  //- Create the points that will conform to the feature
134  void createFeaturePoints(DynamicList<Vb>& pts);
135 
136 
137 public:
138 
139  //- Runtime type information
140  ClassName("featurePointConformer");
141 
142 
143  // Constructors
144 
145  //- Construct from components
146  explicit featurePointConformer
147  (
148  const conformalVoronoiMesh& foamyHexMesh
149  );
150 
151  //- Disallow default bitwise copy construction
153 
154 
155  //- Destructor
157 
158 
159  // Member Functions
160 
161  // Access
162 
163  //- Return the feature point vertices for insertion into the
164  // triangulation.
165  inline const List<Vb>& featurePointVertices() const;
166 
167  //- Return the feature point pair table
168  inline const pointPairs<Delaunay>& featurePointPairs() const;
169 
170 
171  // Edit
172 
173  //- Distribute the feature point vertices according to the
174  // supplied background mesh
175  void distribute(const backgroundMeshDecomposition& decomposition);
176 
177  //- Reindex the feature point pairs using the map.
178  void reIndexPointPairs(const Map<label>& oldToNewIndices);
179 
180 
181  // Member Operators
182 
183  //- Disallow default bitwise assignment
184  void operator=(const featurePointConformer&) = delete;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #include "featurePointConformerI.H"
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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
const List< Vb > & featurePointVertices() const
Return the feature point vertices for insertion into the.
void operator=(const featurePointConformer &)=delete
Disallow default bitwise assignment.
Hold the types of feature edges attached to the point.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
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:52
CGAL data structures used for 3D Delaunay meshing.
featurePointConformer(const conformalVoronoiMesh &foamyHexMesh)
Construct from components.
const pointPairs< Delaunay > & featurePointPairs() const
Return the feature point pair table.
Namespace for OpenFOAM.
A HashTable to objects of type <T> with a label key.
Definition: Map.H:49