MADNESS 0.10.1
funcplot.h
Go to the documentation of this file.
1/*
2 This file is part of MADNESS.
3
4 Copyright (C) 2007,2010 Oak Ridge National Laboratory
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20 For more information please contact:
21
22 Robert J. Harrison
23 Oak Ridge National Laboratory
24 One Bethel Valley Road
25 P.O. Box 2008, MS-6367
26
27 email: harrisonrj@ornl.gov
28 tel: 865-241-3937
29 fax: 865-572-0680
30*/
31
32#ifndef MADNESS_MRA_FUNCPLOT_H__INCLUDED
33#define MADNESS_MRA_FUNCPLOT_H__INCLUDED
34
35#include <madness/constants.h>
37/*!
38
39 \file mra/funcplot.h
40 \brief Defines/implements plotting interface for functions
41 \ingroup funcplot
42
43 @{
44 */
45
46namespace madness {
47
49 PlotParameters(World& world, const commandlineparser parser=commandlineparser(), const std::string tag="plot") : PlotParameters() {
50 read_input_and_commandline_options(world,parser,tag);
51 }
52
54
55 // initialize with: key, value, comment (optional), allowed values (optional)
56 initialize<double>("zoom",2,"zoom into the simulation cell");
57 initialize<long>("npoints",151,"number of plot points per dimension");
58 initialize<std::vector<double>>("origin",{},"origin of the plot");
59 initialize<std::vector<std::string>>("plane",{"x1","x2"},"plot plane: x1, x2, .., x6");
60 }
61 std::string get_tag() const override {
62 return std::string("plot");
63 }
64
65
66 PlotParameters& set_zoom(const double z) {
67 set_user_defined_value("zoom",z);
68 return *this;
69 }
70 PlotParameters& set_npoints(const long n) {
71 set_user_defined_value("npoints",n);
72 return *this;
73 }
74 PlotParameters& set_plane(const std::vector<std::string> plane) {
76 return *this;
77 }
78 PlotParameters& set_origin(const std::vector<double> origin) {
80 return *this;
81 }
82
83
84 double zoom() const {return get<double>("zoom");}
85 long npoints() const {return get<long>("npoints");}
86
87 template<std::size_t NDIM>
89 auto origin_vec=get<std::vector<double>>("origin");
90 // fill in zeros if the default origin has fewer dimensions than the actual origin
91 int missing=NDIM-origin_vec.size();
92 for (auto i=0; i<missing; ++i) origin_vec.push_back(0.0);
93 Vector<double,NDIM> o(origin_vec);
94 return o;
95 }
96
97 std::vector<std::string> plane() const {return get<std::vector<std::string>>("plane");}
98
99
100 };
101 /// Writes an OpenDX format file with a cube/slice of points on a uniform grid
102
103 /// Collective operation but only process 0 writes the file. By convention OpenDX
104 /// files end in ".dx" but this choice is up to the user. The binary format is
105 /// more compact and vastly faster to both write and load but is not as portable.
106 ///
107 /// Now follow some brief tips about how to look at files inside OpenDX.
108 ///
109 /// To view a 1D function \c file-selector-->import-->plot-->image.
110 ///
111 /// To view a 2D function as a colored plane \c file-selector-->import-->autocolor-->image.
112 ///
113 /// To view a 2D function as a 3D surface \c file-selector-->import-->rubbersheet-->image.
114 ///
115 /// To view a 3D function as an isosurface \c file-selector-->import-->isosurface-->image.
116 ///
117 /// To select the real/imaginary/absolute value of a complex number insert a compute
118 /// element after the import.
119 template <typename T, std::size_t NDIM>
120 void plotdx(const Function<T,NDIM>& f,
121 const char* filename,
122 const Tensor<double>& cell = FunctionDefaults<NDIM>::get_cell(),
123 const std::vector<long>& npt = std::vector<long>(NDIM,201L),
124 bool binary=true);
125
126
127 /// Writes the header information of a VTK file for plotting in an external
128 /// post-processing package (such as Paraview)
129 //
130 /// @param world World communicator
131 /// @param filename String containing the filename to export to
132 /// @param plotlo Vector of double values indicating the minimum coordinate to plot to in each dimension
133 /// @param plothi Vector of double values indicating the maximum coordinate to plot to in each dimension
134 /// @param npt Vector of long integers indicating the number of points to plot in each dimension
135 /// @param binary (optional) Boolean indicating whether to print in binary
136
137 /// The VTK routines are also designed for SERIAL data, parallel coming...
138 ///
139 /// This header is templated by the dimension of the data.
140 ///
141 /// To plot with the plotvtk_* routines:
142 /// plotvtk_begin(...)
143 /// plotvtk_data(...)
144 /// plotvtk_data(...) ...
145 /// plotvtk_end(...)
146 ///
147 /// NOTE: Paraview expects the structured mesh points in a particular
148 /// order, which is why the LowDimIndexIterator is used...
149 template<std::size_t NDIM>
150 void plotvtk_begin(World &world, const char *filename,
151 const Vector<double, NDIM> &plotlo, const Vector<double, NDIM> &plothi,
152 const Vector<long, NDIM> &npt, bool binary = false) {
153
155 MADNESS_ASSERT(NDIM>=1 && NDIM<=3); // how do we plot data in more than 3-D?
156
157 Tensor<double> cell(NDIM, 2);
158 std::size_t i;
159 for(i = 0; i < NDIM; ++i) {
160 cell(i, 0) = plotlo[i];
161 cell(i, 1) = plothi[i];
162 }
163
164 FILE *f=0;
165 if(world.rank() == 0) {
166 f = fopen(filename, "w");
167 if(!f)
168 MADNESS_EXCEPTION("plotvtk: failed to open the plot file", 0);
169
170 fprintf(f, "<VTKFile type=\"StructuredGrid\" version=\"0.1\"" \
171 " byte_order=\"LittleEndian\" compressor=\"" \
172 "vtkZLibDataCompressor\">\n");
173 fprintf(f, " <StructuredGrid WholeExtent=\"");
174 for(i = 0; i < NDIM; ++i)
175 fprintf(f, "0 %ld ", npt[i]-1);
176 for(; i < 3; ++i)
177 fprintf(f, "0 0 ");
178 fprintf(f, "\">\n");
179 fprintf(f, " <Piece Extent=\"");
180 for(i = 0; i < NDIM; ++i)
181 fprintf(f, "0 %ld ", npt[i]-1);
182 for(; i < 3; ++i)
183 fprintf(f, "0 0 ");
184 fprintf(f, "\">\n");
185 fprintf(f, " <Points>\n");
186 fprintf(f, " <DataArray NumberOfComponents=\"3\" " \
187 "type=\"Float32\" format=\"ascii\">\n");
188
190 for(i = 0; i < NDIM; ++i) {
191 if(npt[i] == 1)
192 space[i] = 0.0;
193 else
194 space[i] = (cell(i, 1) - cell(i, 0)) / (npt[i] - 1);
195 }
196
197 // go through the grid
198 for(LowDimIndexIterator it(npt); it; ++it) {
199 for(i = 0; i < NDIM; ++i)
200 fprintf(f, "%f ", plotlo[i] + it[i]*space[i]);
201 for(; i < 3; ++i)
202 fprintf(f, "0.0 ");
203 fprintf(f, "\n");
204 }
205
206 fprintf(f, " </DataArray>\n");
207 fprintf(f, " </Points>\n");
208 fprintf(f, " <PointData>\n");
209 fclose(f);
210 }
211 world.gop.fence();
212 }
213
214 /// Generic VTK data writer. Specific type instances of this function are defined for
215 /// both real and complex valued functions.
216 //
217 /// @param function Function (real or complex) that we wish to export the data of
218 /// @param fieldname A string containing the name we wish to refer to this field as in the exported data
219 /// @param world World communicator
220 /// @param filename String containing the filename to export to
221 /// @param plotlo Vector of double values indicating the minimum coordinate to plot to in each dimension
222 /// @param plothi Vector of double values indicating the maximum coordinate to plot to in each dimension
223 /// @param npt Vector of long integers indicating the number of points to plot in each dimension
224 /// @param binary (optional) Boolean indicating whether to print in binary
225
226 /// This templated function won't do anything except print a warning
227 /// message. Specialized versions of this function should be used.
228 template<typename T, std::size_t NDIM>
229 void plotvtk_data(const T &function, const char *fieldname, World &world,
230 const char *filename, const Vector<double, NDIM> &plotlo,
231 const Vector<double, NDIM> &plothi, const Vector<long, NDIM> &npt,
232 bool binary = false) {
233
234 MADNESS_EXCEPTION("plotvtk only supports madness::functions", 0);
235 }
236
237 /// VTK data writer for real-valued (not complex) madness::functions.
238
239 /// Set plot_refine=true to get a plot of the refinement levels of
240 /// the given function.
241 template<typename T, std::size_t NDIM>
242 void plotvtk_data(const Function<T, NDIM> &function, const char *fieldname,
243 World &world, const char *filename, const Vector<double, NDIM> &plotlo,
244 const Vector<double, NDIM> &plothi, const Vector<long, NDIM> &npt,
245 bool binary = false, bool plot_refine = false) {
246
248 MADNESS_ASSERT(NDIM>=1 && NDIM<=3); // no plotting high-D functions, yet...
249
250 Tensor<double> cell(NDIM, 2);
251 std::size_t i;
252 for(i = 0; i < NDIM; ++i) {
253 cell(i, 0) = plotlo[i];
254 cell(i, 1) = plothi[i];
255 }
256 std::vector<long> numpt(NDIM);
257 for(i = 0; i < NDIM; ++i)
258 numpt[i] = npt[i];
259
260 world.gop.barrier();
261
262 function.verify();
263 FILE *f = 0;
264 if(world.rank() == 0) {
265 f = fopen(filename, "a");
266 if(!f)
267 MADNESS_EXCEPTION("plotvtk: failed to open the plot file", 0);
268
269 fprintf(f, " <DataArray Name=\"%s\" format=\"ascii\" " \
270 "type=\"Float32\" NumberOfComponents=\"1\">\n", fieldname);
271 }
272
273 world.gop.fence();
274 Tensor<T> tmpr = function.eval_cube(cell, numpt, plot_refine);
275 world.gop.fence();
276
277 if(world.rank() == 0) {
278 for(LowDimIndexIterator it(numpt); it; ++it) {
279 fprintf(f, "%.6e\n", tmpr(*it));
280 }
281 fprintf(f, " </DataArray>\n");
282 fclose(f);
283 }
284 world.gop.fence();
285 }
286
287 /// VTK data writer for complex-valued madness::functions.
288
289 /// The complex-value is written as two reals (a vector from VTK's
290 /// perspective. The first (X) component is the real part and the second
291 /// (Y) component is the imaginary part.
292 /// Set plot_refine=true to get a plot of the refinement levels of
293 /// the given function.
294 template<typename T, std::size_t NDIM>
295 void plotvtk_data(const Function<std::complex<T>, NDIM> &function,
296 const char *fieldname, World &world, const char *filename,
297 const Vector<double, NDIM> &plotlo, const Vector<double, NDIM> &plothi,
298 const Vector<long, NDIM> &npt, bool binary = false,
299 bool plot_refine = false) {
300
301 // this is the same as plotvtk_data for real functions, except the
302 // real and imaginary parts are printed on the same line (needed
303 // to change NumberOfComponents in the XML tag)
304
306 MADNESS_ASSERT(NDIM>=1 && NDIM<=3); // no plotting high-D functions, yet...
307
308 Tensor<double> cell(NDIM, 2);
309 std::size_t i;
310 for(i = 0; i < NDIM; ++i) {
311 cell(i, 0) = plotlo[i];
312 cell(i, 1) = plothi[i];
313 }
314 std::vector<long> numpt(NDIM);
315 for(i = 0; i < NDIM; ++i)
316 numpt[i] = npt[i];
317
318 world.gop.barrier();
319
320 function.verify();
321 FILE *f = 0;
322 if(world.rank() == 0) {
323 f = fopen(filename, "a");
324 if(!f)
325 MADNESS_EXCEPTION("plotvtk: failed to open the plot file", 0);
326
327 fprintf(f, " <DataArray Name=\"%s\" format=\"ascii\" " \
328 "type=\"Float32\" NumberOfComponents=\"2\">\n", fieldname);
329 }
330
331 world.gop.fence();
332 Tensor<std::complex<T> > tmpr = function.eval_cube(cell, numpt,
333 plot_refine);
334 world.gop.fence();
335
336 if(world.rank() == 0) {
337 for(LowDimIndexIterator it(numpt); it; ++it) {
338 fprintf(f, "%.6e %.6e\n", real(tmpr(*it)), imag(tmpr(*it)));
339 }
340 fprintf(f, " </DataArray>\n");
341 fclose(f);
342 }
343 world.gop.fence();
344 }
345
346 /// Writes the footer information of a VTK file for plotting in an external
347 /// post-processing package (such as Paraview)
348 //
349 /// @param world World communicator
350 /// @param filename Name of VTK file
351 /// @param binary (Optional) Boolean indicating whether to print in binary
352 template<std::size_t NDIM>
353 void plotvtk_end(World &world, const char *filename, bool binary = false) {
355 MADNESS_ASSERT(NDIM>=1 && NDIM<=3);
356
357 FILE *f = 0;
358 if(world.rank() == 0) {
359 f = fopen(filename, "a");
360 if(!f)
361 MADNESS_EXCEPTION("plotvtk: failed to open the plot file", 0);
362
363 fprintf(f, " </PointData>\n");
364 fprintf(f, " <CellData>\n");
365 fprintf(f, " </CellData>\n");
366 fprintf(f, " </Piece>\n");
367 fprintf(f, " </StructuredGrid>\n");
368 fprintf(f, "</VTKFile>\n");
369 fclose(f);
370 }
371 world.gop.fence();
372 }
373
374 namespace detail {
375 inline unsigned short htons_x(unsigned short a) {
376 return (a>>8) | (a<<8);
377 }
378 }
379
380 /// Writes a Povray DF3 format file with a cube of points on a uniform grid
381
382 /// Collective operation but only process 0 writes the file. By convention Povray
383 /// files end in ".df3" but this choice is up to the user. The dynamic range of
384 /// function values is mapped onto [0,1] and values stored in 16-bit fixed precision.
385 template <typename T>
387 const char* filename,
389 const std::vector<long>& npt = std::vector<long>(3,201L))
390 {
391 using detail::htons_x;
392
393 MADNESS_ASSERT(npt.size() == 3);
394 unsigned short dims[3] = {htons_x(npt[0]),htons_x(npt[1]),htons_x(npt[2])};
395
396 World& world = const_cast< Function<T,3>& >(function).world();
397 FILE *f=0;
398 if (world.rank() == 0) {
399 f = fopen(filename, "w");
400 if (!f) MADNESS_EXCEPTION("plotdx: failed to open the plot file", 0);
401 fwrite((void*) dims, sizeof(short), 3, f);
402 }
403 Tensor<T> r = function.eval_cube(cell, npt);
404 if (world.rank() == 0) {
405 double rmax = r.max();
406 double rmin = r.min();
407 double rrange = rmax + rmin;
408 double rmean = rrange*0.5;
409 double fac = 65535.0/rrange;
410
411 printf("plot_povray: %s: min=%.2e(0.0) mean=%.2e(0.5) max=%.2e(1.0) range=%.2e\n",
412 filename,rmin,rmean,rmax,rrange);
413
414 std::vector<unsigned short> d(npt[0]);
415 for (unsigned int i2=0; i2<npt[2]; ++i2) {
416 for (unsigned int i1=0; i1<npt[1]; ++i1) {
417 for (unsigned int i0=0; i0<npt[0]; ++i0) {
418 d[i0] = (unsigned short)(htons_x((unsigned short)(fac*(r(i0,i1,i2) - rmin))));
419 //printf("%d\n",htons_x(d[i0]));
420 }
421 fwrite((void*) &d[0], sizeof(short), npt[0], f);
422 }
423 }
424
425 fclose(f);
426 }
427 }
428
429 static inline void plot_line_print_value(FILE* f, double_complex v) {
430 fprintf(f, " %.14e %.14e ", real(v), imag(v));
431 }
432
433 static inline void plot_line_print_value(FILE* f, double v) {
434 fprintf(f, " %.14e", v);
435 }
436
437
438 /// Generates ASCII file tabulating f(r) at npoints along line r=lo,...,hi
439
440 /// The ordinate is distance from lo
441 template <typename opT, std::size_t NDIM>
442 void plot_line(World& world, const char* filename, int npt, const Vector<double,NDIM>& lo,
443 const Vector<double,NDIM>& hi, const opT& op) {
445 coordT h = (hi - lo)*(1.0/(npt-1));
446
447 double sum = 0.0;
448 for (std::size_t i=0; i<NDIM; ++i) sum += h[i]*h[i];
449 sum = sqrt(sum);
450
451 if (world.rank() == 0) {
452 FILE* file = fopen(filename,"w");
453 if(!file)
454 MADNESS_EXCEPTION("plot_line: failed to open the plot file", 0);
455 for (int i=0; i<npt; ++i) {
456 coordT r = lo + h*double(i);
457 fprintf(file, "%.14e ", i*sum);
458 plot_line_print_value(file, op(r));
459 fprintf(file,"\n");
460 }
461 fclose(file);
462 }
463 world.gop.fence();
464 }
465
466
467 /// Generates ASCII file tabulating f(r) at npoints along line r=lo,...,hi
468
469 /// The ordinate is distance from lo
470 template <typename T, std::size_t NDIM>
471 void plot_line(const char* filename, int npt, const Vector<double,NDIM>& lo, const Vector<double,NDIM>& hi,
472 const Function<T,NDIM>& f) {
474 coordT h = (hi - lo)*(1.0/(npt-1));
475
476 double sum = 0.0;
477 for (std::size_t i=0; i<NDIM; ++i) sum += h[i]*h[i];
478 sum = sqrt(sum);
479
480 World& world = f.world();
481 f.reconstruct();
482 if (world.rank() == 0) {
483 FILE* file = fopen(filename,"w");
484 if(!file)
485 MADNESS_EXCEPTION("plot_line: failed to open the plot file", 0);
486 for (int i=0; i<npt; ++i) {
487 coordT r = lo + h*double(i);
488 fprintf(file, "%.14e ", i*sum);
489 plot_line_print_value(file, f.eval(r));
490 fprintf(file,"\n");
491 }
492 fclose(file);
493 }
494 world.gop.fence();
495 }
496
497 /// Generates ASCII file tabulating f(r) and g(r) at npoints along line r=lo,...,hi
498
499 /// The ordinate is distance from lo
500 template <typename T, typename U, std::size_t NDIM>
501 void plot_line(const char* filename, int npt, const Vector<double,NDIM>& lo, const Vector<double,NDIM>& hi,
502 const Function<T,NDIM>& f, const Function<U,NDIM>& g) {
504 coordT h = (hi - lo)*(1.0/(npt-1));
505
506 double sum = 0.0;
507 for (std::size_t i=0; i<NDIM; ++i) sum += h[i]*h[i];
508 sum = sqrt(sum);
509
510 World& world = f.world();
511 f.reconstruct();
512 g.reconstruct();
513 if (world.rank() == 0) {
514 FILE* file = fopen(filename,"w");
515 if(!file)
516 MADNESS_EXCEPTION("plot_line: failed to open the plot file", 0);
517 for (int i=0; i<npt; ++i) {
518 coordT r = lo + h*double(i);
519 fprintf(file, "%.14e ", i*sum);
520 plot_line_print_value(file, f.eval(r));
521 plot_line_print_value(file, g.eval(r));
522 fprintf(file,"\n");
523 }
524 fclose(file);
525 }
526 world.gop.fence();
527 }
528
529
530 /// Generates ASCII file tabulating f(r), g(r), and a(r) at npoints along line r=lo,...,hi
531
532 /// The ordinate is distance from lo
533 template <typename T, typename U, typename V, std::size_t NDIM>
534 void plot_line(const char* filename, int npt, const Vector<double,NDIM>& lo, const Vector<double,NDIM>& hi,
535 const Function<T,NDIM>& f, const Function<U,NDIM>& g, const Function<V,NDIM>& a) {
537 coordT h = (hi - lo)*(1.0/(npt-1));
538
539 double sum = 0.0;
540 for (std::size_t i=0; i<NDIM; ++i) sum += h[i]*h[i];
541 sum = sqrt(sum);
542
543 World& world = f.world();
544 f.reconstruct();
545 g.reconstruct();
546 a.reconstruct();
547 if (world.rank() == 0) {
548 FILE* file = fopen(filename,"w");
549 if(!file)
550 MADNESS_EXCEPTION("plot_line: failed to open the plot file", 0);
551 for (int i=0; i<npt; ++i) {
552 coordT r = lo + h*double(i);
553 fprintf(file, "%.14e ", i*sum);
554 plot_line_print_value(file, f.eval(r));
555 plot_line_print_value(file, g.eval(r));
556 plot_line_print_value(file, a.eval(r));
557 fprintf(file,"\n");
558 }
559 fclose(file);
560 }
561 world.gop.fence();
562 }
563
564 /// Generates ASCII file tabulating f(r), g(r), a(r), b(r) at npoints along line r=lo,...,hi
565
566 /// The ordinate is distance from lo
567 template <typename T, typename U, typename V, typename W, std::size_t NDIM>
568 void plot_line(const char* filename, int npt, const Vector<double,NDIM>& lo, const Vector<double,NDIM>& hi,
569 const Function<T,NDIM>& f, const Function<U,NDIM>& g, const Function<V,NDIM>& a, const Function<W,NDIM>& b) {
571 coordT h = (hi - lo)*(1.0/(npt-1));
572
573 double sum = 0.0;
574 for (std::size_t i=0; i<NDIM; ++i) sum += h[i]*h[i];
575 sum = sqrt(sum);
576
577 World& world = f.world();
578 f.reconstruct();
579 g.reconstruct();
580 a.reconstruct();
581 b.reconstruct();
582 if (world.rank() == 0) {
583 FILE* file = fopen(filename,"w");
584 for (int i=0; i<npt; ++i) {
585 coordT r = lo + h*double(i);
586 fprintf(file, "%.14e ", i*sum);
587 plot_line_print_value(file, f.eval(r));
588 plot_line_print_value(file, g.eval(r));
589 plot_line_print_value(file, a.eval(r));
590 plot_line_print_value(file, b.eval(r));
591 fprintf(file,"\n");
592 }
593 fclose(file);
594 }
595 world.gop.fence();
596 }
597 /// The ordinate is distance from lo
598 template <typename T, std::size_t NDIM>
599 void plot_line(const char* filename, int npt, const Vector<double,NDIM>& lo, const Vector<double,NDIM>& hi,
600 const std::vector<Function<T,NDIM>>& vf) {
602 coordT h = (hi - lo)*(1.0/(npt-1));
603 double sum = 0.0;
604 for (std::size_t i=0; i<NDIM; ++i) sum += h[i]*h[i];
605 sum = sqrt(sum);
606 World& world = vf[0].world();// get world from first function
607 // reconstruct each function in vf
608 std::for_each(vf.begin(), vf.end(), [](const Function<T,NDIM>& f){f.reconstruct();});
609 if (world.rank() == 0) {
610 FILE* file = fopen(filename,"w");
611 if(!file)
612 MADNESS_EXCEPTION("plot_line: failed to open the plot file", 0);
613 for (int i=0; i<npt; ++i) {
614 coordT r = lo + h*double(i);
615 fprintf(file, "%.14e ", i*sum);
616 std::for_each(vf.begin(), vf.end(), [&](const Function<T,NDIM>& f){ plot_line_print_value(file, f.eval(r));});
617 fprintf(file,"\n");
618 }
619 fclose(file);
620 }
621 world.gop.fence();
622 }
623
624 template<size_t NDIM>
626 const std::string name) {
627 typedef std::vector<Function<double,NDIM> > vecfuncT;
629 }
630
631 template<size_t NDIM>
632 void plot_plane(World& world, const Function<double,NDIM>& function1,
633 const Function<double,NDIM>& function2,
634 const std::string name) {
635 typedef std::vector<Function<double,NDIM> > vecfuncT;
636 vecfuncT vf(2);
637 vf[0]=function1;
638 vf[1]=function2;
639 plot_plane(world,vf,name);
640 }
641
642 template<size_t NDIM>
643 void plot_plane(World& world, const Function<double,NDIM>& function1,
644 const Function<double,NDIM>& function2,const Function<double,NDIM>& function3,
645 const std::string name) {
646 typedef std::vector<Function<double,NDIM> > vecfuncT;
647 vecfuncT vf(3);
648 vf[0]=function1;
649 vf[1]=function2;
650 vf[2]=function3;
651 plot_plane(world,vf,name);
652 }
653
654
655 /// plot a 2-d slice of a given function and the according MRA structure
656 /// FIXME: doesn't work for more than 1 rank
657
658 /// the plotting parameters are taken from the input file "input" and its
659 /// data group "plot", e.g. plotting the xy plane around (0,0,0.7):
660 /// plot
661 /// plane x1 x2
662 /// zoom 2.0
663 /// npoints 100
664 /// origin 0.0 0.0 0.7
665 /// end
666 /// @param[in] world the world
667 /// @param[in] vfunction the function to plot
668 /// @param[in] name the output name
669 template<size_t NDIM>
670 void plot_plane(World& world, const std::vector<Function<double,NDIM> >& vfunction,
671 const std::string name, const std::string inputfile="input") {
672
673 if (world.size()>1) return;
674 // determine the ploting plane
675 std::string c1="x1", c2="x2";
676
677 // zoom factor
678 double zoom=1.0;
679
680 // output type: mathematica or gnuplot
681 std::string output_type="gnuplot";
682
683 // number of points in each direction
684 int npoints=200;
685
686 // the coordinates to be plotted
687 Vector<double,NDIM> coord(0.0);
688 Vector<double,NDIM> origin(0.0);
689
690 try {
691 std::ifstream f(inputfile);
692 position_stream_to_word(f, "plot",'#',true,true);
693 std::string s;
694 while (f >> s) {
695 if (s == "end") {
696 break;
697 } else if (s == "plane") {
698 f >> c1 >> c2;
699 } else if (s == "zoom") {
700 f >> zoom;
701 } else if (s == "output") {
702 f >> output_type;
703 } else if (s == "points") {
704 f >> npoints;
705 } else if (s == "origin") {
706 for (std::size_t i=0; i<NDIM; ++i) f >> origin[i];
707 }
708 }
709 } catch (...) {
710 print("can't locate plot in file="+inputfile+" -- using default values");
711 }
712 double scale=1.0/zoom;
713 coord=origin;
714
715 // convert human to mad form
716 size_t cc1=0, cc2=1;
717 if (c1=="x1") cc1=0;
718 if (c1=="x2") cc1=1;
719 if (c1=="x3") cc1=2;
720 if (c1=="x4") cc1=3;
721 if (c1=="x5") cc1=4;
722 if (c1=="x6") cc1=5;
723 if (c2=="x1") cc2=0;
724 if (c2=="x2") cc2=1;
725 if (c2=="x3") cc2=2;
726 if (c2=="x4") cc2=3;
727 if (c2=="x5") cc2=4;
728 if (c2=="x6") cc2=5;
729
730 MADNESS_ASSERT(cc1<NDIM);
731 MADNESS_ASSERT(cc2<NDIM);
732 // output file name for the gnuplot data
733 std::string filename="plane_"+c1+c2+"_"+name;
734 // assume a cubic cell
736 lo=lo*scale;
737
738 const double stepsize=FunctionDefaults<NDIM>::get_cell_width()[0]*scale/npoints;
739
740 if(world.rank() == 0) {
741
742 // plot 3d plot
743 FILE *f = 0;
744 f=fopen(filename.c_str(), "w");
745 if(!f) MADNESS_EXCEPTION("plot_along: failed to open the plot file", 0);
746
747 for (int i0=0; i0<npoints; i0++) {
748 for (int i1=0; i1<npoints; i1++) {
749 // plot plane
750 coord[cc1]=lo+origin[cc1]+i0*stepsize;
751 coord[cc2]=lo+origin[cc2]+i1*stepsize;
752
753 // other electron
754// fprintf(f,"%12.6f %12.6f %12.20f\n",coord[cc1],coord[cc2],
755// function(coord));
756 fprintf(f,"%12.6f %12.6f",coord[cc1],coord[cc2]);
757 for (std::size_t ivec=0; ivec<vfunction.size(); ++ivec)
758 fprintf(f," %12.20f",vfunction[ivec](coord));
759 fprintf(f,"\n");
760
761 }
762 // additional blank line between blocks for gnuplot
763 if (output_type=="gnuplot") fprintf(f,"\n");
764 }
765 fclose(f);
766
767 }
768
769// // plot mra structure
770// filename="mra_structure_"+c1+c2+"_"+name;
771// function.get_impl()->print_plane(filename.c_str(),cc1,cc2,coord);
772 }
773
774
775/// plot a 2-d slice of a given function and the according MRA structure
776
777/// the plotting parameters are taken from the input file "input" and its
778/// data group "plot", e.g. plotting the xy plane around (0,0,0.7):
779/// plot
780/// plane x1 x2
781/// zoom 2.0
782/// npoints 100
783/// origin 0.0 0.0 0.7
784/// end
785/// @param[in] world the world
786/// @param[in] vfunction the function to plot
787/// @param[in] name the output name
788template<size_t NDIM>
789void plot_plane(World& world, const std::vector<Function<double,NDIM> >& vfunction,
790 const std::string name, const PlotParameters param) {
791
792 if (world.size()>1) return;
793
794 auto plane=param.plane();
795 std::string c1=plane[0];
796 std::string c2=plane[1];
797 auto npoints=param.npoints();
798 auto origin=param.origin<NDIM>();
799 auto coord=param.origin<NDIM>();
800 double scale=1.0/param.zoom();
801 std::string output_type="gnuplot";
802
803 auto plane2dim = [](std::string c) {
804 if (c=="x1") return 0;
805 else if (c=="x2") return 1;
806 else if (c=="x3") return 2;
807 else if (c=="x4") return 3;
808 else if (c=="x5") return 4;
809 else if (c=="x6") return 5;
810 else return -1;
811 };
812
813 // convert human to mad form
814 std::size_t cc1=plane2dim(c1);
815 std::size_t cc2=plane2dim(c2);
816
817 MADNESS_ASSERT(cc1<NDIM);
818 MADNESS_ASSERT(cc2<NDIM);
819
820 // output file name for the gnuplot data
821 std::string filename="plane_"+c1+c2+"_"+name;
822 // assume a cubic cell
824 lo=lo*scale;
825
826 const double stepsize=FunctionDefaults<NDIM>::get_cell_width()[0]*scale/npoints;
827
828 if(world.rank() == 0) {
829
830 // plot 3d plot
831 FILE *f = 0;
832 f=fopen(filename.c_str(), "w");
833 if(!f) MADNESS_EXCEPTION("plot_along: failed to open the plot file", 0);
834
835 for (int i0=0; i0<npoints; i0++) {
836 for (int i1=0; i1<npoints; i1++) {
837 // plot plane
838 coord[cc1]=lo+origin[cc1]+i0*stepsize;
839 coord[cc2]=lo+origin[cc2]+i1*stepsize;
840
841 fprintf(f,"%12.6f %12.6f",coord[cc1],coord[cc2]);
842 for (std::size_t ivec=0; ivec<vfunction.size(); ++ivec)
843 fprintf(f," %12.20f",vfunction[ivec](coord));
844 fprintf(f,"\n");
845
846 }
847 // additional blank line between blocks for gnuplot
848 if (output_type=="gnuplot") fprintf(f,"\n");
849 }
850 fclose(f);
851
852 }
853}
854
855
856 template<size_t NDIM, typename opT>
857 void plot_plane(World& world, const opT& op, const std::string name, const PlotParameters param) {
858
859 if (world.size()>1) return;
860
861 auto plane=param.plane();
862 std::string c1=plane[0];
863 std::string c2=plane[1];
864 auto npoints=param.npoints();
865 auto origin=param. template origin<NDIM>();
866 auto coord=param. template origin<NDIM>();
867 double scale=1.0/param.zoom();
868 std::string output_type="gnuplot";
869
870 auto plane2dim = [](std::string c) {
871 if (c=="x1") return 0;
872 else if (c=="x2") return 1;
873 else if (c=="x3") return 2;
874 else if (c=="x4") return 3;
875 else if (c=="x5") return 4;
876 else if (c=="x6") return 5;
877 else return -1;
878 };
879
880 // convert human to mad form
881 std::size_t cc1=plane2dim(c1);
882 std::size_t cc2=plane2dim(c2);
883
884 MADNESS_ASSERT(cc1<NDIM);
885 MADNESS_ASSERT(cc2<NDIM);
886
887 // output file name for the gnuplot data
888 std::string filename="plane_"+c1+c2+"_"+name;
889 // assume a cubic cell
891 lo=lo*scale;
892
893 const double stepsize=FunctionDefaults<NDIM>::get_cell_width()[0]*scale/npoints;
894
895 if(world.rank() == 0) {
896
897 // plot 3d plot
898 FILE *f = 0;
899 f=fopen(filename.c_str(), "w");
900 if(!f) MADNESS_EXCEPTION("plot_along: failed to open the plot file", 0);
901
902 for (int i0=0; i0<npoints; i0++) {
903 for (int i1=0; i1<npoints; i1++) {
904 // plot plane
905 coord[cc1]=lo+origin[cc1]+i0*stepsize;
906 coord[cc2]=lo+origin[cc2]+i1*stepsize;
907
908 // other electron
909 // fprintf(f,"%12.6f %12.6f %12.20f\n",coord[cc1],coord[cc2],
910 // function(coord));
911 fprintf(f,"%12.6f %12.6f",coord[cc1],coord[cc2]);
912 fprintf(f," %12.20f\n",op(coord));
913
914 }
915 // additional blank line between blocks for gnuplot
916 if (output_type=="gnuplot") fprintf(f,"\n");
917 }
918 fclose(f);
919
920 }
921 }
922
923
924
925 template<size_t NDIM>
926 typename std::enable_if<NDIM==3,void>::type
928 std::vector<std::string> molecular_info=std::vector<std::string>(), int npoints=100, double zoom=1.0,
929 const Vector<double,NDIM> origin=Vector<double,NDIM>(0.0)) {
930
931 if (world.size()>1) return;
932
933 // dummy atom in the center
934 if (molecular_info.size()==0)
935 molecular_info=std::vector<std::string>(1,"0 0 0.0 0.0 0.0\n");
936
937 // the coordinates to be plotted
938 // Vector<double,NDIM> origin(0.0);
939
940 // number of points in each direction
941 std::vector<int> npt(3,npoints);
942
944 cell.scale(1.0/zoom);
945 double xlen=cell(0,1)-cell(0,0);
946 double ylen=cell(1,1)-cell(1,0);
947 double zlen=cell(2,1)-cell(2,0);
948
949 // plot file
950 FILE *file = 0;
951 file=fopen(filename.c_str(), "w");
952 if(!file) MADNESS_EXCEPTION("plot_along: failed to open the plot file", 0);
953
954
955 // print header
956 fprintf(file,"cube file from MADNESS\n");
957 fprintf(file,"comment line\n");
958
959 // print the number of atoms if a calculation was provided
960 fprintf(file,"%d %12.8f %12.8f %12.8f \n",int(molecular_info.size()),
961 cell(0,0),cell(1,0),cell(2,0));
962
963 // grid spacing for each dimension such that the cell edges are plotted
964 const auto xdelta = xlen/(npt[0]-1);
965 const auto ydelta = ylen/(npt[1]-1);
966 const auto zdelta = zlen/(npt[2]-1);
967
968 // print the cell constants
969 fprintf(file,"%d %12.6f %12.6f %12.6f\n",npt[0],xdelta,0.0,0.0);
970 fprintf(file,"%d %12.6f %12.6f %12.6f\n",npt[1],0.0,ydelta,0.0);
971 fprintf(file,"%d %12.6f %12.6f %12.6f\n",npt[2],0.0,0.0,zdelta);
972
973 // print the molecule
974 for (const std::string& s : molecular_info) fprintf(file,"%s",s.c_str());
975
976
977 Tensor<double> grid(npt[0], npt[1], npt[2]);
978 long count_per_line = 0;
979 for (int i = 0; i < npt[0]; ++i) {
980 for (int j = 0; j < npt[1]; ++j) {
981 for (int k = 0; k < npt[2]; ++k) {
982 double x = cell(0, 0) + origin[0] + xdelta * i;
983 double y = cell(1, 0) + origin[1] + ydelta * j;
984 double z = cell(2, 0) + origin[2] + zdelta * k;
985 // the original format has up to 6 entries per line: https://paulbourke.net/dataformats/cube/
986 // stick with this, even though many codes can read an arbitrary number of entries per line
987 if (count_per_line < 6) {
988 fprintf(file, "%12.5e ", f(x, y, z));
989 count_per_line++;
990 } else {
991 fprintf(file, "%12.5e\n", f(x, y, z));
992 count_per_line = 0;
993 }
994 }
995 }
996 }
997 fprintf(file, "\n");
998 fclose(file);
999 }
1000
1001 template<typename T, size_t NDIM>
1002 void
1003 print_tree_jsonfile(World& world, const Function<T,NDIM>& f, std::string filename) {
1004
1005 if (world.size() > 1)
1006 return;
1007
1009 std::ofstream os(filename.c_str());
1010
1011 os << "{";
1012 os << "\"cell\":[";
1013 for (int xyz = 0; xyz != NDIM; ++xyz) {
1014 os << "[" << cell(xyz, 0) << "," << cell(xyz, 1) << "]";
1015 if (xyz != NDIM-1)
1016 os << ",";
1017 }
1018 os << "],";
1019
1020 os << "\"tree\":{";
1021 f.print_tree_json(os);
1022 os << "}}";
1023 }
1024
1025 /// convenience to get plot_plane and plot_cubefile
1026 template<size_t NDIM>
1027 void plot(const std::vector<Function<double,NDIM> >& vf, const std::string& name, const std::vector<std::string>& header){
1028 if(vf.empty()) return;
1029 World& world=vf.front().world();
1030 for(size_t i=0;i<vf.size();++i){
1031 const std::string namei=name+"_"+std::to_string(i);
1032// vf[i].print_size("plot:"+namei);
1033 plot_plane<NDIM>(world,vf[i],namei);
1034// plot_cubefile<NDIM>(world,vf[i],namei+".cube",header);
1035 }
1036 }
1037
1038 template<typename T>
1039 static std::string stringify(T arg) {
1040 std::ostringstream o;
1041 if (!(o << arg))
1042 MADNESS_EXCEPTION("stringify<T> failed",1);
1043 return o.str();
1044 }
1045
1046
1049
1050 // plot along this trajectory
1051 template<size_t NDIM>
1052 struct trajectory {
1053
1055
1056 double lo;
1057 double hi;
1058 double radius;
1059 long npt;
1060 coordT start, end;
1062 coordT (*curve)(const coordT& lo, const coordT& hi, double radius, coord_3d el2, long npt, long ipt);
1063
1064 /// some tools for plotting MRA ranks of low order tensors
1065
1066 // return a hue number [0,0.7] according to the rank in relation to maxrank,
1067 static double hueCode(const int rank) {
1068 const double maxrank=40.0;
1069 double hue=0.7-(0.7/maxrank)*(rank);
1070 return std::max(0.0,hue);
1071 }
1072
1073
1074 // print a dot of hue color at (x,y) in file f
1075 static void print_psdot(FILE *f, double x, double y, double color) {
1076 fprintf(f,"\\newhsbcolor{mycolor}{%8.4f 1.0 0.7}\n",color);
1077 fprintf(f,"\\psdot[linecolor=mycolor](%12.8f,%12.8f)\n",x,y);
1078 }
1079
1080
1081 static coord_3d circle2(double lo, double hi, double radius, coord_3d el2, long npt, long ipt) {
1082 double stepsize=constants::pi * 2.0 / npt;
1083 double phi=ipt*stepsize;
1084
1085 // in the xz plane
1086 coord_3d coord(0.0);
1087 coord[0]=radius * sin(phi);
1088 coord[1]=radius * cos(phi);
1089 return coord;
1090
1091 }
1092
1093 static coord_6d circle_6d(const coord_6d& lo, const coord_6d& hi, double radius, coord_3d el2, long npt, long ipt) {
1094 double stepsize=constants::pi * 2.0 / npt;
1095
1096 // start at phi=1.0
1097 double phi=1.0+constants::pi+ipt*stepsize;
1098
1099 // in the xz plane
1100 coord_6d coord(0.0);
1101 coord[0]=radius * sin(phi);
1102 coord[1]=radius * cos(phi);
1103 coord[2]=0.0;
1104 coord[3]=el2[0];
1105 coord[4]=el2[1];
1106 coord[5]=el2[2];
1107
1108 return coord;
1109
1110 }
1111
1112
1113 // typedef Vector<double,NDIM> (trajectory::circle_6d)(double lo, double hi, double radius, long npt, long ipt) const;
1114
1116// // ctor for a straight line thru the origin
1117// trajectory(double lo, double hi, long npt) : lo(lo), hi(hi), npt(npt), curve(line) {
1118// }
1119
1120 // ctor for circle
1121 trajectory(double radius, long npt) : radius(radius), npt(npt), curve(this->circle2) {
1122 }
1123
1124 // ctor for circle with electron 2 fixed at coord_3d
1125 trajectory(double radius, coord_3d el2, long npt) : radius(radius), npt(npt), el2(el2), curve(this->circle_6d) {
1126 }
1127
1128
1129 static Vector<double, NDIM> line_internal(const coordT& lo, const coordT& hi, double radius, coord_3d el2, long npt, long ipt) {
1130 const coordT step=(hi-lo)*(1.0/npt);
1131 coordT coord=lo+step*ipt;
1132 return coord;
1133 }
1134
1135
1136 /// constructor for a line
1137// static trajectory line(const Vector<double,NDIM>& lo, const Vector<double,NDIM>& hi, const long npt) {
1138 static trajectory line2(const coordT start, const coordT end, const long npt) {
1139 trajectory<NDIM> traj;
1140 traj.start=start;
1141 traj.end=end;
1142 traj.npt=npt;
1144 return traj;
1145 }
1146
1147 /// EZ ctor for a line a direction xyz={0,1,2,..,NDIM-1} thru the origin
1148 static trajectory line_xyz(const int xyz, const long npt) {
1150 coordT lo(0.0), hi(0.0);
1151 lo[xyz]=-L/2;
1152 hi[xyz]=L/2;
1153 return trajectory<NDIM>::line2(lo,hi,npt);
1154 }
1155
1157 return curve(start,end,radius,el2,npt,ipt);
1158 }
1159
1160 };
1161
1162
1163
1164 // plot along a line
1165 template<size_t NDIM>
1167 FILE *f=0;
1168 const int npt=traj.npt;
1169
1170 const bool psdot=false;
1171
1172 if(world.rank() == 0) {
1173 f = fopen(filename.c_str(), "w");
1174 if(!f) MADNESS_EXCEPTION("plot_along: failed to open the plot file", 0);
1175
1176 if (psdot) {
1177
1178 fprintf(f,"\\psset{xunit=0.1cm}\n");
1179 fprintf(f,"\\psset{yunit=10cm}\n");
1180 fprintf(f,"\\begin{pspicture}(0,-0.3)(100,1.0)\n");
1181 fprintf(f,"\\pslinewidth=0.05pt\n");
1182 }
1183
1184 // walk along the line
1185 for (int ipt=0; ipt<npt; ipt++) {
1186 Vector<double,NDIM> coord=traj(ipt);
1187 if (psdot) {
1188 long rank=function.evalR(coord);
1190 } else {
1191 fprintf(f,"%4i %12.6f\n",ipt, function(coord));
1192 }
1193 }
1194
1195
1196 if (psdot) fprintf(f,"\\end{pspicture}\n");
1197
1198 fclose(f);
1199 }
1200 world.gop.fence();
1201 ;
1202 }
1203
1204
1205 // plot along a line
1206 template<size_t NDIM>
1207 void plot_along(World& world, trajectory<NDIM> traj, double (*ff)(const Vector<double,NDIM>&), std::string filename) {
1208 FILE *f=0;
1209 const int npt=traj.npt;
1210
1211 const bool psdot=false;
1212
1213 if(world.rank() == 0) {
1214 f = fopen(filename.c_str(), "w");
1215 if(!f) MADNESS_EXCEPTION("plotvtk: failed to open the plot file", 0);
1216
1217 if (psdot) {
1218 fprintf(f,"\\psset{xunit=0.05cm}\n");
1219 fprintf(f,"\\psset{yunit=100cm}\n");
1220 fprintf(f,"\\begin{pspicture}(0,0.25)(100,0.3)\n");
1221 fprintf(f,"\\pslinewidth=0.005pt\n");
1222 }
1223
1224
1225 // walk along the line
1226 for (int ipt=0; ipt<npt; ipt++) {
1227
1228 Vector<double,NDIM> coord=traj(ipt);
1229// fprintf(f,"%12.6f %12.6f %12.6f %12.6f %12.6f %12.6f %12.6f\n",coord[0],coord[1],coord[2],coord[3],coord[4],coord[5], ff(coord));
1230 if (psdot) {
1231 // no hue code here
1232 // long rank=ff.evalR(coord);
1234 } else {
1235 fprintf(f,"%4i %12.6f\n",ipt, ff(coord));
1236 }
1237
1238
1239 }
1240 if (psdot) fprintf(f,"\\end{pspicture}\n");
1241
1242 fclose(f);
1243 }
1244 world.gop.fence();
1245 ;
1246 }
1247
1248
1249
1250}
1251
1252/* @} */
1253#endif // MADNESS_MRA_FUNCPLOT_H__INCLUDED
std::complex< double > double_complex
Definition cfft.h:14
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:100
static const Tensor< double > & get_cell_width()
Returns the width of each user cell dimension.
Definition funcdefaults.h:369
static const Tensor< double > & get_cell()
Gets the user cell for the simulation.
Definition funcdefaults.h:347
A multiresolution adaptive numerical function.
Definition mra.h:139
Definition indexit.h:180
class for holding the parameters for calculation
Definition QCCalculationParametersBase.h:294
virtual void read_input_and_commandline_options(World &world, const commandlineparser &parser, const std::string tag)
Definition QCCalculationParametersBase.h:330
void set_user_defined_value(const std::string &key, const T &value)
Definition QCCalculationParametersBase.h:521
A tensor is a multidimensional array.
Definition tensor.h:317
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type scale(Q x)
Inplace multiplication by scalar of supported type (legacy name)
Definition tensor.h:686
T max(long *ind=0) const
Return the maximum value (and if ind is non-null, its index) in the Tensor.
Definition tensor.h:1703
T min(long *ind=0) const
Return the minimum value (and if ind is non-null, its index) in the Tensor.
Definition tensor.h:1683
A simple, fixed dimension vector.
Definition vector.h:64
constexpr size_type size() const
Accessor for the number of elements in the Vector.
Definition vector.h:292
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition worldgop.cc:161
void barrier()
Synchronizes all processes in communicator ... does NOT fence pending AM or tasks.
Definition worldgop.h:702
A parallel world class.
Definition world.h:132
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:320
ProcessID size() const
Returns the number of processes in this World (same as MPI_Comm_size()).
Definition world.h:330
WorldGopInterface & gop
Global operations.
Definition world.h:207
Defines common mathematical and physical constants.
static double lo
Definition dirac-hatom.cc:23
static double function(const coord_3d &r)
Normalized gaussian.
Definition functionio.cc:100
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:28
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition tensor.h:2503
static const double v
Definition hatom_sf_dirac.cc:20
Tensor< double > op(const Tensor< double > &x)
Definition kain.cc:508
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Definition potentialmanager.cc:41
constexpr double pi
Mathematical constant .
Definition constants.h:48
unsigned short htons_x(unsigned short a)
Definition funcplot.h:375
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
static const char * filename
Definition legendre.cc:96
static std::string stringify(T arg)
Definition funcplot.h:1039
std::vector< double > grid({0.00000000000000e+00, 7.74564534039568e-10, 2.47256327461087e-08, 1.86997862087340e-07, 7.83531011839395e-07, 2.37369448442132e-06, 5.85385578447464e-06, 1.25192693640128e-05, 2.41120079015646e-05, 4.28530598081574e-05, 7.14571735608571e-05, 1.13129528705579e-04, 1.71543841230856e-04, 2.50802052874775e-04, 3.55376294767219e-04, 4.90034340610786e-04, 6.59750258771429e-04, 8.69602422403842e-04, 1.12466142949409e-03, 1.42987080942386e-03, 1.78992364014940e-03, 2.20913836324745e-03, 2.69133715810767e-03, 3.23973021906902e-03, 3.85680917042725e-03, 4.54425265659531e-03, 5.30284686331574e-03, 6.13242336803442e-03, 7.03181629276860e-03, 7.99884025229928e-03, 9.03029006708050e-03, 1.01219626578657e-02, 1.12687009724886e-02, 1.24644592296948e-02, 1.37023882155871e-02, 1.49749388498821e-02, 1.62739817657269e-02, 1.75909402310371e-02, 1.89169333923840e-02, 2.02429265537309e-02, 2.15598850190411e-02, 2.28589279348859e-02, 2.41314785691809e-02, 2.53694075550732e-02, 2.65651658122794e-02, 2.77119041269022e-02, 2.88035767176875e-02, 2.98350265324687e-02, 3.08020504919994e-02, 3.17014434167336e-02, 3.25310199214522e-02, 3.32896141281727e-02, 3.39770576143407e-02, 3.45941365656990e-02, 3.51425296266603e-02, 3.56247284215205e-02, 3.60439431446186e-02, 3.64039959753441e-02, 3.67092053552739e-02, 3.69642643623641e-02, 3.71741165259965e-02, 3.73438324441572e-02, 3.74784904900007e-02, 3.75830647318932e-02, 3.76623229435371e-02, 3.77207372560624e-02, 3.77624096112071e-02, 3.77910137249598e-02, 3.78097547768664e-02, 3.78213475154040e-02, 3.78280129289835e-02, 3.78314930902835e-02, 3.78330832537561e-02, 3.78336797869059e-02, 3.78338420591352e-02, 3.78338660102034e-02, 3.78338692887670e-02, 3.78339467173722e-02, 3.78344713082705e-02, 3.78363997704733e-02, 3.78415404238543e-02, 3.78527910300104e-02, 3.78743388654655e-02, 3.79118156730933e-02, 3.79724014263881e-02, 3.80648723179728e-02, 3.81995899976738e-02, 3.83884307919462e-02, 3.86446553881524e-02, 3.89827212156132e-02, 3.94180414519212e-02, 3.99666961805422e-02, 4.06451026796855e-02, 4.14696530921280e-02, 4.24563287754274e-02, 4.36203014320401e-02, 4.49755316463183e-02, 4.65343756946706e-02, 4.83072114386611e-02, 5.03020937588608e-02, 5.25244493483274e-02, 5.49768197749344e-02, 5.76586605651183e-02, 6.05662026884007e-02, 6.36923812686800e-02, 6.70268346561297e-02, 7.05559752077735e-02, 7.42631312932333e-02, 7.81287582138778e-02, 8.21307139477169e-02, 8.62445939566306e-02, 9.04441177619647e-02, 9.47015586503668e-02, 9.89882067501835e-02, 1.03274854850000e-01, 1.07532295738402e-01, 1.11731819543736e-01, 1.15845699552650e-01, 1.19847655286489e-01, 1.23713282207134e-01, 1.27420438292594e-01, 1.30949578844237e-01, 1.34284032231687e-01, 1.37410210811966e-01, 1.40317752935249e-01, 1.42999593725433e-01, 1.45451964152040e-01, 1.47674319741506e-01, 1.49669202061706e-01, 1.51442037805696e-01, 1.53000881854049e-01, 1.54356112068327e-01, 1.55520084724940e-01, 1.56506760408239e-01, 1.57331310820682e-01, 1.58009717319825e-01, 1.58558372048446e-01, 1.58993692284754e-01, 1.59331758112215e-01, 1.59587982708421e-01, 1.59776823502693e-01, 1.59911541182394e-01, 1.60004012073979e-01, 1.60064597827274e-01, 1.60102074634902e-01, 1.60123622470357e-01, 1.60134873076513e-01, 1.60140013729894e-01, 1.60141942192096e-01, 1.60142466782995e-01, 1.60142544211600e-01, 1.60142551561710e-01, 1.60142701413062e-01, 1.60143716679379e-01, 1.60147448926215e-01, 1.60157397883103e-01, 1.60179171729209e-01, 1.60220874304751e-01, 1.60293404996033e-01, 1.60410659555492e-01, 1.60589622976194e-01, 1.60850348663762e-01, 1.61215821451274e-01, 1.61711705392906e-01, 1.62365980655838e-01, 1.63208477113433e-01, 1.64270315334478e-01, 1.65583268477170e-01, 1.67179061053879e-01, 1.69088622564332e-01, 1.71341315543301e-01, 1.73964158589697e-01, 1.76981065407121e-01, 1.80412120776561e-01, 1.84272913700736e-01, 1.88573946723051e-01, 1.93320138663612e-01, 1.98510435776210e-01, 2.04137543672572e-01, 2.10187789353851e-01, 2.16641119414426e-01, 2.23471237026998e-01, 2.30645876773227e-01, 2.38127212845837e-01, 2.45872392711143e-01, 2.53834185077787e-01, 2.61961728055316e-01, 2.70201360784824e-01, 2.78497519653254e-01, 2.86793678521684e-01, 2.95033311251191e-01, 3.03160854228721e-01, 3.11122646595364e-01, 3.18867826460670e-01, 3.26349162533280e-01, 3.33523802279509e-01, 3.40353919892081e-01, 3.46807249952656e-01, 3.52857495633936e-01, 3.58484603530297e-01, 3.63674900642895e-01, 3.68421092583456e-01, 3.72722125605771e-01, 3.76582918529946e-01, 3.80013973899386e-01, 3.83030880716811e-01, 3.85653723763206e-01, 3.87906416742175e-01, 3.89815978252628e-01, 3.91411770829337e-01, 3.92724723972029e-01, 3.93786562193074e-01, 3.94629058650669e-01, 3.95283333913601e-01, 3.95779217855233e-01, 3.96144690642745e-01, 3.96405416330313e-01, 3.96584379751016e-01, 3.96701634310474e-01, 3.96774165001756e-01, 3.96815867577298e-01, 3.96837641423404e-01, 3.96847590380292e-01, 3.96851322627128e-01, 3.96852337893446e-01, 3.96852487744797e-01, 3.96852501080501e-01, 3.96852763595511e-01, 3.96854542175721e-01, 3.96861080460548e-01, 3.96878509402610e-01, 3.96916653612757e-01, 3.96989709691015e-01, 3.97116771576032e-01, 3.97322182348883e-01, 3.97635696933973e-01, 3.98092445611658e-01, 3.98732694042811e-01, 3.99601401444597e-01, 4.00747584484612e-01, 4.02223500212562e-01, 4.04083666765013e-01, 4.06383745508240e-01, 4.09179312589000e-01, 4.12524551422180e-01, 4.16470900356858e-01, 4.21065691550599e-01, 4.26350817893211e-01, 4.32361464629548e-01, 4.39124941137697e-01, 4.46659646152579e-01, 4.54974196640938e-01, 4.64066746612100e-01, 4.73924517493193e-01, 4.84523556430928e-01, 4.95828733144949e-01, 5.07793979903267e-01, 5.20362772980513e-01, 5.33468847761119e-01, 5.47037133628609e-01, 5.60984889100643e-01, 5.75223012480244e-01, 5.89657498736383e-01, 6.04191009524582e-01, 6.18724520312781e-01, 6.33159006568921e-01, 6.47397129948521e-01, 6.61344885420555e-01, 6.74913171288045e-01, 6.88019246068651e-01, 7.00588039145897e-01, 7.12553285904216e-01, 7.23858462618236e-01, 7.34457501555971e-01, 7.44315272437064e-01, 7.53407822408226e-01, 7.61722372896585e-01, 7.69257077911467e-01, 7.76020554419616e-01, 7.82031201155953e-01, 7.87316327498565e-01, 7.91911118692306e-01, 7.95857467626984e-01, 7.99202706460164e-01, 8.01998273540924e-01, 8.04298352284151e-01, 8.06158518836602e-01, 8.07634434564552e-01, 8.08780617604567e-01, 8.09649325006353e-01, 8.10289573437506e-01, 8.10746322115191e-01, 8.11059836700281e-01, 8.11265247473132e-01, 8.11392309358149e-01, 8.11465365436407e-01, 8.11503509646554e-01, 8.11520938588616e-01, 8.11527476873443e-01, 8.11529255453653e-01, 8.11529517968663e-01, 8.11529541176345e-01, 8.11529996288764e-01, 8.11533079746512e-01, 8.11544414925490e-01, 8.11574630828117e-01, 8.11640760013437e-01, 8.11767414594025e-01, 8.11987697014585e-01, 8.12343809961018e-01, 8.12887338428862e-01, 8.13679186466493e-01, 8.14789161138720e-01, 8.16295206552722e-01, 8.18282301065180e-01, 8.20841040761609e-01, 8.24065941688939e-01, 8.28053501868532e-01, 8.32900071579870e-01, 8.38699586575474e-01, 8.45541223590310e-01, 8.53507040609252e-01, 8.62669665762836e-01, 8.73090098389325e-01, 8.84815683732401e-01, 8.97878318988171e-01, 9.12292943068421e-01, 9.28056355648415e-01, 9.45146402996031e-01, 9.63521558948635e-01, 9.83120919457849e-01, 1.00386461862596e+00, 1.02565466339202e+00, 1.04837617327936e+00, 1.07189900117812e+00, 1.09607970128622e+00, 1.12076380133619e+00, 1.14578832833438e+00, 1.17098453044675e+00, 1.19618073255911e+00, 1.22120525955731e+00, 1.24588935960728e+00, 1.27007005971537e+00, 1.29359288761414e+00, 1.31631439750148e+00, 1.33810444226754e+00, 1.35884814143565e+00, 1.37844750194486e+00, 1.39682265789747e+00, 1.41391270524508e+00, 1.42967611782508e+00, 1.44409074190533e+00, 1.45715337716110e+00, 1.46887896250417e+00, 1.47929939513066e+00, 1.48846202028425e+00, 1.49642783730319e+00, 1.50326947431802e+00, 1.50906898931363e+00, 1.51391555902497e+00, 1.51790311920456e+00, 1.52112802013189e+00, 1.52368675982832e+00, 1.52567385434078e+00, 1.52717989975478e+00, 1.52828987442701e+00, 1.52908172246464e+00, 1.52962525093248e+00, 1.52998136387891e+00, 1.53020164629947e+00, 1.53032830088006e+00, 1.53039443006538e+00, 1.53042464596801e+00, 1.53043598114699e+00, 1.53043906460474e+00, 1.53043951971715e+00, 1.53043956057345e+00, 1.53044036881866e+00, 1.53044584480621e+00, 1.53046597522602e+00, 1.53051963638178e+00, 1.53063707680903e+00, 1.53086200575658e+00, 1.53125321066044e+00, 1.53188564029607e+00, 1.53285090571065e+00, 1.53425716788373e+00, 1.53622839887814e+00, 1.53890302152796e+00, 1.54243195096192e+00, 1.54697607896990e+00, 1.55270325889653e+00, 1.55978486392298e+00, 1.56839200485204e+00, 1.57869150446938e+00, 1.59084173390576e+00, 1.60498842193063e+00, 1.62126055060600e+00, 1.63976645013905e+00, 1.66059020209859e+00, 1.68378845349035e+00, 1.70938773469079e+00, 1.73738236216545e+00, 1.76773299256309e+00, 1.80036587856233e+00, 1.83517285918360e+00, 1.87201209863831e+00, 1.91070956866812e+00, 1.95106125024279e+00, 1.99283601194713e+00, 2.03577910489527e+00, 2.07961619803354e+00, 2.12405786366203e+00, 2.16880441129773e+00, 2.21355095893343e+00, 2.25799262456193e+00, 2.30182971770019e+00, 2.34477281064834e+00, 2.38654757235268e+00, 2.42689925392735e+00, 2.46559672395716e+00, 2.50243596341186e+00, 2.53724294403314e+00, 2.56987583003238e+00, 2.60022646043001e+00, 2.62822108790467e+00, 2.65382036910512e+00, 2.67701862049687e+00, 2.69784237245642e+00, 2.71634827198947e+00, 2.73262040066483e+00, 2.74676708868971e+00, 2.75891731812608e+00, 2.76921681774343e+00, 2.77782395867248e+00, 2.78490556369893e+00, 2.79063274362556e+00, 2.79517687163354e+00, 2.79870580106750e+00, 2.80138042371732e+00, 2.80335165471173e+00, 2.80475791688482e+00, 2.80572318229939e+00, 2.80635561193503e+00, 2.80674681683888e+00, 2.80697174578644e+00, 2.80708918621368e+00, 2.80714284736945e+00, 2.80716297778926e+00, 2.80716845377681e+00, 2.80716926202201e+00, 2.80716933652781e+00, 2.80717083214942e+00, 2.80718096521951e+00, 2.80721821566121e+00, 2.80731751323041e+00, 2.80753483148951e+00, 2.80795105244894e+00, 2.80867495963022e+00, 2.80984524239094e+00, 2.81163142287735e+00, 2.81423364814557e+00, 2.81788132295423e+00, 2.82283059256804e+00, 2.82936071868432e+00, 2.83776942436573e+00, 2.84836731472069e+00, 2.86147150815776e+00, 2.87739863756603e+00, 2.89645740105067e+00, 2.91894085730732e+00, 2.94511867090741e+00, 2.97522951738903e+00, 3.00947385695645e+00, 3.04800727879293e+00, 3.09093460564947e+00, 3.13830493080142e+00, 3.19010773712238e+00, 3.24627022150018e+00, 3.30665591781433e+00, 3.37106467900872e+00, 3.43923404429894e+00, 3.51084198217487e+00, 3.58551096454407e+00, 3.66281329305810e+00, 3.74227756629515e+00, 3.82339614690749e+00, 3.90563346187864e+00, 3.98843494737088e+00, 4.07123643286313e+00, 4.15347374783428e+00, 4.23459232844661e+00, 4.31405660168366e+00, 4.39135893019769e+00, 4.46602791256689e+00, 4.53763585044283e+00, 4.60580521573305e+00, 4.67021397692744e+00, 4.73059967324159e+00, 4.78676215761938e+00, 4.83856496394034e+00, 4.88593528909229e+00, 4.92886261594884e+00, 4.96739603778531e+00, 5.00164037735273e+00, 5.03175122383435e+00, 5.05792903743445e+00, 5.08041249369110e+00, 5.09947125717573e+00, 5.11539838658400e+00, 5.12850258002107e+00, 5.13910047037603e+00, 5.14750917605745e+00, 5.15403930217373e+00, 5.15898857178754e+00, 5.16263624659620e+00, 5.16523847186442e+00, 5.16702465235083e+00, 5.16819493511155e+00, 5.16891884229283e+00, 5.16933506325225e+00, 5.16955238151135e+00, 5.16965167908056e+00, 5.16968892952225e+00, 5.16969906259234e+00, 5.16970055821395e+00, 5.16970070074519e+00, 5.16970361247163e+00, 5.16972333987315e+00, 5.16979586028538e+00, 5.16998917613145e+00, 5.17041225862441e+00, 5.17122257158139e+00, 5.17263189841936e+00, 5.17491024424232e+00, 5.17838764046389e+00, 5.18345374010175e+00, 5.19055515605250e+00, 5.20019056052898e+00, 5.21290362959218e+00, 5.22927398050981e+00, 5.24990630974935e+00, 5.27541799408998e+00, 5.30642546508522e+00, 5.34352970658452e+00, 5.38730125510908e+00, 5.43826510271255e+00, 5.49688591095665e+00, 5.56355394250644e+00, 5.63857210361471e+00, 5.72214446673726e+00, 5.81436660831299e+00, 5.91521805324665e+00, 6.02455706599185e+00, 6.14211796971732e+00, 6.26751111140535e+00, 6.40022552357701e+00, 6.53963426446189e+00, 6.68500234967725e+00, 6.83549712169932e+00, 6.99020084039182e+00, 7.14812522029963e+00, 7.30822758986854e+00, 7.46942830557509e+00, 7.63062902128164e+00, 7.79073139085055e+00, 7.94865577075836e+00, 8.10335948945085e+00, 8.25385426147293e+00, 8.39922234668829e+00, 8.53863108757317e+00, 8.67134549974483e+00, 8.79673864143286e+00, 8.91429954515833e+00, 9.02363855790353e+00, 9.12449000283719e+00, 9.21671214441292e+00, 9.30028450753547e+00, 9.37530266864374e+00, 9.44197070019353e+00, 9.50059150843763e+00, 9.55155535604110e+00, 9.59532690456566e+00, 9.63243114606496e+00, 9.66343861706020e+00, 9.68895030140082e+00, 9.70958263064037e+00, 9.72595298155800e+00, 9.73866605062120e+00, 9.74830145509768e+00, 9.75540287104843e+00, 9.76046897068629e+00, 9.76394636690786e+00, 9.76622471273082e+00, 9.76763403956879e+00, 9.76844435252577e+00, 9.76886743501873e+00, 9.76906075086480e+00, 9.76913327127703e+00, 9.76915299867855e+00, 9.76915591040499e+00, 9.76915619860098e+00, 9.76916219846504e+00, 9.76920284848150e+00, 9.76935228306099e+00, 9.76975062707579e+00, 9.77062242513200e+00, 9.77229214503906e+00, 9.77519618483832e+00, 9.77989091339106e+00, 9.78705638895934e+00, 9.79749552527532e+00, 9.81212860682633e+00, 9.83198319082184e+00, 9.85817956879146e+00, 9.89191209222870e+00, 9.93442679048652e+00, 9.98699582179647e+00, 1.00508893966709e+01, 1.01273458942923e+01, 1.02175409544910e+01, 1.03225563687840e+01, 1.04433496124935e+01, 1.05807248555829e+01, 1.07353062625751e+01, 1.09075143424092e+01, 1.10975460386012e+01, 1.13053591604470e+01, 1.15306616495989e+01, 1.17729060559758e+01, 1.20312894658455e+01, 1.23047589865396e+01, 1.25920227503353e+01, 1.28915662583656e+01, 1.32016737478116e+01, 1.35204541357752e+01, 1.38458709746296e+01, 1.41757757494884e+01, 1.45079437615262e+01, 1.48401117735640e+01, 1.51700165484228e+01, 1.54954333872772e+01, 1.58142137752408e+01, 1.61243212646868e+01, 1.64238647727170e+01, 1.67111285365127e+01, 1.69845980572069e+01, 1.72429814670766e+01, 1.74852258734535e+01, 1.77105283626053e+01, 1.79183414844512e+01, 1.81083731806431e+01, 1.82805812604773e+01, 1.84351626674695e+01, 1.85725379105589e+01, 1.86933311542684e+01, 1.87983465685614e+01, 1.88885416287600e+01, 1.89649981263815e+01, 1.90288917012559e+01, 1.90814607325659e+01, 1.91239754308237e+01, 1.91577079542609e+01, 1.91839043322306e+01, 1.92037589162261e+01, 1.92183919977771e+01, 1.92288311340931e+01, 1.92359966096613e+01, 1.92406913382141e+01, 1.92435953780133e+01, 1.92452650979204e+01, 1.92461368959766e+01, 1.92465352399914e+01, 1.92466846745709e+01, 1.92467253245873e+01, 1.92467313244514e+01, 1.92467319433609e+01, 1.92467450814034e+01, 1.92468340936939e+01, 1.92471613140832e+01, 1.92480335772770e+01, 1.92499425738442e+01, 1.92535987985263e+01, 1.92599578423078e+01, 1.92702379990799e+01, 1.92859284083041e+01, 1.93087872289342e+01, 1.93408296294082e+01, 1.93843056757497e+01, 1.94416684964889e+01, 1.95155333909890e+01, 1.96086288188291e+01, 1.97237404546042e+01, 1.98636497079429e+01, 2.00310682866674e+01, 2.02285705167748e+01, 2.04585252224186e+01, 2.07230290096769e+01, 2.10238427883022e+01, 2.13623333059298e+01, 2.17394213608060e+01, 2.21555382047478e+01, 2.26105914517851e+01, 2.31039415749319e+01, 2.36343898099582e+01, 2.42001779979100e+01, 2.47990005951181e+01, 2.54280287686536e+01, 2.60839461849717e+01, 2.67629957981511e+01, 2.74610366597973e+01, 2.81736095129742e+01, 2.88960097044501e+01, 2.96233657592419e+01, 3.03507218140337e+01, 3.10731220055095e+01, 3.17856948586865e+01, 3.24837357203327e+01, 3.31627853335120e+01, 3.38187027498302e+01, 3.44477309233657e+01, 3.50465535205737e+01, 3.56123417085256e+01, 3.61427899435518e+01, 3.66361400666986e+01, 3.70911933137359e+01, 3.75073101576777e+01, 3.78843982125540e+01, 3.82228887301816e+01, 3.85237025088068e+01, 3.87882062960652e+01, 3.90181610017090e+01, 3.92156632318163e+01, 3.93830818105409e+01, 3.95229910638796e+01, 3.96381026996546e+01, 3.97311981274948e+01, 3.98050630219949e+01, 3.98624258427341e+01, 3.99059018890755e+01, 3.99379442895496e+01, 3.99608031101797e+01, 3.99764935194039e+01, 3.99867736761760e+01, 3.99931327199574e+01, 3.99967889446395e+01, 3.99986979412068e+01, 3.99995702044006e+01, 3.99998974247898e+01, 3.99999864370804e+01, 3.99999995751228e+01})
Vector< double, 3 > coordT
Definition corepotential.cc:54
response_space scale(response_space a, double b)
void plot_along(World &world, trajectory< NDIM > traj, const Function< double, NDIM > &function, std::string filename)
Definition funcplot.h:1166
std::enable_if< NDIM==3, void >::type plot_cubefile(World &world, const Function< double, NDIM > &f, std::string filename, std::vector< std::string > molecular_info=std::vector< std::string >(), int npoints=100, double zoom=1.0, const Vector< double, NDIM > origin=Vector< double, NDIM >(0.0))
Definition funcplot.h:927
std::istream & position_stream_to_word(std::istream &f, const std::string &tag, const char comment='#', bool rewind=true, bool silent=false)
position the input stream to tag, which must be a word (not part of a word)
Definition position_stream.cc:56
void plotvtk_data(const T &function, const char *fieldname, World &world, const char *filename, const Vector< double, NDIM > &plotlo, const Vector< double, NDIM > &plothi, const Vector< long, NDIM > &npt, bool binary=false)
Definition funcplot.h:229
Vector< double, 6 > coord_6d
Definition funcplot.h:1048
void plotdx(const Function< T, NDIM > &f, const char *filename, const Tensor< double > &cell=FunctionDefaults< NDIM >::get_cell(), const std::vector< long > &npt=std::vector< long >(NDIM, 201L), bool binary=true)
Writes an OpenDX format file with a cube/slice of points on a uniform grid.
Definition mraimpl.h:3446
void plot(const std::vector< Function< double, NDIM > > &vf, const std::string &name, const std::vector< std::string > &header)
convenience to get plot_plane and plot_cubefile
Definition funcplot.h:1027
static void plot_line_print_value(FILE *f, double_complex v)
Definition funcplot.h:429
void plot_plane(World &world, const Function< double, NDIM > &function, const std::string name)
Definition funcplot.h:625
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:225
NDIM & f
Definition mra.h:2481
NDIM const Function< R, NDIM > & g
Definition mra.h:2481
static void plotpovray(const Function< T, 3 > &function, const char *filename, const Tensor< double > &cell=FunctionDefaults< 3 >::get_cell(), const std::vector< long > &npt=std::vector< long >(3, 201L))
Writes a Povray DF3 format file with a cube of points on a uniform grid.
Definition funcplot.h:386
double imag(double x)
Definition complexfun.h:56
vector< functionT > vecfuncT
Definition corepotential.cc:58
void print_tree_jsonfile(World &world, const Function< T, NDIM > &f, std::string filename)
Definition funcplot.h:1003
void plotvtk_begin(World &world, const char *filename, const Vector< double, NDIM > &plotlo, const Vector< double, NDIM > &plothi, const Vector< long, NDIM > &npt, bool binary=false)
Definition funcplot.h:150
void plotvtk_end(World &world, const char *filename, bool binary=false)
Definition funcplot.h:353
Vector< double, 3 > coord_3d
Definition funcplot.h:1047
void plot_line(World &world, const char *filename, int npt, const Vector< double, NDIM > &lo, const Vector< double, NDIM > &hi, const opT &op)
Generates ASCII file tabulating f(r) at npoints along line r=lo,...,hi.
Definition funcplot.h:442
double real(double x)
Definition complexfun.h:52
std::string name(const FuncType &type, const int ex=-1)
Definition ccpairfunction.h:28
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence.
Definition mra.h:2066
static const double b
Definition nonlinschro.cc:119
static const double d
Definition nonlinschro.cc:121
static const double a
Definition nonlinschro.cc:118
static const double c
Definition relops.cc:10
static const double L
Definition rk.cc:46
static const long k
Definition rk.cc:44
Definition test_QCCalculationParametersBase.cc:62
Definition funcplot.h:48
PlotParameters & set_zoom(const double z)
Definition funcplot.h:66
PlotParameters()
Definition funcplot.h:53
std::vector< std::string > plane() const
Definition funcplot.h:97
long npoints() const
Definition funcplot.h:85
std::string get_tag() const override
Definition funcplot.h:61
double zoom() const
Definition funcplot.h:84
PlotParameters & set_origin(const std::vector< double > origin)
Definition funcplot.h:78
PlotParameters(World &world, const commandlineparser parser=commandlineparser(), const std::string tag="plot")
Definition funcplot.h:49
PlotParameters & set_plane(const std::vector< std::string > plane)
Definition funcplot.h:74
PlotParameters & set_npoints(const long n)
Definition funcplot.h:70
Vector< double, NDIM > origin() const
Definition funcplot.h:88
very simple command line parser
Definition commandlineparser.h:15
Definition funcplot.h:1052
long npt
Definition funcplot.h:1059
static coord_6d circle_6d(const coord_6d &lo, const coord_6d &hi, double radius, coord_3d el2, long npt, long ipt)
Definition funcplot.h:1093
double lo
Definition funcplot.h:1056
static trajectory line_xyz(const int xyz, const long npt)
EZ ctor for a line a direction xyz={0,1,2,..,NDIM-1} thru the origin.
Definition funcplot.h:1148
static trajectory line2(const coordT start, const coordT end, const long npt)
constructor for a line
Definition funcplot.h:1138
trajectory(double radius, coord_3d el2, long npt)
Definition funcplot.h:1125
static Vector< double, NDIM > line_internal(const coordT &lo, const coordT &hi, double radius, coord_3d el2, long npt, long ipt)
Definition funcplot.h:1129
coordT end
Definition funcplot.h:1060
double radius
Definition funcplot.h:1058
coordT start
Definition funcplot.h:1060
static void print_psdot(FILE *f, double x, double y, double color)
Definition funcplot.h:1075
static coord_3d circle2(double lo, double hi, double radius, coord_3d el2, long npt, long ipt)
Definition funcplot.h:1081
trajectory(double radius, long npt)
Definition funcplot.h:1121
trajectory()
Definition funcplot.h:1115
double hi
Definition funcplot.h:1057
Vector< double, NDIM > coordT
Definition funcplot.h:1054
Vector< double, NDIM > operator()(int ipt)
Definition funcplot.h:1156
coord_3d el2
Definition funcplot.h:1061
static double hueCode(const int rank)
some tools for plotting MRA ranks of low order tensors
Definition funcplot.h:1067
coordT(* curve)(const coordT &lo, const coordT &hi, double radius, coord_3d el2, long npt, long ipt)
Definition funcplot.h:1062
InputParameters param
Definition tdse.cc:203
AtomicInt sum
Definition test_atomicint.cc:46
constexpr std::size_t NDIM
Definition testgconv.cc:54
double h(const coord_1d &r)
Definition testgconv.cc:175
#define PROFILE_FUNC
Definition worldprofile.h:209