Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
atoms.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 ATOMS_H_
5 #define ATOMS_H_
6 
7 #include "container_classes.h"
8 #include "module.h"
9 
10 class TransitionProxy;
11 
15 void atom_level2( const TransitionProxy &t );
16 void atom_level2( const TransitionProxy &t, const bool lgHFS );
17 
46 {
48  vector<double*> excit;
49  vector<double> excit_b;
50 public:
52  void resize(long int nlev)
53  {
54  if (nlev > nLevelAlloc)
55  {
56  excit.resize(nlev);
57  excit_b.resize(0.5*nlev*(nlev-1));
58  size_t ibase = 0;
59  for (long ihi=1; ihi<nlev; ++ihi)
60  {
61  excit[ihi] = &excit_b[ibase];
62  ibase += ihi;
63  }
64  ASSERT(ibase == excit_b.size());
65  nLevelAlloc = nlev;
66  }
67  }
68  void operator()(
69  long nlev,
70  double TeInverse,
71  double **col_str,
72  const double ex[],
73  const double g[],
74  double **CollRate
75  );
76 };
77 
79 {
80  // these are all automatically deallocated when they go out of scope
81  valarray<double> bvec;
83 public:
85  void operator()(
86  long nLevelCalled,
87  realnum abund,
88  const vector<double>& g,
89  const vector<double>& ex,
90  char chExUnits,
91  vector<double>& pops,
92  vector<double>& depart,
93  multi_arr<double,2>& AulEscp,
94  multi_arr<double,2>& AulDest,
95  multi_arr<double,2>& AulPump,
96  const multi_arr<double,2>& CollRate,
97  const vector<double>& create,
98  const vector<double>& destroy,
99  double *cooltl,
100  double *coolder,
101  const char *chLabel,
102  bool lgPrtMatrix,
103  bool lgImgMatrix,
104  int *nNegPop,
105  bool *lgZeroPop,
106  bool lgDeBug,
107  bool lgLTE=false,
109  multi_arr<double,2> *dCooldT=NULL,
110  double *grnd_excit = NULL);
111 };
112 
113 
115 const long LIMLEVELN = 20L;
116 
117 struct t_atoms : public module {
118 
119  const char *chName() const
120  {
121  return "atoms";
122  }
123  void zero();
124  void comment(t_warnings&) {}
125 
128 
132  popMg2,
134  rateMg2;
135 
142  double PopLevels[LIMLEVELN+1],
144 
145  };
146 extern t_atoms atoms;
147 
148 #endif /* ATOMS_H_ */
Definition: atoms.h:78
Definition: atoms.h:45
Definition: warnings.h:11
setCollRate()
Definition: atoms.h:51
void comment(t_warnings &)
Definition: atoms.h:124
double depart(const genericState &gs)
Definition: generic_state.cpp:39
void resize(long int nlev)
Definition: atoms.h:52
double DepLTELevels[LIMLEVELN+1]
Definition: atoms.h:142
realnum d5200r
Definition: atoms.h:127
realnum popMg2
Definition: atoms.h:130
Atom_LevelN()
Definition: atoms.h:84
t_abund abund
Definition: abund.cpp:5
realnum rateMg2
Definition: atoms.h:130
float realnum
Definition: cddefines.h:127
#define NULL
Definition: cddefines.h:115
realnum xMg2Max
Definition: atoms.h:130
vector< double * > excit
Definition: atoms.h:48
#define ASSERT(exp)
Definition: cddefines.h:637
void atom_level2(const TransitionProxy &t)
Definition: atom_level2.cpp:237
realnum p2nit
Definition: atoms.h:127
multi_arr< double, 2, C_TYPE > amat
Definition: atoms.h:82
vector< double > excit_b
Definition: atoms.h:49
Definition: atoms.h:117
void zero()
Definition: atoms.cpp:7
const long LIMLEVELN
Definition: atoms.h:115
Definition: transition.h:23
t_atoms atoms
Definition: atoms.cpp:5
void operator()(long nLevelCalled, realnum abund, const vector< double > &g, const vector< double > &ex, char chExUnits, vector< double > &pops, vector< double > &depart, multi_arr< double, 2 > &AulEscp, multi_arr< double, 2 > &AulDest, multi_arr< double, 2 > &AulPump, const multi_arr< double, 2 > &CollRate, const vector< double > &create, const vector< double > &destroy, double *cooltl, double *coolder, const char *chLabel, bool lgPrtMatrix, bool lgImgMatrix, int *nNegPop, bool *lgZeroPop, bool lgDeBug, bool lgLTE=false, multi_arr< double, 2 > *Cool=NULL, multi_arr< double, 2 > *dCooldT=NULL, double *grnd_excit=NULL)
Definition: atom_leveln.cpp:171
double PopLevels[LIMLEVELN+1]
Definition: atoms.h:142
Definition: module.h:26
void operator()(long nlev, double TeInverse, double **col_str, const double ex[], const double g[], double **CollRate)
Definition: atom_leveln.cpp:96
long nLevelAlloc
Definition: atoms.h:47
const char * chName() const
Definition: atoms.h:119
valarray< double > bvec
Definition: atoms.h:81