28 #include "rheolef/field.h"
29 #include "rheolef/piola_util.h"
30 #include "rheolef/rheostream.h"
31 #include "rheolef/iorheo.h"
32 #include "rheolef/field_evaluate.h"
33 #include "rheolef/space_component.h"
34 #include "rheolef/diststream.h"
35 #include "rheolef/interpolate.h"
52 ostream&
vtk = ods.
os();
54 vtk << setprecision(numeric_limits<T>::digits10);
56 std::string data_type = (degree == 0) ?
"CELL_DATA" :
"POINT_DATA";
57 vtk << data_type <<
" " << uh.
ndof() << endl;
59 vtk <<
"SCALARS " <<
name <<
" float" << endl
60 <<
"LOOKUP_TABLE default" << endl;
62 vtk << uh.
dof(idof) << endl;
72 ostream&
vtk = ods.
os();
79 vtk << setprecision(numeric_limits<T>::digits10)
80 <<
"VECTORS " <<
name <<
" float" << endl;
82 for (
size_type i_comp_dof = 0, n_comp_dof = uh.
ndof()/n_comp; i_comp_dof < n_comp_dof; i_comp_dof++) {
83 for (
size_type i_comp = 0; i_comp < n_comp; i_comp++) {
84 size_type idof = i_comp_dof*n_comp + i_comp;
86 if (i_comp != 2)
vtk <<
" ";
88 for (
size_type i_comp = n_comp; i_comp < 3; i_comp++) {
90 if (i_comp != 2)
vtk <<
" ";
102 ostream&
vtk = ods.
os();
107 vtk << setprecision(numeric_limits<T>::digits10)
108 <<
"TENSORS " <<
name <<
" float" << endl;
114 vtk << t00.
dof(idof) <<
" 0 0" << endl
126 for (
size_type i_comp_dof = 0, n_comp_dof = tau_h.
ndof()/n_comp; i_comp_dof < n_comp_dof; i_comp_dof++) {
127 size_type idof00 = i_comp_dof*n_comp + i_comp00;
128 size_type idof01 = i_comp_dof*n_comp + i_comp01;
129 size_type idof11 = i_comp_dof*n_comp + i_comp11;
130 vtk << tau_h.
dof(idof00) <<
" " << tau_h.
dof(idof01) <<
" 0" << endl
131 << tau_h.
dof(idof01) <<
" " << tau_h.
dof(idof11) <<
" 0" << endl
144 vtk << t00.
dof(idof) <<
" " << t01.
dof(idof) <<
" " << t02.
dof(idof) << endl
145 << t01.
dof(idof) <<
" " << t11.
dof(idof) <<
" " << t12.
dof(idof) << endl
146 << t02.
dof(idof) <<
" " << t12.
dof(idof) <<
" " << t22.
dof(idof) << endl;
164 if (subdivide == 0) {
169 geo_put_vtk (ods, vh.get_geo(), my_piola, vh.get_geo().get_nodes(),
false, vh.get_geo().map_dimension());
171 }
else if (
order <= degree && uh.
get_space().get_basis().family_name() ==
"P") {
175 geo_put_vtk (ods, vh.get_geo(), my_numb, vh.get_space().get_xdofs(),
false, vh.get_geo().map_dimension());
180 warning_macro (
"reinterpolate since not Pk[d] or order > degree");
182 std::string approx =
"P" +
itos(k);
183 if (uh.
get_space().get_basis().have_compact_support_inside_element()) approx +=
"d";
187 geo_put_vtk (ods, vh.get_geo(), vh.get_space().get_basis(), vh.get_space().get_xdofs(),
false, vh.get_geo().map_dimension());
199 geo_put_vtk (ods, vh.get_geo(), vh.get_space().get_basis(), vh.get_space().get_xdofs(),
false, vh.get_geo().map_dimension());
204 if (
name ==
"") {
name = vh.get_space().valued(); }
205 switch (vh.get_space().valued_tag()) {
209 default:
error_macro (
"put_vtk: do not known how to print " << vh.valued() <<
"-valued field");
225 template odiststream&
field_put_vtk<Float> (odiststream&,
const field_basic<Float,sequential>&, std::string,
bool);
226 template odiststream&
field_put_vtk<Float> (odiststream&,
const field_basic<Float,sequential>&);