00001
00002
00003
00004
00005
00006
00007 #include "cddefines.h"
00008 #include "physconst.h"
00009 #include "rfield.h"
00010 #include "doppvel.h"
00011 #include "radius.h"
00012 #include "continuum.h"
00013
00014
00015 static float damp;
00016
00017 static float PumpTau;
00018
00019
00020 static double vfun(double x);
00021
00022
00023
00024 static double con_pump_op(double x);
00025
00027
00028 double DrvContPump(EmLine * t)
00029 {
00030 double a0,
00031 ContPump_v,
00032 tau,
00033 yinc1,
00034 yinc2;
00035
00036 DEBUG_ENTRY( "DrvContPump()" );
00037
00038
00039 # define FITTED(t) ((0.98925439 + 0.084594094*(t))/(1. + (t)*(0.64794212 + (t)*0.44743976)))
00040
00041 if( !rfield.lgInducProcess )
00042 {
00043
00044 ContPump_v = 0.;
00045 }
00046 else
00047 {
00048
00049
00050 tau = t->TauIn + t->PopOpc * t->opacity / DoppVel.doppler[t->nelem-1]*radius.dRNeff;
00051
00052 if( tau <= 10. )
00053 {
00054
00055 ContPump_v = FITTED(tau);
00056 }
00057 else if( tau > 1e6 )
00058 {
00059
00060
00061 ContPump_v = 0.;
00062 }
00063 else
00064 {
00065
00066 if( t->iRedisFun > 0 )
00067 {
00068 damp = t->damp;
00069 }
00070 else
00071 {
00072 damp = 0.;
00073 }
00074 PumpTau = (float)tau;
00075 a0 = 0.886227*(1. + damp);
00076 # define BREAK_ 3.
00077 yinc1 = qg32(0.,BREAK_,con_pump_op);
00078 yinc2 = qg32(BREAK_,100.,con_pump_op);
00079 ContPump_v = (yinc1 + yinc2)/a0;
00080 }
00081 }
00082
00083
00084
00085
00086
00087
00088 DEBUG_EXIT( "DrvContPump()" );
00089 return( ContPump_v );
00090 # undef FITTED
00091 }
00092
00093
00094
00095 static double con_pump_op(double x)
00096 {
00097 double opfun_v,
00098 v;
00099
00100 DEBUG_ENTRY( "con_pump_op()" );
00101
00102 v = vfun(x);
00103 opfun_v = sexp(PumpTau*v)*v;
00104
00105
00106 DEBUG_EXIT( "con_pump_op()" );
00107 return( opfun_v );
00108 }
00109
00110
00111 static double vfun(double x)
00112 {
00113 double vfun_v;
00114
00115 DEBUG_ENTRY( "vfun()" );
00116
00117 vfun_v = sexp(x*x) + damp/SQRTPI/(1. + x*x);
00118
00119 DEBUG_EXIT( "vfun()" );
00120 return( vfun_v );
00121 }