69 #include "graphique.h" 71 #include "utilitaires.h" 77 void des_coupe_bin_x(
const Cmp& uu1,
const Cmp& uu2,
double x0,
double y_min,
78 double y_max,
double z_min,
double z_max,
const char* title,
79 const Cmp* defsurf1,
const Cmp* defsurf2,
80 bool draw_bound,
int ncour,
int ny,
int nz) {
84 const Map& mp1 = *(uu1.get_mp()) ;
85 const Map& mp2 = *(uu2.get_mp()) ;
90 float* uutab =
new float[ny*nz] ;
92 double hy = (y_max - y_min) /
double(ny-1) ;
93 double hza = (z_max - z_min) /
double(nz-1) ;
95 for (
int j=0; j<nz; j++) {
97 double z = z_min + hza * j ;
99 for (
int i=0; i<ny; i++) {
101 double y = y_min + hy * i ;
103 double r, theta, phi ;
105 mp1.convert_absolute(x0, y, z, r, theta, phi) ;
106 double uu_1 = uu1.val_point(r, theta, phi) ;
108 mp2.convert_absolute(x0, y, z, r, theta, phi) ;
109 double uu_2 = uu2.val_point(r, theta, phi) ;
111 uutab[ny*j+i] = float(uu_1 + uu_2) ;
116 float ymin1 = float(y_min / km) ;
117 float ymax1 = float(y_max / km) ;
118 float zmin1 = float(z_min / km) ;
119 float zmax1 = float(z_max / km) ;
121 const char* nomy =
"y [km]" ;
122 const char* nomz =
"z [km]" ;
128 const char* device = 0x0 ;
129 int newgraph = ( (defsurf1 != 0x0) || (defsurf2 != 0x0) || draw_bound ) ?
132 des_equipot(uutab, ny, nz, ymin1, ymax1, zmin1, zmax1, ncour, nomy, nomz,
133 title, device, newgraph) ;
140 if (defsurf1 != 0x0) {
142 assert(defsurf1->get_mp() == uu1.get_mp()) ;
143 newgraph = ( (defsurf2 != 0x0) || draw_bound ) ? 0 : 2 ;
147 if (defsurf2 != 0x0) {
149 assert(defsurf2->get_mp() == uu2.get_mp()) ;
150 newgraph = draw_bound ? 0 : 2 ;
160 int ndom1 = mp1.get_mg()->get_nzone() ;
161 int ndom2 = mp2.get_mg()->get_nzone() ;
163 for (
int l=0; l<ndom1-1; l++) {
169 for (
int l=0; l<ndom2-1; l++) {
172 newgraph = (l == ndom2-2) ? 2 : 0 ;
183 void des_coupe_bin_y(
const Cmp& uu1,
const Cmp& uu2,
double y0,
double x_min,
184 double x_max,
double z_min,
double z_max,
const char* title,
185 const Cmp* defsurf1,
const Cmp* defsurf2,
186 bool draw_bound,
int ncour,
int nx,
int nz) {
190 const Map& mp1 = *(uu1.get_mp()) ;
191 const Map& mp2 = *(uu2.get_mp()) ;
196 float* uutab =
new float[nx*nz] ;
198 double hx = (x_max - x_min) /
double(nx-1) ;
199 double hza = (z_max - z_min) /
double(nz-1) ;
203 for (
int j=0; j<nz; j++) {
205 double z = z_min + hza * j ;
207 for (
int i=0; i<nx; i++) {
209 double x = x_min + hx * i ;
211 double r, theta, phi ;
213 mp1.convert_absolute(x, y0, z, r, theta, phi) ;
214 double uu_1 = uu1.val_point(r, theta, phi) ;
216 mp2.convert_absolute(x, y0, z, r, theta, phi) ;
217 double uu_2 = uu2.val_point(r, theta, phi) ;
219 uutab[nx*j+i] = float(uu_1 + uu_2) ;
223 float xmin1 = float(x_min / km) ;
224 float xmax1 = float(x_max / km) ;
225 float zmin1 = float(z_min / km) ;
226 float zmax1 = float(z_max / km) ;
228 const char* nomx =
"x [km]" ;
229 const char* nomz =
"z [km]" ;
236 const char* device = 0x0 ;
237 int newgraph = ( (defsurf1 != 0x0) || (defsurf2 != 0x0) || draw_bound ) ?
240 des_equipot(uutab, nx, nz, xmin1, xmax1, zmin1, zmax1, ncour, nomx, nomz,
241 title, device, newgraph) ;
248 if (defsurf1 != 0x0) {
250 assert(defsurf1->get_mp() == uu1.get_mp()) ;
251 newgraph = ( (defsurf2 != 0x0) || draw_bound ) ? 0 : 2 ;
255 if (defsurf2 != 0x0) {
257 assert(defsurf2->get_mp() == uu2.get_mp()) ;
258 newgraph = draw_bound ? 0 : 2 ;
268 int ndom1 = mp1.get_mg()->get_nzone() ;
269 int ndom2 = mp2.get_mg()->get_nzone() ;
271 for (
int l=0; l<ndom1-1; l++) {
277 for (
int l=0; l<ndom2-1; l++) {
280 newgraph = (l == ndom2-2) ? 2 : 0 ;
291 void des_coupe_bin_z(
const Cmp& uu1,
const Cmp& uu2,
double z0,
double x_min,
292 double x_max,
double y_min,
double y_max,
const char* title,
293 const Cmp* defsurf1,
const Cmp* defsurf2,
294 bool draw_bound,
int ncour,
int nx,
int ny) {
298 const Map& mp1 = *(uu1.get_mp()) ;
299 const Map& mp2 = *(uu2.get_mp()) ;
304 float* uutab =
new float[ny*nx] ;
306 double hy = (y_max - y_min) /
double(ny-1) ;
307 double hx = (x_max - x_min) /
double(nx-1) ;
309 for (
int j=0; j<ny; j++) {
311 double y = y_min + hy * j ;
313 for (
int i=0; i<nx; i++) {
315 double x = x_min + hx * i ;
317 double r, theta, phi ;
319 mp1.convert_absolute(x, y, z0, r, theta, phi) ;
320 double uu_1 = uu1.val_point(r, theta, phi) ;
322 mp2.convert_absolute(x, y, z0, r, theta, phi) ;
323 double uu_2 = uu2.val_point(r, theta, phi) ;
325 uutab[nx*j+i] = float(uu_1 + uu_2) ;
329 float ymin1 = float(y_min / km) ;
330 float ymax1 = float(y_max / km) ;
331 float xmin1 = float(x_min / km) ;
332 float xmax1 = float(x_max / km) ;
334 const char* nomy =
"y [km]" ;
335 const char* nomx =
"x [km]" ;
341 const char* device = 0x0 ;
342 int newgraph = ( (defsurf1 != 0x0) || (defsurf2 != 0x0) || draw_bound ) ?
345 des_equipot(uutab, nx, ny, xmin1, xmax1, ymin1, ymax1, ncour, nomx, nomy,
346 title, device, newgraph) ;
354 if (defsurf1 != 0x0) {
356 assert(defsurf1->get_mp() == uu1.get_mp()) ;
357 newgraph = ( (defsurf2 != 0x0) || draw_bound ) ? 0 : 2 ;
361 if (defsurf2 != 0x0) {
363 assert(defsurf2->get_mp() == uu2.get_mp()) ;
364 newgraph = draw_bound ? 0 : 2 ;
374 int ndom1 = mp1.get_mg()->get_nzone() ;
375 int ndom2 = mp2.get_mg()->get_nzone() ;
377 for (
int l=0; l<ndom1-1; l++) {
383 for (
int l=0; l<ndom2-1; l++) {
386 newgraph = (l == ndom2-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_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_coupe_bin_y(const Cmp &uu1, const Cmp &uu2, double y0, double x_min, double x_max, double z_min, double z_max, const char *title, const Cmp *defsurf1=0x0, const Cmp *defsurf2=0x0, bool draw_bound=true, int ncour=15, int nx=100, int nz=100)
Draws isocontour lines of a the sum of two Cmp 's in a plane Y=constant.
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_coupe_bin_z(const Cmp &uu1, const Cmp &uu2, double z0, double x_min, double x_max, double y_min, double y_max, const char *title, const Cmp *defsurf1=0x0, const Cmp *defsurf2=0x0, bool draw_bound=true, int ncour=15, int nx=100, int ny=100)
Draws isocontour lines of a the sum of two Cmp 's in a plane Z=constant.
void des_coupe_bin_x(const Cmp &uu1, const Cmp &uu2, double x0, double y_min, double y_max, double z_min, double z_max, const char *title, const Cmp *defsurf1=0x0, const Cmp *defsurf2=0x0, bool draw_bound=true, int ncour=15, int ny=100, int nz=100)
Draws isocontour lines of a the sum of two Cmp 's in a plane X=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.