21#include "rheolef/branch.h"
28template <
class T,
class M>
31 if (_p_data_out) delete_macro (_p_data_out);
37template <
class T,
class M>
41 if (_header_in_done)
return;
42 _header_in_done =
true;
47 in >> version >> sz >> nval >> _parameter_name;
48 _n_value = ((nval == -1) ? numeric_limits<size_type>::max() : nval);
51 in >> base::operator[](i).first;
54template <
class T,
class M>
58 get_header_rheolef (in);
59 if (!in || !
dis_scatch(in,
"#"+parameter_name())) {
71 in >>
catchmark (base::operator[](i).first) >> base::operator[](i).second;
86 else if (format [
iorheo::rheo]) { b.get_header_rheolef(in); }
87 else {
error_macro (
"unsupported input format="<<format); }
95 else if (format [
iorheo::rheo]) { b.get_event_rheolef(in); }
96 else {
error_macro (
"unsupported input format="<<format); }
98#ifdef _RHEOLEF_HAVE_MPI
103 b.get_header_rheolef (in);
109 b.get_event_rheolef (in);
112template <
class T,
class M>
122template <
class T,
class M>
127 if (_n_value != numeric_limits<size_type>::max()) nval = _n_value;
128 out <<
"#!branch" << endl
131 <<
"1 " << base::size() <<
" " << nval << endl
134 for (
size_type i = 0; i < base::size(); i++) {
135 out <<
" " << base::operator[](i).first;
147 else if (format [
iorheo::rheo]) {
b.put_header_rheolef(out); }
148 else {
error_macro (
"unsupported output/render format="<<format); }
150#ifdef _RHEOLEF_HAVE_MPI
155 b.put_header_rheolef (out);
158template <
class T,
class M>
162 if (_header_out_done)
return;
163 _header_out_done =
true;
166template <
class T,
class M>
171 << setprecision(numeric_limits<T>::digits10)
172 <<
"#" << _parameter_name <<
" " << _parameter_value << endl
176 out <<
catchmark (base::operator[](i).first) << base::operator[](i).second;
190 else { b.put_event_rheolef(out); }
192#ifdef _RHEOLEF_HAVE_MPI
198 b.put_event_rheolef (out);
201template <
class T,
class M>
208template <
class T,
class M>
217 if (b._finalize_out_done)
return;
218 b._finalize_out_done =
true;
224 else { b.put_finalize_rheolef(out); }
226#ifdef _RHEOLEF_HAVE_MPI
233template <
class T,
class M>
242#define rheolef_instanciate(T,M) \
243 template class branch_basic<T,M>; \
244 template void get_header (idiststream&, branch_basic<T,M>&); \
245 template void get_event (idiststream&, branch_basic<T,M>&); \
246 template odiststream& operator<< (odiststream&, const branch_basic<T,M>&); \
247 template idiststream& operator>> (idiststream&, branch_basic<T,M>&);
250#ifdef _RHEOLEF_HAVE_MPI
253#undef rheolef_instanciate
see the Float page for the full documentation
void put_header_rheolef(odiststream &) const
void put_finalize_rheolef(odiststream &) const
void get_header_rheolef(idiststream &)
base::size_type size_type
friend void put_finalize(odiststream &, const branch_basic< T1, sequential > &)
void get_event_rheolef(idiststream &)
friend void put_header(odiststream &, const branch_basic< T1, sequential > &)
void put_event_rheolef(odiststream &) const
see the catchmark page for the full documentation
idiststream: see the diststream page for the full documentation
std::bitset< last > flag_type
static flag_type format_field
odiststream: see the diststream page for the full documentation
#define error_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
#define rheolef_instanciate(T, M)
This file is part of Rheolef.
void put_header_paraview(odiststream &out, const branch_basic< T, sequential > &b)
void put_header_vtk(odiststream &out, const branch_basic< T, sequential > &b)
void put_event(odiststream &out, const branch_basic< T, sequential > &b)
void put_finalize_paraview(odiststream &out, const branch_basic< T, sequential > &b)
void put_finalize(odiststream &out, const branch_basic< T, sequential > &b)
void get_event(idiststream &in, branch_basic< T, sequential > &b)
std::ostream & operator<<(std::ostream &os, const catchmark &m)
void put_event_gnuplot(odiststream &ops, const branch_basic< T, sequential > &b)
void put_finalize_vtk(odiststream &out, const branch_basic< T, sequential > &b)
void get_header(idiststream &in, branch_basic< T, sequential > &b)
bool dis_scatch(idiststream &ips, const communicator &comm, std::string ch)
distributed version of scatch(istream&,string)
void put_header_gnuplot(odiststream &ops, const branch_basic< T, sequential > &b)
void get_event_vtk(idiststream &ips, branch_basic< T, sequential > &b)
void put_event_vtk(odiststream &out, const branch_basic< T, sequential > &b)
void put_event_paraview(odiststream &out, const branch_basic< T, sequential > &b)
std::istream & operator>>(std::istream &is, const catchmark &m)
void put_finalize_gnuplot(odiststream &ops, const branch_basic< T, sequential > &b)
void put_header(odiststream &out, const branch_basic< T, sequential > &b)
void get_header_vtk(idiststream &ips, branch_basic< T, sequential > &b)