cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
taulines.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 "taulines.h"
5 #include "atmdat.h"
6 
8 
10 
14 char **chSpecies;
16 vector<qList> dBaseStates;
17 vector< multi_arr<int,2> > ipdBaseTrans;
22 long int nSpecies;
23 qList AnonStates("AnonStates",1);
26 TransitionList UTALines("UTALines", &AnonStates);
27 long int nLevel1;
28 TransitionList HFLines("HFLines", &AnonStates);
29 //vector<vector<multi_arr<int,2> > > ipTransitions;
30 vector<vector<TransitionList> > Transitions;
32 static qList Fe2LevNStates;
33 TransitionList Fe2LevN("Fe2LevN", &Fe2LevNStates);
34 multi_arr<int,3> ipSatelliteLines; /* [ipISO][nelem][level] */
35 vector<vector<TransitionList> > SatelliteLines; /* [ipISO][nelem][level] */
36 TransitionList TauLine2("TauLine2", &AnonStates);
38 
39 extern void checkTransitionListOfLists(vector<TransitionList>&list)
40 {
41  for (vector<TransitionList>::iterator it=list.begin();
42  it != list.end(); ++it)
43  {
44  for (TransitionList::iterator tr = it->begin();
45  tr != it->end(); ++tr)
46  {
47  (*tr).check();
48  }
49  for (EmissionList::iterator em = it->Emis().begin();
50  em != it->Emis().end(); ++em)
51  {
52  (*em).check();
53  }
54  }
55 }
56 
58  const long n_hi, const long l_hi, const long S_hi,
59  const long n_lo, const long l_lo, const long S_lo )
60 {
61  TransitionList::iterator matchedTrans = AllTransitions.back().end();
62  bool lgFound = false;
63 
64  for (vector<TransitionList>::iterator it = AllTransitions.begin();
65  it != AllTransitions.end(); ++it)
66  {
67  if( (*(it->begin())).chLabel().find( speciesLabel ) == string::npos )
68  continue;
69 
70  for (TransitionList::iterator tr = it->begin();
71  tr != it->end(); ++tr)
72  {
73  if( (*tr).Lo()->n() == n_lo && (*tr).Lo()->l() == l_lo &&
74  (*tr).Lo()->S() == S_lo &&
75  (*tr).Hi()->n() == n_hi && (*tr).Hi()->l() == l_hi &&
76  (*tr).Hi()->S() == S_hi )
77  {
78  matchedTrans = tr;
79  lgFound = true;
80  break;
81  }
82  }
83 
84  if( lgFound )
85  break;
86  }
87 
88  return matchedTrans;
89 }
90 
91 TransitionList::iterator findTrans_byWLAng( string speciesLabel, const double wl_Ang,
92  double &wl_err )
93 {
94  TransitionList::iterator matchedTrans = AllTransitions.back().end();
95  double dwl = 1e30;
96 
97  if( wl_Ang < 0. )
98  return matchedTrans;
99 
100  for (vector<TransitionList>::iterator it = AllTransitions.begin();
101  it != AllTransitions.end(); ++it)
102  {
103  if( (*(it->begin())).chLabel().find( speciesLabel ) == string::npos )
104  continue;
105 
106  for (TransitionList::iterator tr = it->begin();
107  tr != it->end(); ++tr)
108  {
109  if( fabs( (*tr).WLAng() - wl_Ang ) < dwl )
110  {
111  wl_err = (*tr).WLAng() - wl_Ang;
112  dwl = fabs( wl_err );
113  matchedTrans = tr;
114  }
115  }
116  }
117 
118  return matchedTrans;
119 }
120 
123 
124 namespace
125 {
126  class Init
127  {
128  EmissionList DummyEmisList;
129  TransitionListImpl TauDummyTrans;
130  public:
131  Init(qList*states) :
132  DummyEmisList(&TauDummyTrans, 1), TauDummyTrans("TauDummy",states, 1)
133  {
134  DummyEmis = DummyEmisList[0];
135  TauDummy=TauDummyTrans.begin();
136  };
137  };
138  qList TauDummyStates("TauDummyStates",1);
139  Init TauDummyInit(&TauDummyStates);
140 }
vector< StoutCollArray > StoutCollData
Definition: taulines.cpp:21
TransitionList UTALines("UTALines",&AnonStates)
TransitionProxy::iterator TauDummy
Definition: taulines.cpp:121
multi_arr< int, 3 > ipSatelliteLines
Definition: taulines.cpp:34
long int nLevel1
Definition: taulines.cpp:27
TransitionList HFLines("HFLines",&AnonStates)
vector< multi_arr< int, 2 > > ipdBaseTrans
Definition: taulines.cpp:17
multi_arr< CollRateCoeffArray, 2 > AtmolCollRateCoeff
Definition: taulines.cpp:19
vector< vector< TransitionList > > Transitions
Definition: taulines.cpp:30
TransitionList TauLine2("TauLine2",&AnonStates)
long int nSpecies
Definition: taulines.cpp:22
char ** chSpecies
Definition: taulines.cpp:14
bool lgLinesAdded
Definition: taulines.cpp:12
TransitionList::iterator findTrans_byWLAng(string speciesLabel, const double wl_Ang, double &wl_err)
Definition: taulines.cpp:91
void checkTransitionListOfLists(vector< TransitionList > &list)
Definition: taulines.cpp:39
multi_arr< int, 3 > ipExtraLymanLines
Definition: taulines.cpp:24
EmissionProxy DummyEmis
Definition: taulines.cpp:122
float realnum
Definition: cddefines.h:124
vector< vector< TransitionList > > SatelliteLines
Definition: taulines.cpp:35
vector< multi_arr< CollSplinesArray, 3 > > AtmolCollSplines
Definition: taulines.cpp:20
realnum * cs1_flag_lev2
Definition: taulines.cpp:37
TransitionList::iterator findTrans_byQuantNumb(const string speciesLabel, const long n_hi, const long l_hi, const long S_hi, const long n_lo, const long l_lo, const long S_lo)
Definition: taulines.cpp:57
vector< vector< TransitionList > > ExtraLymanLines
Definition: taulines.cpp:25
#define lgBOUNDSCHECKVAL
Definition: cddefines.h:173
vector< qList > dBaseStates
Definition: taulines.cpp:16
vector< species > dBaseSpecies
Definition: taulines.cpp:15
bool lgStatesAdded
Definition: taulines.cpp:11
vector< TransitionList > AllTransitions
Definition: taulines.cpp:9
multi_arr< int, 2 > ipFe2LevN
Definition: taulines.cpp:31
multi_arr< qList, 2 > StatesElemNEW
Definition: taulines.cpp:13
vector< TransitionList > dBaseTrans
Definition: taulines.cpp:18
#define INSTANTIATE_MULTI_ARR(TYPE, BC)
qList AnonStates("AnonStates", 1)
TransitionList Fe2LevN("Fe2LevN",&Fe2LevNStates)
static qList Fe2LevNStates
Definition: taulines.cpp:32