28char des_prof_scalar_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_prof_scalar.C,v 1.12 2014/10/13 08:53:22 j_novak Exp $" ;
93void des_profile(
const Scalar& uu,
double r_min,
double r_max,
94 double theta,
double phi,
const char* nomy,
const char* title,
102 double hr = (r_max - r_min) /
double(npt-1) ;
104 for (
int i=0; i<npt; i++) {
106 double r = hr * i + r_min ;
108 uutab[i] = float(uu.val_point(r, theta, phi)) ;
112 float xmin = float(r_min) ;
113 float xmax = float(r_max) ;
115 const char* nomx =
"r" ;
127 const Map& mp = uu.get_mp() ;
128 int nz = mp.get_mg()->get_nzone() ;
129 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
131 float* xbound =
new float[l_max+1] ;
135 const double xi_max = 1. ;
136 for (
int l=0; l<=l_max; l++) {
138 double rb = mp.val_r(l, xi_max, theta, phi) ;
140 if ((rb >= r_min) && (rb <= r_max)) {
141 xbound[nbound] = float(rb) ;
147 des_profile(uutab, npt, xmin, xmax, nomx, nomy, title, 0x0,
156void des_profile(
const Scalar& uu,
double r_min,
double r_max,
double scale,
157 double theta,
double phi,
const char* nomx,
const char* nomy,
158 const char* title,
bool draw_bound) {
161 const int npt = 400 ;
165 double hr = (r_max - r_min) /
double(npt-1) ;
167 for (
int i=0; i<npt; i++) {
169 double r = hr * i + r_min ;
171 uutab[i] = float(uu.val_point(r, theta, phi)) ;
175 float xmin = float(r_min * scale) ;
176 float xmax = float(r_max * scale) ;
193 const Map& mp = uu.get_mp() ;
194 int nz = mp.get_mg()->get_nzone() ;
195 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
197 float* xbound =
new float[l_max+1] ;
201 const double xi_max = 1. ;
202 for (
int l=0; l<=l_max; l++) {
204 double rb = mp.val_r(l, xi_max, theta, phi) ;
206 if ((rb >= r_min) && (rb <= r_max)) {
207 xbound[nbound] = float(rb) ;
215 des_profile(uutab, npt, xmin, xmax, nomx, nomy, title, 0x0,
225void des_profile_mult(
const Scalar** uu,
int nprof,
double r_min,
double r_max,
226 const double* theta,
const double* phi,
double radial_scale,
227 bool closeit,
const char* nomy,
const char* title,
int ngraph,
228 const char* nomx,
const int* line_style,
const char* device,
233 if ((device[0] ==
'/') && (device[1] ==
'n')) return ;
236 const int npt = 400 ;
239 float* uutab =
new float[npt*nprof] ;
242 double hr = (r_max - r_min) /
double(npt-1) ;
244 for (
int i=0; i<npt; i++) {
245 rr[i] = hr * i + r_min ;
249 for (
int j=0; j<nprof; j++) {
251 const Scalar& vv = *(uu[j]) ;
253 for (
int i=0; i<npt; i++) {
254 uutab[j*npt+i] = float(vv.val_point(rr[i], theta[j], phi[j])) ;
259 float xmin = float(radial_scale * r_min) ;
260 float xmax = float(radial_scale * r_max) ;
262 if (nomx == 0x0) nomx =
"r" ;
264 if (nomy == 0x0) nomy =
"" ;
266 if (title == 0x0) title =
"" ;
271 int nbound_max = 100 * nprof ;
272 float* xbound =
new float[nbound_max] ;
276 const double xi_max = 1. ;
277 for (
int j=0; j<nprof; j++) {
279 const Map& mp = uu[j]->get_mp() ;
280 int nz = mp.get_mg()->get_nzone() ;
281 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
283 for (
int l=0; l<=l_max; l++) {
285 double rb = mp.val_r(l, xi_max, theta[j], phi[j]) ;
287 if ((rb >= r_min) && (rb <= r_max)) {
288 xbound[nbound] = float(rb * radial_scale) ;
290 if (nbound > nbound_max-1) {
291 cout <<
"des_profile_mult : nbound too large !" << endl ;
303 line_style, ngraph, closeit, device, nbound, xbound) ;
313void des_meridian(
const Scalar& uu,
double r_min,
double r_max,
314 const char* nomy,
int ngraph,
const char* device,
315 bool closeit,
bool draw_bound) {
319 if ((device[0] ==
'/') && (device[1] ==
'n')) return ;
322 const Scalar* des[] = {&uu, &uu, &uu, &uu, &uu} ;
323 double phi1[] = {0., 0., 0., 0.25*M_PI, 0.25*M_PI} ;
324 double theta1[] = {0., 0.25*M_PI, 0.5*M_PI, 0., 0.25*M_PI} ;
328 "phi=0: th=0, pi/4, pi/2, phi=pi/4: th=0, pi/4",
329 ngraph, 0x0, 0x0, device, draw_bound) ;
336void des_meridian(
const Sym_tensor& hh,
double r_min,
double r_max,
337 const char* name,
int ngraph0,
const char* device,
342 if ((device[0] ==
'/') && (device[1] ==
'n')) return ;
348 for (
int i=1; i<=3; i++) {
349 for (
int j=i; j<=3; j++) {
352 sprintf(nom_i,
"%d", i) ;
354 sprintf(nom_j,
"%d", j) ;
355 strncpy(nomy, name, 40) ;
356 strcat(nomy,
" comp. ") ;
357 strcat(nomy, nom_i) ;
358 strcat(nomy, nom_j) ;
360 des_meridian(hh(i,j), r_min, r_max, nomy, ngraph0+k, device,
374 double theta,
double phi,
const char* nomy,
const char* title,
377 const Map& mp = uu.get_mp() ;
378 int nz = mp.get_mg()->get_nzone() ;
379 int nt = mp.get_mg()->get_nt(nz-1) ;
380 int np = mp.get_mg()->get_np(nz-1) ;
387 for(
int ii = 0; ii<nz; ii++)
388 npt += (uu.get_mp().get_mg())->get_nr(ii) ;
390 float *uutab =
new float[npt] ;
391 float *xtab =
new float[npt] ;
395 for(
int ii = 0; ii<nz; ii++){
396 int nr = (uu.get_mp().get_mg())->get_nr(ii) ;
397 for(
int ij=0; ij<nr; ij++){
398 uutab[ii*nr+ij] = float(uu.val_grid_point(ii,np-1,nt-1,ij)) ;
399 xtab[ii*nr+ij] = float(r(ii,np-1,nt-1,ij)) ;
406 const char* nomx =
"r" ;
418 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
420 float* xbound =
new float[l_max+1] ;
424 const double xi_max = 1. ;
425 for (
int l=0; l<=l_max; l++) {
427 double rb = mp.val_r(l, xi_max, theta, phi) ;
429 if ((rb >= xmin) && (rb <= xmax)) {
430 xbound[nbound] = float(rb) ;
436 des_profile(uutab, npt, xtab, nomx, nomy, title, 0x0,
445void des_points(
const Scalar& uu,
double scale,
446 double theta,
double phi,
const char* nomx,
const char* nomy,
447 const char* title,
bool draw_bound) {
449 const Map& mp = uu.get_mp() ;
450 int nz = mp.get_mg()->get_nzone() ;
451 int nt = mp.get_mg()->get_nt(nz-1) ;
452 int np = mp.get_mg()->get_np(nz-1) ;
459 for(
int ii = 0; ii<nz; ii++)
460 npt += (uu.get_mp().get_mg())->get_nr(ii) ;
462 float *uutab =
new float[npt] ;
463 float *xtab =
new float[npt] ;
467 for(
int ii = 0; ii<nz; ii++){
468 int nr = (uu.get_mp().get_mg())->get_nr(ii) ;
469 for(
int ij=0; ij<nr; ij++){
470 uutab[ii*nr+ij] = float(uu.val_grid_point(ii,np-1,nt-1,ij)) ;
471 xtab[ii*nr+ij] = float(r(ii,np-1,nt-1,ij)) ;
475 float xmin = float(
totalmin(r) * scale) ;
476 float xmax = float(
totalmax(r) * scale) ;
493 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
495 float* xbound =
new float[l_max+1] ;
499 const double xi_max = 1. ;
500 for (
int l=0; l<=l_max; l++) {
502 double rb = mp.val_r(l, xi_max, theta, phi) ;
504 if ((rb >= xmin/scale) && (rb <= xmax/scale)) {
505 xbound[nbound] = float(rb) ;
513 des_profile(uutab, npt, xtab, nomx, nomy, title, 0x0,
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.
void des_points(const float *uutab, int nx, float xmin, float xmax, const char *nomx=0x0, const char *nomy=0x0, const char *title=0x0, const char *device=0x0, int nbound=0, float *xbound=0x0)
Basic routine for plotting points using grid locations.
void des_meridian(const Scalar &uu, double r_min, double r_max, const char *nomy, int ngraph, const char *device=0x0, bool closeit=false, bool draw_bound=true)
Draws 5 profiles of a scalar field along various radial axes in two meridional planes and .
double totalmin(const Mtbl &)
Minimum value of the Mtbl elements in all domain.
double totalmax(const Mtbl &)
Maximum value of the Mtbl elements in all domains.