rheolef  7.0
branch_seq_visu_vtk_paraview.cc
Go to the documentation of this file.
1 #include "rheolef/branch.h"
2 #include "rheolef/iofem.h"
3 #include "rheolef/iorheo.h"
4 #include "rheolef/rheostream.h"
5 namespace rheolef {
6 using namespace std;
7 
8 template <class T> odiststream& field_put_vtk (odiststream&, const field_basic<T,sequential>&, std::string, bool);
9 
10 template<class T>
11 void
13 {
14 }
15 template<class T>
16 void
18 {
19  ostream& out = ods.os();
20  string basename = iorheo::getbasename(out);
21  if (basename == "") basename = "output";
22  string data_file_name = basename + "-" + itos(b._count_value) + ".vtk";
23  ofstream vtk (data_file_name.c_str());
24  odiststream ods_vtk (vtk);
25  bool verbose = iorheo::getverbose(clog);
26  verbose && clog << "! file `" << data_file_name << "' created" << endl;
27  vtk << setbasename(basename)
28  << setprecision(numeric_limits<T>::digits10);
29 
30  check_macro (b.n_field() > 0, "empty branch (n_field = 0)");
31  const field_basic<T,sequential>& u0 = b[0].second;
32  string approx = u0.get_approx();
33  bool put_geo = true;
34  for (size_t i = 0; i < b.n_field(); i++) {
35  const string& name = b[i].first;
36  const field_basic<T,sequential>& ui = b[i].second;
37  check_macro (ui.get_approx() == approx,
38  "field #"<<i<<" name '"<<name<<": approx `"<<ui.get_approx()<<"' incompatible with field #0 approx `"<<approx<<"'");
39  field_put_vtk (ods_vtk, ui, name, put_geo);
40  put_geo = false;
41  }
42  vtk.close();
43 }
44 template<class T>
45 void
47 {
48 }
52 
53 } // namespace rheolef
field - piecewise polynomial finite element field
idiststream, odiststream - distributed interface for large data streams
Definition: diststream.h:68
std::string get_approx() const
Definition: field.h:286
void put_finalize_paraview(odiststream &out, const branch_basic< T, sequential > &b)
STL namespace.
irheostream, orheostream - large data streams
Definition: compiler.h:7
branch - a parameter-dependent sequence of field
Definition: branch.h:46
void put_header_paraview(odiststream &out, const branch_basic< T, sequential > &)
#define check_macro(ok_condition, message)
Definition: compiler.h:104
void put_event_paraview(odiststream &ods, const branch_basic< T, sequential > &b)
odiststream & field_put_vtk(odiststream &, const field_basic< T, sequential > &, std::string, bool)
size_type n_field() const
Definition: branch.h:330
size_type _count_value
Definition: branch.h:160
std::string itos(std::string::size_type i)
std::ostream & os()
Definition: diststream.h:166
verbose clean transpose logscale grid shrink ball stereo iso volume velocity elevation bezieradapt label color color format format format format format format format format format format format format format format format format vtk