90 #include "graphique.h" 92 #include "utilitaires.h" 98 void des_coupe_y(
const Cmp& uu,
double y0,
int nzdes,
const char* title,
99 const Cmp* defsurf,
double zoom,
bool draw_bound,
100 int ncour,
int nx,
int nz) {
102 const Map& mp = *(uu.get_mp()) ;
104 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
105 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
106 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
107 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
109 ray = ( a1 > ray ) ? a1 : ray ;
110 ray = ( a2 > ray ) ? a2 : ray ;
111 ray = ( a3 > ray ) ? a3 : ray ;
115 double x_min = mp.get_ori_x() - ray ;
116 double x_max = mp.get_ori_x() + ray ;
117 double z_min = mp.get_ori_z() - ray ;
118 double z_max = mp.get_ori_z() + ray ;
120 des_coupe_y(uu, y0, x_min, x_max, z_min, z_max, title, defsurf, draw_bound,
127 void des_coupe_y(
const Cmp& uu,
double y0,
double x_min,
double x_max,
128 double z_min,
double z_max,
const char* title,
const Cmp* defsurf,
129 bool draw_bound,
int ncour,
int nx,
int nz) {
133 const Map& mp = *(uu.get_mp()) ;
138 float* uutab =
new float[nx*nz] ;
140 double hx = (x_max - x_min) /
double(nx-1) ;
141 double hza = (z_max - z_min) /
double(nz-1) ;
145 for (
int j=0; j<nz; j++) {
147 double z = z_min + hza * j ;
149 for (
int i=0; i<nx; i++) {
151 double x = x_min + hx * i ;
154 double r, theta, phi ;
155 mp.convert_absolute(x, y0, z, r, theta, phi) ;
157 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
161 float xmin1 = float(x_min / km) ;
162 float xmax1 = float(x_max / km) ;
163 float zmin1 = float(z_min / km) ;
164 float zmax1 = float(z_max / km) ;
166 const char* nomx =
"x [km]" ;
167 const char* nomz =
"z [km]" ;
174 const char* device = 0x0 ;
175 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
177 des_equipot(uutab, nx, nz, xmin1, xmax1, zmin1, zmax1, ncour, nomx, nomz,
178 title, device, newgraph) ;
183 if (defsurf != 0x0) {
185 assert(defsurf->get_mp() == uu.get_mp()) ;
187 newgraph = draw_bound ? 0 : 2 ;
200 int ndom = mp.get_mg()->get_nzone() ;
202 for (
int l=0; l<ndom-1; l++) {
205 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.
Standard units of space, time and mass.
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.