97 void des_profile(
const float* uutab,
int nx,
float xmin,
float xmax,
98 const char* nomx,
const char* nomy,
99 const char* title,
const char* device,
100 int nbound,
float* xbound,
bool) {
105 float uumin = uutab[0] ;
106 float uumax = uutab[0] ;
107 for (
int i=1; i<nx; i++) {
108 uumin = (uutab[i] < uumin) ? uutab[i] : uumin ;
109 uumax = (uutab[i] > uumax) ? uutab[i] : uumax ;
112 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax
118 float* xx =
new float[nx] ;
119 float hx = (xmax-xmin)/
float(nx-1) ;
120 for(
int i=0; i<nx; i++) {
121 xx[i] = xmin + float(i) * hx ;
131 int ier = cpgbeg(0, device, 1, 1) ;
133 cout <<
"des_profile: problem in opening PGPLOT display !" << endl ;
137 float size = float(1.3) ;
148 float uuamp = uumax - uumin ;
149 float uumin1 = uumin - float(0.05) * uuamp ;
150 float uumax1 = uumax + float(0.05) * uuamp ;
151 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
152 cpglab(nomx,nomy,title) ;
155 cpgline(nx, xx, uutab) ;
168 for (
int i=0; i<nbound; i++) {
190 float xmin,
float xmax,
const char* nomx,
const char* nomy,
191 const char* title,
const int* line_style,
192 int ngraph,
bool closeit,
const char* device,
193 int nbound,
float* xbound,
bool) {
195 const int ngraph_max = 100 ;
196 static int graph_list[ngraph_max] ;
197 static bool first_call = true ;
203 for (
int i=0; i<ngraph_max; i++) {
213 int ntot = nprof * nx ;
214 float uumin = uutab[0] ;
215 float uumax = uutab[0] ;
216 for (
int i=1; i<ntot; i++) {
217 if (uutab[i] < uumin) uumin = uutab[i] ;
218 if (uutab[i] > uumax) uumax = uutab[i] ;
221 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax
227 float* xx =
new float[nx] ;
228 float hx = (xmax-xmin)/
float(nx-1) ;
229 for(
int i=0; i<nx; i++) {
230 xx[i] = xmin + float(i) * hx ;
238 if ( (ngraph < 0) || (ngraph >= ngraph_max) ) {
239 cerr <<
"des_profile_mult : graph index out of range ! \n" ;
240 cerr <<
" ngraph = " << ngraph <<
" while range = 0, " 241 << ngraph_max-1 << endl ;
245 if (graph_list[ngraph] == 0) {
248 if (device == 0x0) device =
"?" ;
250 graph_list[ngraph] = cpgopen(device) ;
252 if ( graph_list[ngraph] <= 0 ) {
253 cerr <<
"des_profile_mult: problem in opening PGPLOT display !\n" ;
262 cpgslct( graph_list[ngraph] ) ;
269 float size = float(1.3) ;
280 float uuamp = uumax - uumin ;
281 float uumin1 = uumin - float(0.05) * uuamp ;
282 float uumax1 = uumax + float(0.05) * uuamp ;
284 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
285 cpglab(nomx,nomy,title) ;
288 for (
int i=0; i<nprof; i++) {
289 const float* uudes = uutab + i*nx ;
291 if (line_style == 0x0) cpgsls(i%5 + 1) ;
292 else cpgsls(line_style[i]) ;
294 cpgline(nx, xx, uudes) ;
307 for (
int i=0; i<nbound; i++) {
319 graph_list[ngraph] = 0 ;
332 const char* nomx,
const char* nomy,
333 const char* title,
const char* device,
334 int nbound,
float* xbound) {
339 float uumin = uutab[0] ;
340 float uumax = uutab[0] ;
341 float xmin = xtab[0] ;
342 float xmax = xtab[0] ;
343 for (
int i=1; i<nx; i++) {
344 uumin = (uutab[i] < uumin) ? uutab[i] : uumin ;
345 uumax = (uutab[i] > uumax) ? uutab[i] : uumax ;
346 xmin = (xtab[i] < xmin) ? xtab[i] : xmin ;
347 xmax = (xtab[i] > xmax) ? xtab[i] : xmax ;
350 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax << endl;
351 cout <<
" " <<
"domain: " <<
"min, max : " << xmin <<
" " << xmax << endl ;
369 int ier = cpgbeg(0, device, 1, 1) ;
371 cout <<
"des_profile: problem in opening PGPLOT display !" << endl ;
375 float size = float(1.3) ;
386 float uuamp = uumax - uumin ;
387 float uumin1 = uumin - float(0.05) * uuamp ;
388 float uumax1 = uumax + float(0.05) * uuamp ;
389 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
390 cpglab(nomx,nomy,title) ;
393 cpgline(nx, xtab, uutab) ;
406 for (
int i=0; i<nbound; i++) {
426 const char* nomx,
const char* nomy,
const char* title,
427 const int* line_style,
int ngraph,
bool closeit,
428 const char* device,
int nbound,
float* xbound) {
430 const int ngraph_max = 100 ;
431 static int graph_list[ngraph_max] ;
432 static bool first_call = true ;
438 for (
int i=0; i<ngraph_max; i++) {
448 int ntot = nprof * nx ;
449 float uumin = uutab[0] ;
450 float uumax = uutab[0] ;
451 for (
int i=1; i<ntot; i++) {
452 if (uutab[i] < uumin) uumin = uutab[i] ;
453 if (uutab[i] > uumax) uumax = uutab[i] ;
456 float xmin = xtab[0] ;
457 float xmax = xtab[0] ;
458 for (
int i=1; i<ntot; i++) {
459 if (xtab[i] < xmin) xmin = xtab[i] ;
460 if (xtab[i] > xmax) xmax = xtab[i] ;
463 cout <<
" " << nomy <<
" : min, max : " << uumin <<
" " << uumax
472 if ( (ngraph < 0) || (ngraph >= ngraph_max) ) {
473 cerr <<
"des_profile_mult : graph index out of range ! \n" ;
474 cerr <<
" ngraph = " << ngraph <<
" while range = 0, " 475 << ngraph_max-1 << endl ;
479 if (graph_list[ngraph] == 0) {
482 if (device == 0x0) device =
"?" ;
484 graph_list[ngraph] = cpgopen(device) ;
486 if ( graph_list[ngraph] <= 0 ) {
487 cerr <<
"des_profile_mult: problem in opening PGPLOT display !\n" ;
496 cpgslct( graph_list[ngraph] ) ;
503 float size = float(1.3) ;
514 float uuamp = uumax - uumin ;
515 float uumin1 = uumin - float(0.05) * uuamp ;
516 float uumax1 = uumax + float(0.05) * uuamp ;
518 cpgenv(xmin, xmax, uumin1, uumax1, 0, 0 ) ;
519 cpglab(nomx,nomy,title) ;
522 for (
int i=0; i<nprof; i++) {
523 const float* uudes = uutab + i*nx ;
524 const float* xdes = xtab + i*nx ;
526 if (line_style == 0x0) cpgsls(i%5 + 1) ;
527 else cpgsls(line_style[i]) ;
529 cpgline(nx, xdes, uudes) ;
542 for (
int i=0; i<nbound; i++) {
553 graph_list[ngraph] = 0 ;
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, bool logscale=false)
Basic routine for drawing a single profile with uniform x sampling.
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, bool logscale=false)
Basic routine for drawing multiple profiles with uniform x sampling.