cloudy  trunk
 All Data Structures 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 double g[],
89  const double ex[],
90  char chExUnits,
91  double pops[],
92  double depart[],
93  double **AulEscp,
94  double **AulDest,
95  double **AulPump,
96  double **CollRate,
97  const double create[],
98  const double destroy[],
99  double *cooltl,
100  double *coolder,
101  const char *chLabel,
102  bool lgPrtMatrix,
103  int *nNegPop,
104  bool *lgZeroPop,
105  bool lgDeBug,
106  bool lgLTE=false,
107  multi_arr<double,2> *Cool=NULL,
108  multi_arr<double,2> *dCooldT=NULL,
109  double *grnd_excit = NULL);
110 };
111 
112 
114 const long LIMLEVELN = 20L;
115 
116 struct t_atoms : public module {
117 
118  const char *chName() const
119  {
120  return "atoms";
121  }
122  void zero();
123  void comment(t_warnings&) {}
124 
127 
131  popMg2,
133  rateMg2;
134 
141  double PopLevels[LIMLEVELN+1],
143 
144  };
145 extern t_atoms atoms;
146 
147 #endif /* ATOMS_H_ */
setCollRate()
Definition: atoms.h:51
void comment(t_warnings &)
Definition: atoms.h:123
double depart(const genericState &gs)
void resize(long int nlev)
Definition: atoms.h:52
double DepLTELevels[LIMLEVELN+1]
Definition: atoms.h:141
realnum d5200r
Definition: atoms.h:126
realnum popMg2
Definition: atoms.h:129
Atom_LevelN()
Definition: atoms.h:84
t_abund abund
Definition: abund.cpp:5
realnum rateMg2
Definition: atoms.h:129
void atom_level2(const TransitionProxy &t, const bool lgHFS)
Definition: atom_level2.cpp:30
t_atoms atoms
Definition: atoms.cpp:5
float realnum
Definition: cddefines.h:124
void operator()(long nLevelCalled, realnum abund, const double g[], const double ex[], char chExUnits, double pops[], double depart[], double **AulEscp, double **AulDest, double **AulPump, double **CollRate, const double create[], const double destroy[], double *cooltl, double *coolder, const char *chLabel, bool lgPrtMatrix, 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)
realnum xMg2Max
Definition: atoms.h:129
vector< double * > excit
Definition: atoms.h:48
#define ASSERT(exp)
Definition: cddefines.h:613
realnum p2nit
Definition: atoms.h:126
multi_arr< double, 2, C_TYPE > amat
Definition: atoms.h:82
vector< double > excit_b
Definition: atoms.h:49
Definition: atoms.h:116
void zero()
Definition: atoms.cpp:7
const long LIMLEVELN
Definition: atoms.h:114
double PopLevels[LIMLEVELN+1]
Definition: atoms.h:141
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:28
long nLevelAlloc
Definition: atoms.h:47
const char * chName() const
Definition: atoms.h:118
valarray< double > bvec
Definition: atoms.h:81