<h3>Specific improvements</h3>
<ol>
- <li> New: There is now a QSorted<dim> quadrature which takes an
+ <li> New: The GridIn::read_vtk() function places fewer restrictions
+ on the VTK files it wants to read and should, consequently, be able
+ to read more correctly formatted VTK files than before.
+ <br>
+ (Giorgos Kourakos, 2014/05/08)
+ </li>
+
+ <li> New: There is now a QSorted quadrature which takes an
arbitrary quadrature at construction time and reorders the quadrature
points according to the weigths, from smaller to bigger. This should
improve stability of higher order polynomial integration.
{
Assert((dim == 2)||(dim == 3), ExcNotImplemented());
std::string line;
- std::string text[4];
- text[0] = "# vtk DataFile Version 3.0";
- text[1] = "vtk output";
- text[2] = "ASCII";
- text[3] = "DATASET UNSTRUCTURED_GRID";
- for (unsigned int i = 0; i < 4; i++) //Checking for the match between initial strings/text in the file.
+ // verify that the first, third and fourth lines match
+ // expectations. the second line of the file may essentially be
+ // anything the author of the file chose to identify what's in
+ // there, so we just ensure that we can read it
+ {
+ std::string text[4];
+ text[0] = "# vtk DataFile Version 3.0";
+ text[1] = "****";
+ text[2] = "ASCII";
+ text[3] = "DATASET UNSTRUCTURED_GRID";
+
+ for (unsigned int i = 0; i < 4; ++i)
{
getline(in,line);
-
- AssertThrow (line.compare(text[i]) == 0,
- ExcMessage(std::string("While reading VTK file, failed to find <") +
- text[i] + ">"));
+ if (i != 1)
+ AssertThrow (line.compare(text[i]) == 0,
+ ExcMessage(std::string("While reading VTK file, failed to find a header line with text <") +
+ text[i] + ">"));
}
+ }
///////////////////Declaring storage and mappings//////////////////
for (unsigned int j = 0; j < type; j++) //loop to feed data
in >> cells.back().vertices[j];
+
cells.back().material_id = 0;
for (unsigned int j = 0; j < type; j++) //loop to feed the data of the vertices to the cell
for (unsigned int i = 0; i < 2; i++)
{
- getline(in,linenew);
-
- if (linenew.compare(textnew[i]) == 0)
- {}
- else
- AssertThrow (false,
- ExcMessage (std::string("While reading VTK file, failed to find <") +
- textnew[i] + "> section"));
+ getline(in, linenew);
+ if (i == 0)
+ if (linenew.size() > textnew[0].size())
+ linenew.resize(textnew[0].size());
+
+ AssertThrow (linenew.compare(textnew[i]) == 0,
+ ExcMessage (std::string("While reading VTK file, failed to find <") +
+ textnew[i] + "> section"));
}
for (unsigned int i = 0; i < no_cells; i++) //assigning IDs to cells.
}
}
}
- else
- AssertThrow (false,
- ExcMessage ("While reading VTK file, failed to find CELL_DATA section"));
-
Assert(subcelldata.check_consistency(dim), ExcInternalError());