00001
00002
00003
00004 #ifndef RFIELD_H_
00005 #define RFIELD_H_
00006
00007
00008 #include "energy.h"
00009
00011 const double WL_V_FILT = 5500.;
00012
00014 const double WL_B_FILT = 4400.;
00015
00018 const int LIMSPC = 100;
00019
00021 const int NCELL = 130000;
00022
00024 void rfield_opac_zero( long lo , long ihi );
00025
00027 extern bool lgRfieldMalloced;
00028
00029 namespace Illuminate {
00030 typedef enum { FORWARD , REVERSE , SYMMETRIC } IlluminationType ;
00031 }
00032
00033 struct t_rfield {
00034
00043 long int nflux;
00044
00046 long int nupper;
00047
00049 realnum emm;
00050
00052 realnum egamry;
00053
00055 realnum FluxFaint;
00056
00058 double *anu;
00059
00062 double *AnuOrg;
00063
00065 realnum *widflx;
00066
00068 long int *line_count;
00069
00071 realnum *OccNumbBremsCont;
00072
00074 realnum *OccNumbContEmitOut;
00075
00077 realnum *anulog,
00078 *anusqr,
00079 *anu2,
00080 *anu3;
00081
00086 realnum **flux;
00087
00089 realnum *flux_isotropic;
00090
00092 realnum *flux_beam_time , *flux_beam_const;
00093
00095 realnum *flux_accum;
00096
00098 realnum *ExtinguishFactor;
00099 realnum ExtinguishLeakage,
00100 ExtinguishColumnDensity,
00101 ExtinguishLowEnergyLimit,
00103 ExtinguishConvertColDen2OptDepth ,
00105 ExtinguishEnergyPowerLow;
00106
00110 bool lgMustBlockHIon;
00111
00112
00113
00114 bool lgBlockHIon;
00115
00117 bool lgDoLineTrans;
00118
00121 bool lgOpacityReevaluate;
00122
00124 bool lgCMB_set;
00125
00128 bool lgIonizReevaluate;
00129
00131 bool lgMeshSetUp;
00132
00134 realnum *convoc;
00135
00138 realnum *OccNumbIncidCont;
00139
00141 realnum *OccNumbDiffCont;
00142
00145 double *ContBoltz;
00146
00149 realnum **ConEmitLocal;
00150
00152 realnum **ConSourceFcnLocal;
00153
00155 realnum **ConEmitReflec;
00156
00161 realnum **ConEmitOut;
00162
00164 realnum *ConInterOut;
00165
00167 realnum **ConRefIncid;
00168
00171 double *SummedCon;
00172 realnum *SummedDif;
00173 realnum *SummedOcc;
00174 realnum *SummedDifSave;
00175
00178 realnum *ConOTS_local_photons,
00180 *ConOTS_local_OTS_rate;
00181
00184 realnum *DiffuseEscape;
00185
00187 realnum *TotDiff2Pht;
00188
00191 realnum
00193 *otslin,
00195 *otscon,
00196 **otssav;
00197
00199 realnum **outlin,
00200 *outlin_noplot;
00201
00203 realnum *DiffuseLineEmission;
00204
00206 realnum **reflin;
00207
00209 realnum **flux_total_incident;
00210 realnum *flux_beam_const_save , *flux_time_beam_save , *flux_isotropic_save;
00211
00213 realnum time_continuum_scale;
00214
00217 realnum DiffPumpOn;
00218
00220 char **chLineLabel;
00221
00223 char **chContLabel;
00224
00227 realnum **gff;
00228
00232 bool lgCompileGauntFF;
00233
00236 char chDffTrns[4];
00237
00241 bool lgOutOnly;
00242
00245 long int ipEnergyBremsThin;
00246 realnum EnergyBremsThin;
00247
00249 long int ipMaxBolt;
00250
00252 bool lgInducProcess;
00253
00255 double *comup,
00256 *comdn;
00257
00259 long int ipB_filter , ipV_filter;
00260
00263 long int ipG0_TH85_lo , ipG0_TH85_hi;
00264
00267 long int ipG0_DB96_lo , ipG0_DB96_hi;
00268
00270 long int ipG0_spec_lo , ipG0_spec_hi;
00271
00273 long int ip1000A;
00274
00277 double extin_mag_B_point , extin_mag_V_point;
00278
00281 double extin_mag_B_extended , extin_mag_V_extended;
00282
00284 double opac_mag_B_point, opac_mag_V_point, opac_mag_B_extended , opac_mag_V_extended;
00285
00288 realnum *csigh,
00289 *csigc;
00290
00291 double comtot,
00292 cmheat,
00293 cmcool,
00294 cinrat;
00295 bool lgComptonOn;
00296
00298 bool lgComUndr;
00299
00300 double totpow[LIMSPC],
00301 slope[LIMSPC],
00302 cutoff[LIMSPC][3],
00303 spfac[LIMSPC];
00304
00306 bool lgTimeVary[LIMSPC];
00307
00308
00309
00310 bool lgBeamed[LIMSPC];
00311
00314 realnum OpticalDepthScaleFactor[LIMSPC];
00315
00316 Illuminate::IlluminationType Illumination[LIMSPC];
00317
00322 long int nShape,
00323 ipSpec;
00324
00330 vector<Energy> tNu[LIMSPC];
00331 vector<realnum> tslop[LIMSPC];
00333 vector<realnum> tFluxLog[LIMSPC];
00334
00335 long ncont[LIMSPC];
00336
00339 double RSFCheck[LIMSPC];
00340
00343 bool lgContMalloc[LIMSPC];
00344
00347 double range[LIMSPC][2];
00348
00351 char chSpNorm[LIMSPC][5],
00352 chRSpec[LIMSPC][5],
00353 chSpType[LIMSPC][6];
00354
00356 realnum qhtot,
00357 qhe,
00358 qheii,
00359 qbal,
00360 qrad,
00361 qtot;
00362
00364 realnum uh;
00365
00367 realnum uheii;
00368
00370 bool lgUSphON;
00372 realnum rstrom;
00373
00376 bool lgHabing;
00377
00380 long int fine_opac_nelem;
00381
00383 long int fine_opac_nresolv;
00384
00386 realnum fine_opac_velocity_width;
00387
00388 private:
00390 realnum *trans_coef_total;
00391
00392 public:
00393 bool trans_coef_total_stale;
00394
00397 long int *ipnt_coarse_2_fine;
00398
00400 realnum fine_ener_lo, fine_ener_hi;
00402 long nfine;
00404 long nfine_malloc;
00406 double fine_resol;
00408 realnum *fine_opac_zone;
00410 realnum *fine_opt_depth;
00412 realnum *fine_anu;
00413
00418 long int ipFineConVelShift;
00419
00421 bool lgOpacityFine;
00423 bool lgSaveOpacityFine;
00424
00427 bool lgLyaOTS;
00428
00431 bool lgHeIIOTS;
00432
00434 bool lgKillOutLine;
00435
00437 bool lgKillOutCont;
00438
00440 bool lgKillOTSLine;
00441
00445 bool lgPlasNu;
00447 realnum plsfrq,
00449 plsfrqmax;
00450
00451 long int nZonePlsFrqEval;
00453 long int ipPlasma,
00455 ipPlasmax;
00456
00459 bool lgMMok,
00460 lgHPhtOK,
00461 lgXRayOK,
00462 lgGamrOK;
00463
00465 realnum EnerGammaRay;
00466 long int ipEnerGammaRay;
00467
00469 bool lgHionRad;
00470
00472 realnum occmax,
00473 occmnu,
00474 tbrmax,
00475 tbrmnu,
00476 tbr4nu,
00477 occ1nu;
00478
00480 bool lgOcc1Hi;
00481
00484 realnum EnergyIncidCont ,
00485 EnergyDiffCont;
00486
00487
00488 t_rfield( )
00489 {
00490 nZonePlsFrqEval = -1;
00491
00492
00493 ExtinguishConvertColDen2OptDepth = (realnum)6.22e-18;
00494
00495 ExtinguishEnergyPowerLow = (realnum)-2.43;
00496
00497
00498 emm = 1.001e-8f;
00499 egamry = 7.354e6f;
00500
00501
00502 for( long i=0; i < LIMSPC; i++ )
00503 lgContMalloc[i] = false;
00504 }
00505
00506 const realnum *getCoarseTransCoef();
00507
00508 void setCoarseTransCoefPtr(realnum *ptr)
00509 {
00510 trans_coef_total = ptr;
00511 }
00512 void resetCoarseTransCoef()
00513 {
00514 for (long i=0; i<nupper; ++i)
00515 trans_coef_total[i] = 1.0;
00516 trans_coef_total_stale = true;
00517 }
00518 };
00519 extern t_rfield rfield;
00520
00521
00522 #endif