featurePointConformerSpecialisations.C
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) 2012-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 \*---------------------------------------------------------------------------*/
27 
28 #include "featurePointConformer.H"
29 #include "vectorTools.H"
30 #include "pointFeatureEdgesTypes.H"
31 #include "conformalVoronoiMesh.H"
32 #include "pointConversion.H"
33 
34 using namespace Foam::vectorTools;
35 
36 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
37 
38 bool Foam::featurePointConformer::createSpecialisedFeaturePoint
39 (
40  const extendedFeatureEdgeMesh& feMesh,
41  const labelList& pEds,
42  const pointFeatureEdgesTypes& pFEdgesTypes,
43  const List<extendedFeatureEdgeMesh::edgeStatus>& allEdStat,
44  const label ptI,
45  DynamicList<Vb>& pts
46 ) const
47 {
48  if
49  (
50  !pFEdgesTypes.found(extendedFeatureEdgeMesh::EXTERNAL)
51  || !pFEdgesTypes.found(extendedFeatureEdgeMesh::INTERNAL)
52  )
53  {
54  return false;
55  }
56 
57  if
58  (
59  pFEdgesTypes[extendedFeatureEdgeMesh::EXTERNAL] == 2
60  && pFEdgesTypes[extendedFeatureEdgeMesh::INTERNAL] == 1
61  && pEds.size() == 3
62  )
63  {
64  if (debug) Info<< "nExternal == 2 && nInternal == 1" << endl;
65 
66  const Foam::point& featPt = feMesh.points()[ptI];
67 
68  if
69  (
71  && !foamyHexMesh_.decomposition().positionOnThisProcessor(featPt)
72  )
73  {
74  return false;
75  }
76 
77  label nVert = foamyHexMesh_.number_of_vertices();
78 
79  const label initialNumOfPoints = pts.size();
80 
81  const scalar ppDist = foamyHexMesh_.pointPairDistance(featPt);
82 
83  const vectorField& normals = feMesh.normals();
84 
85  const labelListList& edgeNormals = feMesh.edgeNormals();
86 
87  label concaveEdgeI = -1;
88  labelList convexEdgesI(2, label(-1));
89  label nConvex = 0;
90 
91  forAll(pEds, i)
92  {
93  const extendedFeatureEdgeMesh::edgeStatus& eS = allEdStat[i];
94 
96  {
97  concaveEdgeI = pEds[i];
98  }
99  else if (eS == extendedFeatureEdgeMesh::EXTERNAL)
100  {
101  convexEdgesI[nConvex++] = pEds[i];
102  }
103  else if (eS == extendedFeatureEdgeMesh::FLAT)
104  {
106  << "Edge " << eS << " is flat"
107  << endl;
108  }
109  else
110  {
112  << "Edge " << eS << " not concave/convex"
113  << exit(FatalError);
114  }
115  }
116 
117  const vector& concaveEdgePlaneANormal =
118  normals[edgeNormals[concaveEdgeI][0]];
119 
120  const vector& concaveEdgePlaneBNormal =
121  normals[edgeNormals[concaveEdgeI][1]];
122 
123  // Intersect planes parallel to the concave edge planes offset
124  // by ppDist and the plane defined by featPt and the edge vector.
125  plane planeA
126  (
127  featPt + ppDist*concaveEdgePlaneANormal,
128  concaveEdgePlaneANormal
129  );
130 
131  plane planeB
132  (
133  featPt + ppDist*concaveEdgePlaneBNormal,
134  concaveEdgePlaneBNormal
135  );
136 
137  const vector& concaveEdgeDir = feMesh.edgeDirection
138  (
139  concaveEdgeI,
140  ptI
141  );
142 
143  // Todo,needed later but want to get rid of this.
144  const Foam::point concaveEdgeLocalFeatPt =
145  featPt + ppDist*concaveEdgeDir;
146 
147  // Finding the nearest point on the intersecting line to the edge
148  // point. Floating point errors often occur using planePlaneIntersect
149 
150  plane planeF(concaveEdgeLocalFeatPt, concaveEdgeDir);
151 
152  const Foam::point concaveEdgeExternalPt = planeF.planePlaneIntersect
153  (
154  planeA,
155  planeB
156  );
157 
158  // Redefine planes to be on the feature surfaces to project through
159 
160  planeA = plane(featPt, concaveEdgePlaneANormal);
161 
162  planeB = plane(featPt, concaveEdgePlaneBNormal);
163 
164  const Foam::point internalPtA =
165  concaveEdgeExternalPt
166  - 2.0*planeA.distance(concaveEdgeExternalPt)
167  *concaveEdgePlaneANormal;
168 
169  pts.append
170  (
171  Vb
172  (
173  internalPtA,
174  foamyHexMesh_.vertexCount() + pts.size(),
175  Vb::vtInternalFeaturePoint,
177  )
178  );
179 
180  const label internalPtAIndex(pts.last().index());
181 
182  const Foam::point internalPtB =
183  concaveEdgeExternalPt
184  - 2.0*planeB.distance(concaveEdgeExternalPt)
185  *concaveEdgePlaneBNormal;
186 
187  pts.append
188  (
189  Vb
190  (
191  internalPtB,
192  foamyHexMesh_.vertexCount() + pts.size(),
193  Vb::vtInternalFeaturePoint,
195  )
196  );
197 
198  const label internalPtBIndex(pts.last().index());
199 
200  // Add the external points
201 
202  Foam::point externalPtD;
203  Foam::point externalPtE;
204 
205  vector convexEdgePlaneCNormal(Zero);
206  vector convexEdgePlaneDNormal(Zero);
207 
208  const labelList& concaveEdgeNormals = edgeNormals[concaveEdgeI];
209  const labelList& convexEdgeANormals = edgeNormals[convexEdgesI[0]];
210  const labelList& convexEdgeBNormals = edgeNormals[convexEdgesI[1]];
211 
212  forAll(concaveEdgeNormals, edgeNormalI)
213  {
214  bool convexEdgeA = false;
215  bool convexEdgeB = false;
216 
217  forAll(convexEdgeANormals, edgeAnormalI)
218  {
219  const vector& concaveNormal
220  = normals[concaveEdgeNormals[edgeNormalI]];
221  const vector& convexNormal
222  = normals[convexEdgeANormals[edgeAnormalI]];
223 
224  if (debug)
225  {
226  Info<< "Angle between vectors = "
227  << degAngleBetween(concaveNormal, convexNormal) << endl;
228  }
229 
230  // Need a looser tolerance, because sometimes adjacent triangles
231  // on the same surface will be slightly out of alignment.
232  if (areParallel(concaveNormal, convexNormal, tolParallel))
233  {
234  convexEdgeA = true;
235  }
236  }
237 
238  forAll(convexEdgeBNormals, edgeBnormalI)
239  {
240  const vector& concaveNormal
241  = normals[concaveEdgeNormals[edgeNormalI]];
242  const vector& convexNormal
243  = normals[convexEdgeBNormals[edgeBnormalI]];
244 
245  if (debug)
246  {
247  Info<< "Angle between vectors = "
248  << degAngleBetween(concaveNormal, convexNormal) << endl;
249  }
250 
251  // Need a looser tolerance, because sometimes adjacent triangles
252  // on the same surface will be slightly out of alignment.
253  if (areParallel(concaveNormal, convexNormal, tolParallel))
254  {
255  convexEdgeB = true;
256  }
257  }
258 
259  if ((convexEdgeA && convexEdgeB) || (!convexEdgeA && !convexEdgeB))
260  {
262  << "Both or neither of the convex edges share the concave "
263  << "edge's normal."
264  << " convexEdgeA = " << convexEdgeA
265  << " convexEdgeB = " << convexEdgeB
266  << endl;
267 
268  // Remove points that have just been added before returning
269  for (label i = 0; i < 2; ++i)
270  {
271  pts.remove();
272  nVert--;
273  }
274 
275  return false;
276  }
277 
278  if (convexEdgeA)
279  {
280  forAll(convexEdgeANormals, edgeAnormalI)
281  {
282  const vector& concaveNormal
283  = normals[concaveEdgeNormals[edgeNormalI]];
284  const vector& convexNormal
285  = normals[convexEdgeANormals[edgeAnormalI]];
286 
287  if
288  (
289  !areParallel(concaveNormal, convexNormal, tolParallel)
290  )
291  {
292  convexEdgePlaneCNormal = convexNormal;
293 
294  plane planeC(featPt, convexEdgePlaneCNormal);
295 
296  externalPtD =
297  internalPtA
298  + 2.0*planeC.distance(internalPtA)
299  *convexEdgePlaneCNormal;
300 
301  pts.append
302  (
303  Vb
304  (
305  externalPtD,
306  foamyHexMesh_.vertexCount() + pts.size(),
307  Vb::vtExternalFeaturePoint,
309  )
310  );
311 
312  ftPtPairs_.addPointPair
313  (
314  internalPtAIndex,
315  pts.last().index()
316  );
317  }
318  }
319  }
320 
321  if (convexEdgeB)
322  {
323  forAll(convexEdgeBNormals, edgeBnormalI)
324  {
325  const vector& concaveNormal
326  = normals[concaveEdgeNormals[edgeNormalI]];
327  const vector& convexNormal
328  = normals[convexEdgeBNormals[edgeBnormalI]];
329 
330  if
331  (
332  !areParallel(concaveNormal, convexNormal, tolParallel)
333  )
334  {
335  convexEdgePlaneDNormal = convexNormal;
336 
337  plane planeD(featPt, convexEdgePlaneDNormal);
338 
339  externalPtE =
340  internalPtB
341  + 2.0*planeD.distance(internalPtB)
342  *convexEdgePlaneDNormal;
343 
344  pts.append
345  (
346  Vb
347  (
348  externalPtE,
349  foamyHexMesh_.vertexCount() + pts.size(),
350  Vb::vtExternalFeaturePoint,
352  )
353  );
354 
355  ftPtPairs_.addPointPair
356  (
357  internalPtBIndex,
358  pts.last().index()
359  );
360  }
361  }
362  }
363  }
364 
365  pts.append
366  (
367  Vb
368  (
369  concaveEdgeExternalPt,
370  foamyHexMesh_.vertexCount() + pts.size(),
371  Vb::vtExternalFeaturePoint,
373  )
374  );
375 
376  ftPtPairs_.addPointPair
377  (
378  internalPtBIndex,
379  pts.last().index()
380  );
381 
382  ftPtPairs_.addPointPair
383  (
384  internalPtAIndex,
385  pts.last().index()
386  );
387 
388  const label concaveEdgeExternalPtIndex(pts.last().index());
389 
390  const scalar totalAngle = radToDeg
391  (
393  + radAngleBetween(concaveEdgePlaneANormal, concaveEdgePlaneBNormal)
394  );
395 
396  if (totalAngle > foamyHexMeshControls_.maxQuadAngle())
397  {
398  // Add additional mitreing points
399  //scalar angleSign = 1.0;
400 
401 
402  vector convexEdgesPlaneNormal =
403  0.5*(convexEdgePlaneCNormal + convexEdgePlaneDNormal);
404 
405  plane planeM(featPt, convexEdgesPlaneNormal);
406 
407 // if
408 // (
409 // geometryToConformTo_.outside
410 // (
411 // featPt - convexEdgesPlaneNormal*ppDist
412 // )
413 // )
414 // {
415 // angleSign = -1.0;
416 // }
417 
418 // scalar phi =
419 // angleSign*acos(concaveEdgeDir & -convexEdgesPlaneNormal);
420 //
421 // scalar guard =
422 // (
423 // 1.0 + sin(phi)*ppDist/mag
424 // (
425 // concaveEdgeLocalFeatPt - concaveEdgeExternalPt
426 // )
427 // )/cos(phi) - 1.0;
428 
429  const Foam::point internalPtF =
430  concaveEdgeExternalPt
431  //+ (2.0 + guard)*(concaveEdgeLocalFeatPt - concaveEdgeExternalPt);
432  + 2.0*(concaveEdgeLocalFeatPt - concaveEdgeExternalPt);
433 
434  pts.append
435  (
436  Vb
437  (
438  internalPtF,
439  foamyHexMesh_.vertexCount() + pts.size(),
440  Vb::vtInternalFeaturePoint,
442  )
443  );
444 
445  const label internalPtFIndex(pts.last().index());
446 
447  ftPtPairs_.addPointPair
448  (
449  concaveEdgeExternalPtIndex,
450  pts.last().index()
451  );
452 
453  const Foam::point externalPtG =
454  internalPtF
455  + 2.0*planeM.distance(internalPtF)*convexEdgesPlaneNormal;
456 
457  pts.append
458  (
459  Vb
460  (
461  externalPtG,
462  foamyHexMesh_.vertexCount() + pts.size(),
463  Vb::vtExternalFeaturePoint,
465  )
466  );
467 
468  ftPtPairs_.addPointPair
469  (
470  internalPtFIndex,
471  pts.last().index()
472  );
473  }
474 
475  if (debug)
476  {
477  for (label ptI = initialNumOfPoints; ptI < pts.size(); ++ptI)
478  {
479  Info<< "Point " << ptI << " : ";
480  meshTools::writeOBJ(Info, topoint(pts[ptI].point()));
481  }
482  }
483 
484  return true;
485  }
486  else if
487  (
488  pFEdgesTypes[extendedFeatureEdgeMesh::EXTERNAL] == 1
489  && pFEdgesTypes[extendedFeatureEdgeMesh::INTERNAL] == 2
490  && pEds.size() == 3
491  )
492  {
493  if (debug)
494  {
495  Info<< "nExternal == 1 && nInternal == 2" << endl;
496  }
497 
498  const Foam::point& featPt = feMesh.points()[ptI];
499 
500  if
501  (
503  && !foamyHexMesh_.decomposition().positionOnThisProcessor(featPt)
504  )
505  {
506  return false;
507  }
508 
509  label nVert = foamyHexMesh_.number_of_vertices();
510 
511  const label initialNumOfPoints = pts.size();
512 
513  const scalar ppDist = foamyHexMesh_.pointPairDistance(featPt);
514 
515  const vectorField& normals = feMesh.normals();
516 
517  const labelListList& edgeNormals = feMesh.edgeNormals();
518 
519  label convexEdgeI = -1;
520  labelList concaveEdgesI(2, label(-1));
521  label nConcave = 0;
522 
523  forAll(pEds, i)
524  {
525  const extendedFeatureEdgeMesh::edgeStatus& eS = allEdStat[i];
526 
528  {
529  convexEdgeI = pEds[i];
530  }
531  else if (eS == extendedFeatureEdgeMesh::INTERNAL)
532  {
533  concaveEdgesI[nConcave++] = pEds[i];
534  }
535  else if (eS == extendedFeatureEdgeMesh::FLAT)
536  {
538  << "Edge " << eS << " is flat"
539  << endl;
540  }
541  else
542  {
544  << "Edge " << eS << " not concave/convex"
545  << exit(FatalError);
546  }
547  }
548 
549  const vector& convexEdgePlaneANormal =
550  normals[edgeNormals[convexEdgeI][0]];
551 
552  const vector& convexEdgePlaneBNormal =
553  normals[edgeNormals[convexEdgeI][1]];
554 
555  // Intersect planes parallel to the concave edge planes offset
556  // by ppDist and the plane defined by featPt and the edge vector.
557  plane planeA
558  (
559  featPt - ppDist*convexEdgePlaneANormal,
560  convexEdgePlaneANormal
561  );
562 
563  plane planeB
564  (
565  featPt - ppDist*convexEdgePlaneBNormal,
566  convexEdgePlaneBNormal
567  );
568 
569  const vector& convexEdgeDir = feMesh.edgeDirection
570  (
571  convexEdgeI,
572  ptI
573  );
574 
575  // Todo,needed later but want to get rid of this.
576  const Foam::point convexEdgeLocalFeatPt =
577  featPt + ppDist*convexEdgeDir;
578 
579  // Finding the nearest point on the intersecting line to the edge
580  // point. Floating point errors often occur using planePlaneIntersect
581 
582  plane planeF(convexEdgeLocalFeatPt, convexEdgeDir);
583 
584  const Foam::point convexEdgeExternalPt = planeF.planePlaneIntersect
585  (
586  planeA,
587  planeB
588  );
589 
590  // Redefine planes to be on the feature surfaces to project through
591 
592  planeA = plane(featPt, convexEdgePlaneANormal);
593 
594  planeB = plane(featPt, convexEdgePlaneBNormal);
595 
596  const Foam::point internalPtA =
597  convexEdgeExternalPt
598  + 2.0*planeA.distance(convexEdgeExternalPt)
599  *convexEdgePlaneANormal;
600 
601  pts.append
602  (
603  Vb
604  (
605  internalPtA,
606  foamyHexMesh_.vertexCount() + pts.size(),
607  Vb::vtExternalFeaturePoint,
609  )
610  );
611 
612  const label internalPtAIndex(pts.last().index());
613 
614  const Foam::point internalPtB =
615  convexEdgeExternalPt
616  + 2.0*planeB.distance(convexEdgeExternalPt)
617  *convexEdgePlaneBNormal;
618 
619  pts.append
620  (
621  Vb
622  (
623  internalPtB,
624  foamyHexMesh_.vertexCount() + pts.size(),
625  Vb::vtExternalFeaturePoint,
627  )
628  );
629 
630  const label internalPtBIndex(pts.last().index());
631 
632  // Add the internal points
633 
634  Foam::point externalPtD;
635  Foam::point externalPtE;
636 
637  vector concaveEdgePlaneCNormal(Zero);
638  vector concaveEdgePlaneDNormal(Zero);
639 
640  const labelList& convexEdgeNormals = edgeNormals[convexEdgeI];
641  const labelList& concaveEdgeANormals = edgeNormals[concaveEdgesI[0]];
642  const labelList& concaveEdgeBNormals = edgeNormals[concaveEdgesI[1]];
643 
644  forAll(convexEdgeNormals, edgeNormalI)
645  {
646  bool concaveEdgeA = false;
647  bool concaveEdgeB = false;
648 
649  forAll(concaveEdgeANormals, edgeAnormalI)
650  {
651  const vector& convexNormal
652  = normals[convexEdgeNormals[edgeNormalI]];
653  const vector& concaveNormal
654  = normals[concaveEdgeANormals[edgeAnormalI]];
655 
656  if (debug)
657  {
658  Info<< "Angle between vectors = "
659  << degAngleBetween(convexNormal, concaveNormal) << endl;
660  }
661 
662  // Need a looser tolerance, because sometimes adjacent triangles
663  // on the same surface will be slightly out of alignment.
664  if (areParallel(convexNormal, concaveNormal, tolParallel))
665  {
666  concaveEdgeA = true;
667  }
668  }
669 
670  forAll(concaveEdgeBNormals, edgeBnormalI)
671  {
672  const vector& convexNormal
673  = normals[convexEdgeNormals[edgeNormalI]];
674  const vector& concaveNormal
675  = normals[concaveEdgeBNormals[edgeBnormalI]];
676 
677  if (debug)
678  {
679  Info<< "Angle between vectors = "
680  << degAngleBetween(convexNormal, concaveNormal) << endl;
681  }
682 
683  // Need a looser tolerance, because sometimes adjacent triangles
684  // on the same surface will be slightly out of alignment.
685  if (areParallel(convexNormal, concaveNormal, tolParallel))
686  {
687  concaveEdgeB = true;
688  }
689  }
690 
691  if
692  (
693  (concaveEdgeA && concaveEdgeB)
694  || (!concaveEdgeA && !concaveEdgeB)
695  )
696  {
698  << "Both or neither of the concave edges share the convex "
699  << "edge's normal."
700  << " concaveEdgeA = " << concaveEdgeA
701  << " concaveEdgeB = " << concaveEdgeB
702  << endl;
703 
704  // Remove points that have just been added before returning
705  for (label i = 0; i < 2; ++i)
706  {
707  pts.remove();
708  nVert--;
709  }
710 
711  return false;
712  }
713 
714  if (concaveEdgeA)
715  {
716  forAll(concaveEdgeANormals, edgeAnormalI)
717  {
718  const vector& convexNormal
719  = normals[convexEdgeNormals[edgeNormalI]];
720  const vector& concaveNormal
721  = normals[concaveEdgeANormals[edgeAnormalI]];
722 
723  if
724  (
725  !areParallel(convexNormal, concaveNormal, tolParallel)
726  )
727  {
728  concaveEdgePlaneCNormal = concaveNormal;
729 
730  plane planeC(featPt, concaveEdgePlaneCNormal);
731 
732  externalPtD =
733  internalPtA
734  - 2.0*planeC.distance(internalPtA)
735  *concaveEdgePlaneCNormal;
736 
737  pts.append
738  (
739  Vb
740  (
741  externalPtD,
742  foamyHexMesh_.vertexCount() + pts.size(),
743  Vb::vtInternalFeaturePoint,
745  )
746  );
747 
748  ftPtPairs_.addPointPair
749  (
750  internalPtAIndex,
751  pts.last().index()
752  );
753  }
754  }
755  }
756 
757  if (concaveEdgeB)
758  {
759  forAll(concaveEdgeBNormals, edgeBnormalI)
760  {
761  const vector& convexNormal
762  = normals[convexEdgeNormals[edgeNormalI]];
763  const vector& concaveNormal
764  = normals[concaveEdgeBNormals[edgeBnormalI]];
765 
766  if
767  (
768  !areParallel(convexNormal, concaveNormal, tolParallel)
769  )
770  {
771  concaveEdgePlaneDNormal = concaveNormal;
772 
773  plane planeD(featPt, concaveEdgePlaneDNormal);
774 
775  externalPtE =
776  internalPtB
777  - 2.0*planeD.distance(internalPtB)
778  *concaveEdgePlaneDNormal;
779 
780  pts.append
781  (
782  Vb
783  (
784  externalPtE,
785  foamyHexMesh_.vertexCount() + pts.size(),
786  Vb::vtInternalFeaturePoint,
788  )
789  );
790 
791  ftPtPairs_.addPointPair
792  (
793  internalPtBIndex,
794  pts.last().index()
795  );
796  }
797  }
798  }
799  }
800 
801  pts.append
802  (
803  Vb
804  (
805  convexEdgeExternalPt,
806  foamyHexMesh_.vertexCount() + pts.size(),
807  Vb::vtInternalFeaturePoint,
809  )
810  );
811 
812  ftPtPairs_.addPointPair
813  (
814  internalPtBIndex,
815  pts.last().index()
816  );
817 
818  ftPtPairs_.addPointPair
819  (
820  internalPtAIndex,
821  pts.last().index()
822  );
823 
824  const scalar totalAngle = radToDeg
825  (
827  + radAngleBetween(convexEdgePlaneANormal, convexEdgePlaneBNormal)
828  );
829 
830  if (totalAngle > foamyHexMeshControls_.maxQuadAngle())
831  {
832  // Add additional mitreing points
833  //scalar angleSign = 1.0;
834 
835 
836  vector convexEdgesPlaneNormal =
837  0.5*(concaveEdgePlaneCNormal + concaveEdgePlaneDNormal);
838 
839  plane planeM(featPt, convexEdgesPlaneNormal);
840 
841 // if
842 // (
843 // geometryToConformTo_.outside
844 // (
845 // featPt - convexEdgesPlaneNormal*ppDist
846 // )
847 // )
848 // {
849 // angleSign = -1.0;
850 // }
851 
852 // scalar phi =
853 // angleSign*acos(concaveEdgeDir & -convexEdgesPlaneNormal);
854 //
855 // scalar guard =
856 // (
857 // 1.0 + sin(phi)*ppDist/mag
858 // (
859 // concaveEdgeLocalFeatPt - concaveEdgeExternalPt
860 // )
861 // )/cos(phi) - 1.0;
862 
863  const Foam::point internalPtF =
864  convexEdgeExternalPt
865  //+ (2.0 + guard)*(concaveEdgeLocalFeatPt - concaveEdgeExternalPt);
866  + 2.0*(convexEdgeLocalFeatPt - convexEdgeExternalPt);
867 
868  pts.append
869  (
870  Vb
871  (
872  internalPtF,
873  foamyHexMesh_.vertexCount() + pts.size(),
874  Vb::vtExternalFeaturePoint,
876  )
877  );
878 
879  ftPtPairs_.addPointPair
880  (
881  pts[pts.size() - 2].index(),
882  pts.last().index()
883  );
884 
885  const Foam::point externalPtG =
886  internalPtF
887  - 2.0*planeM.distance(internalPtF)*convexEdgesPlaneNormal;
888 
889  pts.append
890  (
891  Vb
892  (
893  externalPtG,
894  foamyHexMesh_.vertexCount() + pts.size(),
895  Vb::vtInternalFeaturePoint,
897  )
898  );
899 
900  ftPtPairs_.addPointPair
901  (
902  pts[pts.size() - 2].index(),
903  pts.last().index()
904  );
905  }
906 
907  if (debug)
908  {
909  for (label ptI = initialNumOfPoints; ptI < pts.size(); ++ptI)
910  {
911  Info<< "Point " << ptI << " "
912  << indexedVertexEnum::vertexTypeNames_[pts[ptI].type()]
913  << " : ";
914 
915  meshTools::writeOBJ(Info, topoint(pts[ptI].point()));
916  }
917  }
918 
919  return true;
920  }
921 
922  return false;
923 }
924 
925 
926 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:63
Foam::extendedEdgeMesh::edgeStatus
edgeStatus
Definition: extendedEdgeMesh.H:100
pointConversion.H
Foam::Zero
static constexpr const zero Zero
Definition: zero.H:131
Foam::extendedEdgeMesh::FLAT
@ FLAT
Neither concave or convex, on a flat surface.
Definition: extendedEdgeMesh.H:104
Foam::meshTools::writeOBJ
void writeOBJ(Ostream &os, const point &pt)
Definition: meshTools.C:196
CGAL::indexedVertex
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:50
Foam::vectorTools::radAngleBetween
T radAngleBetween(const Vector< T > &a, const Vector< T > &b, const T &tolerance=SMALL)
Definition: vectorTools.H:118
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::topoint
pointFromPoint topoint(const Point &P)
Definition: pointConversion.H:66
forAll
#define forAll(list, i)
Definition: stdFoam.H:349
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:48
Foam::extendedEdgeMesh::INTERNAL
@ INTERNAL
"Concave" edge
Definition: extendedEdgeMesh.H:103
Foam::Info
messageStream Info
Foam::radToDeg
constexpr scalar radToDeg(const scalar rad) noexcept
Definition: unitConversion.H:52
featurePointConformer.H
Foam::FatalError
error FatalError
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:47
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
Foam::indexedVertexEnum::vertexTypeNames_
static const Enum< vertexType > vertexTypeNames_
Definition: indexedVertexEnum.H:73
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:51
pointFeatureEdgesTypes.H
Foam::vectorTools
Definition: vectorTools.H:45
Foam::vectorTools::areParallel
bool areParallel(const Vector< T > &a, const Vector< T > &b, const T &tolerance=SMALL)
Definition: vectorTools.H:52
FatalErrorInFunction
#define FatalErrorInFunction
Definition: error.H:465
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=worldComm)
Definition: UPstream.H:459
Foam::constant::mathematical::pi
constexpr scalar pi(M_PI)
Foam::Vector< scalar >
Foam::UPstream::parRun
static bool & parRun() noexcept
Definition: UPstream.H:429
Foam::extendedEdgeMesh::EXTERNAL
@ EXTERNAL
"Convex" edge
Definition: extendedEdgeMesh.H:102
Foam::vectorTools::degAngleBetween
T degAngleBetween(const Vector< T > &a, const Vector< T > &b, const T &tolerance=SMALL)
Definition: vectorTools.H:133
Foam::VectorSpace::size
static constexpr direction size() noexcept
Definition: VectorSpace.H:172
Foam::point
vector point
Point is a vector.
Definition: point.H:37
vectorTools.H
WarningInFunction
#define WarningInFunction
Definition: messageStream.H:353
conformalVoronoiMesh.H