28#include "rheolef/branch.h"
29#include "rheolef/rheostream.h"
30#include "rheolef/iorheo.h"
37geo_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();
59 istream& is = ips.
is();
60 string basename = iorheo::getbasename(is);
61 omega.set_name(basename);
66 while (is >> ws >> mark) {
67 if (mark ==
"CELL_DATA" || mark ==
"POINT_DATA" || mark ==
"FIELD")
break;
69 if (!is.good())
break;
71 string name, dummy, approx, valued;
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
generic mesh with rerefence counting
idiststream: see the diststream page for the full documentation
#define error_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
idiststream & geo_get_vtk(idiststream &ips, geo_basic< T, sequential > &omega)
template void get_event_vtk< Float >(idiststream &, branch_basic< Float, sequential > &)
void get_event_vtk(idiststream &ips, branch_basic< T, sequential > &b)
template void get_header_vtk< Float >(idiststream &, branch_basic< Float, sequential > &)
void get_header_vtk(idiststream &ips, branch_basic< T, sequential > &b)