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