cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rfield.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef RFIELD_H_
5 #define RFIELD_H_
6 
7 /* rfield.h */
8 #include "energy.h"
9 #include "module.h"
10 #include "vectorize.h"
11 #include "mesh.h"
12 
14 const double WL_V_FILT = 5500.;
15 
17 const double WL_B_FILT = 4400.;
18 
21 const int LIMSPC = 100;
22 
24 void rfield_opac_zero( long lo , long ihi );
25 
27 extern bool lgRfieldMalloced;
28 
29 namespace Illuminate {
30  typedef enum { FORWARD , REVERSE , ISOTROPIC } IlluminationType ;
31 }
32 
33 struct t_rfield : public module, public t_mesh {
34  const char *chName() const
35  {
36  return "rfield";
37  }
38 
39  void zero();
40  void comment(t_warnings&) {}
46  long int nflux;
47 
49  long int nflux_with_check;
50 
53  long int nPositive;
54 
56  double FluxFaint;
57 
59  long int *line_count;
60 
63 
69 
72 
75 
78 
88 
93 
94  /* this is set true if H-ionizing radiation is blocked with extinguish
95  * command */
97 
100 
104 
106  bool lgCMB_set;
107 
111 
114 
118 
121 
124  vector<double, allocator_avx<double> > ContBoltz;
125 
127  vector<double, allocator_avx<double> > ContBoltzHelp1;
128  vector<double, allocator_avx<double> > ContBoltzHelp2;
129 
131  vector<double, allocator_avx<double> > vexp_arg;
132 
135  vector<double, allocator_avx<double> > ContBoltzAvg;
136 
139  realnum **ConEmitLocal/* [depth][energy]*/;
140 
142  realnum **ConSourceFcnLocal/* [depth][energy]*/;
143 
146 
152 
155 
158 
161  double *SummedCon;
165 
171 
175 
178 
181  realnum
183  *otslin/*[rfield.nflux_with_check]*/,
185  *otscon/*[rfield.nflux_with_check]*/,
186  **otssav/*[rfield.nflux_with_check][2]*/;
187 
190  *outlin_noplot;
191 
194 
196  realnum **reflin/*[rfield.nflux_with_check]*/;
197 
201 
204 
208 
210  vector<string> chLineLabel/*[rfield.nflux_with_check][5]*/;
211 
213  vector<string> chContLabel/*[rfield.nflux_with_check][5]*/;
214 
217  char chDffTrns[4];
218 
222  bool lgOutOnly;
223 
228 
230  long int ipMaxBolt;
231 
234 
236  double *comup,
237  *comdn;
238 
240  long int ipB_filter , ipV_filter;
241 
245 
249 
252 
254  long int ip1000A;
255 
259 
263 
266 
270  *csigc;
271 
274 
275  double comtot,
276  cmheat,
277  cmcool,
278  cinrat;
280 
282  bool lgComUndr;
283 
284  double totpow[LIMSPC],
285  slope[LIMSPC],
286  cutoff[LIMSPC][3],
287  spfac[LIMSPC];
288 
291 
292  /* beamed or isotropic continuum? if isotropic then does not vary
293  * with time */
295 
299 
301 
306  long int nShape,
307  ipSpec;
308 
314  vector<Energy> tNu[LIMSPC];
315  vector<realnum> tslop[LIMSPC];
317  vector<realnum> tFluxLog[LIMSPC];
322 
323  long ncont[LIMSPC];
324 
327  double RSFCheck[LIMSPC];
328 
331  double range[LIMSPC][2];
332 
335  char chSpNorm[LIMSPC][5],
336  chRSpec[LIMSPC][5],
337  chSpType[LIMSPC][6],
338  chCumuType[5];
339 
342  qhe,
343  qheii,
344  qbal,
345  qrad,
346  qtot;
347 
350 
353 
355  bool lgUSphON;
358 
361  bool lgHabing;
362 
365  long int fine_opac_nelem;
366 
369 
372 
373 private:
376 
377 public:
379 
383 
387  long nfine;
389  double fine_resol;
396 
402 
407 
410  bool lgLyaOTS;
411 
414  bool lgHeIIOTS;
415 
418 
421 
424 
428  bool lgPlasNu;
432  plsfrqmax;
433  // the zone where the plasma frequency is evaluated
434  long int nZonePlsFrqEval;
436  long int ipPlasma,
438  ipPlasmax;
439 
442  bool lgMMok,
443  lgHPhtOK,
444  lgXRayOK,
445  lgGamrOK;
446 
449  long int ipEnerGammaRay;
450 
452  bool lgHionRad;
453 
456  occmnu,
457  tbrmax,
458  tbrmnu,
459  tbr4nu,
460  occ1nu;
461 
463  bool lgOcc1Hi;
464 
469 
470  // constructor
472  {
473  nZonePlsFrqEval = -1;
474 
475  // the constant that multiplies the column density to get optical depth at 1 Ryd
477  // the power on the energy for the extinction
479  }
480 
481  const realnum *getCoarseTransCoef();
482 
484  {
485  trans_coef_total = ptr;
486  }
488  {
489  for (long i=0; i<nflux_with_check; ++i)
490  trans_coef_total[i] = 1.0;
491  trans_coef_total_stale = true;
492  }
493  void setTrimming();
494 };
495 extern t_rfield rfield;
496 
508 double flux_correct_isotropic( const bool lgSaveIsotrp, const int nEmType, const int j );
509 
518 double flux_correct_isotropic( const int nEmType, const int j );
519 
520 #endif /* RFIELD_H_ */
realnum ** ConSourceFcnLocal
Definition: rfield.h:142
realnum * fine_opt_depth
Definition: rfield.h:393
realnum * fine_anu
Definition: rfield.h:395
realnum * csigh
Definition: rfield.h:269
long int * line_count
Definition: rfield.h:59
vector< double, allocator_avx< double > > ContBoltz
Definition: rfield.h:124
realnum * ConOTS_local_OTS_rate
Definition: rfield.h:168
bool lgBeamed[LIMSPC]
Definition: rfield.h:294
vector< double, allocator_avx< double > > vexp_arg
Definition: rfield.h:131
realnum * flux_isotropic
Definition: rfield.h:71
bool lgGamrOK
Definition: rfield.h:442
bool lgSaveOpacityFine
Definition: rfield.h:406
long int ipG0_spec_hi
Definition: rfield.h:251
long int fine_opac_nresolv
Definition: rfield.h:368
const char * chName() const
Definition: rfield.h:34
double comtot
Definition: rfield.h:275
double opac_mag_B_extended
Definition: rfield.h:265
realnum qtot
Definition: rfield.h:341
realnum EnerGammaRay
Definition: rfield.h:448
long int ipG0_DB96_hi
Definition: rfield.h:248
bool lgKillOutLine
Definition: rfield.h:417
long int ipEnergyBremsThin
Definition: rfield.h:226
void setTrimming()
Definition: rfield.cpp:92
realnum qbal
Definition: rfield.h:341
realnum * flux_beam_const_save
Definition: rfield.h:200
realnum ** flux
Definition: rfield.h:68
realnum * DiffuseLineEmission
Definition: rfield.h:193
const double WL_V_FILT
Definition: rfield.h:14
realnum occ1nu
Definition: rfield.h:455
bool lgSphericalDilution[LIMSPC]
Definition: rfield.h:321
vector< string > chContLabel
Definition: rfield.h:213
realnum * DiffuseEscape
Definition: rfield.h:174
realnum EnergyBremsThin
Definition: rfield.h:227
double opac_mag_V_point
Definition: rfield.h:265
double totpow[LIMSPC]
Definition: rfield.h:284
realnum * outlin_noplot
Definition: rfield.h:189
char chDffTrns[4]
Definition: rfield.h:217
char chRSpec[LIMSPC][5]
Definition: rfield.h:335
void rfield_opac_zero(long lo, long ihi)
realnum ** flux_total_incident
Definition: rfield.h:199
bool lgOcc1Hi
Definition: rfield.h:463
realnum fine_opac_velocity_width
Definition: rfield.h:371
long int ipG0_spec_lo
Definition: rfield.h:251
long int ipMaxBolt
Definition: rfield.h:230
realnum * OccNumbContEmitOut
Definition: rfield.h:62
bool lgOpacityFine
Definition: rfield.h:404
realnum qhe
Definition: rfield.h:341
long int ipG0_TH85_hi
Definition: rfield.h:244
double * SummedCon
Definition: rfield.h:161
double TableRadius[LIMSPC]
Definition: rfield.h:319
long int nZonePlsFrqEval
Definition: rfield.h:434
bool lgKillOutCont
Definition: rfield.h:420
double RSFCheck[LIMSPC]
Definition: rfield.h:327
realnum * SummedOcc
Definition: rfield.h:163
bool lgIonizReevaluate
Definition: rfield.h:110
vector< Energy > tNu[LIMSPC]
Definition: rfield.h:314
vector< double, allocator_avx< double > > ContBoltzHelp2
Definition: rfield.h:128
vector< realnum > tFluxLog[LIMSPC]
Definition: rfield.h:317
bool lgKillOTSLine
Definition: rfield.h:423
void comment(t_warnings &)
Definition: rfield.h:40
long int ipEnerGammaRay
Definition: rfield.h:449
vector< double, allocator_avx< double > > ContBoltzAvg
Definition: rfield.h:135
realnum ** outlin
Definition: rfield.h:189
long ncont[LIMSPC]
Definition: rfield.h:323
long int ipG0_TH85_lo
Definition: rfield.h:244
double spfac[LIMSPC]
Definition: rfield.h:284
vector< realnum > tslop[LIMSPC]
Definition: rfield.h:315
realnum * ConOTS_local_photons
Definition: rfield.h:168
realnum time_continuum_scale
Definition: rfield.h:203
realnum * flux_accum
Definition: rfield.h:77
bool lgHeIIOTS
Definition: rfield.h:414
IlluminationType
Definition: rfield.h:30
realnum ExtinguishEnergyPowerLow
Definition: rfield.h:81
double cutoff[LIMSPC][3]
Definition: rfield.h:284
bool lgTimeVary[LIMSPC]
Definition: rfield.h:290
void resetCoarseTransCoef()
Definition: rfield.h:487
double * comup
Definition: rfield.h:236
double range[LIMSPC][2]
Definition: rfield.h:331
bool lgHabing
Definition: rfield.h:361
const int LIMSPC
Definition: rfield.h:21
long int nflux_with_check
Definition: rfield.h:49
realnum ExtinguishConvertColDen2OptDepth
Definition: rfield.h:81
realnum EnergyIncidCont
Definition: rfield.h:467
const realnum * getCoarseTransCoef()
Definition: rfield.cpp:56
long int fine_opac_nelem
Definition: rfield.h:365
realnum * otslin
Definition: rfield.h:183
realnum ExtinguishLeakage
Definition: rfield.h:81
long int ipG0_DB96_lo
Definition: rfield.h:248
realnum ** ConEmitLocal
Definition: rfield.h:139
double fine_resol
Definition: rfield.h:389
bool lgOutOnly
Definition: rfield.h:222
double slope[LIMSPC]
Definition: rfield.h:284
realnum tbrmax
Definition: rfield.h:455
bool lgHPhtOK
Definition: rfield.h:442
long int ipPlasma
Definition: rfield.h:436
bool lgCMB_set
Definition: rfield.h:106
Definition: mesh.h:10
bool trans_coef_total_stale
Definition: rfield.h:378
bool lgLyaOTS
Definition: rfield.h:410
realnum qhtot
Definition: rfield.h:341
double cmcool
Definition: rfield.h:275
t_rfield rfield
Definition: rfield.cpp:9
realnum * flux_time_beam_save
Definition: rfield.h:200
realnum * convoc
Definition: rfield.h:113
realnum * ConInterOut
Definition: rfield.h:154
float realnum
Definition: cddefines.h:124
realnum uh
Definition: rfield.h:349
Illuminate::IlluminationType Illumination[LIMSPC]
Definition: rfield.h:300
double opac_mag_B_point
Definition: rfield.h:265
realnum uheii
Definition: rfield.h:352
long int ipFineConVelShift
Definition: rfield.h:401
double FluxFaint
Definition: rfield.h:56
realnum * otscon
Definition: rfield.h:183
double cmheat
Definition: rfield.h:275
bool lgMustBlockHIon
Definition: rfield.h:92
realnum * OccNumbIncidCont
Definition: rfield.h:117
realnum rstrom
Definition: rfield.h:357
realnum * eeBremsDif
Definition: rfield.h:273
bool lgXRayOK
Definition: rfield.h:442
vector< string > chLineLabel
Definition: rfield.h:210
char chSpNorm[LIMSPC][5]
Definition: rfield.h:335
realnum ** reflin
Definition: rfield.h:196
realnum ** ConEmitOut
Definition: rfield.h:151
bool lgDoLineTrans
Definition: rfield.h:99
realnum * fine_opac_zone
Definition: rfield.h:391
double extin_mag_V_point
Definition: rfield.h:258
realnum fine_ener_lo
Definition: rfield.h:385
long int ipV_filter
Definition: rfield.h:240
realnum ** otssav
Definition: rfield.h:183
void zero()
Definition: rfield.cpp:11
realnum fine_ener_hi
Definition: rfield.h:385
bool lgOpacityReevaluate
Definition: rfield.h:103
realnum * SummedDifSave
Definition: rfield.h:164
double extin_mag_B_point
Definition: rfield.h:258
double extin_mag_V_extended
Definition: rfield.h:262
const double WL_B_FILT
Definition: rfield.h:17
bool lgRfieldMalloced
Definition: cdinit.cpp:39
long nfine
Definition: rfield.h:387
double opac_mag_V_extended
Definition: rfield.h:265
realnum * flux_isotropic_save
Definition: rfield.h:200
realnum ExtinguishColumnDensity
Definition: rfield.h:81
realnum * OccNumbDiffCont
Definition: rfield.h:120
realnum qheii
Definition: rfield.h:341
double * comdn
Definition: rfield.h:236
realnum * csigc
Definition: rfield.h:269
bool lgHionRad
Definition: rfield.h:452
long int * ipnt_coarse_2_fine
Definition: rfield.h:382
bool lgMMok
Definition: rfield.h:442
long int ip1000A
Definition: rfield.h:254
realnum EnergyDiffCont
Definition: rfield.h:467
vector< double, allocator_avx< double > > ContBoltzHelp1
Definition: rfield.h:127
double extin_mag_B_extended
Definition: rfield.h:262
void setCoarseTransCoefPtr(realnum *ptr)
Definition: rfield.h:483
realnum * ExtinguishFactor
Definition: rfield.h:80
bool lgInducProcess
Definition: rfield.h:233
realnum * SummedDif
Definition: rfield.h:162
realnum OpticalDepthScaleFactor[LIMSPC]
Definition: rfield.h:298
long int ipB_filter
Definition: rfield.h:240
long int ipPlasmax
Definition: rfield.h:436
realnum * trans_coef_total
Definition: rfield.h:375
realnum * TotDiff2Pht
Definition: rfield.h:177
long int nShape
Definition: rfield.h:306
long int ipSpec
Definition: rfield.h:306
t_rfield()
Definition: rfield.h:471
realnum occmnu
Definition: rfield.h:455
realnum DiffPumpOn
Definition: rfield.h:207
realnum ** ConEmitReflec
Definition: rfield.h:145
realnum * flux_beam_time
Definition: rfield.h:74
bool lgUSphON
Definition: rfield.h:355
realnum * flux_beam_const
Definition: rfield.h:74
char chCumuType[5]
Definition: rfield.h:335
realnum plsfrqmax
Definition: rfield.h:430
realnum qrad
Definition: rfield.h:341
bool lgComUndr
Definition: rfield.h:282
realnum plsfrq
Definition: rfield.h:430
long int nflux
Definition: rfield.h:46
double flux_correct_isotropic(const bool lgSaveIsotr, const int nEmType, const int iflux)
Definition: rfield.cpp:112
Definition: module.h:26
bool lgPlasNu
Definition: rfield.h:428
bool lgBlockHIon
Definition: rfield.h:96
realnum ** ConRefIncid
Definition: rfield.h:157
long int nPositive
Definition: rfield.h:53
realnum tbr4nu
Definition: rfield.h:455
char chSpType[LIMSPC][6]
Definition: rfield.h:335
bool lgComptonOn
Definition: rfield.h:279
realnum ExtinguishLowEnergyLimit
Definition: rfield.h:81
realnum occmax
Definition: rfield.h:455
double cinrat
Definition: rfield.h:275
realnum tbrmnu
Definition: rfield.h:455