28 #include "rheolef/geo.h"
29 #include "rheolef/rheostream.h"
30 #include "rheolef/iorheo.h"
45 check_macro (ips.good(),
"bad input stream for vtk");
46 istream& is = ips.is();
63 node.get_values (ips);
64 check_macro (ips.good(),
"bad input stream for vtk");
70 xmin[k] = std::numeric_limits<T>::max();
71 xmax[k] = std::numeric_limits<T>::min();
73 for (
size_t i = 0,
n = node.size(); i <
n; ++i) {
75 xmin[k] = std::min (node[i][k], xmin[k]);
76 xmax[k] = std::max (node[i][k], xmax[k]);
95 if (mark ==
"VERTICES") {
103 if (mark ==
"POLYGONS" || mark ==
"LINES" || mark ==
"CELLS")
break;
104 }
while (is >> ws >> mark);
105 bool have_vtk_cell_type =
false;
106 string mesh_fmt = mark;
109 else if (mesh_fmt ==
"CELLS") { hdr.
map_dimension = 0; have_vtk_cell_type =
true; }
110 else error_macro (
"geo: unexpected `" << mesh_fmt <<
"' in vtk input."
111 <<
" Expect LINES, POLYGONS or CELLS.");
117 std::vector<size_type> cell_trash (ncs);
118 for (
size_type ics = 0; ics < ncs; ics++) {
119 is >> cell_trash [ics];
121 std::vector<size_type> vtk_cell_type (ne);
122 if (have_vtk_cell_type) {
124 check_macro (mark ==
"CELL_TYPES",
"geo: unexpected `" << mark <<
"' in vtk input."
125 <<
" Expect CELL_TYPES.");
128 check_macro (ne == ne2,
"geo: unexpected CELL_TYPES size=`" << ne2 <<
"' , expect size="<<ne);
130 is >> vtk_cell_type [ie];
136 for (
size_type ie = 0, ics = 0; ie < ne; ie++) {
143 for (
size_type iloc = 0 ; iloc < nloc; iloc++, ics++) {
144 elt[ie][iloc] = cell_trash [ics];
155 std::array<disarray_t, reference_element::max_variant> tmp_geo_element;
162 std::array<size_type, 4> counter;
167 tmp_geo_element [
variant] [ige] = elt[ie];
180 template idiststream&
geo_get_vtk<Float> (idiststream&, geo_basic<Float,sequential>&);