23char des_coupe_scalar_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_coupe_scalar.C,v 1.4 2014/10/13 08:53:21 j_novak Exp $" ;
53#include "utilitaires.h"
58void des_coupe_x(
const Scalar& uu,
double x0,
int nzdes,
const char* title,
59 const Scalar* defsurf,
double zoom,
bool draw_bound,
60 int ncour,
int ny,
int nz) {
62 const Map& mp = uu.get_mp() ;
64 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
65 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
66 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
67 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
69 ray = ( a1 > ray ) ? a1 : ray ;
70 ray = ( a2 > ray ) ? a2 : ray ;
71 ray = ( a3 > ray ) ? a3 : ray ;
75 double y_min = mp.get_ori_y() - ray ;
76 double y_max = mp.get_ori_y() + ray ;
77 double z_min = mp.get_ori_z() - ray ;
78 double z_max = mp.get_ori_z() + ray ;
80 des_coupe_x(uu, x0, y_min, y_max, z_min, z_max, title, defsurf, draw_bound,
87void des_coupe_x(
const Scalar& uu,
double x0,
double y_min,
double y_max,
88 double z_min,
double z_max,
const char* title,
const Scalar* defsurf,
89 bool draw_bound,
int ncour,
int ny,
int nz) {
93 const Map& mp = uu.get_mp() ;
98 float* uutab =
new float[ny*nz] ;
100 double hy = (y_max - y_min) /
double(ny-1) ;
101 double hza = (z_max - z_min) /
double(nz-1) ;
103 for (
int j=0; j<nz; j++) {
105 double z = z_min + hza * j ;
107 for (
int i=0; i<ny; i++) {
109 double y = y_min + hy * i ;
112 double r, theta, phi ;
113 mp.convert_absolute(x0, y, z, r, theta, phi) ;
115 uutab[ny*j+i] = float(uu.val_point(r, theta, phi)) ;
119 float ymin1 = float(y_min / km) ;
120 float ymax1 = float(y_max / km) ;
121 float zmin1 = float(z_min / km) ;
122 float zmax1 = float(z_max / km) ;
124 const char* nomy =
"y [km]" ;
125 const char* nomz =
"z [km]" ;
131 const char* device = 0x0 ;
132 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
134 des_equipot(uutab, ny, nz, ymin1, ymax1, zmin1, zmax1, ncour, nomy, nomz,
135 title, device, newgraph) ;
142 if (defsurf != 0x0) {
144 assert( &(defsurf->get_mp()) == &mp ) ;
146 newgraph = draw_bound ? 0 : 2 ;
158 int ndom = mp.get_mg()->get_nzone() ;
160 for (
int l=0; l<ndom-1; l++) {
163 newgraph = (l == ndom-2) ? 2 : 0 ;
175void des_coupe_y(
const Scalar& uu,
double y0,
int nzdes,
const char* title,
176 const Scalar* defsurf,
double zoom,
bool draw_bound,
177 int ncour,
int nx,
int nz) {
179 const Map& mp = uu.get_mp() ;
181 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
182 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
183 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
184 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
186 ray = ( a1 > ray ) ? a1 : ray ;
187 ray = ( a2 > ray ) ? a2 : ray ;
188 ray = ( a3 > ray ) ? a3 : ray ;
192 double x_min = mp.get_ori_x() - ray ;
193 double x_max = mp.get_ori_x() + ray ;
194 double z_min = mp.get_ori_z() - ray ;
195 double z_max = mp.get_ori_z() + ray ;
197 des_coupe_y(uu, y0, x_min, x_max, z_min, z_max, title, defsurf, draw_bound,
204void des_coupe_y(
const Scalar& uu,
double y0,
double x_min,
double x_max,
205 double z_min,
double z_max,
const char* title,
const Scalar* defsurf,
206 bool draw_bound,
int ncour,
int nx,
int nz) {
210 const Map& mp = uu.get_mp() ;
215 float* uutab =
new float[nx*nz] ;
217 double hx = (x_max - x_min) /
double(nx-1) ;
218 double hza = (z_max - z_min) /
double(nz-1) ;
222 for (
int j=0; j<nz; j++) {
224 double z = z_min + hza * j ;
226 for (
int i=0; i<nx; i++) {
228 double x = x_min + hx * i ;
231 double r, theta, phi ;
232 mp.convert_absolute(x, y0, z, r, theta, phi) ;
234 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
238 float xmin1 = float(x_min / km) ;
239 float xmax1 = float(x_max / km) ;
240 float zmin1 = float(z_min / km) ;
241 float zmax1 = float(z_max / km) ;
243 const char* nomx =
"x [km]" ;
244 const char* nomz =
"z [km]" ;
251 const char* device = 0x0 ;
252 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
254 des_equipot(uutab, nx, nz, xmin1, xmax1, zmin1, zmax1, ncour, nomx, nomz,
255 title, device, newgraph) ;
260 if (defsurf != 0x0) {
262 assert( &(defsurf->get_mp()) == &mp ) ;
264 newgraph = draw_bound ? 0 : 2 ;
277 int ndom = mp.get_mg()->get_nzone() ;
279 for (
int l=0; l<ndom-1; l++) {
282 newgraph = (l == ndom-2) ? 2 : 0 ;
294void des_coupe_z(
const Scalar& uu,
double z0,
int nzdes,
const char* title,
295 const Scalar* defsurf,
double zoom,
bool draw_bound,
296 int ncour,
int nx,
int ny) {
298 const Map& mp = uu.get_mp() ;
300 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
301 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
302 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
303 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
305 ray = ( a1 > ray ) ? a1 : ray ;
306 ray = ( a2 > ray ) ? a2 : ray ;
307 ray = ( a3 > ray ) ? a3 : ray ;
311 double x_min = mp.get_ori_x() - ray ;
312 double x_max = mp.get_ori_x() + ray ;
313 double y_min = mp.get_ori_y() - ray ;
314 double y_max = mp.get_ori_y() + ray ;
316 des_coupe_z(uu, z0, x_min, x_max, y_min, y_max, title, defsurf, draw_bound,
324void des_coupe_z(
const Scalar& uu,
double z0,
double x_min,
double x_max,
325 double y_min,
double y_max,
const char* title,
const Scalar* defsurf,
326 bool draw_bound,
int ncour,
int nx,
int ny) {
330 const Map& mp = uu.get_mp() ;
335 float* uutab =
new float[ny*nx] ;
337 double hy = (y_max - y_min) /
double(ny-1) ;
338 double hx = (x_max - x_min) /
double(nx-1) ;
340 for (
int j=0; j<ny; j++) {
342 double y = y_min + hy * j ;
344 for (
int i=0; i<nx; i++) {
346 double x = x_min + hx * i ;
349 double r, theta, phi ;
350 mp.convert_absolute(x, y, z0, r, theta, phi) ;
352 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
356 float ymin1 = float(y_min / km) ;
357 float ymax1 = float(y_max / km) ;
358 float xmin1 = float(x_min / km) ;
359 float xmax1 = float(x_max / km) ;
361 const char* nomy =
"y [km]" ;
362 const char* nomx =
"x [km]" ;
368 const char* device = 0x0 ;
369 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
371 des_equipot(uutab, nx, ny, xmin1, xmax1, ymin1, ymax1, ncour, nomx, nomy,
372 title, device, newgraph) ;
380 if (defsurf != 0x0) {
382 assert( &(defsurf->get_mp()) == &mp ) ;
384 newgraph = draw_bound ? 0 : 2 ;
395 int ndom = mp.get_mg()->get_nzone() ;
397 for (
int l=0; l<ndom-1; l++) {
400 newgraph = (l == ndom-2) ? 2 : 0 ;
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.
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_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_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=0x0, int newgraph=3, int nxpage=1, int nypage=1)
Basic routine for drawing isocontours.
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.
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_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_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_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_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.
Standard units of space, time and mass.