28char des_vect_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_vect.C,v 1.5 2014/10/13 08:53:23 j_novak Exp $" ;
72void des_vect(
float* vvx,
float* vvy,
int nx,
int ny,
float xmin,
float xmax,
73 float ymin,
float ymax,
double scale,
double sizefl,
74 const char* nomx,
const char* nomy,
const char* title,
const char* device,
75 int newgraph,
int nxpage,
int nypage) {
81 float hx = (xmax - xmin)/
float(nx-1) ;
82 float hy = (ymax - ymin)/
float(ny-1) ;
98 double norme_max = 0 ;
99 for(
int ix = 0; ix < nx; ix++) {
100 for(
int iy = 0; iy < ny; iy++) {
101 double xxx =
sqrt( vvx[iy*nx+ix]*vvx[iy*nx+ix] +
102 vvy[iy*nx+ix]*vvy[iy*nx+ix] ) ;
103 norme_max = (xxx > norme_max) ? xxx : norme_max ;
107 if (norme_max < 1.e-14) {
111 double pas_max = (hx > hy) ? hx : hy ;
112 scale = fabs(scale) * pas_max / norme_max ;
114 cout <<
"des_vect: norme_max = " << norme_max << endl ;
115 cout <<
"des_vect: scale = " << scale << endl ;
122 if ( (newgraph == 1) || (newgraph == 3) ) {
124 if (device == 0x0) device =
"?" ;
126 int ier = cpgbeg(0, device, nxpage, nypage) ;
128 cout <<
"des_vect: problem in opening PGPLOT display !" << endl ;
134 float size = float(1.3) ;
145 cpgenv(xmin, xmax, ymin, ymax, 1, 0 ) ;
146 cpglab(nomx,nomy,title) ;
150 float sizefl1 = float(sizefl) ;
154 float scale1 = float(scale) ;
157 cpgvect(vvx, vvy, nx, ny, 1, nx, 1, ny, scale1, nc, tr, blank) ;
166 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=0x0, int newgraph=3, int nxpage=1, int nypage=1)
Basic routine for plotting vector field.