36 for(
long nelem=0; nelem<
LIMELM; ++nelem )
38 for(
long ion=0; ion<
LIMELM; ++ion )
74 ASSERT( nTemps != 0 && nTrans != 0 );
79 if( chLine[0] ==
'!' || chLine[0] ==
'#' || chLine[0] ==
'\n' )
84 ASSERT( strlen( chLine ) > 0 );
88 char *chColltemp = strtok(chLine,
" \t\n");
89 while( chColltemp != NULL )
91 coll_rate_table.
temps.push_back( atof(chColltemp) );
92 chColltemp = strtok(NULL,
" \t\n");
96 nTemps = coll_rate_table.
temps.size();
98 ASSERT( (
unsigned)nTemps == coll_rate_table.
temps.size() );
103 for(
long ipHi=0; ipHi<nMolLevs; ipHi++ )
106 for(
long ipLo=0; ipLo<nMolLevs; ipLo++ )
118 if( chLine[0] ==
'!' || chLine[0] ==
'#' || chLine[0] ==
'\n' )
122 long ipHi = -1, ipLo = -1;
123 (*GetIndices)( ipHi, ipLo, chLine, i );
127 if( ipHi == -1 && ipLo == -1 )
131 if( ipLo >= nMolLevs || ipHi >= nMolLevs )
133 if( nTrans > 0 && ipTrans == nTrans )
142 ASSERT( ipLo == nMolLevs - 1);
152 for(
long j = 0; j < nTemps; ++j )
154 coll_rate_table.
collrates[ipHi][ipLo][j] =
155 (double)
FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
160 FFmtRead( chLine, &i,
sizeof(chLine), &lgEOL );
164 enum {DEBUG_LOC=
false};
167 printf(
"The values of up and lo are %ld & %ld \n",ipHi,ipLo);
168 printf(
"The collision rates are");
169 for(
long i = 0; i < nTemps; ++i )
171 printf(
"\n %e", coll_rate_table.
collrates[ipHi][ipLo][i]);
177 if( nTrans > 0 && ipTrans == nTrans )
182 ASSERT( ipTrans == nTrans );
190 double ret_collrate = 0.;
192 if( rate_table.
temps.size() == 0 )
197 if( ftemp < rate_table.
temps[0] )
199 ret_collrate = rate_table.
collrates[ipHi][ipLo][0];
201 else if( ftemp > rate_table.
temps.back() )
203 ret_collrate = rate_table.
collrates[ipHi][ipLo][ rate_table.
temps.size()-1 ];
205 else if( rate_table.
temps.size() == 1 )
208 ret_collrate = rate_table.
collrates[ipHi][ipLo][0];
214 rate_table.
temps.size(),
219 return(ret_collrate);
multi_arr< double, 3 > collrates
double CharExcRecTotal[NCX]
double CharExcIonTotal[NCX]
static const double aulThreshold
double **** HS_He1_Xsectn
double InterpCollRate(const CollRateCoeffArray &rate_table, const long &ipHi, const long &ipLo, const double &ftemp)
double ***** OP_Helike_Xsectn
const int INPUT_LINE_LENGTH
bool lgInnerShell_Kisielius
void reserve(size_type i1)
double **** HS_He1_Energy
#define DEBUG_ENTRY(funcname)
double ***** OP_Helike_Energy
double linint(const double x[], const double y[], long n, double xval)
long **** OP_Helike_NumPts
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
double CharExcIonOf[NCX][LIMELM][LIMELM+1]
void ReadCollisionRateTable(CollRateCoeffArray &coll_rate_table, FILE *io, FunctPtr GetIndices, long nMolLevs, long nTemps, long nTrans)
double CharExcRecTo[NCX][LIMELM][LIMELM+1]
double FFmtRead(const char *chCard, long int *ipnt, long int last, bool *lgEOL)