65 outputStream <<
"------------- Shape Quality Statistics -------------\n\n";
66 outputStream <<
"Cell Type" << std::setw(16) <<
"Num Cells" << std::setw(16)
67 <<
"Minimum" << std::setw(16) <<
"Maximum" << std::setw(16)
68 <<
"Average" << std::setw(16) <<
"Variance" << std::endl;
70 for (
int i = 0; i < 4; ++i) {
72 outputStream <<
"Tri" << std::setw(16);
74 outputStream <<
"Quad" << std::setw(15);
76 outputStream <<
"Tet" << std::setw(16);
78 outputStream <<
"Hex" << std::setw(16);
80 vtkSmartPointer<vtkDoubleArray> qualityField =
getStats(i);
81 double *val = qualityField->GetTuple(0);
83 outputStream << std::right << val[4] << std::setw(16) << std::right
84 << val[0] << std::setw(16) << std::right << val[2]
85 << std::setw(16) << std::right << val[1] << std::setw(16)
86 << std::right << val[3] << std::endl;
89 outputStream <<
"\n------------- Detailed Statistics ------------------\n" 92 vtkSmartPointer<vtkDoubleArray> qualityArray = vtkDoubleArray::SafeDownCast(
93 qualityFilter->GetOutput()->GetCellData()->GetArray(
"Quality"));
100 outputStream <<
"Type" << std::setw(10) <<
"Quality\n" << std::endl;
103 double val = qualityArray->GetValue(i);
106 outputStream <<
"TRI\t" << std::right << setw(10) << val <<
"\n";
110 outputStream <<
"TET\t" << std::right << setw(10) << val <<
"\n";
114 outputStream <<
"QUAD\t" << std::right << setw(10) << val <<
"\n";
117 case VTK_HEXAHEDRON: {
118 outputStream <<
"HEX\t" << std::right << setw(10) << val <<
"\n";
123 <<
"Invalid cell type. Only tri, quad, tet, and hex supported." std::string trim_fname(const std::string &name, const std::string &ext)
vtkSmartPointer< vtkDataSet > getDataSet() const
get this meshes' dataSet
const std::string & getFileName() const
get the current file name
virtual void write() const
write the mesh to file named after the private var 'filename'.
vtkSmartPointer< vtkDoubleArray > getStats(int n)
vtkSmartPointer< vtkMeshQuality > qualityFilter
nemId_t getNumberOfCells() const
return the number of cells