30 namespace Illuminate {
34 namespace Accumulate {
72 void resize(
long int nbins );
74 void accumulate_flux(
const double this_cumulfac,
double timestep,
double total_time )
78 vector<realnum> &flux_inst =
flux[0];
79 vector<realnum> &flux_cumul =
flux[1];
81 double mean = flux_cumul[ 0 ] *
norm + flux_inst[ 0 ] * this_cumulfac;
83 for(
long ip = 1; ip <
nflux; ip++ )
86 double tmp_fl = flux_cumul[ ip ] *
norm +
87 flux_inst[ ip ] * this_cumulfac;
88 mean += (tmp_fl -
mean) /
double( ip+1 );
94 double mean_inv = 1. /
mean;
96 for(
long ip = 0; ip <
nflux; ip++ )
98 double tmp_flux = flux_cumul[ ip ] *
norm +
99 flux_inst[ ip ] * this_cumulfac;
100 flux_cumul[ ip ] =
realnum( tmp_flux * mean_inv );
112 timestep / ( timestep + total_time );
118 double get_flux(
long int accType,
long int ip )
const
129 return double(
flux[0][ip] );
133 return double(
flux[1][ip] ) *
norm;
146 return flux[ accType ];
Definition: warnings.h:11
double norm
Definition: rfield.h:55
vector_avx< double > ContBoltzHelp1
Definition: rfield.h:244
bool lgBeamed[LIMSPC]
Definition: rfield.h:408
bool lgGamrOK
Definition: rfield.h:560
Spectrum ConEmitOut
Definition: rfield.h:268
bool lgSaveOpacityFine
Definition: rfield.h:524
vector< realnum > ConOTS_local_OTS_rate
Definition: rfield.h:287
long int ipG0_spec_hi
Definition: rfield.h:366
long int fine_opac_nresolv
Definition: rfield.h:482
const char * chName() const
Definition: rfield.h:151
double comtot
Definition: rfield.h:389
double opac_mag_B_extended
Definition: rfield.h:380
realnum qtot
Definition: rfield.h:455
realnum EnerGammaRay
Definition: rfield.h:566
long int ipG0_DB96_hi
Definition: rfield.h:363
bool lgKillOutLine
Definition: rfield.h:535
long int ipEnergyBremsThin
Definition: rfield.h:342
void setTrimming()
Definition: rfield.cpp:103
realnum qbal
Definition: rfield.h:455
double time_avg_flux
Definition: rfield.h:58
const double WL_V_FILT
Definition: rfield.h:15
realnum occ1nu
Definition: rfield.h:573
vector< realnum > outlin_noplot
Definition: rfield.h:306
bool lgSphericalDilution[LIMSPC]
Definition: rfield.h:435
void accumulate_flux(const double this_cumulfac, double timestep, double total_time)
Definition: rfield.h:74
vector< realnum > fine_anu
Definition: rfield.h:509
vector< string > chContLabel
Definition: rfield.h:329
realnum EnergyBremsThin
Definition: rfield.h:343
double opac_mag_V_point
Definition: rfield.h:380
double totpow[LIMSPC]
Definition: rfield.h:398
vector< realnum > eeBremsDif
Definition: rfield.h:387
char chDffTrns[4]
Definition: rfield.h:333
vector< realnum > otslin
Definition: rfield.h:299
char chRSpec[LIMSPC][5]
Definition: rfield.h:449
Spectrum()
Definition: rfield.h:66
vector< realnum > DiffuseEscape
Definition: rfield.h:291
bool lgOcc1Hi
Definition: rfield.h:581
realnum fine_opac_velocity_width
Definition: rfield.h:485
long int ipG0_spec_lo
Definition: rfield.h:366
long int ipMaxBolt
Definition: rfield.h:346
vector< realnum > ConInterOut
Definition: rfield.h:271
bool lgOpacityFine
Definition: rfield.h:522
realnum qhe
Definition: rfield.h:455
vector< realnum > csigh
Definition: rfield.h:384
long int ipG0_TH85_hi
Definition: rfield.h:359
vector< realnum > OccNumbContEmitOut
Definition: rfield.h:179
t_rfield rfield
Definition: rfield.cpp:9
double TableRadius[LIMSPC]
Definition: rfield.h:433
long int nZonePlsFrqEval
Definition: rfield.h:552
void rfield_opac_zero(long lo, long ihi)
Definition: cont_createmesh.cpp:295
bool lgKillOutCont
Definition: rfield.h:538
vector< realnum > OccNumbDiffCont
Definition: rfield.h:237
double RSFCheck[LIMSPC]
Definition: rfield.h:441
bool lgIonizReevaluate
Definition: rfield.h:227
vector< Energy > tNu[LIMSPC]
Definition: rfield.h:428
vector< realnum > flux_beam_const
Definition: rfield.h:191
vector< realnum > tFluxLog[LIMSPC]
Definition: rfield.h:431
bool lgKillOTSLine
Definition: rfield.h:541
void comment(t_warnings &)
Definition: rfield.h:157
long int ipEnerGammaRay
Definition: rfield.h:567
vector< realnum > fine_opt_depth
Definition: rfield.h:507
long ncont[LIMSPC]
Definition: rfield.h:437
long int ipG0_TH85_lo
Definition: rfield.h:359
vector< realnum > flux_beam_const_save
Definition: rfield.h:316
double spfac[LIMSPC]
Definition: rfield.h:398
vector< realnum > tslop[LIMSPC]
Definition: rfield.h:429
vector_avx< double > ContBoltz
Definition: rfield.h:241
realnum time_continuum_scale
Definition: rfield.h:319
double get_time_avg_flux() const
Definition: rfield.h:137
bool lgHeIIOTS
Definition: rfield.h:532
IlluminationType
Definition: rfield.h:31
realnum ExtinguishEnergyPowerLow
Definition: rfield.h:198
double cutoff[LIMSPC][3]
Definition: rfield.h:398
vector< realnum > convoc
Definition: rfield.h:230
vector< realnum > flux_beam_time
Definition: rfield.h:191
bool lgTimeVary[LIMSPC]
Definition: rfield.h:404
vector_avx< double > ContBoltzAvg
Definition: rfield.h:252
void resetCoarseTransCoef()
Definition: rfield.h:605
double range[LIMSPC][2]
Definition: rfield.h:445
bool lgHabing
Definition: rfield.h:475
const int LIMSPC
Definition: rfield.h:22
long int nflux_with_check
Definition: rfield.h:166
realnum ExtinguishConvertColDen2OptDepth
Definition: rfield.h:198
realnum EnergyIncidCont
Definition: rfield.h:585
const realnum * getCoarseTransCoef()
Definition: rfield.cpp:67
long int fine_opac_nelem
Definition: rfield.h:479
bool fp_equal(sys_float x, sys_float y, int n=3)
Definition: cddefines.h:864
double get_flux(long int accType, long int ip) const
Definition: rfield.h:118
typename std::vector< T, allocator_avx< T >> vector_avx
Definition: vectorize.h:331
multi_arr< realnum, 2 > ConEmitLocal
Definition: rfield.h:256
realnum ExtinguishLeakage
Definition: rfield.h:198
Spectrum reflin
Definition: rfield.h:312
multi_arr< realnum, 2 > otssav
Definition: rfield.h:302
long int ipG0_DB96_lo
Definition: rfield.h:363
vector< realnum > flux_isotropic_save
Definition: rfield.h:316
double fine_resol
Definition: rfield.h:503
bool lgOutOnly
Definition: rfield.h:338
double slope[LIMSPC]
Definition: rfield.h:398
vector< realnum > fine_opac_zone
Definition: rfield.h:505
Spectrum ConRefIncid
Definition: rfield.h:274
realnum tbrmax
Definition: rfield.h:573
vector< realnum > SummedOcc
Definition: rfield.h:280
bool lgHPhtOK
Definition: rfield.h:560
vector< realnum > flux_isotropic
Definition: rfield.h:188
vector< realnum > otscon
Definition: rfield.h:301
vector< double > comdn
Definition: rfield.h:352
void resize(long int nbins)
Definition: rfield.cpp:56
long int ipPlasma
Definition: rfield.h:554
bool lgCMB_set
Definition: rfield.h:223
Spectrum outlin
Definition: rfield.h:305
bool trans_coef_total_stale
Definition: rfield.h:492
bool lgLyaOTS
Definition: rfield.h:528
realnum qhtot
Definition: rfield.h:455
double cmcool
Definition: rfield.h:389
t_mean mean
Definition: mean.cpp:17
Spectrum flux
Definition: rfield.h:185
float realnum
Definition: cddefines.h:127
realnum uh
Definition: rfield.h:463
Illuminate::IlluminationType Illumination[LIMSPC]
Definition: rfield.h:414
double opac_mag_B_point
Definition: rfield.h:380
realnum uheii
Definition: rfield.h:466
long int ipFineConVelShift
Definition: rfield.h:519
vector< realnum > flux_time_beam_save
Definition: rfield.h:316
vector< realnum > ConOTS_local_photons
Definition: rfield.h:285
double FluxFaint
Definition: rfield.h:173
double cmheat
Definition: rfield.h:389
bool lgMustBlockHIon
Definition: rfield.h:209
realnum rstrom
Definition: rfield.h:471
vector< realnum > SummedDifSave
Definition: rfield.h:281
vector_avx< double > ContBoltzHelp2
Definition: rfield.h:245
bool lgXRayOK
Definition: rfield.h:560
vector< realnum > SummedDif
Definition: rfield.h:279
vector< string > chLineLabel
Definition: rfield.h:326
char chSpNorm[LIMSPC][5]
Definition: rfield.h:449
vector< realnum > csigc
Definition: rfield.h:384
vector< realnum > & operator[](int accType)
Definition: rfield.h:142
long int nflux
Definition: rfield.h:61
bool lgDoLineTrans
Definition: rfield.h:216
double extin_mag_V_point
Definition: rfield.h:373
realnum fine_ener_lo
Definition: rfield.h:499
long int ipV_filter
Definition: rfield.h:355
Spectrum ConEmitReflec
Definition: rfield.h:262
Spectrum flux_total_incident
Definition: rfield.h:315
vector< realnum > flux[2]
Definition: rfield.h:52
void zero()
Definition: rfield.cpp:11
#define ASSERT(exp)
Definition: cddefines.h:637
vector< long > line_count
Definition: rfield.h:176
realnum fine_ener_hi
Definition: rfield.h:499
bool lgOpacityReevaluate
Definition: rfield.h:220
double extin_mag_B_point
Definition: rfield.h:373
double extin_mag_V_extended
Definition: rfield.h:377
double flux_correct_isotropic(const bool lgSaveIsotrp, const int nEmType, const int j)
Definition: rfield.cpp:123
const double WL_B_FILT
Definition: rfield.h:18
vector< realnum > trans_coef_total
Definition: rfield.h:489
long nfine
Definition: rfield.h:501
double opac_mag_V_extended
Definition: rfield.h:380
vector< double > SummedCon
Definition: rfield.h:278
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:730
realnum ExtinguishColumnDensity
Definition: rfield.h:198
realnum qheii
Definition: rfield.h:455
bool lgRfieldAllocated
Definition: cdinit.cpp:41
bool lgHionRad
Definition: rfield.h:570
vector< realnum > ExtinguishFactor
Definition: rfield.h:197
vector< realnum > OccNumbIncidCont
Definition: rfield.h:234
bool lgMMok
Definition: rfield.h:560
long int ip1000A
Definition: rfield.h:369
realnum EnergyDiffCont
Definition: rfield.h:585
double extin_mag_B_extended
Definition: rfield.h:377
bool lgInducProcess
Definition: rfield.h:349
vector< long > ipnt_coarse_2_fine
Definition: rfield.h:496
realnum OpticalDepthScaleFactor[LIMSPC]
Definition: rfield.h:412
long int ipB_filter
Definition: rfield.h:355
long int ipPlasmax
Definition: rfield.h:554
long int nShape
Definition: rfield.h:420
long int ipSpec
Definition: rfield.h:420
unordered_map< long, vector< int > > fine_lstack
Definition: rfield.h:513
t_rfield()
Definition: rfield.h:589
vector< realnum > TotDiff2Pht
Definition: rfield.h:294
void setCoarseTransCoefPtr(size_t size)
Definition: rfield.h:601
AccumulationType
Definition: rfield.h:35
realnum occmnu
Definition: rfield.h:573
realnum DiffPumpOn
Definition: rfield.h:323
bool lgUSphON
Definition: rfield.h:469
char chCumuType[5]
Definition: rfield.h:449
realnum plsfrqmax
Definition: rfield.h:548
realnum qrad
Definition: rfield.h:455
bool lgComUndr
Definition: rfield.h:396
realnum plsfrq
Definition: rfield.h:548
vector< realnum > DiffuseLineEmission
Definition: rfield.h:309
long int nflux
Definition: rfield.h:163
vector< double > comup
Definition: rfield.h:352
bool lgPlasNu
Definition: rfield.h:546
bool lgBlockHIon
Definition: rfield.h:213
long int nPositive
Definition: rfield.h:170
multi_arr< realnum, 2 > ConSourceFcnLocal
Definition: rfield.h:259
realnum tbr4nu
Definition: rfield.h:573
char chSpType[LIMSPC][6]
Definition: rfield.h:449
vector_avx< double > vexp_arg
Definition: rfield.h:248
bool lgComptonOn
Definition: rfield.h:393
realnum ExtinguishLowEnergyLimit
Definition: rfield.h:198
vector< realnum > flux_accum
Definition: rfield.h:194
realnum occmax
Definition: rfield.h:573
double cinrat
Definition: rfield.h:389
realnum tbrmnu
Definition: rfield.h:573