51 void des_profile_log(
const Scalar& uu,
double r_min,
double r_max,
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) ;
115 void des_prof_mult_log(
const Scalar** uu,
int nprof,
double r_min,
double r_max,
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 ;
195 des_profile_mult(uutab, nprof, npt, xmin, xmax, nomx, nomy, title,
196 line_style, ngraph, closeit, device, nbound, xbound,
true) ;
206 void des_meridian_log(
const Scalar& uu,
double r_min,
double r_max,
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} ;
220 des_prof_mult_log(des, 5, r_min, r_max, theta1, phi1, pzero, 1., closeit,
221 nomy,
"phi=0: th=0, pi/4, pi/2, phi=pi/4: th=0, pi/4",
222 ngraph, 0x0, 0x0, device, draw_bound) ;
Tensor field of valence 0 (or component of a tensorial field).
Cmp log10(const Cmp &)
Basis 10 logarithm.
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Coord phi
coordinate centered on the grid
Coord r
r coordinate centered on the grid