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(),
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(),
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  pts.pop_back(2);
270  //nVert -= 2;
271 
272  return false;
273  }
274 
275  if (convexEdgeA)
276  {
277  forAll(convexEdgeANormals, edgeAnormalI)
278  {
279  const vector& concaveNormal
280  = normals[concaveEdgeNormals[edgeNormalI]];
281  const vector& convexNormal
282  = normals[convexEdgeANormals[edgeAnormalI]];
283 
284  if
285  (
286  !areParallel(concaveNormal, convexNormal, tolParallel)
287  )
288  {
289  convexEdgePlaneCNormal = convexNormal;
290 
291  plane planeC(featPt, convexEdgePlaneCNormal);
292 
293  externalPtD =
294  internalPtA
295  + 2.0*planeC.distance(internalPtA)
296  *convexEdgePlaneCNormal;
297 
298  pts.append
299  (
300  Vb
301  (
302  externalPtD,
303  foamyHexMesh_.vertexCount() + pts.size(),
306  )
307  );
308 
309  ftPtPairs_.addPointPair
310  (
311  internalPtAIndex,
312  pts.last().index()
313  );
314  }
315  }
316  }
317 
318  if (convexEdgeB)
319  {
320  forAll(convexEdgeBNormals, edgeBnormalI)
321  {
322  const vector& concaveNormal
323  = normals[concaveEdgeNormals[edgeNormalI]];
324  const vector& convexNormal
325  = normals[convexEdgeBNormals[edgeBnormalI]];
326 
327  if
328  (
329  !areParallel(concaveNormal, convexNormal, tolParallel)
330  )
331  {
332  convexEdgePlaneDNormal = convexNormal;
333 
334  plane planeD(featPt, convexEdgePlaneDNormal);
335 
336  externalPtE =
337  internalPtB
338  + 2.0*planeD.distance(internalPtB)
339  *convexEdgePlaneDNormal;
340 
341  pts.append
342  (
343  Vb
344  (
345  externalPtE,
346  foamyHexMesh_.vertexCount() + pts.size(),
349  )
350  );
351 
352  ftPtPairs_.addPointPair
353  (
354  internalPtBIndex,
355  pts.last().index()
356  );
357  }
358  }
359  }
360  }
361 
362  pts.append
363  (
364  Vb
365  (
366  concaveEdgeExternalPt,
367  foamyHexMesh_.vertexCount() + pts.size(),
370  )
371  );
372 
373  ftPtPairs_.addPointPair
374  (
375  internalPtBIndex,
376  pts.last().index()
377  );
378 
379  ftPtPairs_.addPointPair
380  (
381  internalPtAIndex,
382  pts.last().index()
383  );
384 
385  const label concaveEdgeExternalPtIndex(pts.last().index());
386 
387  const scalar totalAngle = radToDeg
388  (
390  + radAngleBetween(concaveEdgePlaneANormal, concaveEdgePlaneBNormal)
391  );
392 
393  if (totalAngle > foamyHexMeshControls_.maxQuadAngle())
394  {
395  // Add additional mitreing points
396  //scalar angleSign = 1.0;
397 
398 
399  vector convexEdgesPlaneNormal =
400  0.5*(convexEdgePlaneCNormal + convexEdgePlaneDNormal);
401 
402  plane planeM(featPt, convexEdgesPlaneNormal);
403 
404 // if
405 // (
406 // geometryToConformTo_.outside
407 // (
408 // featPt - convexEdgesPlaneNormal*ppDist
409 // )
410 // )
411 // {
412 // angleSign = -1.0;
413 // }
414 
415 // scalar phi =
416 // angleSign*acos(concaveEdgeDir & -convexEdgesPlaneNormal);
417 //
418 // scalar guard =
419 // (
420 // 1.0 + sin(phi)*ppDist/mag
421 // (
422 // concaveEdgeLocalFeatPt - concaveEdgeExternalPt
423 // )
424 // )/cos(phi) - 1.0;
425 
426  const Foam::point internalPtF =
427  concaveEdgeExternalPt
428  //+ (2.0 + guard)*(concaveEdgeLocalFeatPt - concaveEdgeExternalPt);
429  + 2.0*(concaveEdgeLocalFeatPt - concaveEdgeExternalPt);
430 
431  pts.append
432  (
433  Vb
434  (
435  internalPtF,
436  foamyHexMesh_.vertexCount() + pts.size(),
439  )
440  );
441 
442  const label internalPtFIndex(pts.last().index());
443 
444  ftPtPairs_.addPointPair
445  (
446  concaveEdgeExternalPtIndex,
447  pts.last().index()
448  );
449 
450  const Foam::point externalPtG =
451  internalPtF
452  + 2.0*planeM.distance(internalPtF)*convexEdgesPlaneNormal;
453 
454  pts.append
455  (
456  Vb
457  (
458  externalPtG,
459  foamyHexMesh_.vertexCount() + pts.size(),
462  )
463  );
464 
465  ftPtPairs_.addPointPair
466  (
467  internalPtFIndex,
468  pts.last().index()
469  );
470  }
471 
472  if (debug)
473  {
474  for (label ptI = initialNumOfPoints; ptI < pts.size(); ++ptI)
475  {
476  Info<< "Point " << ptI << " : ";
478  }
479  }
480 
481  return true;
482  }
483  else if
484  (
485  pFEdgesTypes[extendedFeatureEdgeMesh::EXTERNAL] == 1
486  && pFEdgesTypes[extendedFeatureEdgeMesh::INTERNAL] == 2
487  && pEds.size() == 3
488  )
489  {
490  if (debug)
491  {
492  Info<< "nExternal == 1 && nInternal == 2" << endl;
493  }
494 
495  const Foam::point& featPt = feMesh.points()[ptI];
496 
497  if
498  (
500  && !foamyHexMesh_.decomposition().positionOnThisProcessor(featPt)
501  )
502  {
503  return false;
504  }
505 
506  //label nVert = foamyHexMesh_.number_of_vertices();
507 
508  const label initialNumOfPoints = pts.size();
509 
510  const scalar ppDist = foamyHexMesh_.pointPairDistance(featPt);
511 
512  const vectorField& normals = feMesh.normals();
513 
514  const labelListList& edgeNormals = feMesh.edgeNormals();
515 
516  label convexEdgeI = -1;
517  labelList concaveEdgesI(2, label(-1));
518  label nConcave = 0;
519 
520  forAll(pEds, i)
521  {
522  const extendedFeatureEdgeMesh::edgeStatus& eS = allEdStat[i];
523 
525  {
526  convexEdgeI = pEds[i];
527  }
528  else if (eS == extendedFeatureEdgeMesh::INTERNAL)
529  {
530  concaveEdgesI[nConcave++] = pEds[i];
531  }
532  else if (eS == extendedFeatureEdgeMesh::FLAT)
533  {
535  << "Edge " << eS << " is flat"
536  << endl;
537  }
538  else
539  {
541  << "Edge " << eS << " not concave/convex"
542  << exit(FatalError);
543  }
544  }
545 
546  const vector& convexEdgePlaneANormal =
547  normals[edgeNormals[convexEdgeI][0]];
548 
549  const vector& convexEdgePlaneBNormal =
550  normals[edgeNormals[convexEdgeI][1]];
551 
552  // Intersect planes parallel to the concave edge planes offset
553  // by ppDist and the plane defined by featPt and the edge vector.
554  plane planeA
555  (
556  featPt - ppDist*convexEdgePlaneANormal,
557  convexEdgePlaneANormal
558  );
559 
560  plane planeB
561  (
562  featPt - ppDist*convexEdgePlaneBNormal,
563  convexEdgePlaneBNormal
564  );
565 
566  const vector& convexEdgeDir = feMesh.edgeDirection
567  (
568  convexEdgeI,
569  ptI
570  );
571 
572  // Todo,needed later but want to get rid of this.
573  const Foam::point convexEdgeLocalFeatPt =
574  featPt + ppDist*convexEdgeDir;
575 
576  // Finding the nearest point on the intersecting line to the edge
577  // point. Floating point errors often occur using planePlaneIntersect
578 
579  plane planeF(convexEdgeLocalFeatPt, convexEdgeDir);
580 
581  const Foam::point convexEdgeExternalPt = planeF.planePlaneIntersect
582  (
583  planeA,
584  planeB
585  );
586 
587  // Redefine planes to be on the feature surfaces to project through
588 
589  planeA = plane(featPt, convexEdgePlaneANormal);
590 
591  planeB = plane(featPt, convexEdgePlaneBNormal);
592 
593  const Foam::point internalPtA =
594  convexEdgeExternalPt
595  + 2.0*planeA.distance(convexEdgeExternalPt)
596  *convexEdgePlaneANormal;
597 
598  pts.append
599  (
600  Vb
601  (
602  internalPtA,
603  foamyHexMesh_.vertexCount() + pts.size(),
606  )
607  );
608 
609  const label internalPtAIndex(pts.last().index());
610 
611  const Foam::point internalPtB =
612  convexEdgeExternalPt
613  + 2.0*planeB.distance(convexEdgeExternalPt)
614  *convexEdgePlaneBNormal;
615 
616  pts.append
617  (
618  Vb
619  (
620  internalPtB,
621  foamyHexMesh_.vertexCount() + pts.size(),
624  )
625  );
626 
627  const label internalPtBIndex(pts.last().index());
628 
629  // Add the internal points
630 
631  Foam::point externalPtD;
632  Foam::point externalPtE;
633 
634  vector concaveEdgePlaneCNormal(Zero);
635  vector concaveEdgePlaneDNormal(Zero);
636 
637  const labelList& convexEdgeNormals = edgeNormals[convexEdgeI];
638  const labelList& concaveEdgeANormals = edgeNormals[concaveEdgesI[0]];
639  const labelList& concaveEdgeBNormals = edgeNormals[concaveEdgesI[1]];
640 
641  forAll(convexEdgeNormals, edgeNormalI)
642  {
643  bool concaveEdgeA = false;
644  bool concaveEdgeB = false;
645 
646  forAll(concaveEdgeANormals, edgeAnormalI)
647  {
648  const vector& convexNormal
649  = normals[convexEdgeNormals[edgeNormalI]];
650  const vector& concaveNormal
651  = normals[concaveEdgeANormals[edgeAnormalI]];
652 
653  if (debug)
654  {
655  Info<< "Angle between vectors = "
656  << degAngleBetween(convexNormal, concaveNormal) << endl;
657  }
658 
659  // Need a looser tolerance, because sometimes adjacent triangles
660  // on the same surface will be slightly out of alignment.
661  if (areParallel(convexNormal, concaveNormal, tolParallel))
662  {
663  concaveEdgeA = true;
664  }
665  }
666 
667  forAll(concaveEdgeBNormals, edgeBnormalI)
668  {
669  const vector& convexNormal
670  = normals[convexEdgeNormals[edgeNormalI]];
671  const vector& concaveNormal
672  = normals[concaveEdgeBNormals[edgeBnormalI]];
673 
674  if (debug)
675  {
676  Info<< "Angle between vectors = "
677  << degAngleBetween(convexNormal, concaveNormal) << endl;
678  }
679 
680  // Need a looser tolerance, because sometimes adjacent triangles
681  // on the same surface will be slightly out of alignment.
682  if (areParallel(convexNormal, concaveNormal, tolParallel))
683  {
684  concaveEdgeB = true;
685  }
686  }
687 
688  if
689  (
690  (concaveEdgeA && concaveEdgeB)
691  || (!concaveEdgeA && !concaveEdgeB)
692  )
693  {
695  << "Both or neither of the concave edges share the convex "
696  << "edge's normal."
697  << " concaveEdgeA = " << concaveEdgeA
698  << " concaveEdgeB = " << concaveEdgeB
699  << endl;
700 
701  // Remove points that have just been added before returning
702  pts.pop_back(2);
703  //nVert -= 2;
704 
705  return false;
706  }
707 
708  if (concaveEdgeA)
709  {
710  forAll(concaveEdgeANormals, edgeAnormalI)
711  {
712  const vector& convexNormal
713  = normals[convexEdgeNormals[edgeNormalI]];
714  const vector& concaveNormal
715  = normals[concaveEdgeANormals[edgeAnormalI]];
716 
717  if
718  (
719  !areParallel(convexNormal, concaveNormal, tolParallel)
720  )
721  {
722  concaveEdgePlaneCNormal = concaveNormal;
723 
724  plane planeC(featPt, concaveEdgePlaneCNormal);
725 
726  externalPtD =
727  internalPtA
728  - 2.0*planeC.distance(internalPtA)
729  *concaveEdgePlaneCNormal;
730 
731  pts.append
732  (
733  Vb
734  (
735  externalPtD,
736  foamyHexMesh_.vertexCount() + pts.size(),
739  )
740  );
741 
742  ftPtPairs_.addPointPair
743  (
744  internalPtAIndex,
745  pts.last().index()
746  );
747  }
748  }
749  }
750 
751  if (concaveEdgeB)
752  {
753  forAll(concaveEdgeBNormals, edgeBnormalI)
754  {
755  const vector& convexNormal
756  = normals[convexEdgeNormals[edgeNormalI]];
757  const vector& concaveNormal
758  = normals[concaveEdgeBNormals[edgeBnormalI]];
759 
760  if
761  (
762  !areParallel(convexNormal, concaveNormal, tolParallel)
763  )
764  {
765  concaveEdgePlaneDNormal = concaveNormal;
766 
767  plane planeD(featPt, concaveEdgePlaneDNormal);
768 
769  externalPtE =
770  internalPtB
771  - 2.0*planeD.distance(internalPtB)
772  *concaveEdgePlaneDNormal;
773 
774  pts.append
775  (
776  Vb
777  (
778  externalPtE,
779  foamyHexMesh_.vertexCount() + pts.size(),
782  )
783  );
784 
785  ftPtPairs_.addPointPair
786  (
787  internalPtBIndex,
788  pts.last().index()
789  );
790  }
791  }
792  }
793  }
794 
795  pts.append
796  (
797  Vb
798  (
799  convexEdgeExternalPt,
800  foamyHexMesh_.vertexCount() + pts.size(),
803  )
804  );
805 
806  ftPtPairs_.addPointPair
807  (
808  internalPtBIndex,
809  pts.last().index()
810  );
811 
812  ftPtPairs_.addPointPair
813  (
814  internalPtAIndex,
815  pts.last().index()
816  );
817 
818  const scalar totalAngle = radToDeg
819  (
821  + radAngleBetween(convexEdgePlaneANormal, convexEdgePlaneBNormal)
822  );
823 
824  if (totalAngle > foamyHexMeshControls_.maxQuadAngle())
825  {
826  // Add additional mitreing points
827  //scalar angleSign = 1.0;
828 
829 
830  vector convexEdgesPlaneNormal =
831  0.5*(concaveEdgePlaneCNormal + concaveEdgePlaneDNormal);
832 
833  plane planeM(featPt, convexEdgesPlaneNormal);
834 
835 // if
836 // (
837 // geometryToConformTo_.outside
838 // (
839 // featPt - convexEdgesPlaneNormal*ppDist
840 // )
841 // )
842 // {
843 // angleSign = -1.0;
844 // }
845 
846 // scalar phi =
847 // angleSign*acos(concaveEdgeDir & -convexEdgesPlaneNormal);
848 //
849 // scalar guard =
850 // (
851 // 1.0 + sin(phi)*ppDist/mag
852 // (
853 // concaveEdgeLocalFeatPt - concaveEdgeExternalPt
854 // )
855 // )/cos(phi) - 1.0;
856 
857  const Foam::point internalPtF =
858  convexEdgeExternalPt
859  //+ (2.0 + guard)*(concaveEdgeLocalFeatPt - concaveEdgeExternalPt);
860  + 2.0*(convexEdgeLocalFeatPt - convexEdgeExternalPt);
861 
862  pts.append
863  (
864  Vb
865  (
866  internalPtF,
867  foamyHexMesh_.vertexCount() + pts.size(),
870  )
871  );
872 
873  ftPtPairs_.addPointPair
874  (
875  pts[pts.size() - 2].index(),
876  pts.last().index()
877  );
878 
879  const Foam::point externalPtG =
880  internalPtF
881  - 2.0*planeM.distance(internalPtF)*convexEdgesPlaneNormal;
882 
883  pts.append
884  (
885  Vb
886  (
887  externalPtG,
888  foamyHexMesh_.vertexCount() + pts.size(),
891  )
892  );
893 
894  ftPtPairs_.addPointPair
895  (
896  pts[pts.size() - 2].index(),
897  pts.last().index()
898  );
899  }
900 
901  if (debug)
902  {
903  for (label ptI = initialNumOfPoints; ptI < pts.size(); ++ptI)
904  {
905  Info<< "Point " << ptI << " "
907  << " : ";
908 
910  }
911  }
912 
913  return true;
914  }
915 
916  return false;
917 }
918 
919 
920 // ************************************************************************* //
pointFromPoint topoint(const Point &P)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:608
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1061
void writeOBJ(Ostream &os, const point &pt)
Write obj representation of a point.
Definition: meshTools.C:196
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
Definition: UPstream.H:1086
Collection of functions for testing relationships between two vectors.
Definition: vectorTools.H:45
List< labelList > labelListList
List of labelList.
Definition: labelList.H:38
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:59
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
T radAngleBetween(const Vector< T > &a, const Vector< T > &b, const T &tolerance=SMALL)
Calculate angle between a and b in radians.
Definition: vectorTools.H:132
constexpr scalar pi(M_PI)
Vector< scalar > vector
Definition: vector.H:57
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
int debug
Static debugging option.
bool areParallel(const Vector< T > &a, const Vector< T > &b, const T &tolerance=SMALL)
Test if a and b are parallel: a^b = 0.
Definition: vectorTools.H:55
T degAngleBetween(const Vector< T > &a, const Vector< T > &b, const T &tolerance=SMALL)
Calculate angle between a and b in degrees.
Definition: vectorTools.H:149
vector point
Point is a vector.
Definition: point.H:37
#define WarningInFunction
Report a warning using Foam::Warning.
constexpr scalar radToDeg(const scalar rad) noexcept
Conversion from radians to degrees.
static const Enum< vertexType > vertexTypeNames_
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
Definition: List.H:62
Neither concave or convex, on a flat surface.
const pointField & pts
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127