cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
iso.cpp
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 #include "cddefines.h"
4 #include "iso.h"
5 
6 #include "two_photon.h"
7 #include "freebound.h"
8 
10 
12 
13 long int max_num_levels;
14 
16 {
17  DEBUG_ENTRY( "t_isoCTRL::zero()" );
18 
19  for( long ipISO=ipH_LIKE; ipISO<NISO; ipISO++ )
20  {
21  /* option to disable continuum lowering */
22  lgContinuumLoweringEnabled[ipISO] = true;
23 
24  /* flag set by compile he-like command, says to regenerate table of recombination coef */
25  lgCompileRecomb[ipISO] = false;
26  lgNoRecombInterp[ipISO] = false;
27 
28  /* how the gbar cs will be treated - set with atom he-like gbar command */
30  lgCS_Vriens[ipISO] = true;
31  lgCS_Vrinceanu[ipISO] = false;
32  lgCS_PS64[ipISO] = true;
33  lgCS_PSClassic[ipISO] = false;
34  lgCS_VOS12[ipISO] = false; // lgCS_Vrinceanu[ipISO] == true overrides
35  lgCS_VOS12QM[ipISO] = false;
36  /*Seaton M. J. 1962, Proc. Phys. Soc. 79, 1105 treatment for l<=3 is default */
37  lgCS_Seaton[ipISO] = true;
38  lgCS_B72[ipISO] = false;
39  lgCS_PSdeg[ipISO] = true;
40 
41  fixit("make this the default for ipH_LIKE if not too slow.");
42  lgCS_Vrinceanu[ipH_LIKE] = false;
43  lgCS_PS64[ipH_LIKE] = true;
44 
45  lgCS_therm_ave[ipISO] = false;
46  lgCS_None[ipISO] = false;
47  /* when set try actually set to 1 or 2, depending on which fit is to be used,
48  * 1 is the broken power law fit */
49  /* >>chng 02 dec 21, change to broken power law fit */
50  nCS_new[ipISO] = 1;
51  /* This flag says whether the density is high enough that helium is sufficiently l-mixed. */
52  lgCritDensLMix[ipISO] = true;
53  /* flag saying whether to include fine-structure mixing in spontaneous decays
54  * set with SPECIES HE-LIKE FSM command */
55  lgFSM[ipISO] = 0;
56  /* This is the flag saying whether to generate errors. false means don't. */
57  lgRandErrGen[ipISO] = false;
58  /* this is the flag saying whether we should include excess recombination in the
59  * helike sequence. Should only be off if testing effect of top off approximations. */
60  lgTopoff[ipISO] = true;
61  /* Dielectronic recombination for helike ions is on by default. */
62  lgDielRecom[ipISO] = true;
63 
64  /* number of Lyman lines to include in opacities, this can be vastly larger
65  * than the number of actual levels in the model atom */
66  nLyman[ipISO] = 100;
67  nLyman_max[ipISO] = 100;
68  nLyman_malloc[ipISO] = 100;
69 
70  /* controls whether l-mixing and collisional ionization included */
71  lgColl_l_mixing[ipISO] = true;
72  lgColl_excite[ipISO] = true;
73  lgColl_ionize[ipISO] = true;
74  lgLTE_levels[ipISO] = false;
75  lgPrintNumberOfLevels = false;
76 
77  for (long nelem=0; nelem<LIMELM; ++nelem)
78  {
79  RRC_TeUsed[ipISO][nelem]=0.;
80  }
81  }
82 
83  /* Dielectronic recombination forming hydrogen-like ions does not exist. */
84  lgDielRecom[ipH_LIKE] = false;
85 
86  /* smallest transition probability allowed */
87  SmallA = 1e-30f;
88 
89  /* reset with SET IND2 command, turns on/off induced two photon */
90  lgInd2nu_On = false;
91 
92  /* hydrogen redistribution functions */
96 
97  /* this is the upper level for each Lya, which uses the special ipLY_A */
100 
101  /* he-like redistribution functions */
105 
106  lgPessimisticErrors = false;
107 
108  /* do not average collision strengths - evaluate at kT
109  * set true with command SET COLLISION STRENGHTS AVERAGE */
110  lgCollStrenThermAver = false;
111 }
112 
114 {
115  // this is flag indicating which type of model atom to use
116  strcpy( chTypeAtomUsed , "none" );
117  CaseBCheck = 0.;
118  /* a first guess at the recombination coefficients */
119  RadRec_caseB = 1e-13;
120  lgLevelsLowered = false;
121  lgLevelsEverLowered = false;
122  lgMustReeval = false;
123  lgPopsRescaled = false;
124  /* error generation done yet? false means not done. */
125  lgErrGenDone = false;
126  for( vector<two_photon>::iterator it = TwoNu.begin(); it != TwoNu.end(); ++it )
127  (*it).Reset();
128  for( vector<freeBound>::iterator it = fb.begin(); it != fb.end(); ++it )
129  (*it).Reset();
130 }
Definition: iso.h:335
void Reset()
Definition: iso.cpp:113
bool lgContinuumLoweringEnabled[NISO]
Definition: iso.h:378
void zero()
Definition: iso.cpp:15
bool lgCS_PSClassic[NISO]
Definition: iso.h:408
const int ipHE_LIKE
Definition: iso.h:65
bool lgPessimisticErrors
Definition: iso.h:433
double RadRec_caseB
Definition: iso.h:544
bool lgColl_ionize[NISO]
Definition: iso.h:365
t_isoCTRL iso_ctrl
Definition: iso.cpp:9
const int NISO
Definition: cddefines.h:311
bool lgCompileRecomb[NISO]
Definition: iso.h:400
bool lgFSM[NISO]
Definition: iso.h:426
bool lgCS_therm_ave[NISO]
Definition: iso.h:408
int ipResoRedist[NISO]
Definition: iso.h:394
const int ipHe2p1P
Definition: iso.h:51
bool lgCS_None[NISO]
Definition: iso.h:408
bool lgColl_l_mixing[NISO]
Definition: iso.h:359
bool lgRandErrGen[NISO]
Definition: iso.h:430
bool lgLTE_levels[NISO]
Definition: iso.h:367
vector< freeBound > fb
Definition: iso.h:481
bool lgCS_Vrinceanu[NISO]
Definition: iso.h:408
double RRC_TeUsed[NISO][LIMELM]
Definition: iso.h:440
t_iso_sp iso_sp[NISO][LIMELM]
Definition: iso.cpp:11
realnum SmallA
Definition: iso.h:391
long int max_num_levels
Definition: iso.cpp:13
bool lgColl_excite[NISO]
Definition: iso.h:362
vector< two_photon > TwoNu
Definition: iso.h:598
long int nLyman_max[NISO]
Definition: iso.h:352
int nCS_new[NISO]
Definition: iso.h:419
bool lgLevelsLowered
Definition: iso.h:505
long int nLyman[NISO]
Definition: iso.h:352
const int ipCRD
Definition: cddefines.h:342
bool lgCS_PS64[NISO]
Definition: iso.h:408
bool lgDielRecom[NISO]
Definition: iso.h:385
bool lgPrintNumberOfLevels
Definition: iso.h:346
bool lgLevelsEverLowered
Definition: iso.h:509
bool lgCritDensLMix[NISO]
Definition: iso.h:422
Definition: iso.h:470
int nLyaLevel[NISO]
Definition: iso.h:397
bool lgInd2nu_On
Definition: iso.h:375
bool lgPopsRescaled
Definition: iso.h:515
const int ipH2p
Definition: iso.h:31
bool lgCS_Seaton[NISO]
Definition: iso.h:408
int ipLyaRedist[NISO]
Definition: iso.h:394
bool lgCS_VOS12[NISO]
Definition: iso.h:408
const int ipH_LIKE
Definition: iso.h:64
const int LIMELM
Definition: cddefines.h:308
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
bool lgCS_VOS12QM[NISO]
Definition: iso.h:408
int ipSubRedist[NISO]
Definition: iso.h:394
bool lgCollStrenThermAver
Definition: iso.h:371
const int ipPRD
Definition: cddefines.h:340
bool lgCS_B72[NISO]
Definition: iso.h:408
#define fixit(a)
Definition: cddefines.h:417
bool lgTopoff[NISO]
Definition: iso.h:435
realnum CaseBCheck
Definition: iso.h:541
bool lgCS_PSdeg[NISO]
Definition: iso.h:408
long int nLyman_malloc[NISO]
Definition: iso.h:352
bool lgMustReeval
Definition: iso.h:512
bool lgCS_Vriens[NISO]
Definition: iso.h:408
const int ipCRDW
Definition: cddefines.h:344
bool lgErrGenDone
Definition: iso.h:591
char chTypeAtomUsed[10]
Definition: iso.h:587
bool lgNoRecombInterp[NISO]
Definition: iso.h:405