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) {
171 }
else if (
order <= degree && uh.
get_space().get_basis().family_name() ==
"P") {
181 std::string approx =
"P" + std::to_string(k);
182 if (uh.
get_space().get_basis().have_compact_support_inside_element()) approx +=
"d";
184 warning_macro (
"reinterpolate \""<< approx <<
"\" since \"" << uh.
get_approx() <<
"\" is not Pk[d] or mesh order > degree");
209 default:
error_macro (
"put_vtk: do not known how to print " << vh.
valued() <<
"-valued field");
field::size_type size_type
valued_type valued_tag() const
std::string get_approx() const
const geo_type & get_geo() const
const space_type & get_space() const
const std::string & valued() const
void build_by_subdividing(const geo_basic< T, sequential > &omega, size_type k)
odiststream: see the diststream page for the full documentation
odiststream dout(cout)
see the diststream page for the full documentation
#define error_macro(message)
#define warning_macro(message)
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format vtk
size_type tensor_index(valued_type valued_tag, coordinate_type sys_coord, size_type i, size_type j)
size_type ndof(const basis_basic< T > &b, const geo_size &gs, size_type map_dim)
This file is part of Rheolef.
odiststream & geo_put_vtk(odiststream &ops, const geo_basic< T, sequential > &omega, const basis_basic< T > &my_numb, const disarray< point_basic< T >, sequential > &my_node, bool append_data, size_t subgeo_dim)
odiststream & put_vtk_tensor_values(odiststream &ods, const field_basic< T, sequential > &tau_h, std::string name, bool put_header)
odiststream & put_vtk_scalar_values(odiststream &ods, const field_basic< T, sequential > &uh, std::string name, bool put_header)
template odiststream & field_put_vtk< Float >(odiststream &, const field_basic< Float, sequential > &, std::string, bool)
odiststream & field_put_vtk(odiststream &, const field_basic< T, sequential > &, std::string, bool)
field_basic< T, M > interpolate(const space_basic< T, M > &V2h, const field_basic< T, M > &u1h)
see the interpolate page for the full documentation
void put_header(odiststream &out, const branch_basic< T, sequential > &b)
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
odiststream & put_vtk_vector_values(odiststream &ods, const field_basic< T, sequential > &uh, std::string name, bool put_header)