71#include "utilitaires.h"
77void 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) {
82 using namespace Unites ;
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 ;
144 des_surface_x(*defsurf1, x0, device, newgraph) ;
147 if (defsurf2 != 0x0) {
149 assert(defsurf2->get_mp() == uu2.get_mp()) ;
150 newgraph = draw_bound ? 0 : 2 ;
151 des_surface_x(*defsurf2, x0, device, newgraph) ;
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++) {
166 des_domaine_x(mp1, l, x0, device, newgraph) ;
169 for (
int l=0; l<ndom2-1; l++) {
172 newgraph = (l == ndom2-2) ? 2 : 0 ;
174 des_domaine_x(mp2, l, x0, device, newgraph) ;
183void 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) {
188 using namespace Unites ;
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 ;
252 des_surface_y(*defsurf1, y0, device, newgraph) ;
255 if (defsurf2 != 0x0) {
257 assert(defsurf2->get_mp() == uu2.get_mp()) ;
258 newgraph = draw_bound ? 0 : 2 ;
259 des_surface_y(*defsurf2, y0, device, newgraph) ;
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++) {
274 des_domaine_y(mp1, l, y0, device, newgraph) ;
277 for (
int l=0; l<ndom2-1; l++) {
280 newgraph = (l == ndom2-2) ? 2 : 0 ;
282 des_domaine_y(mp2, l, y0, device, newgraph) ;
291void 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) {
296 using namespace Unites ;
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 ;
358 des_surface_z(*defsurf1, z0, device, newgraph) ;
361 if (defsurf2 != 0x0) {
363 assert(defsurf2->get_mp() == uu2.get_mp()) ;
364 newgraph = draw_bound ? 0 : 2 ;
365 des_surface_z(*defsurf2, z0, device, newgraph) ;
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++) {
380 des_domaine_z(mp1, l, z0, device, newgraph) ;
383 for (
int l=0; l<ndom2-1; l++) {
386 newgraph = (l == ndom2-2) ? 2 : 0 ;
388 des_domaine_z(mp2, l, z0, device, newgraph) ;
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Coord z
z coordinate centered on the grid
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