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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
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::featurePointConformer
28 
29 Description
30  The Delaunay vertices required to conform to a feature point can be
31  determined upon initialisation because the feature points are fixed and
32  do not change throughout the meshing process.
33 
34 SourceFiles
35  featurePointConformerI.H
36  featurePointConformer.C
37  featurePointConformerSpecialisations.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef featurePointConformer_H
42 #define featurePointConformer_H
43 
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  //- No copy construct
140 
141  //- No copy assignment
142  void operator=(const featurePointConformer&) = delete;
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 // ************************************************************************* //
Foam::conformalVoronoiMesh
Definition: conformalVoronoiMesh.H:96
Foam::extendedEdgeMesh::edgeStatus
edgeStatus
Definition: extendedEdgeMesh.H:104
Foam::cvControls
Controls for the conformalVoronoiMesh mesh generator.
Definition: cvControls.H:55
featurePointConformerI.H
List.H
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:55
Foam::featurePointConformer::~featurePointConformer
~featurePointConformer()
Destructor.
Foam::featurePointConformer::featurePointVertices
const List< Vb > & featurePointVertices() const
Return the feature point vertices for insertion into the.
Definition: featurePointConformerI.H:28
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::conformationSurfaces
Definition: conformationSurfaces.H:55
extendedFeatureEdgeMesh.H
Foam::featurePointConformer::ClassName
ClassName("featurePointConformer")
Runtime type information.
Foam::pointPairs< Delaunay >
pointPairs.H
Foam::featurePointConformer::reIndexPointPairs
void reIndexPointPairs(const Map< label > &oldToNewIndices)
Reindex the feature point pairs using the map.
Foam::featurePointConformer
The Delaunay vertices required to conform to a feature point can be determined upon initialisation be...
Definition: featurePointConformer.H:65
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::featurePointConformer::distribute
void distribute(const backgroundMeshDecomposition &decomposition)
Distribute the feature point vertices according to the.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::backgroundMeshDecomposition
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
Definition: backgroundMeshDecomposition.H:94
Foam::pointFeatureEdgesTypes
Hold the types of feature edges attached to the point.
Definition: pointFeatureEdgesTypes.H:60
vector.H
Foam::extendedFeatureEdgeMesh
extendedEdgeMesh + IO.
Definition: extendedFeatureEdgeMesh.H:56
DynamicList.H
Foam::featurePointConformer::featurePointPairs
const pointPairs< Delaunay > & featurePointPairs() const
Return the feature point pair table.
Definition: featurePointConformerI.H:34
CGALTriangulation3Ddefs.H
CGAL data structures used for 3D Delaunay meshing.