A visualization of double data of a variable can be done by OpenDx as follows:
Example 1
Variable<double,not_staggered,not_staggered,not_staggered> u(grid);
ofstream DATEI;
DATEI.open("u.dx",std::ios :: out);
u.Print_Dx(&DATEI);
DATEI.close();
If a variable contains no double data but for example a complex<double> data, then one needs a function which converts complex<double> to double data. This is shown in the following example:
Example 2
double conIm (std::complex<double> x){
return x.imag();
}
.........
Variable<std::complex<double>,not_staggered,not_staggered,not_staggered> ucom(grid);
ofstream DATEI;
DATEI.open("u.dx",std::ios :: out);
ucom.Print_Dx(&DATEI,conIm);
DATEI.close();
Last modified: Mon Feb 11 09:55:58 MET 2002