motionSmootherAlgoCheck.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) 2011-2014 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 "motionSmootherAlgo.H"
29 #include "polyMeshGeometry.H"
30 #include "IOmanip.H"
31 
32 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
33 
35 (
36  const bool report,
37  const polyMesh& mesh,
38  const dictionary& dict,
39  const labelList& checkFaces,
40  labelHashSet& wrongFaces,
41  const bool dryRun
42 )
43 {
44  List<labelPair> emptyBaffles;
45  return checkMesh
46  (
47  report,
48  mesh,
49  dict,
50  checkFaces,
51  emptyBaffles,
52  wrongFaces,
53  dryRun
54  );
55 }
56 
58 (
59  const bool report,
60  const polyMesh& mesh,
61  const dictionary& dict,
62  const labelList& checkFaces,
63  const List<labelPair>& baffles,
64  labelHashSet& wrongFaces,
65  const bool dryRun
66 )
67 {
68  const scalar maxNonOrtho
69  (
70  get<scalar>(dict, "maxNonOrtho", dryRun, keyType::REGEX_RECURSIVE)
71  );
72  const scalar minVol
73  (
74  get<scalar>(dict, "minVol", dryRun, keyType::REGEX_RECURSIVE)
75  );
76  const scalar minTetQuality
77  (
78  get<scalar>(dict, "minTetQuality", dryRun, keyType::REGEX_RECURSIVE)
79  );
80  const scalar maxConcave
81  (
82  get<scalar>(dict, "maxConcave", dryRun, keyType::REGEX_RECURSIVE)
83  );
84  const scalar minArea
85  (
86  get<scalar>(dict, "minArea", dryRun, keyType::REGEX_RECURSIVE)
87  );
88  const scalar maxIntSkew
89  (
90  get<scalar>
91  (
92  dict, "maxInternalSkewness", dryRun, keyType::REGEX_RECURSIVE
93  )
94  );
95  const scalar maxBounSkew
96  (
97  get<scalar>
98  (
99  dict, "maxBoundarySkewness", dryRun, keyType::REGEX_RECURSIVE
100  )
101  );
102  const scalar minWeight
103  (
104  get<scalar>(dict, "minFaceWeight", dryRun, keyType::REGEX_RECURSIVE)
105  );
106  const scalar minVolRatio
107  (
108  get<scalar>(dict, "minVolRatio", dryRun, keyType::REGEX_RECURSIVE)
109  );
110  const scalar minTwist
111  (
112  get<scalar>(dict, "minTwist", dryRun, keyType::REGEX_RECURSIVE)
113  );
114  const scalar minTriangleTwist
115  (
116  get<scalar>(dict, "minTriangleTwist", dryRun, keyType::REGEX_RECURSIVE)
117  );
118  const scalar minFaceFlatness
119  (
120  dict.lookupOrDefault<scalar>
121  (
122  "minFaceFlatness", -1, keyType::REGEX_RECURSIVE
123  )
124  );
125  const scalar minDet
126  (
127  get<scalar>(dict, "minDeterminant", dryRun, keyType::REGEX_RECURSIVE)
128  );
129 
130 
131  if (dryRun)
132  {
133  string errorMsg(FatalError.message());
134  string IOerrorMsg(FatalIOError.message());
135 
136  if (errorMsg.size() || IOerrorMsg.size())
137  {
138  //errorMsg = "[dryRun] " + errorMsg;
139  //errorMsg.replaceAll("\n", "\n[dryRun] ");
140  //IOerrorMsg = "[dryRun] " + IOerrorMsg;
141  //IOerrorMsg.replaceAll("\n", "\n[dryRun] ");
142 
144  << nl
145  << "Missing/incorrect required dictionary entries:" << nl
146  << nl
147  << IOerrorMsg.c_str() << nl
148  << errorMsg.c_str() << nl
149  //<< nl << "Exiting dry-run" << nl
150  << endl;
151 
152  FatalError.clear();
154  }
155  return false;
156  }
157 
158 
159  label nWrongFaces = 0;
160 
161  Info<< "Checking faces in error :" << endl;
162  //Pout.setf(ios_base::left);
163 
164  if (maxNonOrtho < 180.0-SMALL)
165  {
166  polyMeshGeometry::checkFaceDotProduct
167  (
168  report,
169  maxNonOrtho,
170  mesh,
171  mesh.cellCentres(),
172  mesh.faceAreas(),
173  checkFaces,
174  baffles,
175  &wrongFaces
176  );
177 
178  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
179 
180  Info<< " non-orthogonality > "
181  << setw(3) << maxNonOrtho
182  << " degrees : "
183  << nNewWrongFaces-nWrongFaces << endl;
184 
185  nWrongFaces = nNewWrongFaces;
186  }
187 
188  if (minVol > -GREAT)
189  {
190  polyMeshGeometry::checkFacePyramids
191  (
192  report,
193  minVol,
194  mesh,
195  mesh.cellCentres(),
196  mesh.points(),
197  checkFaces,
198  baffles,
199  &wrongFaces
200  );
201 
202  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
203 
204  Info<< " faces with face pyramid volume < "
205  << setw(5) << minVol << " : "
206  << nNewWrongFaces-nWrongFaces << endl;
207 
208  nWrongFaces = nNewWrongFaces;
209  }
210 
211  if (minTetQuality > -GREAT)
212  {
213  polyMeshGeometry::checkFaceTets
214  (
215  report,
216  minTetQuality,
217  mesh,
218  mesh.cellCentres(),
219  mesh.faceCentres(),
220  mesh.points(),
221  checkFaces,
222  baffles,
223  &wrongFaces
224  );
225 
226  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
227 
228  Info<< " faces with face-decomposition tet quality < "
229  << setw(5) << minTetQuality << " : "
230  << nNewWrongFaces-nWrongFaces << endl;
231 
232  nWrongFaces = nNewWrongFaces;
233  }
234 
235  if (maxConcave < 180.0-SMALL)
236  {
237  polyMeshGeometry::checkFaceAngles
238  (
239  report,
240  maxConcave,
241  mesh,
242  mesh.faceAreas(),
243  mesh.points(),
244  checkFaces,
245  &wrongFaces
246  );
247 
248  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
249 
250  Info<< " faces with concavity > "
251  << setw(3) << maxConcave
252  << " degrees : "
253  << nNewWrongFaces-nWrongFaces << endl;
254 
255  nWrongFaces = nNewWrongFaces;
256  }
257 
258  if (minArea > -SMALL)
259  {
260  polyMeshGeometry::checkFaceArea
261  (
262  report,
263  minArea,
264  mesh,
265  mesh.faceAreas(),
266  checkFaces,
267  &wrongFaces
268  );
269 
270  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
271 
272  Info<< " faces with area < "
273  << setw(5) << minArea
274  << " m^2 : "
275  << nNewWrongFaces-nWrongFaces << endl;
276 
277  nWrongFaces = nNewWrongFaces;
278  }
279 
280  if (maxIntSkew > 0 || maxBounSkew > 0)
281  {
282  polyMeshGeometry::checkFaceSkewness
283  (
284  report,
285  maxIntSkew,
286  maxBounSkew,
287  mesh,
288  mesh.points(),
289  mesh.cellCentres(),
290  mesh.faceCentres(),
291  mesh.faceAreas(),
292  checkFaces,
293  baffles,
294  &wrongFaces
295  );
296 
297  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
298 
299  Info<< " faces with skewness > "
300  << setw(3) << maxIntSkew
301  << " (internal) or " << setw(3) << maxBounSkew
302  << " (boundary) : " << nNewWrongFaces-nWrongFaces << endl;
303 
304  nWrongFaces = nNewWrongFaces;
305  }
306 
307  if (minWeight >= 0 && minWeight < 1)
308  {
309  polyMeshGeometry::checkFaceWeights
310  (
311  report,
312  minWeight,
313  mesh,
314  mesh.cellCentres(),
315  mesh.faceCentres(),
316  mesh.faceAreas(),
317  checkFaces,
318  baffles,
319  &wrongFaces
320  );
321 
322  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
323 
324  Info<< " faces with interpolation weights (0..1) < "
325  << setw(5) << minWeight
326  << " : "
327  << nNewWrongFaces-nWrongFaces << endl;
328 
329  nWrongFaces = nNewWrongFaces;
330  }
331 
332  if (minVolRatio >= 0)
333  {
334  polyMeshGeometry::checkVolRatio
335  (
336  report,
337  minVolRatio,
338  mesh,
339  mesh.cellVolumes(),
340  checkFaces,
341  baffles,
342  &wrongFaces
343  );
344 
345  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
346 
347  Info<< " faces with volume ratio of neighbour cells < "
348  << setw(5) << minVolRatio
349  << " : "
350  << nNewWrongFaces-nWrongFaces << endl;
351 
352  nWrongFaces = nNewWrongFaces;
353  }
354 
355  if (minTwist > -1)
356  {
357  //Pout<< "Checking face twist: dot product of face normal "
358  // << "with face triangle normals" << endl;
359  polyMeshGeometry::checkFaceTwist
360  (
361  report,
362  minTwist,
363  mesh,
364  mesh.cellCentres(),
365  mesh.faceAreas(),
366  mesh.faceCentres(),
367  mesh.points(),
368  checkFaces,
369  &wrongFaces
370  );
371 
372  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
373 
374  Info<< " faces with face twist < "
375  << setw(5) << minTwist
376  << " : "
377  << nNewWrongFaces-nWrongFaces << endl;
378 
379  nWrongFaces = nNewWrongFaces;
380  }
381 
382  if (minTriangleTwist > -1)
383  {
384  //Pout<< "Checking triangle twist: dot product of consecutive triangle"
385  // << " normals resulting from face-centre decomposition" << endl;
386  polyMeshGeometry::checkTriangleTwist
387  (
388  report,
389  minTriangleTwist,
390  mesh,
391  mesh.faceAreas(),
392  mesh.faceCentres(),
393  mesh.points(),
394  checkFaces,
395  &wrongFaces
396  );
397 
398  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
399 
400  Info<< " faces with triangle twist < "
401  << setw(5) << minTriangleTwist
402  << " : "
403  << nNewWrongFaces-nWrongFaces << endl;
404 
405  nWrongFaces = nNewWrongFaces;
406  }
407 
408  if (minFaceFlatness > -SMALL)
409  {
410  polyMeshGeometry::checkFaceFlatness
411  (
412  report,
413  minFaceFlatness,
414  mesh,
415  mesh.faceAreas(),
416  mesh.faceCentres(),
417  mesh.points(),
418  checkFaces,
419  &wrongFaces
420  );
421 
422  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
423 
424  Info<< " faces with flatness < "
425  << setw(5) << minFaceFlatness
426  << " : "
427  << nNewWrongFaces-nWrongFaces << endl;
428 
429  nWrongFaces = nNewWrongFaces;
430  }
431 
432  if (minDet > -1)
433  {
434  polyMeshGeometry::checkCellDeterminant
435  (
436  report,
437  minDet,
438  mesh,
439  mesh.faceAreas(),
440  checkFaces,
441  polyMeshGeometry::affectedCells(mesh, checkFaces),
442  &wrongFaces
443  );
444 
445  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
446 
447  Info<< " faces on cells with determinant < "
448  << setw(5) << minDet << " : "
449  << nNewWrongFaces-nWrongFaces << endl;
450 
451  nWrongFaces = nNewWrongFaces;
452  }
453 
454  //Pout.setf(ios_base::right);
455 
456  return nWrongFaces > 0;
457 }
458 
459 
461 (
462  const bool report,
463  const polyMesh& mesh,
464  const dictionary& dict,
465  labelHashSet& wrongFaces,
466  const bool dryRun
467 )
468 {
469  return checkMesh
470  (
471  report,
472  mesh,
473  dict,
474  identity(mesh.nFaces()),
475  wrongFaces,
476  dryRun
477  );
478 }
479 
481 (
482  const bool report,
483  const dictionary& dict,
484  const polyMeshGeometry& meshGeom,
485  const pointField& points,
486  const labelList& checkFaces,
487  labelHashSet& wrongFaces,
488  const bool dryRun
489 )
490 {
491  List<labelPair> emptyBaffles;
492 
493  return checkMesh
494  (
495  report,
496  dict,
497  meshGeom,
498  points,
499  checkFaces,
500  emptyBaffles,
501  wrongFaces,
502  dryRun
503  );
504 }
505 
506 
508 (
509  const bool report,
510  const dictionary& dict,
511  const polyMeshGeometry& meshGeom,
512  const pointField& points,
513  const labelList& checkFaces,
514  const List<labelPair>& baffles,
515  labelHashSet& wrongFaces,
516  const bool dryRun
517 )
518 {
519  const scalar maxNonOrtho
520  (
521  get<scalar>(dict, "maxNonOrtho", dryRun, keyType::REGEX_RECURSIVE)
522  );
523  const scalar minVol
524  (
525  get<scalar>(dict, "minVol", dryRun, keyType::REGEX_RECURSIVE)
526  );
527  const scalar minTetQuality
528  (
529  get<scalar>(dict, "minTetQuality", dryRun, keyType::REGEX_RECURSIVE)
530  );
531  const scalar maxConcave
532  (
533  get<scalar>(dict, "maxConcave", dryRun, keyType::REGEX_RECURSIVE)
534  );
535  const scalar minArea
536  (
537  get<scalar>(dict, "minArea", dryRun, keyType::REGEX_RECURSIVE)
538  );
539  const scalar maxIntSkew
540  (
541  get<scalar>(dict, "maxInternalSkewness", dryRun, keyType::REGEX_RECURSIVE)
542  );
543  const scalar maxBounSkew
544  (
545  get<scalar>(dict, "maxBoundarySkewness", dryRun, keyType::REGEX_RECURSIVE)
546  );
547  const scalar minWeight
548  (
549  get<scalar>(dict, "minFaceWeight", dryRun, keyType::REGEX_RECURSIVE)
550  );
551  const scalar minVolRatio
552  (
553  get<scalar>(dict, "minVolRatio", dryRun, keyType::REGEX_RECURSIVE)
554  );
555  const scalar minTwist
556  (
557  get<scalar>(dict, "minTwist", dryRun, keyType::REGEX_RECURSIVE)
558  );
559  const scalar minTriangleTwist
560  (
561  get<scalar>(dict, "minTriangleTwist", dryRun, keyType::REGEX_RECURSIVE)
562  );
563  scalar minFaceFlatness = -1.0;
564  dict.readIfPresent
565  (
566  "minFaceFlatness",
567  minFaceFlatness,
568  keyType::REGEX_RECURSIVE
569  );
570  const scalar minDet
571  (
572  get<scalar>(dict, "minDeterminant", dryRun, keyType::REGEX_RECURSIVE)
573  );
574 
575  if (dryRun)
576  {
577  string errorMsg(FatalError.message());
578  string IOerrorMsg(FatalIOError.message());
579 
580  if (errorMsg.size() || IOerrorMsg.size())
581  {
582  //errorMsg = "[dryRun] " + errorMsg;
583  //errorMsg.replaceAll("\n", "\n[dryRun] ");
584  //IOerrorMsg = "[dryRun] " + IOerrorMsg;
585  //IOerrorMsg.replaceAll("\n", "\n[dryRun] ");
586 
587  Perr<< nl
588  << "Missing/incorrect required dictionary entries:" << nl
589  << nl
590  << IOerrorMsg.c_str() << nl
591  << errorMsg.c_str() << nl
592  //<< nl << "Exiting dry-run" << nl
593  << endl;
594 
595  FatalError.clear();
597  }
598  return false;
599  }
600 
601 
602  label nWrongFaces = 0;
603 
604  Info<< "Checking faces in error :" << endl;
605  //Pout.setf(ios_base::left);
606 
607  if (maxNonOrtho < 180.0-SMALL)
608  {
609  meshGeom.checkFaceDotProduct
610  (
611  report,
612  maxNonOrtho,
613  checkFaces,
614  baffles,
615  &wrongFaces
616  );
617 
618  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
619 
620  Info<< " non-orthogonality > "
621  << setw(3) << maxNonOrtho
622  << " degrees : "
623  << nNewWrongFaces-nWrongFaces << endl;
624 
625  nWrongFaces = nNewWrongFaces;
626  }
627 
628  if (minVol > -GREAT)
629  {
630  meshGeom.checkFacePyramids
631  (
632  report,
633  minTetQuality,
634  points,
635  checkFaces,
636  baffles,
637  &wrongFaces
638  );
639 
640  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
641 
642  Info<< " faces with face pyramid volume < "
643  << setw(5) << minVol << " : "
644  << nNewWrongFaces-nWrongFaces << endl;
645 
646  nWrongFaces = nNewWrongFaces;
647  }
648 
649  if (minTetQuality > -GREAT)
650  {
651  meshGeom.checkFaceTets
652  (
653  report,
654  minTetQuality,
655  points,
656  checkFaces,
657  baffles,
658  &wrongFaces
659  );
660 
661  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
662 
663  Info<< " faces with face-decomposition tet quality < "
664  << setw(5) << minTetQuality << " : "
665  << nNewWrongFaces-nWrongFaces << endl;
666 
667  nWrongFaces = nNewWrongFaces;
668  }
669 
670  if (maxConcave < 180.0-SMALL)
671  {
672  meshGeom.checkFaceAngles
673  (
674  report,
675  maxConcave,
676  points,
677  checkFaces,
678  &wrongFaces
679  );
680 
681  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
682 
683  Info<< " faces with concavity > "
684  << setw(3) << maxConcave
685  << " degrees : "
686  << nNewWrongFaces-nWrongFaces << endl;
687 
688  nWrongFaces = nNewWrongFaces;
689  }
690 
691  if (minArea > -SMALL)
692  {
693  meshGeom.checkFaceArea
694  (
695  report,
696  minArea,
697  checkFaces,
698  &wrongFaces
699  );
700 
701  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
702 
703  Info<< " faces with area < "
704  << setw(5) << minArea
705  << " m^2 : "
706  << nNewWrongFaces-nWrongFaces << endl;
707 
708  nWrongFaces = nNewWrongFaces;
709  }
710 
711  if (maxIntSkew > 0 || maxBounSkew > 0)
712  {
713  polyMeshGeometry::checkFaceSkewness
714  (
715  report,
716  maxIntSkew,
717  maxBounSkew,
718  meshGeom.mesh(),
719  points,
720  meshGeom.cellCentres(),
721  meshGeom.faceCentres(),
722  meshGeom.faceAreas(),
723  checkFaces,
724  baffles,
725  &wrongFaces
726  );
727 
728  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
729 
730  Info<< " faces with skewness > "
731  << setw(3) << maxIntSkew
732  << " (internal) or " << setw(3) << maxBounSkew
733  << " (boundary) : " << nNewWrongFaces-nWrongFaces << endl;
734 
735  nWrongFaces = nNewWrongFaces;
736  }
737 
738  if (minWeight >= 0 && minWeight < 1)
739  {
740  meshGeom.checkFaceWeights
741  (
742  report,
743  minWeight,
744  checkFaces,
745  baffles,
746  &wrongFaces
747  );
748 
749  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
750 
751  Info<< " faces with interpolation weights (0..1) < "
752  << setw(5) << minWeight
753  << " : "
754  << nNewWrongFaces-nWrongFaces << endl;
755 
756  nWrongFaces = nNewWrongFaces;
757  }
758 
759  if (minVolRatio >= 0)
760  {
761  meshGeom.checkVolRatio
762  (
763  report,
764  minVolRatio,
765  checkFaces,
766  baffles,
767  &wrongFaces
768  );
769 
770  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
771 
772  Info<< " faces with volume ratio of neighbour cells < "
773  << setw(5) << minVolRatio
774  << " : "
775  << nNewWrongFaces-nWrongFaces << endl;
776 
777  nWrongFaces = nNewWrongFaces;
778  }
779 
780  if (minTwist > -1)
781  {
782  //Pout<< "Checking face twist: dot product of face normal "
783  // << "with face triangle normals" << endl;
784  meshGeom.checkFaceTwist
785  (
786  report,
787  minTwist,
788  points,
789  checkFaces,
790  &wrongFaces
791  );
792 
793  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
794 
795  Info<< " faces with face twist < "
796  << setw(5) << minTwist
797  << " : "
798  << nNewWrongFaces-nWrongFaces << endl;
799 
800  nWrongFaces = nNewWrongFaces;
801  }
802 
803  if (minTriangleTwist > -1)
804  {
805  //Pout<< "Checking triangle twist: dot product of consecutive triangle"
806  // << " normals resulting from face-centre decomposition" << endl;
807  meshGeom.checkTriangleTwist
808  (
809  report,
810  minTriangleTwist,
811  points,
812  checkFaces,
813  &wrongFaces
814  );
815 
816  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
817 
818  Info<< " faces with triangle twist < "
819  << setw(5) << minTriangleTwist
820  << " : "
821  << nNewWrongFaces-nWrongFaces << endl;
822 
823  nWrongFaces = nNewWrongFaces;
824  }
825 
826  if (minFaceFlatness > -SMALL)
827  {
828  meshGeom.checkFaceFlatness
829  (
830  report,
831  minFaceFlatness,
832  points,
833  checkFaces,
834  &wrongFaces
835  );
836 
837  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
838 
839  Info<< " faces with flatness < "
840  << setw(5) << minFaceFlatness
841  << " : "
842  << nNewWrongFaces-nWrongFaces << endl;
843 
844  nWrongFaces = nNewWrongFaces;
845  }
846 
847  if (minDet > -1)
848  {
849  meshGeom.checkCellDeterminant
850  (
851  report,
852  minDet,
853  checkFaces,
854  polyMeshGeometry::affectedCells(meshGeom.mesh(), checkFaces),
855  &wrongFaces
856  );
857 
858  label nNewWrongFaces = returnReduce(wrongFaces.size(), sumOp<label>());
859 
860  Info<< " faces on cells with determinant < "
861  << setw(5) << minDet << " : "
862  << nNewWrongFaces-nWrongFaces << endl;
863 
864  nWrongFaces = nNewWrongFaces;
865  }
866 
867  //Pout.setf(ios_base::right);
868 
869  return nWrongFaces > 0;
870 }
871 
872 
873 // ************************************************************************* //
Foam::HashTable::size
label size() const noexcept
The number of elements in table.
Definition: HashTableI.H:52
Foam::polyMeshGeometry::checkFaceDotProduct
static bool checkFaceDotProduct(const bool report, const scalar orthWarn, const polyMesh &, const vectorField &cellCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
See primitiveMesh.
Definition: polyMeshGeometry.C:361
Foam::polyMeshGeometry::faceAreas
const vectorField & faceAreas() const
Definition: polyMeshGeometry.H:145
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
polyMeshGeometry.H
Foam::polyMeshGeometry::checkFaceWeights
static bool checkFaceWeights(const bool report, const scalar warnWeight, const polyMesh &mesh, const vectorField &cellCentres, const vectorField &faceCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
Interpolation weights (0.5 for regular mesh)
Definition: polyMeshGeometry.C:1136
Foam::FatalIOError
IOerror FatalIOError
Foam::motionSmootherAlgo::checkMesh
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
Definition: motionSmootherAlgoCheck.C:461
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::polyMeshGeometry::checkFaceTets
static bool checkFaceTets(const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
See primitiveMesh.
Definition: polyMeshGeometry.C:710
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::sumOp
Definition: ops.H:213
Foam::polyMeshGeometry::faceCentres
const vectorField & faceCentres() const
Definition: polyMeshGeometry.H:149
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::polyMeshGeometry::checkFaceArea
static bool checkFaceArea(const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
Small faces.
Definition: polyMeshGeometry.C:1933
Foam::Field< vector >
Foam::polyMeshGeometry::mesh
const polyMesh & mesh() const
Definition: polyMeshGeometry.H:140
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
IOmanip.H
Istream and Ostream manipulators taking arguments.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::error::message
string message() const
Definition: error.C:204
Foam::setw
Omanip< int > setw(const int i)
Definition: IOmanip.H:199
Foam::polyMeshGeometry::checkFaceTwist
static bool checkFaceTwist(const bool report, const scalar minTwist, const polyMesh &, const vectorField &cellCentres, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Triangle (from face-centre decomposition) normal v.s.
Definition: polyMeshGeometry.C:1548
Foam::Perr
prefixOSstream Perr
An Ostream wrapper for parallel output to std::cerr.
Foam::polyMeshGeometry::checkFaceFlatness
static bool checkFaceFlatness(const bool report, const scalar minFlatness, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Area of faces v.s. sum of triangle areas.
Definition: polyMeshGeometry.C:1840
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::List< label >
motionSmootherAlgo.H
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::identity
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
Definition: labelList.C:38
Foam::error::clear
void clear() const
Clear any messages.
Definition: error.C:210
Foam::polyMeshGeometry
Updateable mesh geometry and checking routines.
Definition: polyMeshGeometry.H:54
Foam::polyMeshGeometry::checkFacePyramids
static bool checkFacePyramids(const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
See primitiveMesh.
Definition: polyMeshGeometry.C:539
IOWarningInFunction
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Definition: messageStream.H:306
Foam::polyMeshGeometry::checkCellDeterminant
static bool checkCellDeterminant(const bool report, const scalar minDet, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, const labelList &affectedCells, labelHashSet *setPtr)
Area of internal faces v.s. boundary faces.
Definition: polyMeshGeometry.C:1990
Foam::polyMeshGeometry::checkTriangleTwist
static bool checkTriangleTwist(const bool report, const scalar minTwist, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Consecutive triangle (from face-centre decomposition) normals.
Definition: polyMeshGeometry.C:1694
Foam::polyMeshGeometry::cellCentres
const vectorField & cellCentres() const
Definition: polyMeshGeometry.H:153
Foam::polyMeshGeometry::checkVolRatio
static bool checkVolRatio(const bool report, const scalar warnRatio, const polyMesh &mesh, const scalarField &cellVolumes, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
Cell volume ratio of neighbouring cells (1 for regular mesh)
Definition: polyMeshGeometry.C:1284
Foam::polyMeshGeometry::checkFaceAngles
static bool checkFaceAngles(const bool report, const scalar maxDeg, const polyMesh &mesh, const vectorField &faceAreas, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
See primitiveMesh.
Definition: polyMeshGeometry.C:1420