00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 char des_prof_cmp_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_prof_cmp.C,v 1.6 2008/08/19 06:42:00 j_novak Exp $" ;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 #include <math.h>
00064
00065
00066
00067 #include "cmp.h"
00068 #include "graphique.h"
00069 #include "unites.h"
00070
00071
00072
00073 void des_profile(const Cmp& uu, double r_min, double r_max,
00074 double theta, double phi, const char* nomy, const char* title) {
00075
00076 using namespace Unites ;
00077
00078 const int npt = 400 ;
00079
00080 float uutab[npt] ;
00081
00082 double hr = (r_max - r_min) / double(npt-1) ;
00083
00084 for (int i=0; i<npt; i++) {
00085
00086 double r = hr * i + r_min ;
00087
00088 uutab[i] = float(uu.val_point(r, theta, phi)) ;
00089
00090 }
00091
00092 float xmin = float(r_min / km) ;
00093 float xmax = float(r_max / km) ;
00094
00095 const char* nomx = "r [km]" ;
00096
00097 if (title == 0x0) {
00098 title = "" ;
00099 }
00100
00101 if (nomy == 0x0) {
00102 nomy = "" ;
00103 }
00104
00105
00106 des_profile(uutab, npt, xmin, xmax, nomx, nomy, title) ;
00107
00108 }
00109
00110
00111
00112 void des_profile(const Cmp& uu, double r_min, double r_max, double scale,
00113 double theta, double phi, const char* nomx, const char* nomy, const char* title) {
00114
00115
00116 const int npt = 400 ;
00117
00118 float uutab[npt] ;
00119
00120 double hr = (r_max - r_min) / double(npt-1) ;
00121
00122 for (int i=0; i<npt; i++) {
00123
00124 double r = hr * i + r_min ;
00125
00126 uutab[i] = float(uu.val_point(r, theta, phi)) ;
00127
00128 }
00129
00130 float xmin = float(r_min * scale) ;
00131 float xmax = float(r_max * scale) ;
00132
00133
00134 if (title == 0x0) {
00135 title = "" ;
00136 }
00137
00138 if (nomx == 0x0) {
00139 nomx = "" ;
00140 }
00141
00142 if (nomy == 0x0) {
00143 nomy = "" ;
00144 }
00145
00146
00147 des_profile(uutab, npt, xmin, xmax, nomx, nomy, title) ;
00148
00149 }
00150
00151