23char des_coupe_bin_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_coupe_bin.C,v 1.6 2014/10/13 08:53:21 j_novak Exp $" ;
68#include "utilitaires.h"
74void des_coupe_bin_x(
const Cmp& uu1,
const Cmp& uu2,
double x0,
double y_min,
75 double y_max,
double z_min,
double z_max,
const char* title,
76 const Cmp* defsurf1,
const Cmp* defsurf2,
77 bool draw_bound,
int ncour,
int ny,
int nz) {
81 const Map& mp1 = *(uu1.get_mp()) ;
82 const Map& mp2 = *(uu2.get_mp()) ;
87 float* uutab =
new float[ny*nz] ;
89 double hy = (y_max - y_min) /
double(ny-1) ;
90 double hza = (z_max - z_min) /
double(nz-1) ;
92 for (
int j=0; j<nz; j++) {
94 double z = z_min + hza * j ;
96 for (
int i=0; i<ny; i++) {
98 double y = y_min + hy * i ;
100 double r, theta, phi ;
102 mp1.convert_absolute(x0, y, z, r, theta, phi) ;
103 double uu_1 = uu1.val_point(r, theta, phi) ;
105 mp2.convert_absolute(x0, y, z, r, theta, phi) ;
106 double uu_2 = uu2.val_point(r, theta, phi) ;
108 uutab[ny*j+i] = float(uu_1 + uu_2) ;
113 float ymin1 = float(y_min / km) ;
114 float ymax1 = float(y_max / km) ;
115 float zmin1 = float(z_min / km) ;
116 float zmax1 = float(z_max / km) ;
118 const char* nomy =
"y [km]" ;
119 const char* nomz =
"z [km]" ;
125 const char* device = 0x0 ;
126 int newgraph = ( (defsurf1 != 0x0) || (defsurf2 != 0x0) || draw_bound ) ?
129 des_equipot(uutab, ny, nz, ymin1, ymax1, zmin1, zmax1, ncour, nomy, nomz,
130 title, device, newgraph) ;
137 if (defsurf1 != 0x0) {
139 assert(defsurf1->get_mp() == uu1.get_mp()) ;
140 newgraph = ( (defsurf2 != 0x0) || draw_bound ) ? 0 : 2 ;
144 if (defsurf2 != 0x0) {
146 assert(defsurf2->get_mp() == uu2.get_mp()) ;
147 newgraph = draw_bound ? 0 : 2 ;
157 int ndom1 = mp1.get_mg()->get_nzone() ;
158 int ndom2 = mp2.get_mg()->get_nzone() ;
160 for (
int l=0; l<ndom1-1; l++) {
166 for (
int l=0; l<ndom2-1; l++) {
169 newgraph = (l == ndom2-2) ? 2 : 0 ;
180void des_coupe_bin_y(
const Cmp& uu1,
const Cmp& uu2,
double y0,
double x_min,
181 double x_max,
double z_min,
double z_max,
const char* title,
182 const Cmp* defsurf1,
const Cmp* defsurf2,
183 bool draw_bound,
int ncour,
int nx,
int nz) {
187 const Map& mp1 = *(uu1.get_mp()) ;
188 const Map& mp2 = *(uu2.get_mp()) ;
193 float* uutab =
new float[nx*nz] ;
195 double hx = (x_max - x_min) /
double(nx-1) ;
196 double hza = (z_max - z_min) /
double(nz-1) ;
200 for (
int j=0; j<nz; j++) {
202 double z = z_min + hza * j ;
204 for (
int i=0; i<nx; i++) {
206 double x = x_min + hx * i ;
208 double r, theta, phi ;
210 mp1.convert_absolute(x, y0, z, r, theta, phi) ;
211 double uu_1 = uu1.val_point(r, theta, phi) ;
213 mp2.convert_absolute(x, y0, z, r, theta, phi) ;
214 double uu_2 = uu2.val_point(r, theta, phi) ;
216 uutab[nx*j+i] = float(uu_1 + uu_2) ;
220 float xmin1 = float(x_min / km) ;
221 float xmax1 = float(x_max / km) ;
222 float zmin1 = float(z_min / km) ;
223 float zmax1 = float(z_max / km) ;
225 const char* nomx =
"x [km]" ;
226 const char* nomz =
"z [km]" ;
233 const char* device = 0x0 ;
234 int newgraph = ( (defsurf1 != 0x0) || (defsurf2 != 0x0) || draw_bound ) ?
237 des_equipot(uutab, nx, nz, xmin1, xmax1, zmin1, zmax1, ncour, nomx, nomz,
238 title, device, newgraph) ;
245 if (defsurf1 != 0x0) {
247 assert(defsurf1->get_mp() == uu1.get_mp()) ;
248 newgraph = ( (defsurf2 != 0x0) || draw_bound ) ? 0 : 2 ;
252 if (defsurf2 != 0x0) {
254 assert(defsurf2->get_mp() == uu2.get_mp()) ;
255 newgraph = draw_bound ? 0 : 2 ;
265 int ndom1 = mp1.get_mg()->get_nzone() ;
266 int ndom2 = mp2.get_mg()->get_nzone() ;
268 for (
int l=0; l<ndom1-1; l++) {
274 for (
int l=0; l<ndom2-1; l++) {
277 newgraph = (l == ndom2-2) ? 2 : 0 ;
288void des_coupe_bin_z(
const Cmp& uu1,
const Cmp& uu2,
double z0,
double x_min,
289 double x_max,
double y_min,
double y_max,
const char* title,
290 const Cmp* defsurf1,
const Cmp* defsurf2,
291 bool draw_bound,
int ncour,
int nx,
int ny) {
295 const Map& mp1 = *(uu1.get_mp()) ;
296 const Map& mp2 = *(uu2.get_mp()) ;
301 float* uutab =
new float[ny*nx] ;
303 double hy = (y_max - y_min) /
double(ny-1) ;
304 double hx = (x_max - x_min) /
double(nx-1) ;
306 for (
int j=0; j<ny; j++) {
308 double y = y_min + hy * j ;
310 for (
int i=0; i<nx; i++) {
312 double x = x_min + hx * i ;
314 double r, theta, phi ;
316 mp1.convert_absolute(x, y, z0, r, theta, phi) ;
317 double uu_1 = uu1.val_point(r, theta, phi) ;
319 mp2.convert_absolute(x, y, z0, r, theta, phi) ;
320 double uu_2 = uu2.val_point(r, theta, phi) ;
322 uutab[nx*j+i] = float(uu_1 + uu_2) ;
326 float ymin1 = float(y_min / km) ;
327 float ymax1 = float(y_max / km) ;
328 float xmin1 = float(x_min / km) ;
329 float xmax1 = float(x_max / km) ;
331 const char* nomy =
"y [km]" ;
332 const char* nomx =
"x [km]" ;
338 const char* device = 0x0 ;
339 int newgraph = ( (defsurf1 != 0x0) || (defsurf2 != 0x0) || draw_bound ) ?
342 des_equipot(uutab, nx, ny, xmin1, xmax1, ymin1, ymax1, ncour, nomx, nomy,
343 title, device, newgraph) ;
351 if (defsurf1 != 0x0) {
353 assert(defsurf1->get_mp() == uu1.get_mp()) ;
354 newgraph = ( (defsurf2 != 0x0) || draw_bound ) ? 0 : 2 ;
358 if (defsurf2 != 0x0) {
360 assert(defsurf2->get_mp() == uu2.get_mp()) ;
361 newgraph = draw_bound ? 0 : 2 ;
371 int ndom1 = mp1.get_mg()->get_nzone() ;
372 int ndom2 = mp2.get_mg()->get_nzone() ;
374 for (
int l=0; l<ndom1-1; l++) {
380 for (
int l=0; l<ndom2-1; l++) {
383 newgraph = (l == ndom2-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_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_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_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_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.
Standard units of space, time and mass.