28#include "rheolef/geo.h"
29#include "rheolef/piola_util.h"
30#include "rheolef/rheostream.h"
31#include "rheolef/iorheo.h"
32#include "rheolef/iofem.h"
48 std::ostringstream os;
50 for (
size_t i = 1; i <
d; i++)
52 os <<
"]" << std::flush;
53 string buffer = os.str();
69 ostream& os = ops.
os();
70 bool verbose = iorheo::getverbose(os);
71 bool clean = iorheo::getclean(os);
72 bool execute = iorheo::getexecute(os);
73 bool fill = iorheo::getfill(os);
74 bool elevation = iorheo::getelevation(os);
75 bool color = iorheo::getcolor(os);
76 bool gray = iorheo::getgray(os);
77 bool black_and_white = iorheo::getblack_and_white(os);
78 bool stereo = iorheo::getstereo(os);
79 bool full = iorheo::getfull(os);
81 bool cut = iorheo::getcut(os);
82 bool volume = iorheo::getvolume(os);
83 bool grid = iorheo::getgrid(os);
84 bool lattice = iorheo::getlattice(os);
85 bool shrink = iorheo::getshrink(os);
86 bool showlabel = iorheo::getshowlabel(os);
87 bool tube = iorheo::gettube(os);
88 bool ball = iorheo::getball(os);
89 string format = iorheo::getimage_format(os);
90 if (format ==
"tiff") format =
"tif";
91 if (format ==
"jpeg") format =
"jpg";
92 string basename = iorheo::getbasename(os);
96 string outfile_fmt =
"";
108#if (_RHEOLEF_PARAVIEW_VERSION_MAJOR >= 5) && (_RHEOLEF_PARAVIEW_VERSION_MINOR >= 5)
110 bool high_order = omega.
order() > 1 && !cut && !shrink;
112 bool high_order =
false;
119 filelist = filelist +
" " + filename;
120 ofstream vtk_os (filename.c_str());
122 if (
verbose) clog <<
"! file \"" << filename <<
"\" created.\n";
132 filelist = filelist +
" " + filename;
133 ofstream vtk_os_dom (filename.c_str());
135 if (
verbose) clog <<
"! file \"" << filename <<
"\" created.\n";
146 std::string py_name = filename =
tmp+
basename +
".py";
147 filelist = filelist +
" " + filename;
148 ofstream py (filename.c_str());
149 if (
verbose) clog <<
"! file \"" << filename <<
"\" created.\n";
150 py <<
"#!/usr/bin/env paraview --script=" << endl
151 <<
"# This is a paraview script for the visualization of " <<
basename <<
".vtk" << endl
152 <<
"# automatically generated by rheolef." << endl
156 py <<
"from paraview.simple import *" << endl
157 <<
"from paraview_rheolef import * # load rheolef specific functions" << endl
163 py <<
", '" << dom.
name() <<
"'";
167 bool has_origin = (origin[0] != numeric_limits<Float>::max());
168 bool view_2d = (omega.
xmax()[2] - omega.
xmin()[2] == 0);
171 py <<
"opt = { \\" << endl
172 <<
" 'format' : '" << format <<
"', \\" << endl
173 <<
" 'resolution' : [" << resolution[0] <<
"," << resolution[1] <<
"], \\" << endl
174 <<
" 'showlabel': " << showlabel <<
"," << endl
175 <<
" 'axis' : 1," << endl
176 <<
" 'view_1d' : 0," << endl
177 <<
" 'view_2d' : " << view_2d <<
"," << endl
178 <<
" 'color' : '" << (color ?
"color" : (
gray ?
"gray" :
"black_and_white")) <<
"'," << endl
179 <<
" 'stereo' : " << stereo <<
", \\" << endl
180 <<
" 'bbox' : [[" << xmin[0] <<
"," << xmin[1] <<
"," << xmin[2] <<
"],["
181 << xmax[0] <<
"," << xmax[1] <<
"," << xmax[2] <<
"]], \\" << endl
182 <<
" 'ball' : " << ball <<
", \\" << endl
183 <<
" 'cut' : " << cut <<
", \\" << endl
184 <<
" 'fill' : " << fill <<
", \\" << endl
185 <<
" 'full' : " << full <<
", \\" << endl
186 <<
" 'lattice' : " << lattice <<
", \\" << endl
187 <<
" 'shrink' : " << shrink <<
", \\" << endl
188 <<
" 'tube' : " << tube <<
", \\" << endl
189 <<
" 'volume' : " << 0 <<
", \\" << endl
190 <<
" 'has_origin' : " << has_origin <<
", \\" << endl
191 <<
" 'origin' : " <<
python(origin) <<
", \\" << endl
193 <<
" 'elevation' : 0, \\" << endl
194 <<
" 'high_order' : "<< high_order <<
" \\" << endl
198 py <<
"paraview_geo(paraview, opt, d)" << endl
207 string prog = (format ==
"") ?
"paraview --script=" :
"pvbatch --use-offscreen-rendering ";
218 command =
"/bin/rm -f " + filelist;
field::size_type size_type
see the point page for the full documentation
size_type size(size_type iproc) const
const disarray< node_type, sequential > & get_nodes() const
geo_basic< T, sequential > get_domain(size_type i) const
size_type map_dimension() const
const node_type & xmin() const
const basis_basic< T > & get_piola_basis() const
size_type n_domain() const
size_type dimension() const
const node_type & xmax() const
const geo_size & sizes() const
generic mesh with rerefence counting
odiststream: see the diststream page for the full documentation
#define _RHEOLEF_PKGDATADIR
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
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin gray
This file is part of Rheolef.
template odiststream & visu_vtk_paraview< Float >(odiststream &, const geo_basic< Float, sequential > &)
odiststream & visu_vtk_paraview(odiststream &, const field_basic< T, sequential > &)
geo_basic< T, M > compact(const geo_basic< T, M > &gamma)
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)
std::string get_tmpdir()
get_tmpdir: see the rheostream page for the full documentation
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
std::string python(const point_basic< T > &x, size_t d=3)
distributor ownership_by_dimension[4]