0001 struct polynomial_piecewise_0D {
0002 double *data;
0003 };
0004
0005 struct polynomial_piecewise_1D {
0006 mxChar *form_f;
0007 double *breaks_f;
0008 double *coefs_f;
0009 double *pieces_f;
0010 double *order_f;
0011 double *dim_f;
0012 mxChar *orient_f;
0013 mxChar *form_dfdrho;
0014 double *breaks_dfdrho;
0015 double *coefs_dfdrho;
0016 double *pieces_dfdrho;
0017 double *order_dfdrho;
0018 double *dim_dfdrho;
0019 mxChar *orient_dfdrho;
0020 mxChar *form_d2fdrho2;
0021 double *breaks_d2fdrho2;
0022 double *coefs_d2fdrho2;
0023 double *pieces_d2fdrho2;
0024 double *order_d2fdrho2;
0025 double *dim_d2fdrho2;
0026 mxChar *orient_d2fdrho2;
0027 };
0028
0029 struct polynomial_piecewise_2D {
0030 double *n;
0031 mxChar *form_a0;
0032 double *breaks_a0;
0033 double *coefs_a0;
0034 double *pieces_a0;
0035 double *order_a0;
0036 double *dim_a0;
0037 mxChar *orient_a0;
0038 mxChar *form_da0drho;
0039 double *breaks_da0drho;
0040 double *coefs_da0drho;
0041 double *pieces_da0drho;
0042 double *order_da0drho;
0043 double *dim_da0drho;
0044 mxChar *orient_da0drho;
0045 mxChar *form_d2a0drho2;
0046 double *breaks_d2a0drho2;
0047 double *coefs_d2a0drho2;
0048 double *pieces_d2a0drho2;
0049 double *order_d2a0drho2;
0050 double *dim_d2a0drho2;
0051 mxChar *orient_d2a0drho2;
0052 mxChar *form_an;
0053 double *breaks_an;
0054 double *coefs_an;
0055 double *pieces_an;
0056 double *order_an;
0057 double *dim_an;
0058 mxChar *orient_an;
0059 mxChar *form_dandrho;
0060 double *breaks_dandrho;
0061 double *coefs_dandrho;
0062 double *pieces_dandrho;
0063 double *order_dandrho;
0064 double *dim_dandrho;
0065 mxChar *orient_dandrho;
0066 mxChar *form_d2andrho2;
0067 double *breaks_d2andrho2;
0068 double *coefs_d2andrho2;
0069 double *pieces_d2andrho2;
0070 double *order_d2andrho2;
0071 double *dim_d2andrho2;
0072 mxChar *orient_d2andrho2;
0073 mxChar *form_bn;
0074 double *breaks_bn;
0075 double *coefs_bn;
0076 double *pieces_bn;
0077 double *order_bn;
0078 double *dim_bn;
0079 mxChar *orient_bn;
0080 mxChar *form_dbndrho;
0081 double *breaks_dbndrho;
0082 double *coefs_dbndrho;
0083 double *pieces_dbndrho;
0084 double *order_dbndrho;
0085 double *dim_dbndrho;
0086 mxChar *orient_dbndrho;
0087 mxChar *form_d2bndrho2;
0088 double *breaks_d2bndrho2;
0089 double *coefs_d2bndrho2;
0090 double *pieces_d2bndrho2;
0091 double *order_d2bndrho2;
0092 double *dim_d2bndrho2;
0093 mxChar *orient_d2bndrho2;
0094 };
0095
0096 typedef struct polynomial_piecewise_0D pp_0D_format;
0097 typedef struct polynomial_piecewise_1D pp_1D_format;
0098 typedef struct polynomial_piecewise_2D pp_2D_format;
0099
0100 struct rayprofiles {
0101 double *Te;
0102 double *ne;
0103 double *zTi;
0104 double *zni;
0105 double *dTedY;
0106 double *dnedY;
0107 double **dzTidY;
0108 double **dznidY;
0109 double *d2TedY2;
0110 double *d2nedY2;
0111 double **d2zTidY2;
0112 double **d2znidY2;
0113 };
0114
0115 struct rayparam {
0116 double *testmode;
0117 double *tensortype;
0118 double *t0;
0119 double *tfinal;
0120 double *dt0;
0121 double *dS;
0122 double *tol;
0123 double *kmax;
0124 double *ncyclharm;
0125 double *reflection;
0126 double *rel_opt;
0127 double *nperp;
0128 double *pperpmax;
0129 double *tau_lim;
0130 double *kextra;
0131 double *rhomin;
0132 double *metricmode;
0133 double *rhoswitch;
0134 double *deltaswitch;
0135 double *substitution_method;
0136 };
0137
0138 struct equilparam {
0139 double *zZi;
0140 double *zmi;
0141 int *ns;
0142 double *Rp;
0143 double *ap;
0144 double *Zp;
0145 double *psia_apRp;
0146 };
0147
0148 struct distriparam {
0149 double *pn;
0150 int *npn;
0151 double *mhu;
0152 int *nmhu;
0153 double *ne_ref;
0154 double *betath_ref;
0155 };
0156
0157 struct fluctparam {
0158 int *ne_nmodel;
0159 double **ne_model;
0160 double **ne_sigmar_max;
0161 double **ne_sigmar_hwhm;
0162 double **ne_sigmar_rho;
0163 double **ne_polmode;
0164 double **ne_epsi_rho;
0165 double **ne_epsi_theta;
0166 double **ne_epsi_phi;
0167 double **ne_lmin;
0168 double **ne_mmin;
0169 double **ne_nmin;
0170 double **ne_lmax;
0171 double **ne_mmax;
0172 double **ne_nmax;
0173 int **ne_nphase;
0174 double **ne_phase;
0175 int *B_nmodel;
0176 double **B_model;
0177 double **B_sigmar_max;
0178 double **B_sigmar_hwhm;
0179 double **B_sigmar_rho;
0180 double **B_polmode;
0181 double **B_epsi_rho;
0182 double **B_epsi_theta;
0183 double **B_epsi_phi;
0184 double **B_lmin;
0185 double **B_mmin;
0186 double **B_nmin;
0187 double **B_lmax;
0188 double **B_mmax;
0189 double **B_nmax;
0190 int **B_nphase;
0191 double **B_phase;
0192 };
0193
0194 struct raymagnetic {
0195 double *rn;
0196 double *drndY;
0197 double *d2rndY2;
0198 double *xn;
0199 double *dxndY;
0200 double *d2xndY2;
0201 double *yn;
0202 double *dyndY;
0203 double *d2yndY2;
0204 double *Brhon;
0205 double *dBrhondY;
0206 double *d2BrhondY2;
0207 double *Bsn;
0208 double *dBsndY;
0209 double *d2BsndY2;
0210 double *Bzn;
0211 double *dBzndY;
0212 double *d2BzndY2;
0213 double *B;
0214 double *dBdY;
0215 double *d2BdY2;
0216 double *salpha;
0217 double *dsalphadY;
0218 double *d2salphadY2;
0219 double *calpha;
0220 double *dcalphadY;
0221 double *d2calphadY2;
0222 double *gradrhon;
0223 double *dgradrhondY;
0224 double *d2gradrhondY2;
0225 double *rhorip;
0226 double *drhoripdY;
0227 double *d2rhoripdY2;
0228 double *Upsilonn;
0229 double *dUpsilonndY;
0230 double *d2UpsilonndY2;
0231 };
0232
0233 struct susceptibilitytensor {
0234 double complex *Xxx;
0235 double complex *Xxy;
0236 double complex *Xxz;
0237 double complex *Xyy;
0238 double complex *Xyz;
0239 double complex *Xzz;
0240 double complex *dXxxdNperp;
0241 double complex *dXxydNperp;
0242 double complex *dXxzdNperp;
0243 double complex *dXyydNperp;
0244 double complex *dXyzdNperp;
0245 double complex *dXzzdNperp;
0246 double complex *dXxxdNpar;
0247 double complex *dXxydNpar;
0248 double complex *dXxzdNpar;
0249 double complex *dXyydNpar;
0250 double complex *dXyzdNpar;
0251 double complex *dXzzdNpar;
0252 double complex *dXxxdY;
0253 double complex *dXxydY;
0254 double complex *dXxzdY;
0255 double complex *dXyydY;
0256 double complex *dXyzdY;
0257 double complex *dXzzdY;
0258 };
0259
0260 struct raydistri {
0261 pp_1D_format f0_fit;
0262 pp_2D_format PSI_fit;
0263 };
0264
0265 struct rayfluctuations {
0266 pp_0D_format L_rho;
0267 pp_1D_format xq_fit,xL_theta_fit,xL_perp_fit;
0268 pp_2D_format XL_phi_fit;
0269 pp_2D_format *B_sfx_fit,*B_sfy_fit,*B_sfz_fit;
0270 pp_2D_format Xcm_fit,Xcn_fit;
0271 };
0272
0273 struct rayequil {
0274 pp_1D_format Te_fit,ne_fit,zTi_fit,zni_fit;
0275 pp_2D_format x_fit,y_fit,r_fit;
0276 pp_2D_format calpha_fit,salpha_fit;
0277 pp_2D_format gradrho_fit;
0278 pp_2D_format Bx_fit,By_fit,Bz_fit,BP_fit,B_fit;
0279 };
0280
0281 typedef struct susceptibilitytensor susceptibilitytensor_format;
0282 typedef struct rayparam rayparam_format;
0283 typedef struct equilparam equilparam_format;
0284 typedef struct fluctparam fluctparam_format;
0285 typedef struct refractiveindex refractiveindex_format;
0286 typedef struct raymagnetic raymagnetic_format;
0287 typedef struct rayprofiles rayprofiles_format;
0288 typedef struct rayfluctuations rayfluctuations_format;
0289 typedef struct rayequil rayequil_format;
0290 typedef struct distriparam distriparam_format;
0291 typedef struct raydistri raydistri_format;
0292
0293
0294
0295 void ppvald_0D();
0296 void ppvald_1D();
0297 void ppvald_2D();
0298 void ppvali_2D();
0299 void ray();
0300 void rayindex();
0301 void susceptibility();
0302 void rayprocess();
0303 void metrictensor();
0304 double alphaphi_jd();
0305 void coldtensor();
0306 void dsolve();
0307 void testparam();
0308 void disprel();
0309 void interpequil();
0310 void interpequil_test();
0311 void load_idealequil_test();
0312 equilparam_format load_equil_param();
0313 fluctparam_format load_fluct_param();
0314 rayparam_format load_ray_param();
0315 pp_0D_format load_value_0D();
0316 pp_1D_format load_profile_1D();
0317 pp_2D_format load_grid_2D();
0318 distriparam_format load_distri_param();
0319 double inf_norm();
0320 double sgn();
0321 void halftanh();
0322 void buildXstruc();
0323 void calcY();
0324 void Zdisp();
0325 void ZFriedConte();
0326 void hottensor();
0327 void Gamma();
0328 void modBessel();
0329 void imagBessel();
0330 void dawson();
0331 void smith();
0332 void vacuumtensor();
0333 int reflection();
0334 void polarization();
0335 void build_raymagnetic();
0336 void weakrelativistictensor();
0337 void Shka();
0338 void ImShka();
0339 void Fdnest();
0340 void ImFdnest();
0341 void kperproots();
0342 double complex matdot();
0343 void substitution();
0344 void xy2rhotheta();
0345 void rhotheta2xy();
0346 void rho1D_dichotomy();
0347 void rho1D_newton_numeric();
0348 void rho1D_newton_analytic();
0349 void substitution();
0350 void substitution_dichotomy_1D();
0351 void substitution_dichotomy_2D();
0352 void substitution_newton_numeric_1D();
0353 void substitution_newton_numeric_2D();
0354 void substitution_newton_analytic_1D();
0355 void substitution_newton_analytic_2D();
0356 void substitution_newton_mix_2D();