27char des_profile_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_profile.C,v 1.11 2014/10/13 08:53:22 j_novak Exp $" ;
91void des_profile(
const float* uutab,
int nx,
float xmin,
float xmax,
92 const char* nomx,
const char* nomy,
93 const char* title,
const char* device,
94 int nbound,
float* xbound) {
99 float uumin = uutab[0] ;
100 float uumax = uutab[0] ;
101 for (
int i=1; i<nx; i++) {
102 uumin = (uutab[i] < uumin) ? uutab[i] : uumin ;
103 uumax = (uutab[i] > uumax) ? uutab[i] : uumax ;
106 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax
112 float* xx =
new float[nx] ;
113 float hx = (xmax-xmin)/
float(nx-1) ;
114 for(
int i=0; i<nx; i++) {
115 xx[i] = xmin + float(i) * hx ;
125 int ier = cpgbeg(0, device, 1, 1) ;
127 cout <<
"des_profile: problem in opening PGPLOT display !" << endl ;
131 float size = float(1.3) ;
142 float uuamp = uumax - uumin ;
143 float uumin1 = uumin - float(0.05) * uuamp ;
144 float uumax1 = uumax + float(0.05) * uuamp ;
145 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
146 cpglab(nomx,nomy,title) ;
149 cpgline(nx, xx, uutab) ;
162 for (
int i=0; i<nbound; i++) {
184 float xmin,
float xmax,
const char* nomx,
const char* nomy,
185 const char* title,
const int* line_style,
186 int ngraph,
bool closeit,
const char* device,
187 int nbound,
float* xbound) {
189 const int ngraph_max = 100 ;
190 static int graph_list[ngraph_max] ;
191 static bool first_call = true ;
197 for (
int i=0; i<ngraph_max; i++) {
207 int ntot = nprof * nx ;
208 float uumin = uutab[0] ;
209 float uumax = uutab[0] ;
210 for (
int i=1; i<ntot; i++) {
211 if (uutab[i] < uumin) uumin = uutab[i] ;
212 if (uutab[i] > uumax) uumax = uutab[i] ;
215 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax
221 float* xx =
new float[nx] ;
222 float hx = (xmax-xmin)/
float(nx-1) ;
223 for(
int i=0; i<nx; i++) {
224 xx[i] = xmin + float(i) * hx ;
232 if ( (ngraph < 0) || (ngraph >= ngraph_max) ) {
233 cerr <<
"des_profile_mult : graph index out of range ! \n" ;
234 cerr <<
" ngraph = " << ngraph <<
" while range = 0, "
235 << ngraph_max-1 << endl ;
239 if (graph_list[ngraph] == 0) {
242 if (device == 0x0) device =
"?" ;
244 graph_list[ngraph] = cpgopen(device) ;
246 if ( graph_list[ngraph] <= 0 ) {
247 cerr <<
"des_profile_mult: problem in opening PGPLOT display !\n" ;
256 cpgslct( graph_list[ngraph] ) ;
263 float size = float(1.3) ;
274 float uuamp = uumax - uumin ;
275 float uumin1 = uumin - float(0.05) * uuamp ;
276 float uumax1 = uumax + float(0.05) * uuamp ;
278 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
279 cpglab(nomx,nomy,title) ;
282 for (
int i=0; i<nprof; i++) {
283 const float* uudes = uutab + i*nx ;
285 if (line_style == 0x0) cpgsls(i%5 + 1) ;
286 else cpgsls(line_style[i]) ;
288 cpgline(nx, xx, uudes) ;
301 for (
int i=0; i<nbound; i++) {
313 graph_list[ngraph] = 0 ;
325void des_profile(
const float* uutab,
int nx,
const float *xtab,
326 const char* nomx,
const char* nomy,
327 const char* title,
const char* device,
328 int nbound,
float* xbound) {
333 float uumin = uutab[0] ;
334 float uumax = uutab[0] ;
335 float xmin = xtab[0] ;
336 float xmax = xtab[0] ;
337 for (
int i=1; i<nx; i++) {
338 uumin = (uutab[i] < uumin) ? uutab[i] : uumin ;
339 uumax = (uutab[i] > uumax) ? uutab[i] : uumax ;
340 xmin = (xtab[i] < xmin) ? xtab[i] : xmin ;
341 xmax = (xtab[i] > xmax) ? xtab[i] : xmax ;
344 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax << endl;
345 cout <<
" " <<
"domain: " <<
"min, max : " << xmin <<
" " << xmax << endl ;
363 int ier = cpgbeg(0, device, 1, 1) ;
365 cout <<
"des_profile: problem in opening PGPLOT display !" << endl ;
369 float size = float(1.3) ;
380 float uuamp = uumax - uumin ;
381 float uumin1 = uumin - float(0.05) * uuamp ;
382 float uumax1 = uumax + float(0.05) * uuamp ;
383 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
384 cpglab(nomx,nomy,title) ;
387 cpgline(nx, xtab, uutab) ;
400 for (
int i=0; i<nbound; i++) {
419void des_profile_mult(
const float* uutab,
int nprof,
int nx,
const float* xtab,
420 const char* nomx,
const char* nomy,
const char* title,
421 const int* line_style,
int ngraph,
bool closeit,
422 const char* device,
int nbound,
float* xbound) {
424 const int ngraph_max = 100 ;
425 static int graph_list[ngraph_max] ;
426 static bool first_call = true ;
432 for (
int i=0; i<ngraph_max; i++) {
442 int ntot = nprof * nx ;
443 float uumin = uutab[0] ;
444 float uumax = uutab[0] ;
445 for (
int i=1; i<ntot; i++) {
446 if (uutab[i] < uumin) uumin = uutab[i] ;
447 if (uutab[i] > uumax) uumax = uutab[i] ;
450 float xmin = xtab[0] ;
451 float xmax = xtab[0] ;
452 for (
int i=1; i<ntot; i++) {
453 if (xtab[i] < xmin) xmin = xtab[i] ;
454 if (xtab[i] > xmax) xmax = xtab[i] ;
457 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax
466 if ( (ngraph < 0) || (ngraph >= ngraph_max) ) {
467 cerr <<
"des_profile_mult : graph index out of range ! \n" ;
468 cerr <<
" ngraph = " << ngraph <<
" while range = 0, "
469 << ngraph_max-1 << endl ;
473 if (graph_list[ngraph] == 0) {
476 if (device == 0x0) device =
"?" ;
478 graph_list[ngraph] = cpgopen(device) ;
480 if ( graph_list[ngraph] <= 0 ) {
481 cerr <<
"des_profile_mult: problem in opening PGPLOT display !\n" ;
490 cpgslct( graph_list[ngraph] ) ;
497 float size = float(1.3) ;
508 float uuamp = uumax - uumin ;
509 float uumin1 = uumin - float(0.05) * uuamp ;
510 float uumax1 = uumax + float(0.05) * uuamp ;
512 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
513 cpglab(nomx,nomy,title) ;
516 for (
int i=0; i<nprof; i++) {
517 const float* uudes = uutab + i*nx ;
518 const float* xdes = xtab + i*nx ;
520 if (line_style == 0x0) cpgsls(i%5 + 1) ;
521 else cpgsls(line_style[i]) ;
523 cpgline(nx, xdes, uudes) ;
536 for (
int i=0; i<nbound; i++) {
547 graph_list[ngraph] = 0 ;
void des_profile_mult(const float *uutab, int nprof, int nx, float xmin, float xmax, const char *nomx, const char *nomy, const char *title, const int *line_style, int ngraph, bool closeit, const char *device=0x0, int nbound=0, float *xbound=0x0)
Basic routine for drawing multiple profiles with uniform x sampling.
void des_profile(const float *uutab, int nx, float xmin, float xmax, const char *nomx, const char *nomy, const char *title, const char *device=0x0, int nbound=0, float *xbound=0x0)
Basic routine for drawing a single profile with uniform x sampling.