86#include "utilitaires.h"
92void des_coupe_z(
const Cmp& uu,
double z0,
int nzdes,
const char* title,
93 const Cmp* defsurf,
double zoom,
bool draw_bound,
94 int ncour,
int nx,
int ny) {
96 const Map& mp = *(uu.get_mp()) ;
98 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
99 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
100 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
101 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
103 ray = ( a1 > ray ) ? a1 : ray ;
104 ray = ( a2 > ray ) ? a2 : ray ;
105 ray = ( a3 > ray ) ? a3 : ray ;
109 double x_min = mp.get_ori_x() - ray ;
110 double x_max = mp.get_ori_x() + ray ;
111 double y_min = mp.get_ori_y() - ray ;
112 double y_max = mp.get_ori_y() + ray ;
114 des_coupe_z(uu, z0, x_min, x_max, y_min, y_max, title, defsurf, draw_bound,
121void des_coupe_z(
const Cmp& uu,
double z0,
double x_min,
double x_max,
122 double y_min,
double y_max,
const char* title,
const Cmp* defsurf,
123 bool draw_bound,
int ncour,
int nx,
int ny) {
125 using namespace Unites ;
127 const Map& mp = *(uu.get_mp()) ;
132 float* uutab =
new float[ny*nx] ;
134 double hy = (y_max - y_min) /
double(ny-1) ;
135 double hx = (x_max - x_min) /
double(nx-1) ;
137 for (
int j=0; j<ny; j++) {
139 double y = y_min + hy * j ;
141 for (
int i=0; i<nx; i++) {
143 double x = x_min + hx * i ;
146 double r, theta,
phi ;
147 mp.convert_absolute(
x,
y, z0,
r, theta,
phi) ;
149 uutab[nx*j+i] = float(uu.val_point(
r, theta,
phi)) ;
153 float ymin1 = float(y_min / km) ;
154 float ymax1 = float(y_max / km) ;
155 float xmin1 = float(x_min / km) ;
156 float xmax1 = float(x_max / km) ;
158 const char* nomy =
"y [km]" ;
159 const char* nomx =
"x [km]" ;
165 const char* device = 0x0 ;
166 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
168 des_equipot(uutab, nx, ny, xmin1, xmax1, ymin1, ymax1, ncour, nomx, nomy,
169 title, device, newgraph) ;
177 if (defsurf != 0x0) {
179 assert(defsurf->get_mp() == uu.get_mp()) ;
181 newgraph = draw_bound ? 0 : 2 ;
183 des_surface_z(*defsurf, z0, device, newgraph) ;
192 int ndom = mp.get_mg()->get_nzone() ;
194 for (
int l=0; l<ndom-1; l++) {
197 newgraph = (l == ndom-2) ? 2 : 0 ;
199 des_domaine_z(mp, l, z0, device, newgraph) ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Coord y
y coordinate centered on the grid
Map(const Mg3d &)
Constructor from a multi-domain 3D grid.
Coord phi
coordinate centered on the grid
Coord x
x coordinate centered on the grid
Coord r
r coordinate centered on the grid