cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cont_negative.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 /*ContNegative sanity check for negative continuum intensities */
4 #include "cddefines.h"
5 #include "continuum.h"
6 #include "rfield.h"
7 #include "dense.h"
8 #include "phycon.h"
9 
10 void ContNegative(void)
11 {
12  DEBUG_ENTRY( "ContNegative()" );
13 
14  /* look for negative continuum points */
15  bool lgFNeg = false;
16  for( long i=0; i < rfield.nflux; i++ )
17  {
18  if( rfield.flux[0][i] < 0. )
19  {
20  fprintf( ioQQQ, " FLUX negative, value, freq, pointer=%10.2e%10.2e%5ld %4.4s %4.4s\n",
21  rfield.flux[0][i], rfield.anu(i), i, rfield.chLineLabel[i].c_str()
22  , rfield.chContLabel[i].c_str() );
23  lgFNeg = true;
24  }
25  else if( rfield.otslin[i] < 0. )
26  {
27  fprintf( ioQQQ, " OTSLIN negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
28  rfield.otslin[i], rfield.anu(i), i );
29  lgFNeg = true;
30  }
31  else if( rfield.otscon[i] < 0. )
32  {
33  fprintf( ioQQQ, " OTSCON negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
34  rfield.otscon[i], rfield.anu(i), i );
35  lgFNeg = true;
36  }
37  else if( rfield.SummedCon[i] < 0. )
38  {
39  fprintf( ioQQQ, " OUTCON negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
40  rfield.ConInterOut[i], rfield.anu(i), i );
41  lgFNeg = true;
42  }
43  else if( rfield.ConInterOut[i] < 0. )
44  {
45  fprintf( ioQQQ, " OUTCON negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
46  rfield.ConInterOut[i], rfield.anu(i), i );
47  lgFNeg = true;
48  }
49  else if( rfield.outlin[0][i] < 0. )
50  {
51  fprintf( ioQQQ, " OUTLIN negative, value, freq, pointer=%10.2e%10.2e%5ld\n",
52  rfield.outlin[0][i], rfield.anu(i), i );
53  lgFNeg = true;
54  }
55  }
56 
57  if( !lgFNeg )
58  {
59  fprintf( ioQQQ, " No parts of the continuum were negative, the electron density was%10.2e te=%10.2e\n",
60  dense.eden, phycon.te );
61  fprintf( ioQQQ, " This is zone number%4ld\n", nzone );
62  }
63  return;
64 }
realnum ** flux
Definition: rfield.h:68
vector< string > chContLabel
Definition: rfield.h:213
t_phycon phycon
Definition: phycon.cpp:6
double * SummedCon
Definition: rfield.h:161
realnum ** outlin
Definition: rfield.h:189
FILE * ioQQQ
Definition: cddefines.cpp:7
long int nzone
Definition: cddefines.cpp:14
double anu(size_t i) const
Definition: mesh.h:120
t_dense dense
Definition: global.cpp:15
realnum * otslin
Definition: rfield.h:183
void ContNegative(void)
t_rfield rfield
Definition: rfield.cpp:9
realnum * ConInterOut
Definition: rfield.h:154
realnum * otscon
Definition: rfield.h:183
vector< string > chLineLabel
Definition: rfield.h:210
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
double eden
Definition: dense.h:201
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
double te
Definition: phycon.h:21
long int nflux
Definition: rfield.h:46