Plugins
element_quality_statistics.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2021: G-CSC, Goethe University Frankfurt
3  * Author: Martin Stepniewski
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 
34 #ifndef __ELEMENT_QUALITY_STATISTICS_H__
35 #define __ELEMENT_QUALITY_STATISTICS_H__
36 
37 /* system includes */
38 #include <stddef.h>
39 #include <cmath>
40 #include <stdlib.h>
41 #include <stdio.h>
42 #include <string.h>
43 #include <fstream>
44 #include <vector>
45 #include <string>
46 #include <algorithm>
47 
48 #include "lib_grid/lib_grid.h"
49 #include "elem_stat_util.h"
52 
53 
54 
55 using namespace std;
56 
57 
58 namespace ug {
59 
60 
62 // CollectMinAngles
63 template <class TIterator, class TAAPosVRT>
64 void CollectMinAngles(Grid& grid, TIterator elementsBegin,
65  TIterator elementsEnd,
66  TAAPosVRT& aaPos,
67  vector<number>& minAngles)
68 {
69  //PROFILE_FUNC();
70  DistributedGridManager* dgm = grid.distributed_grid_manager();
71 
72 // if elementsBegin equals elementsEnd, then the list is empty and we can
73 // immediately return NULL
74  if(elementsBegin == elementsEnd)
75  {
76  UG_LOG("ERROR in CollectMinAngles: elementsBegin == elementsEnd." << std::endl);
77  return;
78  }
79 
80 // Calculate the minAngle of every element
81  for(TIterator iter = elementsBegin; iter != elementsEnd; ++iter)
82  {
83  #ifdef UG_PARALLEL
84  // ghosts (vertical masters) as well as horizontal slaves (low dimensional elements only) have to be ignored,
85  // since they have a copy on another process and
86  // since we already consider that copy...
87  if(dgm->is_ghost(*iter) || dgm->contains_status(*iter, ES_H_SLAVE))
88  continue;
89  #endif
90 
91  number curMinAngle = CalculateMinAngle(grid, *iter, aaPos);
92  minAngles.push_back(curMinAngle);
93  }
94 }
95 
96 
98 // CollectMaxAngles
99 template <class TIterator, class TAAPosVRT>
100 void CollectMaxAngles(Grid& grid, TIterator elementsBegin,
101  TIterator elementsEnd,
102  TAAPosVRT& aaPos,
103  vector<number>& maxAngles)
104 {
105  //PROFILE_FUNC();
106  DistributedGridManager* dgm = grid.distributed_grid_manager();
107 
108 // if elementsBegin equals elementsEnd, then the list is empty and we can
109 // immediately return NULL
110  if(elementsBegin == elementsEnd)
111  {
112  UG_LOG("ERROR in CollectMaxAngles: elementsBegin == elementsEnd." << std::endl);
113  return;
114  }
115 
116 // Calculate the minAngle of every element
117  for(TIterator iter = elementsBegin; iter != elementsEnd; ++iter)
118  {
119  #ifdef UG_PARALLEL
120  // ghosts (vertical masters) as well as horizontal slaves (low dimensional elements only) have to be ignored,
121  // since they have a copy on another process and
122  // since we already consider that copy...
123  if(dgm->is_ghost(*iter) || dgm->contains_status(*iter, ES_H_SLAVE))
124  continue;
125  #endif
126 
127  number curMaxAngle = CalculateMaxAngle(grid, *iter, aaPos);
128  maxAngles.push_back(curMaxAngle);
129  }
130 }
131 
132 
134 // AspectRatioHistogram
135 template <class TIterator, class TAAPosVRT>
136 void CollectAspectRatios(Grid& grid, TIterator elementsBegin,
137  TIterator elementsEnd,
138  TAAPosVRT& aaPos,
139  vector<number>& aspectRatios)
140 {
141  //PROFILE_FUNC();
142  DistributedGridManager* dgm = grid.distributed_grid_manager();
143 
144 // if elementsBegin equals elementsEnd, then the list is empty and we can
145 // immediately return NULL
146  if(elementsBegin == elementsEnd)
147  {
148  UG_LOG("ERROR in CollectAspectRatios: elementsBegin == elementsEnd." << std::endl);
149  return;
150  }
151 
152 // Calculate the aspectRatio of every element
153  for(TIterator iter = elementsBegin; iter != elementsEnd; ++iter)
154  {
155  #ifdef UG_PARALLEL
156  // ghosts (vertical masters) as well as horizontal slaves (low dimensional elements only) have to be ignored,
157  // since they have a copy on another process and
158  // since we already consider that copy...
159  if(dgm->is_ghost(*iter) || dgm->contains_status(*iter, ES_H_SLAVE))
160  continue;
161  #endif
162 
163  number curAspectRatio = CalculateAspectRatio(grid, *iter, aaPos);
164  aspectRatios.push_back(curAspectRatio);
165  }
166 }
167 
168 
170 // VolToRMSFaceAreaRatioHistogram
171 template <class TIterator, class TAAPosVRT>
172 void CollectVolToRMSFaceAreaRatios(Grid& grid, TIterator elementsBegin,
173  TIterator elementsEnd,
174  TAAPosVRT& aaPos,
175  vector<number>& ratios)
176 {
177  //PROFILE_FUNC();
178  DistributedGridManager* dgm = grid.distributed_grid_manager();
179 
180 // if elementsBegin equals elementsEnd, then the list is empty and we can
181 // immediately return NULL
182  if(elementsBegin == elementsEnd)
183  {
184  UG_LOG("ERROR in CollectVolToRMSFaceAreaRatios: elementsBegin == elementsEnd." << std::endl);
185  return;
186  }
187 
188 // Calculate the ratio of every element
189  bool nonTetrahedralElemsPresent = false;
190  for(TIterator iter = elementsBegin; iter != elementsEnd; ++iter)
191  {
192  #ifdef UG_PARALLEL
193  // ghosts (vertical masters) as well as horizontal slaves (low dimensional elements only) have to be ignored,
194  // since they have a copy on another process and
195  // since we already consider that copy...
196  if(dgm->is_ghost(*iter) || dgm->contains_status(*iter, ES_H_SLAVE))
197  continue;
198  #endif
199 
200  if (!dynamic_cast<Tetrahedron*>(*iter))
201  {
202  ratios.push_back(0.0);
203  nonTetrahedralElemsPresent = true;
204  continue;
205  }
206  number curRatio = CalculateVolToRMSFaceAreaRatio(grid, *iter, aaPos);
207  ratios.push_back(curRatio);
208  }
209 
210  if (nonTetrahedralElemsPresent)
211  UG_LOGN("CollectVolToRMSFaceAreaRatios could not calculate VolToRMSFaceAreaRatios "
212  "for non-tetraheadral elements (set to 0.0)");
213 }
214 
215 
217 // PrintAngleStatistics2d
218 template <class TAAPosVRT>
219 void PrintAngleStatistics2d(Grid& grid, GridObjectCollection& goc, int level, TAAPosVRT& aaPos)
220 {
221  size_t numTriangles = 0;
222  size_t numQuadrilaterals = 0;
223 
224  number sd_tri = 0.0;
225  number sd_quad = 0.0;
226  number mean_tri = 0.0;
227  number mean_quad = 0.0;
228  number regAngle = 90.0;
229 
230  DistributedGridManager* dgm = grid.distributed_grid_manager();
231  int i = level;
232 
233 // Calculate and output standard deviation for triangular/quadrilateral angles
234  if(goc.num<Triangle>(i) > 0 || goc.num<Quadrilateral>(i) > 0)
235  {
236  vector<number> vAnglesOut;
237 
238  for(FaceIterator fIter = goc.begin<Face>(i); fIter != goc.end<Face>(i); ++fIter)
239  {
240  vAnglesOut.clear();
241  Face* f = *fIter;
242 
243  #ifdef UG_PARALLEL
244  // ghosts (vertical masters) as well as horizontal slaves (low dimensional elements only) have to be ignored,
245  // since they have a copy on another process and
246  // since we already consider that copy...
247  if(dgm->is_ghost(f) || dgm->contains_status(f, ES_H_SLAVE))
248  continue;
249  #endif
250 
252  {
253  regAngle = 60.0;
254  CalculateAngles(vAnglesOut, grid, f, aaPos);
255  numTriangles++;
256 
257  for(size_t k = 0; k < vAnglesOut.size(); ++k)
258  {
259  sd_tri += (regAngle-vAnglesOut[k])*(regAngle-vAnglesOut[k]);
260  mean_tri += vAnglesOut[k];
261  }
262  }
263 
265  {
266  regAngle = 90.0;
267  CalculateAngles(vAnglesOut, grid, f, aaPos);
268  numQuadrilaterals++;
269 
270  for(size_t k = 0; k < vAnglesOut.size(); ++k)
271  {
272  sd_quad += (regAngle-vAnglesOut[k])*(regAngle-vAnglesOut[k]);
273  mean_quad += vAnglesOut[k];
274  }
275  }
276  }
277  }
278 
279  #ifdef UG_PARALLEL
280  if(pcl::NumProcs() > 1){
281  // sum the numbers of all involved processes. Since we ignored ghosts,
282  // each process contributes the numbers of a unique part of the grid.
284  numTriangles = pc.allreduce(numTriangles, PCL_RO_SUM);
285  numQuadrilaterals = pc.allreduce(numQuadrilaterals, PCL_RO_SUM);
286  sd_tri = pc.allreduce(sd_tri, PCL_RO_SUM);
287  mean_tri = pc.allreduce(mean_tri, PCL_RO_SUM);
288  sd_quad = pc.allreduce(sd_quad, PCL_RO_SUM);
289  mean_quad = pc.allreduce(mean_quad, PCL_RO_SUM);
290  }
291  #endif
292 
293 // Calculate and output standard deviation for triangular/quadrilateral angles
294  if(goc.num<Triangle>(i) > 0 || goc.num<Quadrilateral>(i) > 0)
295  {
296  if(goc.num<Triangle>(i) > 0)
297  {
298  sd_tri *= (1.0/(3*numTriangles));
299  sd_tri = sqrt(sd_tri);
300  mean_tri *= (1.0/(3*numTriangles));
301  }
302 
303  if(goc.num<Quadrilateral>(i) > 0)
304  {
305  sd_quad *= (1.0/(4*numQuadrilaterals));
306  sd_quad = sqrt(sd_quad);
307  mean_quad *= (1.0/(4*numQuadrilaterals));
308  }
309 
310  UG_LOG("(*) Standard deviation of face angles to regular case" << endl);
311  UG_LOG(" (60° for triangles, 90° for quadrilaterals)" << endl);
312  UG_LOG(endl);
313  UG_LOG(" Triangles (" << numTriangles << "):" << endl);
314  if(goc.num<Triangle>(i) > 0)
315  {
316  UG_LOG(" sd = " << sd_tri << endl);
317  UG_LOG(" mean = " << mean_tri << endl);
318  }
319  UG_LOG(endl);
320  UG_LOG(" Quadrilaterals (" << numQuadrilaterals << "):" << endl);
321  if(goc.num<Quadrilateral>(i) > 0)
322  {
323  UG_LOG(" sd = " << sd_quad << endl);
324  UG_LOG(" mean = " << mean_quad << endl);
325  }
326  UG_LOG(endl);
327  }
328 }
329 
330 
332 // PrintAngleStatistics3d
333 template <class TAAPosVRT>
334 void PrintAngleStatistics3d(Grid& grid, GridObjectCollection& goc, int level, TAAPosVRT& aaPos)
335 {
336  size_t numTriangles = 0;
337  size_t numQuadrilaterals = 0;
338  size_t numTetrahedrons = 0;
339  size_t numHexahedrons = 0;
340  size_t numOctahedrons = 0;
341 
342  number sd_tri = 0.0;
343  number sd_quad = 0.0;
344  number mean_tri = 0.0;
345  number mean_quad = 0.0;
346  number regAngle = 90.0;
347 
348  number sd_tet = 0.0;
349  number sd_hex = 0.0;
350  number sd_oct = 0.0;
351  number mean_tet = 0.0;
352  number mean_hex = 0.0;
353  number mean_oct = 0.0;
354  number regVolDihedral = 90.0;
355 
356  DistributedGridManager* dgm = grid.distributed_grid_manager();
357  int i = level;
358 
359 // Calculate and output standard deviation for triangular/quadrilateral angles
360  if(goc.num<Triangle>(i) > 0 || goc.num<Quadrilateral>(i) > 0)
361  {
362  vector<number> vAnglesOut;
363 
364  for(FaceIterator fIter = goc.begin<Face>(i); fIter != goc.end<Face>(i); ++fIter)
365  {
366  vAnglesOut.clear();
367  Face* f = *fIter;
368 
369  #ifdef UG_PARALLEL
370  // ghosts (vertical masters) as well as horizontal slaves (low dimensional elements only) have to be ignored,
371  // since they have a copy on another process and
372  // since we already consider that copy...
373  if(dgm->is_ghost(f) || dgm->contains_status(f, ES_H_SLAVE))
374  continue;
375  #endif
376 
378  {
379  regAngle = 60.0;
380  CalculateAngles(vAnglesOut, grid, f, aaPos);
381  numTriangles++;
382 
383  for(size_t k = 0; k < vAnglesOut.size(); ++k)
384  {
385  sd_tri += (regAngle-vAnglesOut[k])*(regAngle-vAnglesOut[k]);
386  mean_tri += vAnglesOut[k];
387  }
388  }
389 
391  {
392  regAngle = 90.0;
393  CalculateAngles(vAnglesOut, grid, f, aaPos);
394  numQuadrilaterals++;
395 
396  for(size_t k = 0; k < vAnglesOut.size(); ++k)
397  {
398  sd_quad += (regAngle-vAnglesOut[k])*(regAngle-vAnglesOut[k]);
399  mean_quad += vAnglesOut[k];
400  }
401  }
402  }
403  }
404 
405  #ifdef UG_PARALLEL
406  if(pcl::NumProcs() > 1){
407  // sum the numbers of all involved processes. Since we ignored ghosts,
408  // each process contributes the numbers of a unique part of the grid.
410  numTriangles = pc.allreduce(numTriangles, PCL_RO_SUM);
411  numQuadrilaterals = pc.allreduce(numQuadrilaterals, PCL_RO_SUM);
412  sd_tri = pc.allreduce(sd_tri, PCL_RO_SUM);
413  mean_tri = pc.allreduce(mean_tri, PCL_RO_SUM);
414  sd_quad = pc.allreduce(sd_quad, PCL_RO_SUM);
415  mean_quad = pc.allreduce(mean_quad, PCL_RO_SUM);
416  }
417  #endif
418 
419 // Calculate and output standard deviation for triangular/quadrilateral angles
420  if(goc.num<Triangle>(i) > 0 || goc.num<Quadrilateral>(i) > 0)
421  {
422  if(goc.num<Triangle>(i) > 0)
423  {
424  sd_tri *= (1.0/(3*numTriangles));
425  sd_tri = sqrt(sd_tri);
426  mean_tri *= (1.0/(3*numTriangles));
427  }
428 
429  if(goc.num<Quadrilateral>(i) > 0)
430  {
431  sd_quad *= (1.0/(4*numQuadrilaterals));
432  sd_quad = sqrt(sd_quad);
433  mean_quad *= (1.0/(4*numQuadrilaterals));
434  }
435 
436  UG_LOG("(*) Standard deviation of face angles to regular case" << endl);
437  UG_LOG(" (60° for triangles, 90° for quadrilaterals)" << endl);
438  UG_LOG(endl);
439  UG_LOG(" Triangles (" << numTriangles << "):" << endl);
440  if(goc.num<Triangle>(i) > 0)
441  {
442  UG_LOG(" sd = " << sd_tri << endl);
443  UG_LOG(" mean = " << mean_tri << endl);
444  }
445  UG_LOG(endl);
446  UG_LOG(" Quadrilaterals (" << numQuadrilaterals << "):" << endl);
447  if(goc.num<Quadrilateral>(i) > 0)
448  {
449  UG_LOG(" sd = " << sd_quad << endl);
450  UG_LOG(" mean = " << mean_quad << endl);
451  }
452  UG_LOG(endl);
453  }
454 
455 // Calculate and output standard deviation for tetrahedral/hexahedral angles
456  if(goc.num<Tetrahedron>(i) > 0 || goc.num<Hexahedron>(i) > 0 || goc.num<Octahedron>(i) > 0)
457  {
458  vector<number> vDihedralsOut;
459 
460  for(VolumeIterator vIter = goc.begin<Volume>(i); vIter != goc.end<Volume>(i); ++vIter)
461  {
462  vDihedralsOut.clear();
463  Volume* vol = *vIter;
464 
465  #ifdef UG_PARALLEL
466  // ghosts (vertical masters) have to be ignored,
467  // since they have a copy on another process and
468  // since we already consider that copy...
469  if(dgm->is_ghost(vol))
470  continue;
471  #endif
472 
474  {
475  regVolDihedral = 70.52877937;
476  CalculateAngles(vDihedralsOut, grid, vol, aaPos);
477  numTetrahedrons++;
478 
479  for(size_t k = 0; k < vDihedralsOut.size(); ++k)
480  {
481  sd_tet += (regVolDihedral-vDihedralsOut[k])*(regVolDihedral-vDihedralsOut[k]);
482  mean_tet += vDihedralsOut[k];
483  }
484  }
485 
487  {
488  regVolDihedral = 90.0;
489  CalculateAngles(vDihedralsOut, grid, vol, aaPos);
490  numHexahedrons++;
491 
492  for(size_t k = 0; k < vDihedralsOut.size(); ++k)
493  {
494  sd_hex += (regVolDihedral-vDihedralsOut[k])*(regVolDihedral-vDihedralsOut[k]);
495  mean_hex += vDihedralsOut[k];
496  }
497  }
498 
500  {
501  regVolDihedral = 109.4712206;
502  CalculateAngles(vDihedralsOut, grid, vol, aaPos);
503  numOctahedrons++;
504 
505  for(size_t k = 0; k < vDihedralsOut.size(); ++k)
506  {
507  sd_oct += (regVolDihedral-vDihedralsOut[k])*(regVolDihedral-vDihedralsOut[k]);
508  mean_oct += vDihedralsOut[k];
509  }
510  }
511  }
512  }
513 
514  #ifdef UG_PARALLEL
515  if(pcl::NumProcs() > 1){
516  // sum the numbers of all involved processes. Since we ignored ghosts,
517  // each process contributes the numbers of a unique part of the grid.
519  numTetrahedrons = pc.allreduce(numTetrahedrons, PCL_RO_SUM);
520  numHexahedrons = pc.allreduce(numHexahedrons, PCL_RO_SUM);
521  numOctahedrons = pc.allreduce(numOctahedrons, PCL_RO_SUM);
522  sd_tet = pc.allreduce(sd_tet, PCL_RO_SUM);
523  mean_tet = pc.allreduce(mean_tet, PCL_RO_SUM);
524  sd_hex = pc.allreduce(sd_hex, PCL_RO_SUM);
525  mean_hex = pc.allreduce(mean_hex, PCL_RO_SUM);
526  sd_oct = pc.allreduce(sd_oct, PCL_RO_SUM);
527  mean_oct = pc.allreduce(mean_oct, PCL_RO_SUM);
528  }
529  #endif
530 
531 // Calculate and output standard deviation for tetrahedral/hexahedral angles
532  if(goc.num<Tetrahedron>(i) > 0 || goc.num<Hexahedron>(i) > 0 || goc.num<Octahedron>(i) > 0)
533  {
534  if(goc.num<Tetrahedron>(i) > 0)
535  {
536  sd_tet *= (1.0/(6*numTetrahedrons));
537  sd_tet = sqrt(sd_tet);
538  mean_tet *= (1.0/(6*numTetrahedrons));
539  }
540 
541  if(goc.num<Hexahedron>(i) > 0)
542  {
543  sd_hex *= (1.0/(12*numHexahedrons));
544  sd_hex = sqrt(sd_hex);
545  mean_hex *= (1.0/(12*numHexahedrons));
546  }
547 
548  if(goc.num<Octahedron>(i) > 0)
549  {
550  sd_oct *= (1.0/(12*numOctahedrons));
551  sd_oct = sqrt(sd_oct);
552  mean_oct *= (1.0/(12*numOctahedrons));
553  }
554 
555  UG_LOG("(*) Standard deviation of dihedral angles to regular case" << endl);
556  UG_LOG(" (70.5288° for tetrahedrons, 90° for hexahedrons, 109.471° for Octahedrons)" << endl);
557  UG_LOG(endl);
558  UG_LOG(" Tetrahedrons (" << numTetrahedrons << "):" << endl);
559  if(goc.num<Tetrahedron>(i) > 0)
560  {
561  UG_LOG(" sd = " << sd_tet << endl);
562  UG_LOG(" mean = " << mean_tet << endl);
563  }
564  UG_LOG(endl);
565  UG_LOG(" Hexahedrons (" << numHexahedrons << "):" << endl);
566  if(goc.num<Hexahedron>(i) > 0)
567  {
568  UG_LOG(" sd = " << sd_hex << endl);
569  UG_LOG(" mean = " << mean_hex << endl);
570  }
571  UG_LOG(endl);
572  UG_LOG(" Octahedrons (" << numOctahedrons << "):" << endl);
573  if(goc.num<Octahedron>(i) > 0)
574  {
575  UG_LOG(" sd = " << sd_oct << endl);
576  UG_LOG(" mean = " << mean_oct << endl);
577  }
578  UG_LOG(endl);
579  }
580 }
581 
582 
584 // PrintAngleHistograms
585 void PrintAngleHistogram(vector<number>& locAngles, number stepSize, ug::Table<std::stringstream>& outTable);
586 void PrintAspectRatioHistogram(vector<number>& locAspectRatios, number stepSize, ug::Table<std::stringstream>& outTable);
587 
588 
590 // PrintVertexVolumeValence
591 void PrintVertexVolumeValence(MultiGrid& mg, SubsetHandler& sh, int subsetIndex);
592 
593 
595 // AssignSubsetToElementWithSmallestMinAngle
596 void AssignSubsetToElementWithSmallestMinAngle(MultiGrid& grid, MGSubsetHandler& sh, int dim, const char* roid, int si);
597 void AssignSubsetToElementWithSmallestMinAngle2d(MultiGrid& grid, MGSubsetHandler& sh, const char* roid, int si);
598 void AssignSubsetToElementWithSmallestMinAngle3d(MultiGrid& grid, MGSubsetHandler& sh, const char* roid, int si);
599 
601 // MeasureTetrahedronWithSmallestMinAngle
603 
605 // FindBoundsForStiffnesMatrixMaxEigenvalue
607 
608 
610 // AssignSubsetsByElementQuality3d
611 void AssignSubsetsByElementQuality3d(MultiGrid& mg, MGSubsetHandler& sh, int numSecs);
612 
613 
615 // AssignSubsetsByElementQuality
616 void AssignSubsetsByElementQuality(MultiGrid& mg, MGSubsetHandler& sh, int dim, int numSecs);
617 
618 
620 // AssignSubsetsByElementQuality
621 void AssignSubsetsByElementQuality(Grid& grid, SubsetHandler& sh, int dim, int numSecs);
622 
623 
625 // ElementQualityStatistics
627 
628 // Wrapper
629 void ElementQualityStatistics(MultiGrid& mg, int dim, number angleHistStepSize, number aspectRatioHistStepSize, bool bWriteHistograms);
630 void ElementQualityStatistics(MultiGrid& mg, int dim);
631 void ElementQualityStatistics(Grid& grid, int dim, number angleHistStepSize, number aspectRatioHistStepSize, bool bWriteHistograms);
632 void ElementQualityStatistics(Grid& grid, int dim);
633 
634 // Actual procedures
635 void ElementQualityStatistics2d(Grid& grid, GridObjectCollection goc, number angleHistStepSize = 10.0, number aspectRatioHistStepSize = 0.1, bool bWriteHistograms = true);
636 void ElementQualityStatistics3d(Grid& grid, GridObjectCollection goc, number angleHistStepSize = 10.0, number aspectRatioHistStepSize = 0.1, bool bWriteHistograms = true);
637 
638 
639 }
640 #endif //__ELEMENT_QUALITY_STATISTICS_H__
641 
size_t allreduce(const size_t &t, pcl::ReduceOperation op) const
bool is_ghost(TElem *elem) const
bool contains_status(TGeomObj *o, byte status) const
virtual ReferenceObjectID reference_object_id() const
geometry_traits< TGeomObj >::iterator begin(size_t level=0)
geometry_traits< TGeomObj >::iterator end(size_t level=0)
virtual ReferenceObjectID reference_object_id() const
SmartPtr< TGrid > grid()
static const int dim
ES_H_SLAVE
#define PCL_RO_SUM
int NumProcs()
#define UG_LOG(msg)
#define UG_LOGN(msg)
double number
number CalculateAspectRatio(Grid &grid, Face *face, TAAPosVRT &aaPos)
void ElementQualityStatistics2d(Grid &grid, GridObjectCollection goc, number angleHistStepSize, number aspectRatioHistStepSize, bool bWriteHistograms)
Definition: element_quality_statistics.cpp:576
void CollectAspectRatios(Grid &grid, TIterator elementsBegin, TIterator elementsEnd, TAAPosVRT &aaPos, vector< number > &aspectRatios)
Definition: element_quality_statistics.h:136
ROID_TETRAHEDRON
ROID_QUADRILATERAL
ROID_OCTAHEDRON
ROID_HEXAHEDRON
ROID_TRIANGLE
ElementStorage< Face >::SectionContainer::iterator FaceIterator
void AssignSubsetsByElementQuality3d(MultiGrid &grid, MGSubsetHandler &sh, int numSecs)
Definition: element_quality_statistics.cpp:439
number CalculateMaxAngle(Grid &grid, Face *f, TAAPosVRT &aaPos)
number CalculateMinAngle(Grid &grid, Face *f, TAAPosVRT &aaPos)
GridSubsetHandler SubsetHandler
void AssignSubsetToElementWithSmallestMinAngle3d(MultiGrid &grid, MGSubsetHandler &sh, const char *roid, int si)
Definition: element_quality_statistics.cpp:163
void PrintAngleHistogram(vector< number > &locAngles, number stepSize, ug::Table< std::stringstream > &outTable)
Definition: element_quality_statistics.cpp:1244
void AssignSubsetToElementWithSmallestMinAngle2d(MultiGrid &grid, MGSubsetHandler &sh, const char *roid, int si)
Definition: element_quality_statistics.cpp:130
void FindBoundsForStiffnesMatrixMaxEigenvalue(MultiGrid &mg, MGSubsetHandler &shOut)
Definition: element_quality_statistics.cpp:291
void ElementQualityStatistics3d(Grid &grid, GridObjectCollection goc, number angleHistStepSize, number aspectRatioHistStepSize, bool bWriteHistograms)
Definition: element_quality_statistics.cpp:737
void CollectVolToRMSFaceAreaRatios(Grid &grid, TIterator elementsBegin, TIterator elementsEnd, TAAPosVRT &aaPos, vector< number > &ratios)
Definition: element_quality_statistics.h:172
void CollectMinAngles(Grid &grid, TIterator elementsBegin, TIterator elementsEnd, TAAPosVRT &aaPos, vector< number > &minAngles)
Definition: element_quality_statistics.h:64
MultiGridSubsetHandler MGSubsetHandler
void AssignSubsetToElementWithSmallestMinAngle(MultiGrid &grid, MGSubsetHandler &sh, int dim, const char *roid, int si)
Definition: element_quality_statistics.cpp:117
void PrintVertexVolumeValence(MultiGrid &mg, SubsetHandler &sh, int subsetIndex)
Definition: element_quality_statistics.cpp:47
void PrintAspectRatioHistogram(vector< number > &locAspectRatios, number stepSize, ug::Table< std::stringstream > &outTable)
Definition: element_quality_statistics.cpp:1370
void ElementQualityStatistics(MultiGrid &mg, int dim, number angleHistStepSize, number aspectRatioHistStepSize, bool bWriteHistograms)
Definition: element_quality_statistics.cpp:534
void PrintAngleStatistics3d(Grid &grid, GridObjectCollection &goc, int level, TAAPosVRT &aaPos)
Definition: element_quality_statistics.h:334
void AssignSubsetsByElementQuality(MultiGrid &mg, MGSubsetHandler &sh, int dim, int numSecs)
Definition: element_quality_statistics.cpp:508
void CollectMaxAngles(Grid &grid, TIterator elementsBegin, TIterator elementsEnd, TAAPosVRT &aaPos, vector< number > &maxAngles)
Definition: element_quality_statistics.h:100
void MeasureTetrahedronWithSmallestMinAngle(MultiGrid &grid)
Definition: element_quality_statistics.cpp:214
void CalculateAngles(vector< number > &vAnglesOut, Grid &grid, Face *f, TAAPosVRT &aaPos)
number CalculateVolToRMSFaceAreaRatio(Grid &grid, Face *face, TAAPosVRT &aaPos)
ElementStorage< Volume >::SectionContainer::iterator VolumeIterator
void PrintAngleStatistics2d(Grid &grid, GridObjectCollection &goc, int level, TAAPosVRT &aaPos)
Definition: element_quality_statistics.h:219