54 #include "graphique.h" 56 #include "utilitaires.h" 61 void des_coupe_x(
const Scalar& uu,
double x0,
int nzdes,
const char* title,
62 const Scalar* defsurf,
double zoom,
bool draw_bound,
63 int ncour,
int ny,
int nz) {
65 const Map& mp = uu.get_mp() ;
67 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
68 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
69 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
70 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
72 ray = ( a1 > ray ) ? a1 : ray ;
73 ray = ( a2 > ray ) ? a2 : ray ;
74 ray = ( a3 > ray ) ? a3 : ray ;
78 double y_min = mp.get_ori_y() - ray ;
79 double y_max = mp.get_ori_y() + ray ;
80 double z_min = mp.get_ori_z() - ray ;
81 double z_max = mp.get_ori_z() + ray ;
83 des_coupe_x(uu, x0, y_min, y_max, z_min, z_max, title, defsurf, draw_bound,
90 void des_coupe_x(
const Scalar& uu,
double x0,
double y_min,
double y_max,
91 double z_min,
double z_max,
const char* title,
const Scalar* defsurf,
92 bool draw_bound,
int ncour,
int ny,
int nz) {
96 const Map& mp = uu.get_mp() ;
101 float* uutab =
new float[ny*nz] ;
103 double hy = (y_max - y_min) /
double(ny-1) ;
104 double hza = (z_max - z_min) /
double(nz-1) ;
106 for (
int j=0; j<nz; j++) {
108 double z = z_min + hza * j ;
110 for (
int i=0; i<ny; i++) {
112 double y = y_min + hy * i ;
115 double r, theta, phi ;
116 mp.convert_absolute(x0, y, z, r, theta, phi) ;
118 uutab[ny*j+i] = float(uu.val_point(r, theta, phi)) ;
122 float ymin1 = float(y_min / km) ;
123 float ymax1 = float(y_max / km) ;
124 float zmin1 = float(z_min / km) ;
125 float zmax1 = float(z_max / km) ;
127 const char* nomy =
"y [km]" ;
128 const char* nomz =
"z [km]" ;
134 const char* device = 0x0 ;
135 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
137 des_equipot(uutab, ny, nz, ymin1, ymax1, zmin1, zmax1, ncour, nomy, nomz,
138 title, device, newgraph) ;
145 if (defsurf != 0x0) {
147 assert( &(defsurf->get_mp()) == &mp ) ;
149 newgraph = draw_bound ? 0 : 2 ;
161 int ndom = mp.get_mg()->get_nzone() ;
163 for (
int l=0; l<ndom-1; l++) {
166 newgraph = (l == ndom-2) ? 2 : 0 ;
178 void des_coupe_y(
const Scalar& uu,
double y0,
int nzdes,
const char* title,
179 const Scalar* defsurf,
double zoom,
bool draw_bound,
180 int ncour,
int nx,
int nz) {
182 const Map& mp = uu.get_mp() ;
184 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
185 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
186 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
187 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
189 ray = ( a1 > ray ) ? a1 : ray ;
190 ray = ( a2 > ray ) ? a2 : ray ;
191 ray = ( a3 > ray ) ? a3 : ray ;
195 double x_min = mp.get_ori_x() - ray ;
196 double x_max = mp.get_ori_x() + ray ;
197 double z_min = mp.get_ori_z() - ray ;
198 double z_max = mp.get_ori_z() + ray ;
200 des_coupe_y(uu, y0, x_min, x_max, z_min, z_max, title, defsurf, draw_bound,
207 void des_coupe_y(
const Scalar& uu,
double y0,
double x_min,
double x_max,
208 double z_min,
double z_max,
const char* title,
const Scalar* defsurf,
209 bool draw_bound,
int ncour,
int nx,
int nz) {
213 const Map& mp = uu.get_mp() ;
218 float* uutab =
new float[nx*nz] ;
220 double hx = (x_max - x_min) /
double(nx-1) ;
221 double hza = (z_max - z_min) /
double(nz-1) ;
225 for (
int j=0; j<nz; j++) {
227 double z = z_min + hza * j ;
229 for (
int i=0; i<nx; i++) {
231 double x = x_min + hx * i ;
234 double r, theta, phi ;
235 mp.convert_absolute(x, y0, z, r, theta, phi) ;
237 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
241 float xmin1 = float(x_min / km) ;
242 float xmax1 = float(x_max / km) ;
243 float zmin1 = float(z_min / km) ;
244 float zmax1 = float(z_max / km) ;
246 const char* nomx =
"x [km]" ;
247 const char* nomz =
"z [km]" ;
254 const char* device = 0x0 ;
255 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
257 des_equipot(uutab, nx, nz, xmin1, xmax1, zmin1, zmax1, ncour, nomx, nomz,
258 title, device, newgraph) ;
263 if (defsurf != 0x0) {
265 assert( &(defsurf->get_mp()) == &mp ) ;
267 newgraph = draw_bound ? 0 : 2 ;
280 int ndom = mp.get_mg()->get_nzone() ;
282 for (
int l=0; l<ndom-1; l++) {
285 newgraph = (l == ndom-2) ? 2 : 0 ;
297 void des_coupe_z(
const Scalar& uu,
double z0,
int nzdes,
const char* title,
298 const Scalar* defsurf,
double zoom,
bool draw_bound,
299 int ncour,
int nx,
int ny) {
301 const Map& mp = uu.get_mp() ;
303 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
304 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
305 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
306 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
308 ray = ( a1 > ray ) ? a1 : ray ;
309 ray = ( a2 > ray ) ? a2 : ray ;
310 ray = ( a3 > ray ) ? a3 : ray ;
314 double x_min = mp.get_ori_x() - ray ;
315 double x_max = mp.get_ori_x() + ray ;
316 double y_min = mp.get_ori_y() - ray ;
317 double y_max = mp.get_ori_y() + ray ;
319 des_coupe_z(uu, z0, x_min, x_max, y_min, y_max, title, defsurf, draw_bound,
327 void des_coupe_z(
const Scalar& uu,
double z0,
double x_min,
double x_max,
328 double y_min,
double y_max,
const char* title,
const Scalar* defsurf,
329 bool draw_bound,
int ncour,
int nx,
int ny) {
333 const Map& mp = uu.get_mp() ;
338 float* uutab =
new float[ny*nx] ;
340 double hy = (y_max - y_min) /
double(ny-1) ;
341 double hx = (x_max - x_min) /
double(nx-1) ;
343 for (
int j=0; j<ny; j++) {
345 double y = y_min + hy * j ;
347 for (
int i=0; i<nx; i++) {
349 double x = x_min + hx * i ;
352 double r, theta, phi ;
353 mp.convert_absolute(x, y, z0, r, theta, phi) ;
355 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
359 float ymin1 = float(y_min / km) ;
360 float ymax1 = float(y_max / km) ;
361 float xmin1 = float(x_min / km) ;
362 float xmax1 = float(x_max / km) ;
364 const char* nomy =
"y [km]" ;
365 const char* nomx =
"x [km]" ;
371 const char* device = 0x0 ;
372 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
374 des_equipot(uutab, nx, ny, xmin1, xmax1, ymin1, ymax1, ncour, nomx, nomy,
375 title, device, newgraph) ;
383 if (defsurf != 0x0) {
385 assert( &(defsurf->get_mp()) == &mp ) ;
387 newgraph = draw_bound ? 0 : 2 ;
398 int ndom = mp.get_mg()->get_nzone() ;
400 for (
int l=0; l<ndom-1; l++) {
403 newgraph = (l == ndom-2) ? 2 : 0 ;
void des_surface_y(const Scalar &defsurf, double y0, const char *device=0x0, int newgraph=3, double x_min=-1, double x_max=1, double z_min=-1, double z_max=1, const char *nomx=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing a stellar surface in a plane Y=constant.
void des_coupe_y(const Scalar &uu, double y0, int nzdes, const char *title=0x0, const Scalar *defsurf=0x0, double zoom=1.2, bool draw_bound=true, int ncour=15, int nx=100, int nz=100)
Draws isocontour lines of a Scalar in a plane Y=constant.
void des_coupe_z(const Scalar &uu, double z0, int nzdes, const char *title=0x0, const Scalar *defsurf=0x0, double zoom=1.2, bool draw_bound=true, int ncour=15, int nx=100, int ny=100)
Draws isocontour lines of a Scalar in a plane Z=constant.
void des_domaine_z(const Map &mp, int l0, double z0, const char *device=0x0, int newgraph=3, double x_min=-1, double x_max=1, double y_min=-1, double y_max=1, const char *nomx=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing the outer boundary of a given domain in a plane Z=constant.
void des_domaine_x(const Map &mp, int l0, double x0, const char *device=0x0, int newgraph=3, double y_min=-1, double y_max=1, double z_min=-1, double z_max=1, const char *nomy=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing the outer boundary of a given domain in a plane X=constant.
Standard units of space, time and mass.
void des_surface_z(const Scalar &defsurf, double z0, const char *device=0x0, int newgraph=3, double x_min=-1, double x_max=1, double y_min=-1, double y_max=1, const char *nomx=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing a stellar surface in a plane Z=constant.
void des_equipot(float *uutab, int nx, int ny, float xmin, float xmax, float ymin, float ymax, int ncour, const char *nomx, const char *nomy, const char *title, const char *device, int newgraph, int nxpage, int nypage)
Basic routine for drawing isocontours.
void des_domaine_y(const Map &mp, int l0, double y0, const char *device=0x0, int newgraph=3, double x_min=-1, double x_max=1, double z_min=-1, double z_max=1, const char *nomx=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing the outer boundary of a given domain in a plane Y=constant.
void des_surface_x(const Scalar &defsurf, double x0, const char *device=0x0, int newgraph=3, double y_min=-1, double y_max=1, double z_min=-1, double z_max=1, const char *nomy=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing a stellar surface in a plane X=constant.
void des_coupe_x(const Scalar &uu, double x0, int nzdes, const char *title=0x0, const Scalar *defsurf=0x0, double zoom=1.2, bool draw_bound=true, int ncour=15, int ny=100, int nz=100)
Draws isocontour lines of a Scalar in a plane X=constant.