28char scalar_visu_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Tensor/Scalar/scalar_visu.C,v 1.9 2014/10/13 08:53:47 j_novak Exp $" ;
79 double umax,
double vmin,
double vmax,
const char* title0,
80 const char* filename0,
bool start_dx,
int nu,
int nv)
const {
85 switch (section_type) {
100 visu_section(plane, umin, umax, vmin, vmax, title0, filename0,
106 plane.
set(0,0) = 0. ;
107 plane.
set(0,1) = aa ;
108 plane.
set(0,2) = 0. ;
110 plane.
set(1,0) = 1. ;
111 plane.
set(1,1) = 0. ;
112 plane.
set(1,2) = 0. ;
114 plane.
set(2,0) = 0. ;
115 plane.
set(2,1) = 0. ;
116 plane.
set(2,2) = 1. ;
118 visu_section(plane, umin, umax, vmin, vmax, title0, filename0,
124 plane.
set(0,0) = 0. ;
125 plane.
set(0,1) = 0. ;
126 plane.
set(0,2) = aa ;
128 plane.
set(1,0) = 1. ;
129 plane.
set(1,1) = 0. ;
130 plane.
set(1,2) = 0. ;
132 plane.
set(2,0) = 0. ;
133 plane.
set(2,1) = 1. ;
134 plane.
set(2,2) = 0. ;
136 visu_section(plane, umin, umax, vmin, vmax, title0, filename0,
142 cerr <<
"Scalar::visu_section : unknown type of section ! \n" ;
143 cerr <<
" section_type = " << section_type << endl ;
157 double vmin,
double vmax,
const char* title0,
const char* filename0,
158 bool start_dx,
int nu,
int nv)
const {
163 title =
new char[2] ;
166 title_quotes =
new char[4] ;
167 strcpy(title_quotes,
"\" \"") ;
170 title =
new char[ strlen(title0)+1 ] ;
171 strcpy(title, title0) ;
173 title_quotes =
new char[ strlen(title0)+3 ] ;
174 strcpy(title_quotes,
"\"") ;
175 strcat(title_quotes, title0) ;
176 strcat(title_quotes,
"\"") ;
184 if (filename0 == 0x0) {
185 filename =
new char[30] ;
186 strcpy(filename,
"scalar_section.dxdata") ;
189 filename =
new char[ strlen(filename0)+8 ] ;
190 strcpy(filename, filename0) ;
191 strcat(filename,
".dxdata") ;
194 ofstream fdata(filename) ;
196 fdata << title <<
"\n" ;
197 fdata <<
"size : " << nu <<
" x " << nv <<
"\n" ;
198 fdata <<
"u_min = " << umin <<
" u_max = " << umax <<
"\n" ;
199 fdata <<
"v_min = " << vmin <<
" v_max = " << vmax <<
"\n" ;
204 double xa0 = plane(0,0) ;
205 double ya0 = plane(0,1) ;
206 double za0 = plane(0,2) ;
208 double eux = plane(1,0) ;
209 double euy = plane(1,1) ;
210 double euz = plane(1,2) ;
212 double evx = plane(2,0) ;
213 double evy = plane(2,1) ;
214 double evz = plane(2,2) ;
225 fdata.setf(ios::scientific) ;
229 double du = (umax - umin) /
double(nu-1) ;
230 double dv = (vmax - vmin) /
double(nv-1) ;
234 for (
int j=0; j<nv; j++) {
236 double v = vmin + dv * j ;
238 for (
int i=0; i<nu; i++) {
240 double u = umin + du * i ;
242 double xa = xa0 + u * eux + v * evx ;
243 double ya = ya0 + u * euy + v * evy ;
244 double za = za0 + u * euz + v * evz ;
261 double ff = cva.
val_point(l, xi, th, ph) ;
275 if (npoint != 0) fdata <<
"\n" ;
284 if (filename0 == 0x0) {
285 headername =
new char[30] ;
286 strcpy(headername,
"scalar_section.dxhead") ;
289 headername =
new char[ strlen(filename0)+9 ] ;
290 strcpy(headername, filename0) ;
291 strcat(headername,
".dxhead") ;
294 ofstream fheader(headername) ;
296 fheader <<
"file = " << filename << endl ;
297 fheader <<
"grid = " << nu <<
" x " << nv << endl ;
298 fheader <<
"format = ascii" << endl ;
299 fheader <<
"interleaving = record" << endl ;
300 fheader <<
"majority = column" << endl ;
301 fheader <<
"header = lines 4" << endl ;
302 fheader <<
"field = " << title_quotes << endl ;
303 fheader <<
"structure = scalar" << endl ;
304 fheader <<
"type = float" << endl ;
305 fheader <<
"dependency = positions" << endl ;
306 fheader <<
"positions = regular, regular, " << umin <<
", " << du
307 <<
", " << vmin <<
", " << dv << endl ;
309 fheader <<
"end" << endl ;
316 char* commande =
new char[ strlen(headername) + 60 ] ;
317 strcpy(commande,
"ln -s ") ;
318 strcat(commande, headername) ;
319 strcat(commande,
" visu_section.dxhead") ;
321 system(
"rm -f visu_section.dxhead") ;
323 system(
"dx -image visu_section.net &") ;
331 delete [] title_quotes ;
333 delete [] headername ;
343 double zmin,
double zmax,
const char* title0,
const char* filename0,
344 bool start_dx,
int nx,
int ny,
int nz)
const {
351 scal_tmp =
new Scalar(*
this) ;
362 title =
new char[2] ;
365 title_quotes =
new char[4] ;
366 strcpy(title_quotes,
"\" \"") ;
369 title =
new char[ strlen(title0)+1 ] ;
370 strcpy(title, title0) ;
372 title_quotes =
new char[ strlen(title0)+3 ] ;
373 strcpy(title_quotes,
"\"") ;
374 strcat(title_quotes, title0) ;
375 strcat(title_quotes,
"\"") ;
383 if (filename0 == 0x0) {
384 filename =
new char[30] ;
385 strcpy(filename,
"scalar_box.dxdata") ;
388 filename =
new char[ strlen(filename0)+8 ] ;
389 strcpy(filename, filename0) ;
390 strcat(filename,
".dxdata") ;
393 ofstream fdata(filename) ;
395 fdata << title <<
"\n" ;
396 fdata <<
"size : " << nx <<
" x " << ny <<
" x " << nz <<
"\n" ;
397 fdata <<
"x_min = " << xmin <<
" x_max = " << xmax <<
"\n" ;
398 fdata <<
"y_min = " << ymin <<
" y_max = " << ymax <<
"\n" ;
399 fdata <<
"z_min = " << zmin <<
" z_max = " << zmax <<
"\n" ;
410 fdata.setf(ios::scientific) ;
414 double dx = (xmax - xmin) /
double(nx-1) ;
415 double dy = (ymax - ymin) /
double(ny-1) ;
416 double dz = (zmax - zmin) /
double(nz-1) ;
420 for (
int k=0; k<nz; k++) {
422 double zz = zmin + dz * k ;
424 for (
int j=0; j<ny; j++) {
426 double yy = ymin + dy * j ;
428 for (
int i=0; i<nx; i++) {
430 double xx = xmin + dx * i ;
445 double ff = cva.
val_point(l, xi, th, ph) ;
461 if (npoint != 0) fdata <<
"\n" ;
470 if (filename0 == 0x0) {
471 headername =
new char[30] ;
472 strcpy(headername,
"scalar_box.dxhead") ;
475 headername =
new char[ strlen(filename0)+9 ] ;
476 strcpy(headername, filename0) ;
477 strcat(headername,
".dxhead") ;
480 ofstream fheader(headername) ;
482 fheader <<
"file = " << filename << endl ;
483 fheader <<
"grid = " << nx <<
" x " << ny <<
" x " << nz << endl ;
484 fheader <<
"format = ascii" << endl ;
485 fheader <<
"interleaving = record" << endl ;
486 fheader <<
"majority = column" << endl ;
487 fheader <<
"header = lines 5" << endl ;
488 fheader <<
"field = " << title_quotes << endl ;
489 fheader <<
"structure = scalar" << endl ;
490 fheader <<
"type = float" << endl ;
491 fheader <<
"dependency = positions" << endl ;
492 fheader <<
"positions = regular, regular, regular, "
493 << xmin <<
", " << dx <<
", "
494 << ymin <<
", " << dy <<
", "
495 << zmin <<
", " << dz << endl ;
497 fheader <<
"end" << endl ;
504 char* commande =
new char[ strlen(headername) + 60 ] ;
505 strcpy(commande,
"ln -s ") ;
506 strcat(commande, headername) ;
507 strcat(commande,
" visu_scalar_box.dxhead") ;
509 system(
"rm -f visu_scalar_box.dxhead") ;
511 system(
"dx -image visu_scalar_box.net &") ;
520 if (scal_tmp != 0x0)
delete scal_tmp ;
522 delete [] title_quotes ;
524 delete [] headername ;
536 double umax,
double vmin,
double vmax,
int jtime,
double ,
537 int jgraph,
const char* title,
const char* filename_root,
bool start_dx,
538 int nu,
int nv)
const {
540 if ( jtime % jgraph != 0 ) return ;
544 int k = jtime / jgraph ;
547 if (filename_root == 0x0) {
548 filename =
new char[40] ;
549 strcpy(filename,
"anim") ;
552 filename =
new char[ strlen(filename_root)+10 ] ;
553 strcpy(filename, filename_root) ;
557 sprintf(nomk,
"%04d", k) ;
558 strcat(filename, nomk) ;
563 visu_section(section_type, aa, umin, umax, vmin, vmax, title, filename,
571 system(
"dx -edit anime.net &") ;
Base class for pure radial mappings.
void convert_absolute(double xx, double yy, double zz, double &rr, double &theta, double &pphi) const
Determines the coordinates corresponding to given absolute Cartesian coordinates (X,...
virtual void val_lx(double rr, double theta, double pphi, int &l, double &xi) const =0
Computes the domain index l and the value of corresponding to a point given by its physical coordina...
Coefficients storage for the multi-domain spectral method.
double val_point(int l, double x, double theta, double phi) const
Computes the value of the field represented by *this at an arbitrary point, by means of the spectral ...
Tensor field of valence 0 (or component of a tensorial field).
void visu_box(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const char *title0=0x0, const char *filename0=0x0, bool start_dx=true, int nx=40, int ny=40, int nz=40) const
3D visualization (volume rendering) via OpenDX.
bool check_dzpuis(int dzi) const
Returns false if the last domain is compactified and *this is not zero in this domain and dzpuis is n...
void visu_section_anim(const char section_type, double aa, double umin, double umax, double vmin, double vmax, int jtime, double ttime, int jgraph=1, const char *title=0x0, const char *filename_root=0x0, bool start_dx=false, int nu=200, int nv=200) const
3D visualization via time evolving plane section (animation).
void visu_section(const char section_type, double aa, double umin, double umax, double vmin, double vmax, const char *title=0x0, const char *filename=0x0, bool start_dx=true, int nu=200, int nv=200) const
3D visualization via a plane section.
Valeur va
The numerical value of the Scalar
virtual void dec_dzpuis(int dec=1)
Decreases by dec units the value of dzpuis and changes accordingly the values of the Scalar in the co...
int dzpuis
Power of r by which the quantity represented by this must be divided in the compactified external d...
void set_etat_qcq()
Sets the logical state to ETATQCQ (ordinary state).
double & set(int i)
Read/write of a particular element (index i) (1D case)
Values and coefficients of a (real-value) function.
Mtbl_cf * c_cf
Coefficients of the spectral expansion of the function.
void coef() const
Computes the coeffcients of *this.
const Map *const mp
Mapping on which the numerical values at the grid points are defined.