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