75 void des_vect(
float* vvx,
float* vvy,
int nx,
int ny,
float xmin,
float xmax,
76 float ymin,
float ymax,
double scale,
double sizefl,
77 const char* nomx,
const char* nomy,
const char* title,
const char* device,
78 int newgraph,
int nxpage,
int nypage) {
84 float hx = (xmax - xmin)/
float(nx-1) ;
85 float hy = (ymax - ymin)/
float(ny-1) ;
101 double norme_max = 0 ;
102 for(
int ix = 0; ix < nx; ix++) {
103 for(
int iy = 0; iy < ny; iy++) {
104 double xxx =
sqrt( vvx[iy*nx+ix]*vvx[iy*nx+ix] +
105 vvy[iy*nx+ix]*vvy[iy*nx+ix] ) ;
106 norme_max = (xxx > norme_max) ? xxx : norme_max ;
110 if (norme_max < 1.e-14) {
114 double pas_max = (hx > hy) ? hx : hy ;
115 scale = fabs(scale) * pas_max / norme_max ;
117 cout <<
"des_vect: norme_max = " << norme_max << endl ;
118 cout <<
"des_vect: scale = " << scale << endl ;
125 if ( (newgraph == 1) || (newgraph == 3) ) {
127 if (device == 0x0) device =
"?" ;
129 int ier = cpgbeg(0, device, nxpage, nypage) ;
131 cout <<
"des_vect: problem in opening PGPLOT display !" << endl ;
137 float size = float(1.3) ;
148 cpgenv(xmin, xmax, ymin, ymax, 1, 0 ) ;
149 cpglab(nomx,nomy,title) ;
153 float sizefl1 = float(sizefl) ;
157 float scale1 = float(scale) ;
160 cpgvect(vvx, vvy, nx, ny, 1, nx, 1, ny, scale1, nc, tr, blank) ;
169 if ( (newgraph == 2) || (newgraph == 3) ) {
Cmp sqrt(const Cmp &)
Square root.
void des_vect(float *vvx, float *vvy, int nx, int ny, float xmin, float xmax, float ymin, float ymax, double scale, double sizefl, const char *nomx, const char *nomy, const char *title, const char *device, int newgraph, int nxpage, int nypage)
Basic routine for plotting vector field.