44 #include "graphique.h" 52 double theta,
double phi,
double pzero,
const char* nomy,
53 const char* title,
bool draw_bound) {
59 double hr = (r_max - r_min) /
double(npt-1) ;
61 for (
int i=0; i<npt; i++) {
63 double r = hr * i + r_min ;
65 double tmp_val = fabs(uu.val_point(r, theta, phi)) ;
66 if (tmp_val < pzero) tmp_val = pzero ;
67 uutab[i] = float(
log10(tmp_val)) ;
70 float xmin = float(r_min) ;
71 float xmax = float(r_max) ;
73 const char* nomx =
"r" ;
85 const Map& mp = uu.get_mp() ;
86 int nz = mp.get_mg()->get_nzone() ;
87 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
89 float* xbound =
new float[l_max+1] ;
93 const double xi_max = 1. ;
94 for (
int l=0; l<=l_max; l++) {
96 double rb = mp.val_r(l, xi_max, theta, phi) ;
98 if ((rb >= r_min) && (rb <= r_max)) {
99 xbound[nbound] = float(rb) ;
105 des_profile(uutab, npt, xmin, xmax, nomx, nomy, title, 0x0,
106 nbound, xbound,
true) ;
116 const double* theta,
const double* phi,
double pzero,
117 double radial_scale,
bool closeit,
const char* nomy,
118 const char* title,
int ngraph,
const char* nomx,
119 const int* line_style,
const char* device,
124 if ((device[0] ==
'/') && (device[1] ==
'n')) return ;
127 const int npt = 400 ;
130 float* uutab =
new float[npt*nprof] ;
133 double hr = (r_max - r_min) /
double(npt-1) ;
135 for (
int i=0; i<npt; i++) {
136 rr[i] = hr * i + r_min ;
140 for (
int j=0; j<nprof; j++) {
142 const Scalar& vv = *(uu[j]) ;
144 for (
int i=0; i<npt; i++) {
145 double tmp_val = fabs(vv.val_point(rr[i], theta[j], phi[j])) ;
146 if (tmp_val < pzero) tmp_val = pzero ;
147 uutab[j*npt+i] = float(
log10(tmp_val)) ;
152 float xmin = float(radial_scale * r_min) ;
153 float xmax = float(radial_scale * r_max) ;
155 if (nomx == 0x0) nomx =
"r" ;
157 if (nomy == 0x0) nomy =
"" ;
159 if (title == 0x0) title =
"" ;
164 int nbound_max = 100 * nprof ;
165 float* xbound =
new float[nbound_max] ;
169 const double xi_max = 1. ;
170 for (
int j=0; j<nprof; j++) {
172 const Map& mp = uu[j]->get_mp() ;
173 int nz = mp.get_mg()->get_nzone() ;
174 int l_max = (mp.get_mg()->get_type_r(nz-1) == UNSURR) ? nz-2 : nz-1 ;
176 for (
int l=0; l<=l_max; l++) {
178 double rb = mp.val_r(l, xi_max, theta[j], phi[j]) ;
180 if ((rb >= r_min) && (rb <= r_max)) {
181 xbound[nbound] = float(rb * radial_scale) ;
183 if (nbound > nbound_max-1) {
184 cout <<
"des_profile_mult : nbound too large !" << endl ;
196 line_style, ngraph, closeit, device, nbound, xbound,
true) ;
207 const char* nomy,
int ngraph,
double pzero,
209 bool closeit,
bool draw_bound) {
213 if ((device[0] ==
'/') && (device[1] ==
'n')) return ;
216 const Scalar* des[] = {&uu, &uu, &uu, &uu, &uu} ;
217 double phi1[] = {0., 0., 0., 0.25*M_PI, 0.25*M_PI} ;
218 double theta1[] = {0., 0.25*M_PI, 0.5*M_PI, 0., 0.25*M_PI} ;
221 nomy,
"phi=0: th=0, pi/4, pi/2, phi=pi/4: th=0, pi/4",
222 ngraph, 0x0, 0x0, device, draw_bound) ;
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.
void des_prof_mult_log(const Scalar **uu, int nprof, double r_min, double r_max, const double *theta, const double *phi, double pzero=1.e-16, double radial_scale=1, bool closeit=true, const char *nomy=0x0, const char *title=0x0, int ngraph=0, const char *nomx=0x0, const int *line_style=0x0, const char *device=0x0, bool draw_bound=true)
Draws the profile of Scalar 's absolute value in log10 scale, along some radial axis determined by a ...
Cmp log10(const Cmp &)
Basis 10 logarithm.
void des_meridian_log(const Scalar &uu, double r_min, double r_max, const char *nomy, int ngraph, double pzero=1.e-16, const char *device=0x0, bool closeit=false, bool draw_bound=true)
Draws 5 profiles of the absolute value of a scalar field in log10 scale along various radial directio...
void des_profile_log(const Scalar &uu, double r_min, double r_max, double theta, double phi, double pzero=1.e-16, const char *nomy=0x0, const char *title=0x0, bool draw_bound=true)
Draws the profile of a Scalar 's absolute value in log10 scale, along some radial axis determined by ...