46 std::cout << title << std::endl
47 << min.
x <<
' ' << min.
y <<
' '
48 << max.
x <<
' ' << max.
y << std::endl;
52 const std::string& suffix) {
53 std::cout <<
"filename" << std::endl
55 << std::setw(6) << std::setfill(
'0') <<
frame_id++
56 <<
'.' << suffix << std::endl;
60 std::cout <<
"draw" << std::endl;
64 std::cout <<
"view" << std::endl
65 << elev <<
' ' << azim << std::endl;
69 std::cout <<
"focus" << std::endl
70 << pos.
x <<
' ' << pos.
y << std::endl;
73 template<
typename Iter>
75 unsigned int nb_p = 0;
76 unsigned int nb_e = 0;
77 for(
auto it = begin; it != end; ++it)
84 std::cout <<
"protons" << std::endl;
85 for(
auto it = begin; it != end; ++it)
87 std::cout << (*it).pos.x <<
' ';
88 std::cout << std::endl;
89 for(
auto it = begin; it != end; ++it)
91 std::cout << (*it).pos.y <<
' ';
92 std::cout << std::endl;
96 std::cout <<
"electrons" << std::endl;
97 for(
auto it = begin; it != end; ++it)
99 std::cout << (*it).pos.x <<
' ';
100 std::cout << std::endl;
101 for(
auto it = begin; it != end; ++it)
103 std::cout << (*it).pos.y <<
' ';
104 std::cout << std::endl;
108 template<
typename PosIter,
typename ValIter>
110 const ValIter& vbegin,
const ValIter& vend,
111 double scale,
double max_norm) {
112 std::cout <<
"vector-field" << std::endl;
113 for(
auto it = pbegin; it != pend; ++it)
114 std::cout << (*it).x <<
' ';
115 std::cout << std::endl;
116 for(
auto it = pbegin; it != pend; ++it)
117 std::cout << (*it).y <<
' ';
118 std::cout << std::endl;
120 double n2 = max_norm*max_norm;
122 for(
auto it = vbegin; it != vend; ++it)
124 std::cout << scale*(*it).x <<
' ';
126 std::cout << 0 <<
' ';
127 std::cout << std::endl;
128 for(
auto it = vbegin; it != vend; ++it)
130 std::cout << scale*(*it).y <<
' ';
132 std::cout << 0 <<
' ';
133 std::cout << std::endl;
136 template<
typename PosIter,
typename ValIter>
138 const ValIter& vbegin,
const ValIter& vend,
139 double vmin,
double vmax,
unsigned int nb_contours) {
140 std::cout <<
"scalar-field" << std::endl;
141 std::cout << vmin <<
' ' << vmax <<
' ' << nb_contours << std::endl;
142 for(
auto it = pbegin; it != pend; ++it)
143 std::cout << (*it).x <<
' ';
144 std::cout << std::endl;
145 for(
auto it = pbegin; it != pend; ++it)
146 std::cout << (*it).y <<
' ';
147 std::cout << std::endl;
148 for(
auto it = vbegin; it != vend; ++it)
149 std::cout << *it <<
' ';
150 std::cout << std::endl;
154 std::cout <<
"end" << std::endl;
160 return Figure(title,min,max);
void end_frame()
Definition: elecPlot.hpp:59
Figure figure(const std::string &title, const elec::Point &min, const elec::Point &max)
Definition: elecPlot.hpp:158
void begin_frame(const std::string &prefix, const std::string &suffix)
Definition: elecPlot.hpp:51
Figure(const std::string &title, const elec::Point &min, const elec::Point &max)
Definition: elecPlot.hpp:43
void __plot_focus(const elec::Point &pos)
Definition: elecPlot.hpp:68
Definition: elecPoint.hpp:35
void __plot_particles(const Iter &begin, const Iter &end)
Definition: elecPlot.hpp:74
Definition: elecPlot.hpp:38
double y
Definition: elecPoint.hpp:37
~Figure()
Definition: elecPlot.hpp:153
unsigned int frame_id
Definition: elecPlot.hpp:41
void __plot_field(const PosIter &pbegin, const PosIter &pend, const ValIter &vbegin, const ValIter &vend, double scale, double max_norm)
Definition: elecPlot.hpp:109
void __plot_potential(const PosIter &pbegin, const PosIter &pend, const ValIter &vbegin, const ValIter &vend, double vmin, double vmax, unsigned int nb_contours)
Definition: elecPlot.hpp:137
double x
Definition: elecPoint.hpp:37
void set_view(double elev, double azim)
Definition: elecPlot.hpp:63