28 #include "rheolef/branch.h"
29 #include "rheolef/rheostream.h"
30 #include "rheolef/iorheo.h"
37 geo_get_vtk (idiststream& ips, geo_basic<T,sequential>& omega);
44 if (
b._header_in_done)
return;
45 b._header_in_done =
true;
46 b._parameter_name =
"t";
47 b._n_value = std::numeric_limits<size_type>::max();
58 check_macro (ips.good(),
"bad input stream for vtk");
59 istream& is = ips.is();
60 string basename = iorheo::getbasename(is);
66 while (is >> ws >> mark) {
67 if (mark ==
"CELL_DATA" || mark ==
"POINT_DATA" || mark ==
"FIELD")
break;
69 if (!is.good())
break;
72 if (mark ==
"POINT_DATA" || mark ==
"CELL_DATA") {
74 while (is >> ws >>
dummy) {
if (
dummy ==
"SCALARS")
break; }
76 while (is >> ws >>
dummy) {
if (
dummy ==
"LOOKUP_TABLE")
break; }
80 approx = (mark ==
"CELL_DATA") ?
"P0" :
"P1";
84 for (
size_type idof = 0; idof <
ndof && is.good(); ++idof) { is >> uh.
dof (idof); }
85 check_macro (is.good(),
"bad input stream for vtk");
86 b.push_back (std::make_pair(
name, uh));
87 }
else if (mark ==
"FIELD") {
91 for (
size_type i_field = 0; i_field < n_field && is.good(); ++i_field) {
94 if (
name ==
"METADATA") {
99 is >> n_comp >> n_comp_dof
102 case 1: valued =
"scalar";
break;
103 case 3: valued =
"vector";
break;
104 case 9: valued =
"tensor";
break;
105 default: error_macro (
"branch: unexpected " << n_comp <<
"-component valued field");
107 ndof = n_comp*n_comp_dof;
113 for (
size_type idof = 0; idof <
ndof && is.good(); ++idof) { is >> uh.
dof (idof); }
114 check_macro (is.good(),
"bad input stream for vtk");
115 b.push_back (std::make_pair(
name, uh));
118 error_macro (
"branch: unexpected `" << mark <<
"' in vtk input."
119 <<
" Expect POINT_DATA, or FIELD");
field::size_type size_type
void set_name(std::string name)
generic mesh with rerefence counting
static iorheo::force_initialization dummy
size_type ndof(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
This file is part of Rheolef.
template void get_header_vtk< Float >(idiststream &, branch_basic< Float, sequential > &)
template void get_event_vtk< Float >(idiststream &, branch_basic< Float, sequential > &)
void get_event_vtk(idiststream &ips, branch_basic< T, sequential > &b)
idiststream & geo_get_vtk(idiststream &ips, geo_basic< T, sequential > &omega)
void get_header_vtk(idiststream &ips, branch_basic< T, sequential > &b)