cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
emission.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 EMISSION_H_
5 #define EMISSION_H_
6 
7 #include "proxy_iterator.h"
8 #include "iter_track.h"
9 
10 class TransitionListImpl;
11 class TransitionProxy;
13 class EmissionList;
15 
16 //typedef iter_track_basic<realnum> tracker;
17 typedef secant_track tracker;
18 
20 {
21 public:
25 private:
28  int m_index;
29 public:
30  explicit EmissionProxy() : m_list(NULL), m_index(-1) {}
31  explicit EmissionProxy(EmissionList *list, int index) :
32  m_list(list), m_index(index) {}
33  void copy(const EmissionProxy& other);
34 
35  void check() const
36  {
37  ASSERT(ipTran() >= 0);
38  }
39 
48  int &iRedisFun() const;
49 
51  long int &ipFine() const;
52 
67  realnum &TauIn() const;
68 
73  realnum &TauInSpecific() const;
74 
85  realnum &TauTot() const;
86 
91  tracker& TauTrack() const;
92 
98  realnum &TauCon() const;
99 
101  realnum &FracInwd() const;
102 
105  double &pump() const;
106 
108  double &xIntensity() const;
109 
112  double &xObsIntensity() const;
113 
115  realnum &gf() const;
116 
118  realnum &Pesc() const;
119 
121  realnum &Pelec_esc() const;
122 
124  realnum &Pdest() const;
125 
127  realnum Pesc_total() const { return Pesc() + Pelec_esc(); }
128 
130  realnum Ploss() const { return Pesc_total()+Pdest(); }
131 
135  realnum &dampXvel() const;
136 
138  realnum &damp() const;
139 
141  double &ColOvTot() const;
142 
144  realnum &AutoIonizFrac() const;
145 
151  realnum &opacity() const;
152  // This is the summed opacity in a multiplet.
153  double &mult_opac() const;
154 
156  double &PopOpc() const;
157 
161  double &VoigtLineCen() const;
162 
164  realnum &Aul() const;
165 
167  double &ots() const;
168 
169  int &ipTran() const;
170 
171  TransitionProxy Tran() const;
172 };
174 {
175 public:
176  typedef const EmissionList list_type;
179 private:
182  int m_index;
183 public:
184  explicit EmissionConstProxy() : m_list(NULL), m_index(-1) {}
185  explicit EmissionConstProxy(const EmissionList *list, int index) :
186  m_list(list), m_index(index) {}
187  void copy(const EmissionConstProxy& other);
188 
189  void check() const
190  {
191  ASSERT(ipTran() >= 0);
192  }
193 
202  int iRedisFun() const;
203 
205  long int ipFine() const;
206 
221  realnum TauIn() const;
222 
227  realnum TauInSpecific() const;
228 
239  realnum TauTot() const;
240 
245  const tracker& TauTrack() const;
246 
252  realnum TauCon() const;
253 
255  realnum FracInwd() const;
256 
259  double pump() const;
260 
262  double xIntensity() const;
263 
266  double xObsIntensity() const;
267 
269  realnum gf() const;
270 
272  realnum Pesc() const;
273 
275  realnum Pelec_esc() const;
276 
278  realnum Pdest() const;
279 
281  realnum Pesc_total() const { return Pesc() + Pelec_esc(); }
282 
284  realnum Ploss() const { return Pesc_total()+Pdest(); }
285 
289  realnum dampXvel() const;
290 
292  realnum damp() const;
293 
295  double ColOvTot() const;
296 
298  realnum AutoIonizFrac() const;
299 
305  realnum opacity() const;
306  // This is the summed opacity in a multiplet.
307  double mult_opac() const;
308 
310  double PopOpc() const;
311 
315  double VoigtLineCen() const;
316 
318  realnum Aul() const;
319 
321  double ots() const;
322 
323  int ipTran() const;
324 
325  TransitionConstProxy Tran() const;
326 };
327 
329 {
331  vector<realnum> m_Aul;
332  vector<realnum> m_AutoIonizFrac;
333  vector<double> m_ColOvTot;
334  vector<realnum> m_damp;
335  vector<realnum> m_dampXvel;
336  vector<realnum> m_FracInwd;
337  vector<realnum> m_gf;
338  vector<int> m_iRedisFun;
339  vector<long> m_ipFine;
340  vector<realnum> m_opacity;
341  vector<double> m_mult_opac;
342  vector<double> m_ots;
343  vector<realnum> m_Pdest;
344  vector<realnum> m_Pesc;
345  vector<realnum> m_Pelec_esc;
346  vector<double> m_PopOpc;
347  vector<double> m_VoigtLineCen;
348  vector<double> m_pump;
349  vector<realnum> m_TauCon;
350  vector<realnum> m_TauIn;
351  vector<realnum> m_TauInSpecific;
352  vector<realnum> m_TauTot;
353  vector<tracker > m_TauTrack;
354  vector<double> m_xIntensity;
355  vector<double> m_xObsIntensity;
356  vector<int> m_ipTran;
357  friend class EmissionProxy;
358  friend class EmissionConstProxy;
359 public:
363  explicit EmissionList(TransitionListImpl *tlist, size_t i) : m_tlist(tlist)
364  {
365  resize(i);
366  }
367  explicit EmissionList(TransitionListImpl *tlist) : m_tlist(tlist) {}
369  {
370  return EmissionProxy(this,i);
371  }
372  size_t size(void) const
373  {
374  return m_Aul.size();
375  }
376  void resize(size_t i);
378  {
379  return iterator(this,0);
380  }
382  {
383  return const_iterator(this,0);
384  }
386  {
387  return iterator(this,size());
388  }
390  {
391  return const_iterator(this,size());
392  }
393 };
394 
408 
409 inline void EmissionList::resize(size_t i)
410 {
411  size_t oldsize = m_Aul.size();
412  m_Aul.resize(i);
413  m_AutoIonizFrac.resize(i);
414  m_ColOvTot.resize(i);
415  m_damp.resize(i);
416  m_dampXvel.resize(i);
417  m_gf.resize(i);
418  m_FracInwd.resize(i);
419  m_ipFine.resize(i);
420  m_iRedisFun.resize(i);
421  m_ots.resize(i);
422  m_opacity.resize(i);
423  m_mult_opac.resize(i);
424  m_Pdest.resize(i);
425  m_Pelec_esc.resize(i);
426  m_Pesc.resize(i);
427  m_PopOpc.resize(i);
428  m_VoigtLineCen.resize(i);
429  m_TauCon.resize(i);
430  m_TauIn.resize(i);
431  m_TauInSpecific.resize(i);
432  m_TauTot.resize(i);
433  m_TauTrack.resize(i);
434  m_pump.resize(i);
435  m_xIntensity.resize(i);
436  m_xObsIntensity.resize(i);
437  m_ipTran.resize(i,-1);
438  for (size_t newelem=oldsize; newelem < size(); ++newelem)
439  {
440  EmLineJunk((*this)[newelem]);
441  /*
442  \todo 2 Does doing EmLineZero here defeat the purpose of EmLineJunk?
443  * maybe we should pass full set of Emis components, fill everything in
444  * here, and THEN use EmLineZero? */
445  EmLineZero((*this)[newelem]);
446  TauZero((*this)[newelem]);
447  }
448 }
449 
450 inline int &EmissionProxy::iRedisFun() const
451 {
452  return m_list->m_iRedisFun[m_index];
453 }
454 
456 {
457  return m_list->m_iRedisFun[m_index];
458 }
459 
460 inline long int &EmissionProxy::ipFine() const
461 {
462  return m_list->m_ipFine[m_index];
463 }
464 
465 inline long int EmissionConstProxy::ipFine() const
466 {
467  return m_list->m_ipFine[m_index];
468 }
469 
471 {
472  return m_list->m_TauIn[m_index];
473 }
474 
476 {
477  return m_list->m_TauIn[m_index];
478 }
479 
481 {
482  return m_list->m_TauInSpecific[m_index];
483 }
484 
486 {
487  return m_list->m_TauInSpecific[m_index];
488 }
489 
491 {
492  return m_list->m_TauTot[m_index];
493 }
494 
496 {
497  return m_list->m_TauTot[m_index];
498 }
499 
501 {
502  return m_list->m_TauTrack[m_index];
503 }
504 
506 {
507  return m_list->m_TauTrack[m_index];
508 }
509 
511 {
512  return m_list->m_TauCon[m_index];
513 }
514 
516 {
517  return m_list->m_TauCon[m_index];
518 }
519 
521 {
522  return m_list->m_FracInwd[m_index];
523 }
524 
526 {
527  return m_list->m_FracInwd[m_index];
528 }
529 
530 inline double &EmissionProxy::pump() const
531 {
532  return m_list->m_pump[m_index];
533 }
534 
535 inline double EmissionConstProxy::pump() const
536 {
537  return m_list->m_pump[m_index];
538 }
539 
540 inline double &EmissionProxy::xIntensity() const
541 {
542  return m_list->m_xIntensity[m_index];
543 }
544 
545 inline double &EmissionProxy::xObsIntensity() const
546 {
547  return m_list->m_xObsIntensity[m_index];
548 }
549 
550 inline double EmissionConstProxy::xIntensity() const
551 {
552  return m_list->m_xIntensity[m_index];
553 }
554 
556 {
557  return m_list->m_xObsIntensity[m_index];
558 }
559 
560 inline int &EmissionProxy::ipTran() const
561 {
562  return m_list->m_ipTran[m_index];
563 }
564 
565 inline int EmissionConstProxy::ipTran() const
566 {
567  return m_list->m_ipTran[m_index];
568 }
569 
570 inline realnum &EmissionProxy::gf() const
571 {
572  return m_list->m_gf[m_index];
573 }
574 
576 {
577  return m_list->m_gf[m_index];
578 }
579 
581 {
582  return m_list->m_Pesc[m_index];
583 }
584 
586 {
587  return m_list->m_Pesc[m_index];
588 }
589 
591 {
592  return m_list->m_Pelec_esc[m_index];
593 }
594 
596 {
597  return m_list->m_Pelec_esc[m_index];
598 }
599 
601 {
602  return m_list->m_Pdest[m_index];
603 }
604 
606 {
607  return m_list->m_Pdest[m_index];
608 }
609 
611 {
612  return m_list->m_dampXvel[m_index];
613 }
614 
616 {
617  return m_list->m_dampXvel[m_index];
618 }
619 
621 {
622  return m_list->m_damp[m_index];
623 }
624 
626 {
627  return m_list->m_damp[m_index];
628 }
629 
630 inline double &EmissionProxy::ColOvTot() const
631 {
632  return m_list->m_ColOvTot[m_index];
633 }
634 
635 inline double EmissionConstProxy::ColOvTot() const
636 {
637  return m_list->m_ColOvTot[m_index];
638 }
639 
641 {
642  return m_list->m_AutoIonizFrac[m_index];
643 }
644 
646 {
647  return m_list->m_AutoIonizFrac[m_index];
648 }
649 
651 {
652  return m_list->m_opacity[m_index];
653 }
654 
656 {
657  return m_list->m_opacity[m_index];
658 }
659 
660 inline double &EmissionProxy::mult_opac() const
661 {
662  return m_list->m_mult_opac[m_index];
663 }
664 
665 inline double EmissionConstProxy::mult_opac() const
666 {
667  return m_list->m_mult_opac[m_index];
668 }
669 
670 inline double &EmissionProxy::PopOpc() const
671 {
672  return m_list->m_PopOpc[m_index];
673 }
674 
675 inline double EmissionConstProxy::PopOpc() const
676 {
677  return m_list->m_PopOpc[m_index];
678 }
679 
680 inline double &EmissionProxy::VoigtLineCen() const
681 {
682  return m_list->m_VoigtLineCen[m_index];
683 }
684 
685 inline double EmissionConstProxy::VoigtLineCen() const
686 {
687  return m_list->m_VoigtLineCen[m_index];
688 }
689 
691 {
692  return m_list->m_Aul[m_index];
693 }
694 
696 {
697  return m_list->m_Aul[m_index];
698 }
699 
700 inline double &EmissionProxy::ots() const
701 {
702  return m_list->m_ots[m_index];
703 }
704 
705 inline double EmissionConstProxy::ots() const
706 {
707  return m_list->m_ots[m_index];
708 }
709 
710 inline void EmissionProxy::copy(const EmissionProxy& other)
711 {
712  iRedisFun() = other.iRedisFun();
713  ipFine() = other.ipFine();
714  TauIn() = other.TauIn();
715  TauInSpecific() = other.TauInSpecific();
716  TauTot() = other.TauTot();
717  TauCon() = other.TauCon();
718  FracInwd() = other.FracInwd();
719  gf() = other.gf();
720  Pesc() = other.Pesc();
721  Pelec_esc() = other.Pelec_esc();
722  Pdest() = other.Pdest();
723  dampXvel() = other.dampXvel();
724  damp() = other.damp();
725  AutoIonizFrac() = other.AutoIonizFrac();
726  opacity() = other.opacity();
727  mult_opac() = other.mult_opac();
728  Aul() = other.Aul();
729  TauTrack() = other.TauTrack();
730  pump() = other.pump();
731  xIntensity() = other.xIntensity();
732  xObsIntensity() = other.xObsIntensity();
733  ColOvTot() = other.ColOvTot();
734  PopOpc() = other.PopOpc();
735  VoigtLineCen() = other.VoigtLineCen();
736  ots() = other.ots();
737  ipTran() = other.ipTran();
738 }
739 
740 #endif // EMISSION_H_
vector< realnum > m_gf
Definition: emission.h:337
long int & ipFine() const
Definition: emission.h:460
vector< realnum > m_dampXvel
Definition: emission.h:335
realnum & TauInSpecific() const
Definition: emission.h:480
void copy(const EmissionProxy &other)
Definition: emission.h:710
double & ots() const
Definition: emission.h:700
EmissionProxy(EmissionList *list, int index)
Definition: emission.h:31
int & iRedisFun() const
Definition: emission.h:450
realnum & opacity() const
Definition: emission.h:650
const tracker & TauTrack() const
Definition: emission.h:505
realnum & Pelec_esc() const
Definition: emission.h:590
realnum TauInSpecific() const
Definition: emission.h:485
double mult_opac() const
Definition: emission.h:665
vector< int > m_iRedisFun
Definition: emission.h:338
secant_track tracker
Definition: emission.h:14
EmissionList * m_list
Definition: emission.h:27
realnum Aul() const
Definition: emission.h:695
vector< double > m_xObsIntensity
Definition: emission.h:355
vector< double > m_VoigtLineCen
Definition: emission.h:347
realnum & TauTot() const
Definition: emission.h:490
long int ipFine() const
Definition: emission.h:465
vector< int > m_ipTran
Definition: emission.h:356
EmissionConstProxy(const EmissionList *list, int index)
Definition: emission.h:185
vector< long > m_ipFine
Definition: emission.h:339
double ColOvTot() const
Definition: emission.h:635
double ots() const
Definition: emission.h:705
vector< double > m_mult_opac
Definition: emission.h:341
vector< realnum > m_TauTot
Definition: emission.h:352
realnum TauTot() const
Definition: emission.h:495
TransitionListImpl * m_tlist
Definition: emission.h:330
const EmissionList * m_list
Definition: emission.h:181
realnum TauCon() const
Definition: emission.h:515
void check() const
Definition: emission.h:189
double pump() const
Definition: emission.h:535
vector< double > m_PopOpc
Definition: emission.h:346
TransitionProxy Tran() const
Definition: transition.h:514
int ipTran() const
Definition: emission.h:565
vector< realnum > m_TauIn
Definition: emission.h:350
ProxyIterator< EmissionConstProxy, EmissionConstProxy > const_iterator
Definition: emission.h:178
double xIntensity() const
Definition: emission.h:550
int & ipTran() const
Definition: emission.h:560
ProxyIterator< EmissionProxy, EmissionConstProxy > iterator
Definition: emission.h:23
size_t size(void) const
Definition: emission.h:372
EmissionProxy::iterator iterator
Definition: emission.h:361
EmissionConstProxy::iterator const_iterator
Definition: emission.h:362
vector< realnum > m_Pesc
Definition: emission.h:344
vector< double > m_ots
Definition: emission.h:342
realnum & gf() const
Definition: emission.h:570
realnum Pdest() const
Definition: emission.h:605
double & VoigtLineCen() const
Definition: emission.h:680
vector< tracker > m_TauTrack
Definition: emission.h:353
realnum & dampXvel() const
Definition: emission.h:610
double VoigtLineCen() const
Definition: emission.h:685
EmissionList(TransitionListImpl *tlist, size_t i)
Definition: emission.h:363
double & xIntensity() const
Definition: emission.h:540
realnum Ploss() const
Definition: emission.h:130
const_iterator end() const
Definition: emission.h:389
void EmLineJunk(EmissionList::reference t)
Definition: emission.cpp:12
iterator end()
Definition: emission.h:385
realnum TauIn() const
Definition: emission.h:475
realnum Pelec_esc() const
Definition: emission.h:595
float realnum
Definition: cddefines.h:124
realnum & Pesc() const
Definition: emission.h:580
vector< realnum > m_opacity
Definition: emission.h:340
vector< realnum > m_damp
Definition: emission.h:334
void check() const
Definition: emission.h:35
realnum AutoIonizFrac() const
Definition: emission.h:645
const EmissionList list_type
Definition: emission.h:176
realnum damp() const
Definition: emission.h:625
vector< double > m_pump
Definition: emission.h:348
realnum Pesc_total() const
Definition: emission.h:281
vector< realnum > m_FracInwd
Definition: emission.h:336
vector< double > m_ColOvTot
Definition: emission.h:333
vector< realnum > m_TauInSpecific
Definition: emission.h:351
realnum Ploss() const
Definition: emission.h:284
void resize(size_t i)
Definition: emission.h:409
vector< realnum > m_AutoIonizFrac
Definition: emission.h:332
realnum dampXvel() const
Definition: emission.h:615
EmissionList list_type
Definition: emission.h:22
ProxyIterator< EmissionConstProxy, EmissionConstProxy > iterator
Definition: emission.h:177
realnum & Pdest() const
Definition: emission.h:600
int iRedisFun() const
Definition: emission.h:455
#define ASSERT(exp)
Definition: cddefines.h:613
void EmLineZero(EmissionList::reference t)
Definition: emission.cpp:95
realnum & TauCon() const
Definition: emission.h:510
vector< realnum > m_Pelec_esc
Definition: emission.h:345
realnum Pesc_total() const
Definition: emission.h:127
EmissionList(TransitionListImpl *tlist)
Definition: emission.h:367
tracker & TauTrack() const
Definition: emission.h:500
double xObsIntensity() const
Definition: emission.h:555
double & mult_opac() const
Definition: emission.h:660
double & PopOpc() const
Definition: emission.h:670
void copy(const EmissionConstProxy &other)
friend class EmissionProxy
Definition: emission.h:357
vector< realnum > m_TauCon
Definition: emission.h:349
vector< realnum > m_Aul
Definition: emission.h:331
void TauZero(EmissionList::reference t)
Definition: emission.cpp:75
realnum & damp() const
Definition: emission.h:620
ProxyIterator< EmissionConstProxy, EmissionConstProxy > const_iterator
Definition: emission.h:24
double & ColOvTot() const
Definition: emission.h:630
double & xObsIntensity() const
Definition: emission.h:545
TransitionConstProxy Tran() const
Definition: transition.h:520
realnum FracInwd() const
Definition: emission.h:525
realnum & AutoIonizFrac() const
Definition: emission.h:640
vector< realnum > m_Pdest
Definition: emission.h:343
reference operator[](size_t i)
Definition: emission.h:368
const_iterator begin() const
Definition: emission.h:381
realnum & FracInwd() const
Definition: emission.h:520
iterator begin()
Definition: emission.h:377
realnum Pesc() const
Definition: emission.h:585
realnum opacity() const
Definition: emission.h:655
realnum & Aul() const
Definition: emission.h:690
EmissionProxy reference
Definition: emission.h:360
double PopOpc() const
Definition: emission.h:675
vector< double > m_xIntensity
Definition: emission.h:354
realnum gf() const
Definition: emission.h:575
realnum & TauIn() const
Definition: emission.h:470
double & pump() const
Definition: emission.h:530