28 #include "rheolef/branch.h"
29 #include "rheolef/field_expr.h"
30 #include "rheolef/piola_util.h"
31 #include "rheolef/rheostream.h"
32 #include "rheolef/iorheo.h"
33 #include "rheolef/iofem.h"
34 #include "rheolef/interpolate.h"
35 #include "rheolef/render_option.h"
47 ostream& os =
out.os();
48 iorheo::setbranch_counter(os, 0);
49 b._u_range = std::make_pair( std::numeric_limits<T>::max(),
50 -std::numeric_limits<T>::max());
51 b._have_u_range = std::make_pair(
false,
false);
57 ostream& os =
out.os();
62 string mark = iorheo::getmark(os);
66 for (; idx <
b.n_field(); ++idx)
if (mark ==
b[idx].first)
break;
67 check_macro (idx <
b.n_field(),
"mark `" << mark <<
"' not found in branch");
70 b._u_range.first = std::min (
b._u_range.first, uh.
min());
71 b._u_range.second = std::max (
b._u_range.second, uh.
max());
75 size_t branch_counter = iorheo::getbranch_counter(os);
76 iorheo::setbranch_counter(os, branch_counter+1);
77 bool skipvtk = iorheo::getskipvtk(os);
79 bool clean = iorheo::getclean(os);
80 string basename = iorheo::getbasename(os);
84 string data_file_name =
tmp +
basename +
"-" + std::to_string(
b._count_value) +
".vtk";
85 ofstream
vtk (data_file_name.c_str());
87 bool verbose = iorheo::getverbose(clog);
88 verbose && clog <<
"! file `" << data_file_name <<
"' created" << endl;
108 if (
b.n_field() == 0) {
112 ostream& os =
out.os();
117 popt.
mark = iorheo::getmark(os);
119 if (popt.
mark ==
"") {
120 popt.
mark =
b[0].first;
122 for (; idx <
b.n_field(); ++idx)
if (popt.
mark ==
b[idx].first)
break;
123 check_macro (idx <
b.n_field(),
"mark `" << popt.
mark <<
"' not found in branch");
127 bool is_scalar = (valued ==
"scalar");
129 popt.
fill = iorheo::getfill(os);
130 popt.
elevation = iorheo::getelevation(os);
131 popt.
color = iorheo::getcolor(os);
132 popt.
gray = iorheo::getgray(os);
134 popt.
showlabel = iorheo::getshowlabel(os);
135 popt.
stereo = iorheo::getstereo(os);
136 popt.
volume = iorheo::getvolume(os);
138 popt.
cut = iorheo::getcut(os);
139 popt.
grid = iorheo::getgrid(os);
140 popt.
format = iorheo::getimage_format(os);
141 popt.
scale = iorheo::getvectorscale(os);
142 popt.
origin = iofem::getorigin(os);
143 popt.
normal = iofem::getnormal(os);
147 popt.
isovalue = iorheo::getisovalue(os);
148 popt.
label = iorheo::getlabel(os);
155 #if (_RHEOLEF_PARAVIEW_VERSION_MAJOR >= 5) && (_RHEOLEF_PARAVIEW_VERSION_MINOR >= 5)
165 popt.
f_min =
b._u_range.first;
166 popt.
f_max =
b._u_range.second;
170 bool verbose = iorheo::getverbose(os);
171 bool clean = iorheo::getclean(os);
172 bool execute = iorheo::getexecute(os);
173 bool skipvtk = iorheo::getskipvtk(os);
176 string clean_filelist;
177 string basename = iorheo::getbasename(os);
180 clean_filelist = clean_filelist +
" " + py_name;
181 ofstream py (py_name.c_str());
182 if (
verbose) clog <<
"! file \"" << py_name <<
"\" created.\n";
186 string i_vtk_name =
tmp +
basename +
"-" + std::to_string(i) +
".vtk";
187 string opt_coma = (i+1 != popt.
branch_size) ?
", " :
"";
188 py <<
"\"" << i_vtk_name +
"\"" + opt_coma;
189 if (!skipvtk) clean_filelist = clean_filelist +
" " + i_vtk_name;
193 <<
"paraview_branch_" << valued <<
"(paraview, \"" <<
tmp+
basename <<
"\", filelist, opt)" << endl
203 string prog = (popt.
format ==
"") ?
"paraview --script=" :
"pvbatch --use-offscreen-rendering ";
214 command =
"/bin/rm -f " + clean_filelist;
field::size_type size_type
const space_type & get_space() const
const geo_type & get_geo() const
typename float_traits< T >::type float_type
generic mesh with rerefence counting
odiststream: see the diststream page for the full documentation
typename float_traits< value_type >::type float_type
#define _RHEOLEF_PKGDATADIR
#define warning_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
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
This file is part of Rheolef.
void put_event_paraview(odiststream &out, const branch_basic< T, sequential > &b)
void put_event_vtk_stream(odiststream &out_vtk, const branch_basic< T, sequential > &b)
void put_header_paraview(odiststream &out, const branch_basic< T, sequential > &b)
std::string get_tmpdir()
get_tmpdir: see the rheostream page for the full documentation
std::string python(const point_basic< T > &x, size_t d=3)
void put_finalize_paraview(odiststream &out, const branch_basic< T, sequential > &b)
size_t n_isovalue_negative
point_basic< size_t > resolution