Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
atoms.h
Go to the documentation of this file.
1/* This file is part of Cloudy and is copyright (C)1978-2025 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
10class TransitionProxy;
11
15void atom_level2( const TransitionProxy &t );
16void atom_level2( const TransitionProxy &t, const bool lgHFS );
17
44
46{
48 vector<double*> excit;
49 vector<double> excit_b;
50public:
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;
83public:
85 void operator()(
86 long nLevelCalled,
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
115const long LIMLEVELN = 20L;
116
117struct t_atoms : public module {
118
119 const char *chName() const
120 {
121 return "atoms";
122 }
123 void zero();
125
128
135
144
145 };
146extern t_atoms atoms;
147
148#endif /* ATOMS_H_ */
t_abund abund
Definition abund.cpp:5
t_atoms atoms
Definition atoms.cpp:5
void atom_level2(const TransitionProxy &t)
Definition atom_level2.cpp:237
const long LIMLEVELN
Definition atoms.h:115
#define NULL
Definition cddefines.h:115
#define ASSERT(exp)
Definition cddefines.h:637
float realnum
Definition cddefines.h:127
Atom_LevelN()
Definition atoms.h:84
multi_arr< double, 2, C_TYPE > amat
Definition atoms.h:82
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
valarray< double > bvec
Definition atoms.h:81
Definition transition.h:24
module()
Definition module.h:29
Definition container_classes.h:916
vector< double * > excit
Definition atoms.h:48
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
void resize(long int nlev)
Definition atoms.h:52
setCollRate()
Definition atoms.h:51
vector< double > excit_b
Definition atoms.h:49
Definition warnings.h:11
double depart(const genericState &gs)
Definition generic_state.cpp:39
Definition atoms.h:117
const char * chName() const
Definition atoms.h:119
double DepLTELevels[LIMLEVELN+1]
Definition atoms.h:143
realnum p2nit
Definition atoms.h:127
realnum xMg2Max
Definition atoms.h:130
realnum d5200r
Definition atoms.h:127
void zero()
Definition atoms.cpp:7
void comment(t_warnings &)
Definition atoms.h:124
realnum popMg2
Definition atoms.h:132
realnum rateMg2
Definition atoms.h:134
double PopLevels[LIMLEVELN+1]
Definition atoms.h:142