18 double frac_beam_time;
20 double frac_beam_const;
22 double frac_isotropic;
28 a =
ffun( anu , &frac_beam_time , &frac_beam_const , &frac_isotropic );
38 double *frac_beam_time,
40 double *frac_beam_const,
42 double *frac_isotropic )
45 static bool lgWarn =
false;
46 double flx_beam_time , flx_beam_const , flx_isotropic;
70 flx_beam_const += one;
81 *frac_beam_const = 1.;
88 *frac_beam_time = flx_beam_time / ffun_v;
90 *frac_beam_const = flx_beam_const / ffun_v;
92 *frac_isotropic = flx_isotropic / ffun_v;
94 ASSERT( *frac_beam_time >=0. && *frac_beam_time<=1.+3.*DBL_EPSILON );
95 ASSERT( *frac_beam_const >=0.&& *frac_beam_const<=1.+3.*DBL_EPSILON );
96 ASSERT( *frac_isotropic >=0. && *frac_isotropic<=1.+3.*DBL_EPSILON );
97 ASSERT( fabs( 1.-*frac_beam_time-*frac_beam_const-*frac_isotropic)<
103 fprintf(
ioQQQ,
" FFUN: The net continuum is very intense.\n" );
104 fprintf(
ioQQQ,
" I will try to press on, but may have problems.\n" );
117 static bool lgWarn =
false;
137 if( strcmp(chKey,
"AGN ") == 0 )
166 else if( strcmp(chKey,
"POWER") == 0 )
174 else if( strcmp(chKey,
"DISKB") == 0 )
177 double TempHi, TempLo;
195 ASSERT( TempLo < TempHi );
196 double LogDeltaT = (log10(TempHi) - log10(TempLo))/(numSteps-1.);
198 for(
long i=0; i<numSteps; i++ )
200 double Temp =
exp10( log10(TempHi) -
double(i) * LogDeltaT );
201 double relativeWeight =
powpq( TempHi/Temp, 8, 3 ) *
exp10( LogDeltaT );
206 else if( strcmp(chKey,
"BLACK") == 0 )
210 else if( strcmp(chKey,
"INTER") == 0 )
239 ASSERT( ffun1_v >= ys1/(1.+100.*FLT_EPSILON) );
240 ASSERT( ffun1_v <= ys2*(1.+100.*FLT_EPSILON) );
243 return( ffun1_v/xnu );
255 else if( strcmp(chKey,
"BREMS") == 0 )
259 ffun1_v =
sexp(fac)/pow(xnu,1.2);
262 else if( strcmp(chKey,
"LASER") == 0 )
264 const double BIG = 1.e10;
281 else if( strcmp(chKey,
"READ ") == 0 )
298 else if( strcmp(chKey,
"VOLK ") == 0 )
309 fprintf(
ioQQQ,
" ffun1: I do not understand continuum label \"%s\" for continuum %li.\n",
314 if( ffun1_v > 1e35 && !lgWarn )
317 fprintf(
ioQQQ,
" FFUN1: Continuum %ld is very intense.\n",
319 fprintf(
ioQQQ,
" I will try to press on, but may have problems.\n" );
326 const double db_log = log(DBL_MAX);
331 fac = TE1RYD*E_Ryd/Temp;
339 ffun1_v = E_Ryd*E_Ryd/expm1(fac);
345 void outsum(
double *outtot,
double *outin,
double *outout)
361 *outtot = *outin + *outout;
double PlanckFunction(double Temp, double E_Ryd)
vector< Energy > tNu[LIMSPC]
vector< realnum > tFluxLog[LIMSPC]
sys_float sexp(sys_float x)
vector< realnum > tslop[LIMSPC]
double anu(size_t i) const
long int nflux_with_check
bool fp_equal(sys_float x, sys_float y, int n=3)
size_t ipointC(double anu) const
#define DEBUG_ENTRY(funcname)
double powpq(double x, int p, int q)
int fprintf(const Output &stream, const char *format,...)
void outsum(double *outtot, double *outin, double *outout)
double anumax(size_t i) const